@adea-ai/ui 0.22.1 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +6 -3
  2. package/dist/components/account-drawer.d.ts +3 -3
  3. package/dist/components/account-drawer.js +119 -19
  4. package/dist/components/on-screen-controls.d.ts +2 -1
  5. package/dist/components/on-screen-controls.js +158 -46
  6. package/dist/components/scene-settings.d.ts +3 -3
  7. package/dist/components/scene-settings.js +247 -28
  8. package/dist/components/theme-provider.d.ts +27 -5
  9. package/dist/components/theme-provider.js +96 -7
  10. package/dist/components/theme-toggle.d.ts +4 -4
  11. package/dist/components/theme-toggle.js +62 -18
  12. package/dist/components/ui/badge.d.ts +4 -3
  13. package/dist/components/ui/badge.js +31 -30
  14. package/dist/components/ui/button.d.ts +4 -3
  15. package/dist/components/ui/button.js +49 -32
  16. package/dist/components/ui/card.d.ts +3 -3
  17. package/dist/components/ui/card.js +25 -6
  18. package/dist/components/ui/dialog.d.ts +13 -13
  19. package/dist/components/ui/dialog.js +94 -26
  20. package/dist/components/ui/drawer.d.ts +23 -15
  21. package/dist/components/ui/drawer.js +109 -64
  22. package/dist/components/ui/dropdown-menu.d.ts +28 -22
  23. package/dist/components/ui/dropdown-menu.js +165 -36
  24. package/dist/components/ui/empty.d.ts +7 -6
  25. package/dist/components/ui/empty.js +78 -26
  26. package/dist/components/ui/field.d.ts +15 -14
  27. package/dist/components/ui/field.js +177 -55
  28. package/dist/components/ui/input.d.ts +2 -2
  29. package/dist/components/ui/input.js +20 -5
  30. package/dist/components/ui/label.d.ts +2 -2
  31. package/dist/components/ui/label.js +15 -5
  32. package/dist/components/ui/radio-group.d.ts +4 -4
  33. package/dist/components/ui/radio-group.js +36 -9
  34. package/dist/components/ui/separator.d.ts +6 -2
  35. package/dist/components/ui/separator.js +18 -6
  36. package/dist/components/ui/skeleton.d.ts +2 -1
  37. package/dist/components/ui/skeleton.js +15 -4
  38. package/dist/components/ui/spinner.d.ts +4 -3
  39. package/dist/components/ui/spinner.js +15 -5
  40. package/dist/components/ui/switch.d.ts +6 -3
  41. package/dist/components/ui/switch.js +57 -6
  42. package/dist/components/ui/tabs.d.ts +6 -5
  43. package/dist/components/ui/tabs.js +52 -24
  44. package/dist/components/ui/toggle-group.d.ts +10 -8
  45. package/dist/components/ui/toggle-group.js +91 -20
  46. package/dist/components/ui/toggle.d.ts +4 -2
  47. package/dist/components/ui/toggle.js +38 -23
  48. package/dist/components/ui/tooltip.d.ts +13 -6
  49. package/dist/components/ui/tooltip.js +51 -14
  50. package/dist/components/version-dialog.d.ts +2 -2
  51. package/dist/components/version-dialog.js +322 -129
  52. package/dist/components/workspace-brand.d.ts +1 -1
  53. package/dist/components/workspace-brand.js +12 -3
  54. package/dist/components/workspace-logo.d.ts +2 -2
  55. package/dist/components/workspace-logo.js +15 -3
  56. package/dist/index.d.ts +1 -1
  57. package/dist/index.js +20 -19
  58. package/dist/lib/utils.js +7 -4
  59. package/dist/lib/version-notes.js +14 -29
  60. package/package.json +18 -16
  61. package/src/components/account-drawer.tsx +48 -67
  62. package/src/components/on-screen-controls.tsx +55 -62
  63. package/src/components/scene-settings.tsx +97 -100
  64. package/src/components/theme-provider.tsx +122 -22
  65. package/src/components/theme-toggle.tsx +29 -54
  66. package/src/components/ui/badge.tsx +14 -23
  67. package/src/components/ui/button.tsx +9 -11
  68. package/src/components/ui/card.tsx +9 -6
  69. package/src/components/ui/dialog.tsx +58 -55
  70. package/src/components/ui/drawer.tsx +84 -125
  71. package/src/components/ui/dropdown-menu.tsx +130 -153
  72. package/src/components/ui/empty.tsx +29 -26
  73. package/src/components/ui/field.tsx +83 -87
  74. package/src/components/ui/input.tsx +8 -8
  75. package/src/components/ui/label.tsx +6 -7
  76. package/src/components/ui/radio-group.tsx +22 -19
  77. package/src/components/ui/separator.tsx +16 -9
  78. package/src/components/ui/skeleton.tsx +6 -3
  79. package/src/components/ui/spinner.tsx +9 -5
  80. package/src/components/ui/switch.tsx +47 -20
  81. package/src/components/ui/tabs.tsx +31 -30
  82. package/src/components/ui/toggle-group.tsx +65 -54
  83. package/src/components/ui/toggle.tsx +9 -12
  84. package/src/components/ui/tooltip.tsx +41 -36
  85. package/src/components/version-dialog.tsx +144 -144
  86. package/src/components/workspace-brand.tsx +5 -5
  87. package/src/components/workspace-logo.tsx +9 -8
  88. package/src/index.tsx +7 -1
  89. package/src/styles/base.css +637 -0
  90. package/src/styles/globals.css +1 -1
  91. package/tsconfig.json +2 -1
  92. package/components.json +0 -19
@@ -1,240 +1,217 @@
1
- 'use client'
2
-
3
- import * as React from 'react'
4
- import { Menu as MenuPrimitive } from '@base-ui/react/menu'
1
+ import { DropdownMenu as DropdownMenuPrimitive } from '@kobalte/core/dropdown-menu'
2
+ import { ChevronRightIcon, CheckIcon } from 'lucide-solid'
3
+ import { splitProps, type ComponentProps } from 'solid-js'
5
4
 
6
5
  import { cn } from '#lib/utils'
7
- import { ChevronRightIcon, CheckIcon } from 'lucide-react'
8
6
 
9
- function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
10
- return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />
7
+ type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content> & {
8
+ side?: 'top' | 'right' | 'bottom' | 'left'
9
+ align?: 'start' | 'center' | 'end'
10
+ sideOffset?: number
11
+ alignOffset?: number
12
+ }
13
+
14
+ function DropdownMenu(props: ComponentProps<typeof DropdownMenuPrimitive>) {
15
+ return <DropdownMenuPrimitive data-slot="dropdown-menu" {...props} />
11
16
  }
12
17
 
13
- function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
14
- return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
18
+ function DropdownMenuPortal(props: ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
19
+ return <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
15
20
  }
16
21
 
17
- function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
18
- return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />
22
+ function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
23
+ return <DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />
19
24
  }
20
25
 
21
- function DropdownMenuContent({
22
- align = 'start',
23
- alignOffset = 0,
24
- side = 'bottom',
25
- sideOffset = 4,
26
- className,
27
- ...props
28
- }: MenuPrimitive.Popup.Props &
29
- Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {
26
+ function DropdownMenuContent(props: DropdownMenuContentProps) {
27
+ const [local, rest] = splitProps(props, ['class', 'side', 'align', 'sideOffset', 'children'])
28
+ const placement = () => `${local.side ?? 'bottom'}${local.align ? `-${local.align}` : ''}`
29
+
30
30
  return (
31
- <MenuPrimitive.Portal>
32
- <MenuPrimitive.Positioner
33
- className="isolate z-[140] outline-none"
34
- align={align}
35
- alignOffset={alignOffset}
36
- side={side}
37
- sideOffset={sideOffset}
31
+ <DropdownMenuPrimitive.Portal>
32
+ <DropdownMenuPrimitive.Content
33
+ data-slot="dropdown-menu-content"
34
+ placement={placement()}
35
+ gutter={local.sideOffset ?? 4}
36
+ class={cn(
37
+ 'z-[140] max-h-(--kb-popper-available-height) min-w-32 origin-(--kb-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',
38
+ local.class
39
+ )}
40
+ {...rest}
38
41
  >
39
- <MenuPrimitive.Popup
40
- data-slot="dropdown-menu-content"
41
- className={cn(
42
- 'z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95',
43
- className
44
- )}
45
- {...props}
46
- />
47
- </MenuPrimitive.Positioner>
48
- </MenuPrimitive.Portal>
42
+ {local.children}
43
+ </DropdownMenuPrimitive.Content>
44
+ </DropdownMenuPrimitive.Portal>
49
45
  )
50
46
  }
51
47
 
52
- function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
53
- return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
48
+ function DropdownMenuGroup(props: ComponentProps<typeof DropdownMenuPrimitive.Group>) {
49
+ return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
54
50
  }
55
51
 
56
- function DropdownMenuLabel({
57
- className,
58
- inset,
59
- ...props
60
- }: MenuPrimitive.GroupLabel.Props & {
61
- inset?: boolean
62
- }) {
52
+ function DropdownMenuLabel(
53
+ props: ComponentProps<typeof DropdownMenuPrimitive.GroupLabel> & {
54
+ inset?: boolean
55
+ }
56
+ ) {
57
+ const [local, rest] = splitProps(props, ['class', 'inset'])
63
58
  return (
64
- <MenuPrimitive.GroupLabel
59
+ <DropdownMenuPrimitive.GroupLabel
65
60
  data-slot="dropdown-menu-label"
66
- data-inset={inset}
67
- className={cn(
68
- 'px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7',
69
- className
61
+ data-inset={local.inset}
62
+ class={cn(
63
+ 'px-1.5 py-1 text-xs font-medium text-muted-foreground data-[inset]:pl-7',
64
+ local.class
70
65
  )}
71
- {...props}
66
+ {...rest}
72
67
  />
73
68
  )
74
69
  }
75
70
 
76
- function DropdownMenuItem({
77
- className,
78
- inset,
79
- variant = 'default',
80
- ...props
81
- }: MenuPrimitive.Item.Props & {
82
- inset?: boolean
83
- variant?: 'default' | 'destructive'
84
- }) {
71
+ function DropdownMenuItem(
72
+ props: ComponentProps<typeof DropdownMenuPrimitive.Item> & {
73
+ inset?: boolean
74
+ variant?: 'default' | 'destructive'
75
+ }
76
+ ) {
77
+ const [local, rest] = splitProps(props, ['class', 'inset', 'variant'])
85
78
  return (
86
- <MenuPrimitive.Item
79
+ <DropdownMenuPrimitive.Item
87
80
  data-slot="dropdown-menu-item"
88
- data-inset={inset}
89
- data-variant={variant}
90
- className={cn(
91
- "group/dropdown-menu-item relative flex cursor-pointer items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
92
- className
81
+ data-inset={local.inset}
82
+ data-variant={local.variant ?? 'default'}
83
+ class={cn(
84
+ "group/dropdown-menu-item relative flex cursor-pointer items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[inset]:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-highlighted:bg-accent data-highlighted:text-accent-foreground data-highlighted:not-data-[variant=destructive]:text-accent-foreground data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
85
+ local.class
93
86
  )}
94
- {...props}
87
+ {...rest}
95
88
  />
96
89
  )
97
90
  }
98
91
 
99
- function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
100
- return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />
92
+ function DropdownMenuSub(props: ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
93
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
101
94
  }
102
95
 
103
- function DropdownMenuSubTrigger({
104
- className,
105
- inset,
106
- children,
107
- ...props
108
- }: MenuPrimitive.SubmenuTrigger.Props & {
109
- inset?: boolean
110
- }) {
96
+ function DropdownMenuSubTrigger(
97
+ props: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
98
+ inset?: boolean
99
+ }
100
+ ) {
101
+ const [local, rest] = splitProps(props, ['class', 'inset', 'children'])
111
102
  return (
112
- <MenuPrimitive.SubmenuTrigger
103
+ <DropdownMenuPrimitive.SubTrigger
113
104
  data-slot="dropdown-menu-sub-trigger"
114
- data-inset={inset}
115
- className={cn(
116
- "flex cursor-pointer items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
117
- className
105
+ data-inset={local.inset}
106
+ class={cn(
107
+ "flex cursor-pointer items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-7 data-expanded:bg-accent data-expanded:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
108
+ local.class
118
109
  )}
119
- {...props}
110
+ {...rest}
120
111
  >
121
- {children}
122
- <ChevronRightIcon className="ml-auto" />
123
- </MenuPrimitive.SubmenuTrigger>
112
+ {local.children}
113
+ <ChevronRightIcon class="ml-auto" />
114
+ </DropdownMenuPrimitive.SubTrigger>
124
115
  )
125
116
  }
126
117
 
127
- function DropdownMenuSubContent({
128
- align = 'start',
129
- alignOffset = -3,
130
- side = 'right',
131
- sideOffset = 0,
132
- className,
133
- ...props
134
- }: React.ComponentProps<typeof DropdownMenuContent>) {
118
+ function DropdownMenuSubContent(props: ComponentProps<typeof DropdownMenuContent>) {
119
+ const [local, rest] = splitProps(props, ['class'])
135
120
  return (
136
121
  <DropdownMenuContent
137
122
  data-slot="dropdown-menu-sub-content"
138
- className={cn(
139
- 'w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
140
- className
123
+ class={cn(
124
+ 'w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',
125
+ local.class
141
126
  )}
142
- align={align}
143
- alignOffset={alignOffset}
144
- side={side}
145
- sideOffset={sideOffset}
146
- {...props}
127
+ {...rest}
147
128
  />
148
129
  )
149
130
  }
150
131
 
151
- function DropdownMenuCheckboxItem({
152
- className,
153
- children,
154
- checked,
155
- inset,
156
- ...props
157
- }: MenuPrimitive.CheckboxItem.Props & {
158
- inset?: boolean
159
- }) {
132
+ function DropdownMenuCheckboxItem(
133
+ props: ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
134
+ inset?: boolean
135
+ }
136
+ ) {
137
+ const [local, rest] = splitProps(props, ['class', 'children', 'inset'])
160
138
  return (
161
- <MenuPrimitive.CheckboxItem
139
+ <DropdownMenuPrimitive.CheckboxItem
162
140
  data-slot="dropdown-menu-checkbox-item"
163
- data-inset={inset}
164
- className={cn(
165
- "relative flex cursor-pointer items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
166
- className
141
+ data-inset={local.inset}
142
+ class={cn(
143
+ "relative flex cursor-pointer items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-[inset]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
144
+ local.class
167
145
  )}
168
- checked={checked}
169
- {...props}
146
+ {...rest}
170
147
  >
171
148
  <span
172
- className="pointer-events-none absolute right-2 flex items-center justify-center"
149
+ class="pointer-events-none absolute right-2 flex items-center justify-center"
173
150
  data-slot="dropdown-menu-checkbox-item-indicator"
174
151
  >
175
- <MenuPrimitive.CheckboxItemIndicator>
152
+ <DropdownMenuPrimitive.ItemIndicator>
176
153
  <CheckIcon />
177
- </MenuPrimitive.CheckboxItemIndicator>
154
+ </DropdownMenuPrimitive.ItemIndicator>
178
155
  </span>
179
- {children}
180
- </MenuPrimitive.CheckboxItem>
156
+ {local.children}
157
+ </DropdownMenuPrimitive.CheckboxItem>
181
158
  )
182
159
  }
183
160
 
184
- function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
185
- return <MenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />
161
+ function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
162
+ return <DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />
186
163
  }
187
164
 
188
- function DropdownMenuRadioItem({
189
- className,
190
- children,
191
- inset,
192
- ...props
193
- }: MenuPrimitive.RadioItem.Props & {
194
- inset?: boolean
195
- }) {
165
+ function DropdownMenuRadioItem(
166
+ props: ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
167
+ inset?: boolean
168
+ }
169
+ ) {
170
+ const [local, rest] = splitProps(props, ['class', 'children', 'inset'])
196
171
  return (
197
- <MenuPrimitive.RadioItem
172
+ <DropdownMenuPrimitive.RadioItem
198
173
  data-slot="dropdown-menu-radio-item"
199
- data-inset={inset}
200
- className={cn(
201
- "relative flex cursor-pointer items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
202
- className
174
+ data-inset={local.inset}
175
+ class={cn(
176
+ "relative flex cursor-pointer items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-[inset]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
177
+ local.class
203
178
  )}
204
- {...props}
179
+ {...rest}
205
180
  >
206
181
  <span
207
- className="pointer-events-none absolute right-2 flex items-center justify-center"
182
+ class="pointer-events-none absolute right-2 flex items-center justify-center"
208
183
  data-slot="dropdown-menu-radio-item-indicator"
209
184
  >
210
- <MenuPrimitive.RadioItemIndicator>
185
+ <DropdownMenuPrimitive.ItemIndicator>
211
186
  <CheckIcon />
212
- </MenuPrimitive.RadioItemIndicator>
187
+ </DropdownMenuPrimitive.ItemIndicator>
213
188
  </span>
214
- {children}
215
- </MenuPrimitive.RadioItem>
189
+ {local.children}
190
+ </DropdownMenuPrimitive.RadioItem>
216
191
  )
217
192
  }
218
193
 
219
- function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props) {
194
+ function DropdownMenuSeparator(props: ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
195
+ const [local, rest] = splitProps(props, ['class'])
220
196
  return (
221
- <MenuPrimitive.Separator
197
+ <DropdownMenuPrimitive.Separator
222
198
  data-slot="dropdown-menu-separator"
223
- className={cn('-mx-1 my-1 h-px bg-border', className)}
224
- {...props}
199
+ class={cn('-mx-1 my-1 h-px bg-border', local.class)}
200
+ {...rest}
225
201
  />
226
202
  )
227
203
  }
228
204
 
229
- function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
205
+ function DropdownMenuShortcut(props: ComponentProps<'span'>) {
206
+ const [local, rest] = splitProps(props, ['class'])
230
207
  return (
231
208
  <span
232
209
  data-slot="dropdown-menu-shortcut"
233
- className={cn(
210
+ class={cn(
234
211
  'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',
235
- className
212
+ local.class
236
213
  )}
237
- {...props}
214
+ {...rest}
238
215
  />
239
216
  )
240
217
  }
@@ -1,26 +1,29 @@
1
1
  import { cva, type VariantProps } from 'class-variance-authority'
2
+ import { splitProps, type ComponentProps } from 'solid-js'
2
3
 
3
4
  import { cn } from '#lib/utils'
4
5
 
5
- function Empty({ className, ...props }: React.ComponentProps<'div'>) {
6
+ function Empty(props: ComponentProps<'div'>) {
7
+ const [local, rest] = splitProps(props, ['class'])
6
8
  return (
7
9
  <div
8
10
  data-slot="empty"
9
- className={cn(
11
+ class={cn(
10
12
  'flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance',
11
- className
13
+ local.class
12
14
  )}
13
- {...props}
15
+ {...rest}
14
16
  />
15
17
  )
16
18
  }
17
19
 
18
- function EmptyHeader({ className, ...props }: React.ComponentProps<'div'>) {
20
+ function EmptyHeader(props: ComponentProps<'div'>) {
21
+ const [local, rest] = splitProps(props, ['class'])
19
22
  return (
20
23
  <div
21
24
  data-slot="empty-header"
22
- className={cn('flex max-w-sm flex-col items-center gap-2', className)}
23
- {...props}
25
+ class={cn('flex max-w-sm flex-col items-center gap-2', local.class)}
26
+ {...rest}
24
27
  />
25
28
  )
26
29
  }
@@ -40,53 +43,53 @@ const emptyMediaVariants = cva(
40
43
  }
41
44
  )
42
45
 
43
- function EmptyMedia({
44
- className,
45
- variant = 'default',
46
- ...props
47
- }: React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>) {
46
+ function EmptyMedia(props: ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>) {
47
+ const [local, rest] = splitProps(props, ['class', 'variant'])
48
48
  return (
49
49
  <div
50
50
  data-slot="empty-icon"
51
- data-variant={variant}
52
- className={cn(emptyMediaVariants({ variant, className }))}
53
- {...props}
51
+ data-variant={local.variant ?? 'default'}
52
+ class={cn(emptyMediaVariants({ variant: local.variant }), local.class)}
53
+ {...rest}
54
54
  />
55
55
  )
56
56
  }
57
57
 
58
- function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>) {
58
+ function EmptyTitle(props: ComponentProps<'div'>) {
59
+ const [local, rest] = splitProps(props, ['class'])
59
60
  return (
60
61
  <div
61
62
  data-slot="empty-title"
62
- className={cn('text-sm font-medium tracking-tight', className)}
63
- {...props}
63
+ class={cn('text-sm font-medium tracking-tight', local.class)}
64
+ {...rest}
64
65
  />
65
66
  )
66
67
  }
67
68
 
68
- function EmptyDescription({ className, ...props }: React.ComponentProps<'p'>) {
69
+ function EmptyDescription(props: ComponentProps<'p'>) {
70
+ const [local, rest] = splitProps(props, ['class'])
69
71
  return (
70
72
  <div
71
73
  data-slot="empty-description"
72
- className={cn(
74
+ class={cn(
73
75
  'text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
74
- className
76
+ local.class
75
77
  )}
76
- {...props}
78
+ {...rest}
77
79
  />
78
80
  )
79
81
  }
80
82
 
81
- function EmptyContent({ className, ...props }: React.ComponentProps<'div'>) {
83
+ function EmptyContent(props: ComponentProps<'div'>) {
84
+ const [local, rest] = splitProps(props, ['class'])
82
85
  return (
83
86
  <div
84
87
  data-slot="empty-content"
85
- className={cn(
88
+ class={cn(
86
89
  'flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance',
87
- className
90
+ local.class
88
91
  )}
89
- {...props}
92
+ {...rest}
90
93
  />
91
94
  )
92
95
  }