@dalexto/lexsys-registry 0.0.2

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 (206) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/dist/index.d.ts +25 -0
  4. package/dist/index.js +2164 -0
  5. package/dist/install-layer.d.ts +4 -0
  6. package/dist/items/accordion.d.ts +7 -0
  7. package/dist/items/alert-dialog.d.ts +7 -0
  8. package/dist/items/alert.d.ts +7 -0
  9. package/dist/items/auth-form.d.ts +7 -0
  10. package/dist/items/autocomplete.d.ts +7 -0
  11. package/dist/items/avatar.d.ts +7 -0
  12. package/dist/items/badge.d.ts +7 -0
  13. package/dist/items/button.d.ts +7 -0
  14. package/dist/items/card.d.ts +7 -0
  15. package/dist/items/checkbox-group.d.ts +7 -0
  16. package/dist/items/checkbox.d.ts +7 -0
  17. package/dist/items/collapsible.d.ts +7 -0
  18. package/dist/items/combobox.d.ts +7 -0
  19. package/dist/items/command-palette.d.ts +7 -0
  20. package/dist/items/context-menu.d.ts +7 -0
  21. package/dist/items/dashboard-shell.d.ts +7 -0
  22. package/dist/items/dialog.d.ts +7 -0
  23. package/dist/items/drawer.d.ts +7 -0
  24. package/dist/items/field.d.ts +7 -0
  25. package/dist/items/fieldset.d.ts +7 -0
  26. package/dist/items/form-field.d.ts +7 -0
  27. package/dist/items/form.d.ts +7 -0
  28. package/dist/items/index.d.ts +49 -0
  29. package/dist/items/input.d.ts +7 -0
  30. package/dist/items/menu.d.ts +7 -0
  31. package/dist/items/menubar.d.ts +7 -0
  32. package/dist/items/meter.d.ts +7 -0
  33. package/dist/items/navigation-menu.d.ts +7 -0
  34. package/dist/items/number-field.d.ts +7 -0
  35. package/dist/items/otp-field.d.ts +7 -0
  36. package/dist/items/popover.d.ts +7 -0
  37. package/dist/items/preview-card.d.ts +7 -0
  38. package/dist/items/progress.d.ts +7 -0
  39. package/dist/items/radio-group.d.ts +7 -0
  40. package/dist/items/scroll-area.d.ts +7 -0
  41. package/dist/items/select.d.ts +7 -0
  42. package/dist/items/separator.d.ts +7 -0
  43. package/dist/items/settings-panel.d.ts +7 -0
  44. package/dist/items/sidebar.d.ts +7 -0
  45. package/dist/items/slider.d.ts +7 -0
  46. package/dist/items/switch.d.ts +7 -0
  47. package/dist/items/tabs.d.ts +7 -0
  48. package/dist/items/textarea.d.ts +7 -0
  49. package/dist/items/toast.d.ts +7 -0
  50. package/dist/items/toggle-group.d.ts +7 -0
  51. package/dist/items/toggle.d.ts +7 -0
  52. package/dist/items/toolbar.d.ts +7 -0
  53. package/dist/items/tooltip.d.ts +7 -0
  54. package/dist/registry.types.d.ts +40 -0
  55. package/dist/styles/theme.d.ts +2 -0
  56. package/dist/utilities/cn.d.ts +2 -0
  57. package/dist/validate-registry-composition.d.ts +2 -0
  58. package/dist/validate-registry-item.d.ts +2 -0
  59. package/dist/validate-registry-template-imports.d.ts +4 -0
  60. package/dist/validate-registry.d.ts +9 -0
  61. package/package.json +52 -0
  62. package/templates/blocks/AuthForm/AuthForm.tsx +109 -0
  63. package/templates/blocks/AuthForm/AuthForm.types.ts +34 -0
  64. package/templates/blocks/AuthForm/AuthForm.variants.ts +11 -0
  65. package/templates/blocks/CommandPalette/CommandPalette.tsx +245 -0
  66. package/templates/blocks/CommandPalette/CommandPalette.types.ts +73 -0
  67. package/templates/blocks/CommandPalette/CommandPalette.variants.ts +26 -0
  68. package/templates/blocks/FormField/FormField.tsx +83 -0
  69. package/templates/blocks/FormField/FormField.types.ts +26 -0
  70. package/templates/blocks/FormField/FormField.variants.ts +9 -0
  71. package/templates/blocks/SettingsPanel/SettingsPanel.tsx +104 -0
  72. package/templates/blocks/SettingsPanel/SettingsPanel.types.ts +31 -0
  73. package/templates/blocks/SettingsPanel/SettingsPanel.variants.ts +9 -0
  74. package/templates/blocks/Sidebar/Sidebar.tsx +414 -0
  75. package/templates/blocks/Sidebar/Sidebar.types.ts +99 -0
  76. package/templates/blocks/Sidebar/Sidebar.variants.ts +84 -0
  77. package/templates/primitives/Accordion/Accordion.tsx +102 -0
  78. package/templates/primitives/Accordion/Accordion.types.ts +20 -0
  79. package/templates/primitives/Accordion/Accordion.variants.ts +32 -0
  80. package/templates/primitives/Alert/Alert.tsx +62 -0
  81. package/templates/primitives/Alert/Alert.types.ts +35 -0
  82. package/templates/primitives/Alert/Alert.variants.ts +41 -0
  83. package/templates/primitives/AlertDialog/AlertDialog.tsx +168 -0
  84. package/templates/primitives/AlertDialog/AlertDialog.types.ts +30 -0
  85. package/templates/primitives/AlertDialog/AlertDialog.variants.ts +57 -0
  86. package/templates/primitives/Autocomplete/Autocomplete.tsx +394 -0
  87. package/templates/primitives/Autocomplete/Autocomplete.types.ts +82 -0
  88. package/templates/primitives/Autocomplete/Autocomplete.variants.ts +154 -0
  89. package/templates/primitives/Avatar/Avatar.tsx +56 -0
  90. package/templates/primitives/Avatar/Avatar.types.ts +31 -0
  91. package/templates/primitives/Avatar/Avatar.variants.ts +40 -0
  92. package/templates/primitives/Badge/Badge.tsx +30 -0
  93. package/templates/primitives/Badge/Badge.types.ts +30 -0
  94. package/templates/primitives/Badge/Badge.variants.ts +81 -0
  95. package/templates/primitives/Button/Button.tsx +53 -0
  96. package/templates/primitives/Button/Button.types.ts +25 -0
  97. package/templates/primitives/Button/Button.variants.ts +69 -0
  98. package/templates/primitives/Card/Card.tsx +85 -0
  99. package/templates/primitives/Card/Card.types.ts +54 -0
  100. package/templates/primitives/Card/Card.variants.ts +46 -0
  101. package/templates/primitives/Checkbox/Checkbox.tsx +72 -0
  102. package/templates/primitives/Checkbox/Checkbox.types.ts +28 -0
  103. package/templates/primitives/Checkbox/Checkbox.variants.ts +39 -0
  104. package/templates/primitives/CheckboxGroup/CheckboxGroup.tsx +32 -0
  105. package/templates/primitives/CheckboxGroup/CheckboxGroup.types.ts +17 -0
  106. package/templates/primitives/CheckboxGroup/CheckboxGroup.variants.ts +25 -0
  107. package/templates/primitives/Collapsible/Collapsible.tsx +74 -0
  108. package/templates/primitives/Collapsible/Collapsible.types.ts +28 -0
  109. package/templates/primitives/Collapsible/Collapsible.variants.ts +44 -0
  110. package/templates/primitives/Combobox/Combobox.tsx +450 -0
  111. package/templates/primitives/Combobox/Combobox.types.ts +99 -0
  112. package/templates/primitives/Combobox/Combobox.variants.ts +180 -0
  113. package/templates/primitives/ContextMenu/ContextMenu.tsx +375 -0
  114. package/templates/primitives/ContextMenu/ContextMenu.types.ts +57 -0
  115. package/templates/primitives/ContextMenu/ContextMenu.variants.ts +39 -0
  116. package/templates/primitives/Dialog/Dialog.tsx +148 -0
  117. package/templates/primitives/Dialog/Dialog.types.ts +29 -0
  118. package/templates/primitives/Dialog/Dialog.variants.ts +56 -0
  119. package/templates/primitives/Drawer/Drawer.tsx +266 -0
  120. package/templates/primitives/Drawer/Drawer.types.ts +77 -0
  121. package/templates/primitives/Drawer/Drawer.variants.ts +175 -0
  122. package/templates/primitives/Field/Field.tsx +132 -0
  123. package/templates/primitives/Field/Field.types.ts +43 -0
  124. package/templates/primitives/Field/Field.variants.ts +77 -0
  125. package/templates/primitives/Fieldset/Fieldset.tsx +36 -0
  126. package/templates/primitives/Fieldset/Fieldset.types.ts +26 -0
  127. package/templates/primitives/Fieldset/Fieldset.variants.ts +37 -0
  128. package/templates/primitives/Form/Form.tsx +24 -0
  129. package/templates/primitives/Form/Form.types.ts +13 -0
  130. package/templates/primitives/Form/Form.variants.ts +11 -0
  131. package/templates/primitives/Input/Input.tsx +36 -0
  132. package/templates/primitives/Input/Input.types.ts +27 -0
  133. package/templates/primitives/Input/Input.variants.ts +41 -0
  134. package/templates/primitives/Menu/Menu.tsx +352 -0
  135. package/templates/primitives/Menu/Menu.types.ts +56 -0
  136. package/templates/primitives/Menu/Menu.variants.ts +73 -0
  137. package/templates/primitives/Menubar/Menubar.tsx +25 -0
  138. package/templates/primitives/Menubar/Menubar.types.ts +12 -0
  139. package/templates/primitives/Menubar/Menubar.variants.ts +22 -0
  140. package/templates/primitives/Meter/Meter.tsx +123 -0
  141. package/templates/primitives/Meter/Meter.types.ts +45 -0
  142. package/templates/primitives/Meter/Meter.variants.ts +47 -0
  143. package/templates/primitives/NavigationMenu/NavigationMenu.tsx +256 -0
  144. package/templates/primitives/NavigationMenu/NavigationMenu.types.ts +58 -0
  145. package/templates/primitives/NavigationMenu/NavigationMenu.variants.ts +40 -0
  146. package/templates/primitives/NumberField/NumberField.tsx +168 -0
  147. package/templates/primitives/NumberField/NumberField.types.ts +51 -0
  148. package/templates/primitives/NumberField/NumberField.variants.ts +92 -0
  149. package/templates/primitives/OtpField/OtpField.tsx +65 -0
  150. package/templates/primitives/OtpField/OtpField.types.ts +29 -0
  151. package/templates/primitives/OtpField/OtpField.variants.ts +45 -0
  152. package/templates/primitives/Popover/Popover.tsx +193 -0
  153. package/templates/primitives/Popover/Popover.types.ts +35 -0
  154. package/templates/primitives/Popover/Popover.variants.ts +68 -0
  155. package/templates/primitives/PreviewCard/PreviewCard.tsx +153 -0
  156. package/templates/primitives/PreviewCard/PreviewCard.types.ts +42 -0
  157. package/templates/primitives/PreviewCard/PreviewCard.variants.ts +24 -0
  158. package/templates/primitives/Progress/Progress.tsx +95 -0
  159. package/templates/primitives/Progress/Progress.types.ts +39 -0
  160. package/templates/primitives/Progress/Progress.variants.ts +39 -0
  161. package/templates/primitives/RadioGroup/RadioGroup.tsx +66 -0
  162. package/templates/primitives/RadioGroup/RadioGroup.types.ts +34 -0
  163. package/templates/primitives/RadioGroup/RadioGroup.variants.ts +59 -0
  164. package/templates/primitives/ScrollArea/ScrollArea.tsx +135 -0
  165. package/templates/primitives/ScrollArea/ScrollArea.types.ts +34 -0
  166. package/templates/primitives/ScrollArea/ScrollArea.variants.ts +38 -0
  167. package/templates/primitives/Select/Select.tsx +319 -0
  168. package/templates/primitives/Select/Select.types.ts +74 -0
  169. package/templates/primitives/Select/Select.variants.ts +94 -0
  170. package/templates/primitives/Separator/Separator.tsx +30 -0
  171. package/templates/primitives/Separator/Separator.types.ts +13 -0
  172. package/templates/primitives/Separator/Separator.variants.ts +19 -0
  173. package/templates/primitives/Slider/Slider.tsx +124 -0
  174. package/templates/primitives/Slider/Slider.types.ts +51 -0
  175. package/templates/primitives/Slider/Slider.variants.ts +38 -0
  176. package/templates/primitives/Switch/Switch.tsx +61 -0
  177. package/templates/primitives/Switch/Switch.types.ts +29 -0
  178. package/templates/primitives/Switch/Switch.variants.ts +48 -0
  179. package/templates/primitives/Tabs/Tabs.tsx +70 -0
  180. package/templates/primitives/Tabs/Tabs.types.ts +23 -0
  181. package/templates/primitives/Tabs/Tabs.variants.ts +29 -0
  182. package/templates/primitives/Textarea/Textarea.tsx +42 -0
  183. package/templates/primitives/Textarea/Textarea.types.ts +31 -0
  184. package/templates/primitives/Textarea/Textarea.variants.ts +46 -0
  185. package/templates/primitives/Toast/Toast.tsx +195 -0
  186. package/templates/primitives/Toast/Toast.types.ts +52 -0
  187. package/templates/primitives/Toast/Toast.variants.ts +88 -0
  188. package/templates/primitives/Toggle/Toggle.tsx +24 -0
  189. package/templates/primitives/Toggle/Toggle.types.ts +19 -0
  190. package/templates/primitives/Toggle/Toggle.variants.ts +32 -0
  191. package/templates/primitives/ToggleGroup/ToggleGroup.tsx +34 -0
  192. package/templates/primitives/ToggleGroup/ToggleGroup.types.ts +19 -0
  193. package/templates/primitives/ToggleGroup/ToggleGroup.variants.ts +32 -0
  194. package/templates/primitives/Toolbar/Toolbar.tsx +118 -0
  195. package/templates/primitives/Toolbar/Toolbar.types.ts +32 -0
  196. package/templates/primitives/Toolbar/Toolbar.variants.ts +84 -0
  197. package/templates/primitives/Tooltip/Tooltip.tsx +98 -0
  198. package/templates/primitives/Tooltip/Tooltip.types.ts +22 -0
  199. package/templates/primitives/Tooltip/Tooltip.variants.ts +24 -0
  200. package/templates/shared/utils/cn.ts +46 -0
  201. package/templates/styles/theme.css +311 -0
  202. package/templates/styles/tokens.css +1445 -0
  203. package/templates/templates/DashboardShell/DashboardShell.tsx +124 -0
  204. package/templates/templates/DashboardShell/DashboardShell.types.ts +37 -0
  205. package/templates/templates/DashboardShell/DashboardShell.variants.ts +25 -0
  206. package/templates/tsconfig.json +5 -0
@@ -0,0 +1,319 @@
1
+ /**
2
+ * Select.tsx
3
+ *
4
+ * Reference Select component implementation.
5
+ */
6
+
7
+ import { Check, ChevronDown, ChevronUp } from "lucide-react"
8
+ import { Select as BaseSelect } from "@base-ui/react/select"
9
+ import type {
10
+ SelectArrowProps,
11
+ SelectBackdropProps,
12
+ SelectGroupLabelProps,
13
+ SelectGroupProps,
14
+ SelectIconProps,
15
+ SelectItemIndicatorProps,
16
+ SelectItemProps,
17
+ SelectItemTextProps,
18
+ SelectLabelProps,
19
+ SelectListProps,
20
+ SelectPopupProps,
21
+ SelectPortalProps,
22
+ SelectPositionerProps,
23
+ SelectProps,
24
+ SelectScrollDownArrowProps,
25
+ SelectScrollUpArrowProps,
26
+ SelectTriggerProps,
27
+ SelectValueProps,
28
+ } from "./Select.types"
29
+ import {
30
+ selectArrowVariants,
31
+ selectBackdropVariants,
32
+ selectGroupLabelVariants,
33
+ selectGroupVariants,
34
+ selectIconVariants,
35
+ selectItemIndicatorVariants,
36
+ selectItemTextVariants,
37
+ selectItemVariants,
38
+ selectLabelVariants,
39
+ selectListVariants,
40
+ selectPopupVariants,
41
+ selectPositionerVariants,
42
+ selectScrollArrowVariants,
43
+ selectTriggerVariants,
44
+ selectValueVariants,
45
+ } from "./Select.variants"
46
+ import { mergeClassName } from "@/lib/utils"
47
+ import { overlayPositionerSideOffset } from "@/lib/utils"
48
+
49
+ const Select = <Value = string, Multiple extends boolean | undefined = false>(
50
+ props: SelectProps<Value, Multiple>,
51
+ ) => {
52
+ return <BaseSelect.Root {...props} />
53
+ }
54
+
55
+ Select.displayName = "Select"
56
+
57
+ const SelectLabel = ({ ref, className, ...props }: SelectLabelProps) => {
58
+ return (
59
+ <BaseSelect.Label
60
+ ref={ref}
61
+ className={mergeClassName(selectLabelVariants(), className)}
62
+ {...props}
63
+ />
64
+ )
65
+ }
66
+
67
+ SelectLabel.displayName = "SelectLabel"
68
+
69
+ const SelectTrigger = ({
70
+ ref,
71
+ size,
72
+ className,
73
+ ...props
74
+ }: SelectTriggerProps) => {
75
+ return (
76
+ <BaseSelect.Trigger
77
+ ref={ref}
78
+ className={mergeClassName(selectTriggerVariants({ size }), className)}
79
+ {...props}
80
+ />
81
+ )
82
+ }
83
+
84
+ SelectTrigger.displayName = "SelectTrigger"
85
+
86
+ const SelectValue = ({ ref, className, ...props }: SelectValueProps) => {
87
+ return (
88
+ <BaseSelect.Value
89
+ ref={ref}
90
+ className={mergeClassName(selectValueVariants(), className)}
91
+ {...props}
92
+ />
93
+ )
94
+ }
95
+
96
+ SelectValue.displayName = "SelectValue"
97
+
98
+ const SelectIcon = ({
99
+ ref,
100
+ className,
101
+ children,
102
+ ...props
103
+ }: SelectIconProps) => {
104
+ return (
105
+ <BaseSelect.Icon
106
+ ref={ref}
107
+ className={mergeClassName(selectIconVariants(), className)}
108
+ {...props}
109
+ >
110
+ {children ?? <ChevronDown aria-hidden="true" size={16} />}
111
+ </BaseSelect.Icon>
112
+ )
113
+ }
114
+
115
+ SelectIcon.displayName = "SelectIcon"
116
+
117
+ const SelectPortal = (props: SelectPortalProps) => {
118
+ return <BaseSelect.Portal {...props} />
119
+ }
120
+
121
+ SelectPortal.displayName = "SelectPortal"
122
+
123
+ const SelectBackdrop = ({ ref, className, ...props }: SelectBackdropProps) => {
124
+ return (
125
+ <BaseSelect.Backdrop
126
+ ref={ref}
127
+ className={mergeClassName(selectBackdropVariants(), className)}
128
+ {...props}
129
+ />
130
+ )
131
+ }
132
+
133
+ SelectBackdrop.displayName = "SelectBackdrop"
134
+
135
+ const SelectPositioner = ({
136
+ ref,
137
+ className,
138
+ alignItemWithTrigger = false,
139
+ sideOffset = overlayPositionerSideOffset,
140
+ ...props
141
+ }: SelectPositionerProps) => {
142
+ return (
143
+ <BaseSelect.Positioner
144
+ ref={ref}
145
+ alignItemWithTrigger={alignItemWithTrigger}
146
+ sideOffset={sideOffset}
147
+ className={mergeClassName(selectPositionerVariants(), className)}
148
+ {...props}
149
+ />
150
+ )
151
+ }
152
+
153
+ SelectPositioner.displayName = "SelectPositioner"
154
+
155
+ const SelectPopup = ({ ref, className, ...props }: SelectPopupProps) => {
156
+ return (
157
+ <BaseSelect.Popup
158
+ ref={ref}
159
+ className={mergeClassName(selectPopupVariants(), className)}
160
+ {...props}
161
+ />
162
+ )
163
+ }
164
+
165
+ SelectPopup.displayName = "SelectPopup"
166
+
167
+ const SelectList = ({ ref, className, ...props }: SelectListProps) => {
168
+ return (
169
+ <BaseSelect.List
170
+ ref={ref}
171
+ className={mergeClassName(selectListVariants(), className)}
172
+ {...props}
173
+ />
174
+ )
175
+ }
176
+
177
+ SelectList.displayName = "SelectList"
178
+
179
+ const SelectItem = ({ ref, className, ...props }: SelectItemProps) => {
180
+ return (
181
+ <BaseSelect.Item
182
+ ref={ref}
183
+ className={mergeClassName(selectItemVariants(), className)}
184
+ {...props}
185
+ />
186
+ )
187
+ }
188
+
189
+ SelectItem.displayName = "SelectItem"
190
+
191
+ const SelectItemIndicator = ({
192
+ ref,
193
+ className,
194
+ children,
195
+ ...props
196
+ }: SelectItemIndicatorProps) => {
197
+ return (
198
+ <BaseSelect.ItemIndicator
199
+ ref={ref}
200
+ className={mergeClassName(selectItemIndicatorVariants(), className)}
201
+ {...props}
202
+ >
203
+ {children ?? <Check aria-hidden="true" size={14} />}
204
+ </BaseSelect.ItemIndicator>
205
+ )
206
+ }
207
+
208
+ SelectItemIndicator.displayName = "SelectItemIndicator"
209
+
210
+ const SelectItemText = ({ ref, className, ...props }: SelectItemTextProps) => {
211
+ return (
212
+ <BaseSelect.ItemText
213
+ ref={ref}
214
+ className={mergeClassName(selectItemTextVariants(), className)}
215
+ {...props}
216
+ />
217
+ )
218
+ }
219
+
220
+ SelectItemText.displayName = "SelectItemText"
221
+
222
+ const SelectArrow = ({ ref, className, ...props }: SelectArrowProps) => {
223
+ return (
224
+ <BaseSelect.Arrow
225
+ ref={ref}
226
+ className={mergeClassName(selectArrowVariants(), className)}
227
+ {...props}
228
+ />
229
+ )
230
+ }
231
+
232
+ SelectArrow.displayName = "SelectArrow"
233
+
234
+ const SelectScrollUpArrow = ({
235
+ ref,
236
+ className,
237
+ children,
238
+ ...props
239
+ }: SelectScrollUpArrowProps) => {
240
+ return (
241
+ <BaseSelect.ScrollUpArrow
242
+ ref={ref}
243
+ className={mergeClassName(selectScrollArrowVariants(), className)}
244
+ {...props}
245
+ >
246
+ {children ?? <ChevronUp aria-hidden="true" size={16} />}
247
+ </BaseSelect.ScrollUpArrow>
248
+ )
249
+ }
250
+
251
+ SelectScrollUpArrow.displayName = "SelectScrollUpArrow"
252
+
253
+ const SelectScrollDownArrow = ({
254
+ ref,
255
+ className,
256
+ children,
257
+ ...props
258
+ }: SelectScrollDownArrowProps) => {
259
+ return (
260
+ <BaseSelect.ScrollDownArrow
261
+ ref={ref}
262
+ className={mergeClassName(selectScrollArrowVariants(), className)}
263
+ {...props}
264
+ >
265
+ {children ?? <ChevronDown aria-hidden="true" size={16} />}
266
+ </BaseSelect.ScrollDownArrow>
267
+ )
268
+ }
269
+
270
+ SelectScrollDownArrow.displayName = "SelectScrollDownArrow"
271
+
272
+ const SelectGroup = ({ ref, className, ...props }: SelectGroupProps) => {
273
+ return (
274
+ <BaseSelect.Group
275
+ ref={ref}
276
+ className={mergeClassName(selectGroupVariants(), className)}
277
+ {...props}
278
+ />
279
+ )
280
+ }
281
+
282
+ SelectGroup.displayName = "SelectGroup"
283
+
284
+ const SelectGroupLabel = ({
285
+ ref,
286
+ className,
287
+ ...props
288
+ }: SelectGroupLabelProps) => {
289
+ return (
290
+ <BaseSelect.GroupLabel
291
+ ref={ref}
292
+ className={mergeClassName(selectGroupLabelVariants(), className)}
293
+ {...props}
294
+ />
295
+ )
296
+ }
297
+
298
+ SelectGroupLabel.displayName = "SelectGroupLabel"
299
+
300
+ export {
301
+ Select,
302
+ SelectLabel,
303
+ SelectTrigger,
304
+ SelectValue,
305
+ SelectIcon,
306
+ SelectPortal,
307
+ SelectBackdrop,
308
+ SelectPositioner,
309
+ SelectPopup,
310
+ SelectList,
311
+ SelectItem,
312
+ SelectItemIndicator,
313
+ SelectItemText,
314
+ SelectArrow,
315
+ SelectScrollUpArrow,
316
+ SelectScrollDownArrow,
317
+ SelectGroup,
318
+ SelectGroupLabel,
319
+ }
@@ -0,0 +1,74 @@
1
+ import type { Ref } from "react"
2
+ /**
3
+ * Select.types.ts
4
+ *
5
+ * Public and internal types for Select component.
6
+ */
7
+
8
+ import type { Select as BaseSelect } from "@base-ui/react/select"
9
+
10
+ export type SelectSize = "sm" | "md" | "lg"
11
+
12
+ export type SelectProps<
13
+ Value = string,
14
+ Multiple extends boolean | undefined = false,
15
+ > = BaseSelect.Root.Props<Value, Multiple>
16
+
17
+ export type SelectLabelProps = BaseSelect.Label.Props & {
18
+ ref?: Ref<HTMLDivElement>
19
+ }
20
+
21
+ export interface SelectTriggerProps extends Omit<
22
+ BaseSelect.Trigger.Props,
23
+ "className" | "size"
24
+ > {
25
+ size?: SelectSize
26
+ className?: BaseSelect.Trigger.Props["className"]
27
+ }
28
+
29
+ export interface SelectValueProps extends Omit<
30
+ BaseSelect.Value.Props,
31
+ "className"
32
+ > {
33
+ className?: BaseSelect.Value.Props["className"]
34
+ }
35
+
36
+ export type SelectIconProps = BaseSelect.Icon.Props
37
+
38
+ export type SelectPortalProps = BaseSelect.Portal.Props
39
+
40
+ export type SelectBackdropProps = BaseSelect.Backdrop.Props
41
+
42
+ export type SelectPositionerProps = BaseSelect.Positioner.Props
43
+
44
+ export type SelectPopupProps = BaseSelect.Popup.Props
45
+
46
+ export type SelectListProps = BaseSelect.List.Props
47
+
48
+ export interface SelectItemProps extends Omit<
49
+ BaseSelect.Item.Props,
50
+ "className" | "ref"
51
+ > {
52
+ ref?: Ref<HTMLDivElement>
53
+ className?: BaseSelect.Item.Props["className"]
54
+ }
55
+
56
+ export interface SelectItemIndicatorProps extends Omit<
57
+ BaseSelect.ItemIndicator.Props,
58
+ "className"
59
+ > {
60
+ className?: BaseSelect.ItemIndicator.Props["className"]
61
+ }
62
+
63
+ export type SelectItemTextProps = BaseSelect.ItemText.Props
64
+
65
+ export type SelectArrowProps = BaseSelect.Arrow.Props
66
+
67
+ export type SelectScrollArrowProps = BaseSelect.ScrollDownArrow.Props
68
+
69
+ export type SelectScrollUpArrowProps = SelectScrollArrowProps
70
+ export type SelectScrollDownArrowProps = SelectScrollArrowProps
71
+
72
+ export type SelectGroupProps = BaseSelect.Group.Props
73
+
74
+ export type SelectGroupLabelProps = BaseSelect.GroupLabel.Props
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Select.variants.ts
3
+ *
4
+ * Defines visual variants using class composition.
5
+ */
6
+
7
+ import { cva } from "class-variance-authority"
8
+
9
+ export const selectLabelVariants = cva(
10
+ "text-(length:--lsys-select-label-font-size) font-(--lsys-select-label-font-weight) leading-(--lsys-select-label-font-line-height) text-(--lsys-select-label-foreground)",
11
+ )
12
+
13
+ export const selectTriggerVariants = cva(
14
+ [
15
+ "inline-flex w-full min-w-0 items-center justify-between gap-(--lsys-select-trigger-gap) rounded-(--lsys-select-radius) border",
16
+ "border-(--lsys-select-border-color) bg-(--lsys-select-background) text-(--lsys-select-foreground)",
17
+ "font-(family-name:--lsys-select-font-family) font-(--lsys-select-font-weight) leading-(--lsys-select-font-line-height) tracking-(--lsys-select-font-letter-spacing)",
18
+ "transition-colors duration-(--lsys-select-transition-duration) ease-(--lsys-select-transition-easing)",
19
+ "outline-none data-[focused]:border-(--lsys-select-focus-border-color) data-[focused]:ring-(length:--lsys-select-focus-ring-width) data-[focused]:ring-(--lsys-select-focus-ring-color) data-[focused]:ring-offset-(length:--lsys-select-focus-ring-offset) data-[focused]:ring-offset-(--lsys-select-focus-ring-offset-color)",
20
+ "data-[invalid]:border-(--lsys-select-invalid-border-color) data-[invalid]:ring-(length:--lsys-select-invalid-ring-width) data-[invalid]:ring-(--lsys-select-invalid-ring-color)",
21
+ "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--lsys-opacity-disabled)",
22
+ ].join(" "),
23
+ {
24
+ variants: {
25
+ size: {
26
+ sm: "h-(--lsys-select-height-sm) px-(--lsys-select-padding-x-sm) text-(length:--lsys-select-font-size-sm)",
27
+ md: "h-(--lsys-select-height-md) px-(--lsys-select-padding-x-md) text-(length:--lsys-select-font-size-md)",
28
+ lg: "h-(--lsys-select-height-lg) px-(--lsys-select-padding-x-lg) text-(length:--lsys-select-font-size-lg)",
29
+ },
30
+ },
31
+ defaultVariants: {
32
+ size: "md",
33
+ },
34
+ },
35
+ )
36
+
37
+ export const selectValueVariants = cva(
38
+ "min-w-0 flex-1 truncate text-left data-[placeholder]:text-(--lsys-select-placeholder-color)",
39
+ )
40
+
41
+ export const selectIconVariants = cva(
42
+ "inline-flex size-(--lsys-select-icon-size) shrink-0 items-center justify-center text-(--lsys-select-icon-foreground) transition-transform duration-(--lsys-select-transition-duration) ease-(--lsys-select-transition-easing) data-[open]:rotate-180",
43
+ )
44
+
45
+ export const selectBackdropVariants = cva(
46
+ "fixed inset-0 z-(--lsys-select-backdrop-z-index) bg-(--lsys-select-backdrop-background) opacity-(--lsys-select-backdrop-opacity) data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",
47
+ )
48
+
49
+ export const selectPositionerVariants = cva(
50
+ "z-(--lsys-select-positioner-z-index)",
51
+ )
52
+
53
+ export const selectPopupVariants = cva(
54
+ [
55
+ "min-w-[var(--anchor-width)] overflow-hidden rounded-(--lsys-select-radius) border",
56
+ "border-(--lsys-select-popup-border-color) bg-(--lsys-select-popup-background) text-(--lsys-select-popup-foreground) shadow-(--lsys-select-popup-shadow)",
57
+ "data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
58
+ "origin-[var(--transform-origin)] transition-[opacity,transform] duration-(--lsys-select-transition-duration) ease-(--lsys-select-transition-easing)",
59
+ ].join(" "),
60
+ )
61
+
62
+ export const selectListVariants = cva(
63
+ "grid max-h-(--lsys-select-popup-max-height) gap-(--lsys-select-list-gap) overflow-y-auto p-(--lsys-select-list-padding)",
64
+ )
65
+
66
+ export const selectItemVariants = cva(
67
+ [
68
+ "relative flex min-w-0 cursor-default select-none items-center gap-(--lsys-select-item-gap) rounded-(--lsys-select-item-radius) px-(--lsys-select-item-padding-x) py-(--lsys-select-item-padding-y)",
69
+ "text-(length:--lsys-select-item-font-size) font-(--lsys-select-item-font-weight) leading-(--lsys-select-item-font-line-height) text-(--lsys-select-item-foreground) outline-none",
70
+ "data-[highlighted]:bg-(--lsys-select-item-highlight-background) data-[highlighted]:text-(--lsys-select-item-highlight-foreground)",
71
+ "data-[selected]:bg-(--lsys-select-item-selected-background) data-[selected]:text-(--lsys-select-item-selected-foreground)",
72
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-(--lsys-opacity-disabled)",
73
+ ].join(" "),
74
+ )
75
+
76
+ export const selectItemIndicatorVariants = cva(
77
+ "inline-flex size-(--lsys-select-item-indicator-size) shrink-0 items-center justify-center text-current",
78
+ )
79
+
80
+ export const selectItemTextVariants = cva("min-w-0 flex-1 truncate")
81
+
82
+ export const selectArrowVariants = cva(
83
+ "size-(--lsys-select-arrow-size) rotate-45 border border-(--lsys-select-popup-border-color) bg-(--lsys-select-popup-background)",
84
+ )
85
+
86
+ export const selectScrollArrowVariants = cva(
87
+ "flex h-(--lsys-select-scroll-arrow-height) items-center justify-center text-(--lsys-select-icon-foreground)",
88
+ )
89
+
90
+ export const selectGroupVariants = cva("grid gap-(--lsys-select-group-gap)")
91
+
92
+ export const selectGroupLabelVariants = cva(
93
+ "px-(--lsys-select-item-padding-x) py-(--lsys-select-group-label-padding-y) text-(length:--lsys-select-group-label-font-size) font-(--lsys-select-group-label-font-weight) leading-(--lsys-select-group-label-font-line-height) text-(--lsys-select-group-label-foreground)",
94
+ )
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Separator.tsx
3
+ *
4
+ * Reference Separator component implementation.
5
+ */
6
+
7
+ import { Separator as BaseSeparator } from "@base-ui/react/separator"
8
+ import type { SeparatorProps } from "./Separator.types"
9
+ import { separatorVariants } from "./Separator.variants"
10
+ import { mergeClassName } from "@/lib/utils"
11
+
12
+ const Separator = ({
13
+ ref,
14
+ orientation = "horizontal",
15
+ className,
16
+ ...props
17
+ }: SeparatorProps) => {
18
+ return (
19
+ <BaseSeparator
20
+ ref={ref}
21
+ orientation={orientation}
22
+ className={mergeClassName(separatorVariants({ orientation }), className)}
23
+ {...props}
24
+ />
25
+ )
26
+ }
27
+
28
+ Separator.displayName = "Separator"
29
+
30
+ export { Separator }
@@ -0,0 +1,13 @@
1
+ import type { Ref } from "react"
2
+ /**
3
+ * Separator.types.ts
4
+ *
5
+ * Public and internal types for Separator component.
6
+ */
7
+
8
+ import type { Separator as BaseSeparator } from "@base-ui/react/separator"
9
+
10
+ export interface SeparatorProps extends Omit<BaseSeparator.Props, "className"> {
11
+ ref?: Ref<HTMLDivElement>
12
+ className?: BaseSeparator.Props["className"]
13
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Separator.variants.ts
3
+ *
4
+ * Defines visual variants using class composition.
5
+ */
6
+
7
+ import { cva } from "class-variance-authority"
8
+
9
+ export const separatorVariants = cva("shrink-0 bg-(--lsys-separator-color)", {
10
+ variants: {
11
+ orientation: {
12
+ horizontal: "h-(--lsys-separator-thickness) w-full",
13
+ vertical: "h-full w-(--lsys-separator-thickness)",
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ orientation: "horizontal",
18
+ },
19
+ })
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Slider.tsx
3
+ *
4
+ * Reference Slider component implementation.
5
+ */
6
+
7
+ import { Slider as BaseSlider } from "@base-ui/react/slider"
8
+ import type {
9
+ SliderControlProps,
10
+ SliderIndicatorProps,
11
+ SliderLabelProps,
12
+ SliderProps,
13
+ SliderThumbProps,
14
+ SliderTrackProps,
15
+ SliderValueProps,
16
+ } from "./Slider.types"
17
+ import {
18
+ sliderControlVariants,
19
+ sliderIndicatorVariants,
20
+ sliderLabelVariants,
21
+ sliderThumbVariants,
22
+ sliderTrackVariants,
23
+ sliderValueVariants,
24
+ sliderVariants,
25
+ } from "./Slider.variants"
26
+ import { mergeClassName } from "@/lib/utils"
27
+
28
+ const Slider = ({ ref, className, children, ...props }: SliderProps) => {
29
+ return (
30
+ <BaseSlider.Root
31
+ ref={ref}
32
+ className={mergeClassName(sliderVariants(), className)}
33
+ {...props}
34
+ >
35
+ {children}
36
+ </BaseSlider.Root>
37
+ )
38
+ }
39
+
40
+ Slider.displayName = "Slider"
41
+
42
+ const SliderControl = ({
43
+ className,
44
+ children,
45
+ ...props
46
+ }: SliderControlProps) => {
47
+ return (
48
+ <BaseSlider.Control
49
+ className={mergeClassName(sliderControlVariants(), className)}
50
+ {...props}
51
+ >
52
+ {children}
53
+ </BaseSlider.Control>
54
+ )
55
+ }
56
+
57
+ SliderControl.displayName = "SliderControl"
58
+
59
+ const SliderTrack = ({ className, children, ...props }: SliderTrackProps) => {
60
+ return (
61
+ <BaseSlider.Track
62
+ className={mergeClassName(sliderTrackVariants(), className)}
63
+ {...props}
64
+ >
65
+ {children}
66
+ </BaseSlider.Track>
67
+ )
68
+ }
69
+
70
+ SliderTrack.displayName = "SliderTrack"
71
+
72
+ const SliderIndicator = ({ className, ...props }: SliderIndicatorProps) => {
73
+ return (
74
+ <BaseSlider.Indicator
75
+ className={mergeClassName(sliderIndicatorVariants(), className)}
76
+ {...props}
77
+ />
78
+ )
79
+ }
80
+
81
+ SliderIndicator.displayName = "SliderIndicator"
82
+
83
+ const SliderThumb = ({ className, ...props }: SliderThumbProps) => {
84
+ return (
85
+ <BaseSlider.Thumb
86
+ className={mergeClassName(sliderThumbVariants(), className)}
87
+ {...props}
88
+ />
89
+ )
90
+ }
91
+
92
+ SliderThumb.displayName = "SliderThumb"
93
+
94
+ const SliderLabel = ({ className, ...props }: SliderLabelProps) => {
95
+ return (
96
+ <BaseSlider.Label
97
+ className={mergeClassName(sliderLabelVariants(), className)}
98
+ {...props}
99
+ />
100
+ )
101
+ }
102
+
103
+ SliderLabel.displayName = "SliderLabel"
104
+
105
+ const SliderValue = ({ className, ...props }: SliderValueProps) => {
106
+ return (
107
+ <BaseSlider.Value
108
+ className={mergeClassName(sliderValueVariants(), className)}
109
+ {...props}
110
+ />
111
+ )
112
+ }
113
+
114
+ SliderValue.displayName = "SliderValue"
115
+
116
+ export {
117
+ Slider,
118
+ SliderControl,
119
+ SliderTrack,
120
+ SliderIndicator,
121
+ SliderThumb,
122
+ SliderLabel,
123
+ SliderValue,
124
+ }