From a6f7d4fb1214c5cbc75773dbf7696e86c1e7738d Mon Sep 17 00:00:00 2001 From: maieulchevalier Date: Fri, 8 Dec 2023 22:58:07 +0100 Subject: [PATCH] refactor(notes): change the Note system to reflect what notes are usually used for --- apps/website/src/components/note/note.tsx | 62 ++++++------------- .../routes/docs/headless/accordion/index.mdx | 2 +- .../docs/headless/introduction/index.mdx | 2 +- 3 files changed, 20 insertions(+), 46 deletions(-) diff --git a/apps/website/src/components/note/note.tsx b/apps/website/src/components/note/note.tsx index 5a3a7a9c3..258ce2d0d 100644 --- a/apps/website/src/components/note/note.tsx +++ b/apps/website/src/components/note/note.tsx @@ -1,9 +1,8 @@ import { component$, Slot, QwikIntrinsicElements } from '@builder.io/qwik'; export enum NoteStatus { - Info = 'info', - Warning = 'warning', - Success = 'success', + Important = 'important', + FunFact = 'fun fact', Caution = 'caution', } @@ -13,31 +12,27 @@ export interface NoteProps { function getIconByStatus(status?: NoteStatus) { switch (status) { - case NoteStatus.Info: - return ; - case NoteStatus.Warning: - return ; - case NoteStatus.Success: - return ; + case NoteStatus.Important: + return ; + case NoteStatus.FunFact: + return ; case NoteStatus.Caution: - return ; + return ; default: - return ; + return ; } } function getBackgroundByStatus(status?: NoteStatus) { switch (status) { - case NoteStatus.Info: - return 'bg-[#ECDDFD] border-qwikui-purple-500 dark:bg-[#0C2944] border-l-2 dark:border-qwikui-blue-700 mb-4 rounded-lg block'; - case NoteStatus.Warning: - return 'bg-[#FBF0CD] dark:bg-[#3B3623] border-yellow-500 border-l-2 dark:border-yellow-500 mb-4 rounded-lg block'; - case NoteStatus.Success: - return 'dark:bg-[#103331] bg-[#D2F4DF] border-green-500 border-l-2 dark:border-green-600 mb-4 rounded-lg block'; + case NoteStatus.Important: + return 'bg-secondary/20 border-secondary border-l-2 mb-4 rounded-lg block'; + case NoteStatus.FunFact: + return 'bg-primary/20 border-primary border-l-2 mb-4 rounded-lg block'; case NoteStatus.Caution: - return 'bg-[#F8D3D3] border-red-600 dark:bg-[#311727] border-l-2 dark:border-red-700 mb-4 rounded-lg block'; + return 'bg-destructive/20 border-destructive border-l-2 mb-4 rounded-lg block'; default: - return 'dark:bg-[#0C2944] border-l-2 dark:border-qwikui-blue-700 mb-4 rounded-lg block'; + return 'bg-secondary/20 border-secondary border-l-2 mb-4 rounded-lg block'; } } @@ -45,12 +40,12 @@ export const Note = component$(({ status, ...props }) => { return (