@@ -42,41 +42,38 @@ function InfoIcon(props: React.ComponentPropsWithoutRef<'svg'>) {
42
42
)
43
43
}
44
44
45
- export function Note ( {
46
- children,
47
- type,
48
- } : {
49
- children : React . ReactNode
50
- type ?: 'success' | 'warning'
51
- } ) {
52
- const typeColors = {
53
- success : {
54
- container :
55
- 'border-emerald-500/20 bg-emerald-50/50 text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/5 dark:text-emerald-200 dark:[--tw-prose-links-hover:theme(colors.emerald.300)] dark:[--tw-prose-links:theme(colors.white)]' ,
56
- icon : 'fill-emerald-500 stroke-white dark:fill-emerald-200/20 dark:stroke-emerald-200' ,
57
- } ,
58
- warning : {
59
- container :
60
- 'border-amber-500/20 bg-amber-50/50 text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/5 dark:text-amber-200 dark:[--tw-prose-links-hover:theme(colors.amber.300)] dark:[--tw-prose-links:theme(colors.white)]' ,
61
- icon : 'fill-amber-500 stroke-white dark:fill-amber-200/20 dark:stroke-amber-200' ,
62
- } ,
63
- }
45
+ export function Note ( { children, type } : { children : React . ReactNode ; type ?: 'success' | 'warning' | 'danger' | 'info' } ) {
46
+ const typeColors = {
47
+ success : {
48
+ container :
49
+ 'border-emerald-500/20 bg-emerald-50/50 text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/5 dark:text-emerald-200 dark:[--tw-prose-links-hover:theme(colors.emerald.300)] dark:[--tw-prose-links:theme(colors.white)]' ,
50
+ icon : 'fill-emerald-500 stroke-white dark:fill-emerald-200/20 dark:stroke-emerald-200' ,
51
+ } ,
52
+ warning : {
53
+ container :
54
+ 'border-amber-500/20 bg-amber-50/50 text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/5 dark:text-amber-200 dark:[--tw-prose-links-hover:theme(colors.amber.300)] dark:[--tw-prose-links:theme(colors.white)]' ,
55
+ icon : 'fill-amber-500 stroke-white dark:fill-amber-200/20 dark:stroke-amber-200' ,
56
+ } ,
57
+ danger : {
58
+ container :
59
+ 'border-red-500/20 bg-red-50/50 text-red-900 dark:border-red-500/30 dark:bg-red-500/5 dark:text-red-200 dark:[--tw-prose-links-hover:theme(colors.red.300)] dark:[--tw-prose-links:theme(colors.white)]' ,
60
+ icon : 'fill-red-500 stroke-white dark:fill-red-200/20 dark:stroke-red-200' ,
61
+ } ,
62
+ info : {
63
+ container :
64
+ 'border-blue-500/20 bg-blue-50/50 text-blue-900 dark:border-blue-500/30 dark:bg-blue-500/5 dark:text-blue-200 dark:[--tw-prose-links-hover:theme(colors.blue.300)] dark:[--tw-prose-links:theme(colors.white)]' ,
65
+ icon : 'fill-blue-500 stroke-white dark:fill-blue-200/20 dark:stroke-blue-200' ,
66
+ } ,
67
+ }
64
68
65
- const colors = typeColors [ type ?? 'success' ]
69
+ const colors = typeColors [ type ?? 'success' ]
66
70
67
- return (
68
- < div
69
- className = { clsx (
70
- 'my-6 flex gap-2.5 rounded-2xl border p-4 leading-6' ,
71
- colors . container ,
72
- ) }
73
- >
74
- < InfoIcon className = { clsx ( 'mt-1 h-4 w-4 flex-none' , colors . icon ) } />
75
- < div className = "[&>:first-child]:mt-0 [&>:last-child]:mb-0" >
76
- { children }
77
- </ div >
78
- </ div >
79
- )
71
+ return (
72
+ < div className = { clsx ( 'my-6 flex gap-2.5 rounded-2xl border p-4 leading-6' , colors . container ) } >
73
+ < InfoIcon className = { clsx ( 'mt-1 h-4 w-4 flex-none' , colors . icon ) } />
74
+ < div className = "[&>:first-child]:mt-0 [&>:last-child]:mb-0" > { children } </ div >
75
+ </ div >
76
+ )
80
77
}
81
78
82
79
export function Row ( { children } : { children : React . ReactNode } ) {
0 commit comments