@@ -30,51 +30,45 @@ export function Select({
30
30
} : MenuProps ) : ReactElement {
31
31
return (
32
32
< Listbox value = { selected } onChange = { onChange } >
33
- { ( { open } ) => (
34
- < ListboxButton
35
- title = { title }
36
- className = { cn (
37
- '_h-7 _rounded-md _px-2 _text-left _text-xs _font-medium _text-gray-600 _transition-colors dark:_text-gray-400' ,
38
- open
39
- ? '_bg-gray-200 _text-gray-900 dark:_bg-primary-100/10 dark:_text-gray-50'
40
- : 'hover:_bg-gray-100 hover:_text-gray-900 dark:hover:_bg-primary-100/5 dark:hover:_text-gray-50' ,
41
- className
42
- ) }
33
+ < ListboxButton
34
+ title = { title }
35
+ className = { cn (
36
+ '_h-7 _rounded-md _px-2 _text-left _text-xs _font-medium _text-gray-600 _transition-colors dark:_text-gray-400' ,
37
+ 'data-[open]:_bg-gray-200 data-[open]:_text-gray-900 data-[open]:dark:_bg-primary-100/10 data-[open]:dark:_text-gray-50' ,
38
+ 'hover:_bg-gray-100 hover:_text-gray-900 dark:hover:_bg-primary-100/5 dark:hover:_text-gray-50' ,
39
+ className
40
+ ) }
41
+ >
42
+ { selected . name }
43
+ < ListboxOptions
44
+ transition
45
+ anchor = { {
46
+ to : 'top start' ,
47
+ gap : 10
48
+ } }
49
+ className = "_transition-opacity data-[closed]:_opacity-0 data-[open]:_opacity-100 _min-w-[--button-width] _z-20 _max-h-64 _rounded-md _border _border-black/5 _backdrop-blur-lg _bg-[rgb(var(--nextra-bg),.8)] _py-1 _text-sm _shadow-lg dark:_border-white/20"
43
50
>
44
- { selected . name }
45
- < ListboxOptions
46
- transition
47
- anchor = { {
48
- to : 'top start' ,
49
- gap : 10
50
- } }
51
- className = "_transition-opacity data-[closed]:_opacity-0 data-[open]:_opacity-100 _min-w-[--button-width] _z-20 _max-h-64 _overflow-auto _rounded-md _ring-1 _ring-black/5 _bg-white _py-1 _text-sm _shadow-lg dark:_ring-white/20 dark:_bg-neutral-800"
52
- >
53
- { options . map ( option => (
54
- < ListboxOption
55
- key = { option . key }
56
- value = { option }
57
- className = { ( { focus } ) =>
58
- cn (
59
- focus
60
- ? '_bg-primary-50 _text-primary-600 dark:_bg-primary-500/10'
61
- : '_text-gray-800 dark:_text-gray-100' ,
62
- '_relative _cursor-pointer _whitespace-nowrap _py-1.5' ,
63
- '_transition-colors ltr:_pl-3 ltr:_pr-9 rtl:_pr-3 rtl:_pl-9'
64
- )
65
- }
66
- >
67
- { option . name }
68
- { option . key === selected . key && (
69
- < span className = "_absolute _inset-y-0 _flex _items-center ltr:_right-3 rtl:_left-3" >
70
- < CheckIcon />
71
- </ span >
72
- ) }
73
- </ ListboxOption >
74
- ) ) }
75
- </ ListboxOptions >
76
- </ ListboxButton >
77
- ) }
51
+ { options . map ( option => (
52
+ < ListboxOption
53
+ key = { option . key }
54
+ value = { option }
55
+ className = { cn (
56
+ 'data-[focus]:_bg-primary-50 data-[focus]:_text-primary-600 data-[focus]:dark:_bg-primary-500/10' ,
57
+ '_text-gray-800 dark:_text-gray-100' ,
58
+ '_relative _cursor-pointer _whitespace-nowrap _py-1.5' ,
59
+ '_transition-colors ltr:_pl-3 ltr:_pr-9 rtl:_pr-3 rtl:_pl-9'
60
+ ) }
61
+ >
62
+ { option . name }
63
+ { option . key === selected . key && (
64
+ < span className = "_absolute _inset-y-0 _flex _items-center ltr:_right-3 rtl:_left-3" >
65
+ < CheckIcon />
66
+ </ span >
67
+ ) }
68
+ </ ListboxOption >
69
+ ) ) }
70
+ </ ListboxOptions >
71
+ </ ListboxButton >
78
72
</ Listbox >
79
73
)
80
74
}
0 commit comments