@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.
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +2164 -0
- package/dist/install-layer.d.ts +4 -0
- package/dist/items/accordion.d.ts +7 -0
- package/dist/items/alert-dialog.d.ts +7 -0
- package/dist/items/alert.d.ts +7 -0
- package/dist/items/auth-form.d.ts +7 -0
- package/dist/items/autocomplete.d.ts +7 -0
- package/dist/items/avatar.d.ts +7 -0
- package/dist/items/badge.d.ts +7 -0
- package/dist/items/button.d.ts +7 -0
- package/dist/items/card.d.ts +7 -0
- package/dist/items/checkbox-group.d.ts +7 -0
- package/dist/items/checkbox.d.ts +7 -0
- package/dist/items/collapsible.d.ts +7 -0
- package/dist/items/combobox.d.ts +7 -0
- package/dist/items/command-palette.d.ts +7 -0
- package/dist/items/context-menu.d.ts +7 -0
- package/dist/items/dashboard-shell.d.ts +7 -0
- package/dist/items/dialog.d.ts +7 -0
- package/dist/items/drawer.d.ts +7 -0
- package/dist/items/field.d.ts +7 -0
- package/dist/items/fieldset.d.ts +7 -0
- package/dist/items/form-field.d.ts +7 -0
- package/dist/items/form.d.ts +7 -0
- package/dist/items/index.d.ts +49 -0
- package/dist/items/input.d.ts +7 -0
- package/dist/items/menu.d.ts +7 -0
- package/dist/items/menubar.d.ts +7 -0
- package/dist/items/meter.d.ts +7 -0
- package/dist/items/navigation-menu.d.ts +7 -0
- package/dist/items/number-field.d.ts +7 -0
- package/dist/items/otp-field.d.ts +7 -0
- package/dist/items/popover.d.ts +7 -0
- package/dist/items/preview-card.d.ts +7 -0
- package/dist/items/progress.d.ts +7 -0
- package/dist/items/radio-group.d.ts +7 -0
- package/dist/items/scroll-area.d.ts +7 -0
- package/dist/items/select.d.ts +7 -0
- package/dist/items/separator.d.ts +7 -0
- package/dist/items/settings-panel.d.ts +7 -0
- package/dist/items/sidebar.d.ts +7 -0
- package/dist/items/slider.d.ts +7 -0
- package/dist/items/switch.d.ts +7 -0
- package/dist/items/tabs.d.ts +7 -0
- package/dist/items/textarea.d.ts +7 -0
- package/dist/items/toast.d.ts +7 -0
- package/dist/items/toggle-group.d.ts +7 -0
- package/dist/items/toggle.d.ts +7 -0
- package/dist/items/toolbar.d.ts +7 -0
- package/dist/items/tooltip.d.ts +7 -0
- package/dist/registry.types.d.ts +40 -0
- package/dist/styles/theme.d.ts +2 -0
- package/dist/utilities/cn.d.ts +2 -0
- package/dist/validate-registry-composition.d.ts +2 -0
- package/dist/validate-registry-item.d.ts +2 -0
- package/dist/validate-registry-template-imports.d.ts +4 -0
- package/dist/validate-registry.d.ts +9 -0
- package/package.json +52 -0
- package/templates/blocks/AuthForm/AuthForm.tsx +109 -0
- package/templates/blocks/AuthForm/AuthForm.types.ts +34 -0
- package/templates/blocks/AuthForm/AuthForm.variants.ts +11 -0
- package/templates/blocks/CommandPalette/CommandPalette.tsx +245 -0
- package/templates/blocks/CommandPalette/CommandPalette.types.ts +73 -0
- package/templates/blocks/CommandPalette/CommandPalette.variants.ts +26 -0
- package/templates/blocks/FormField/FormField.tsx +83 -0
- package/templates/blocks/FormField/FormField.types.ts +26 -0
- package/templates/blocks/FormField/FormField.variants.ts +9 -0
- package/templates/blocks/SettingsPanel/SettingsPanel.tsx +104 -0
- package/templates/blocks/SettingsPanel/SettingsPanel.types.ts +31 -0
- package/templates/blocks/SettingsPanel/SettingsPanel.variants.ts +9 -0
- package/templates/blocks/Sidebar/Sidebar.tsx +414 -0
- package/templates/blocks/Sidebar/Sidebar.types.ts +99 -0
- package/templates/blocks/Sidebar/Sidebar.variants.ts +84 -0
- package/templates/primitives/Accordion/Accordion.tsx +102 -0
- package/templates/primitives/Accordion/Accordion.types.ts +20 -0
- package/templates/primitives/Accordion/Accordion.variants.ts +32 -0
- package/templates/primitives/Alert/Alert.tsx +62 -0
- package/templates/primitives/Alert/Alert.types.ts +35 -0
- package/templates/primitives/Alert/Alert.variants.ts +41 -0
- package/templates/primitives/AlertDialog/AlertDialog.tsx +168 -0
- package/templates/primitives/AlertDialog/AlertDialog.types.ts +30 -0
- package/templates/primitives/AlertDialog/AlertDialog.variants.ts +57 -0
- package/templates/primitives/Autocomplete/Autocomplete.tsx +394 -0
- package/templates/primitives/Autocomplete/Autocomplete.types.ts +82 -0
- package/templates/primitives/Autocomplete/Autocomplete.variants.ts +154 -0
- package/templates/primitives/Avatar/Avatar.tsx +56 -0
- package/templates/primitives/Avatar/Avatar.types.ts +31 -0
- package/templates/primitives/Avatar/Avatar.variants.ts +40 -0
- package/templates/primitives/Badge/Badge.tsx +30 -0
- package/templates/primitives/Badge/Badge.types.ts +30 -0
- package/templates/primitives/Badge/Badge.variants.ts +81 -0
- package/templates/primitives/Button/Button.tsx +53 -0
- package/templates/primitives/Button/Button.types.ts +25 -0
- package/templates/primitives/Button/Button.variants.ts +69 -0
- package/templates/primitives/Card/Card.tsx +85 -0
- package/templates/primitives/Card/Card.types.ts +54 -0
- package/templates/primitives/Card/Card.variants.ts +46 -0
- package/templates/primitives/Checkbox/Checkbox.tsx +72 -0
- package/templates/primitives/Checkbox/Checkbox.types.ts +28 -0
- package/templates/primitives/Checkbox/Checkbox.variants.ts +39 -0
- package/templates/primitives/CheckboxGroup/CheckboxGroup.tsx +32 -0
- package/templates/primitives/CheckboxGroup/CheckboxGroup.types.ts +17 -0
- package/templates/primitives/CheckboxGroup/CheckboxGroup.variants.ts +25 -0
- package/templates/primitives/Collapsible/Collapsible.tsx +74 -0
- package/templates/primitives/Collapsible/Collapsible.types.ts +28 -0
- package/templates/primitives/Collapsible/Collapsible.variants.ts +44 -0
- package/templates/primitives/Combobox/Combobox.tsx +450 -0
- package/templates/primitives/Combobox/Combobox.types.ts +99 -0
- package/templates/primitives/Combobox/Combobox.variants.ts +180 -0
- package/templates/primitives/ContextMenu/ContextMenu.tsx +375 -0
- package/templates/primitives/ContextMenu/ContextMenu.types.ts +57 -0
- package/templates/primitives/ContextMenu/ContextMenu.variants.ts +39 -0
- package/templates/primitives/Dialog/Dialog.tsx +148 -0
- package/templates/primitives/Dialog/Dialog.types.ts +29 -0
- package/templates/primitives/Dialog/Dialog.variants.ts +56 -0
- package/templates/primitives/Drawer/Drawer.tsx +266 -0
- package/templates/primitives/Drawer/Drawer.types.ts +77 -0
- package/templates/primitives/Drawer/Drawer.variants.ts +175 -0
- package/templates/primitives/Field/Field.tsx +132 -0
- package/templates/primitives/Field/Field.types.ts +43 -0
- package/templates/primitives/Field/Field.variants.ts +77 -0
- package/templates/primitives/Fieldset/Fieldset.tsx +36 -0
- package/templates/primitives/Fieldset/Fieldset.types.ts +26 -0
- package/templates/primitives/Fieldset/Fieldset.variants.ts +37 -0
- package/templates/primitives/Form/Form.tsx +24 -0
- package/templates/primitives/Form/Form.types.ts +13 -0
- package/templates/primitives/Form/Form.variants.ts +11 -0
- package/templates/primitives/Input/Input.tsx +36 -0
- package/templates/primitives/Input/Input.types.ts +27 -0
- package/templates/primitives/Input/Input.variants.ts +41 -0
- package/templates/primitives/Menu/Menu.tsx +352 -0
- package/templates/primitives/Menu/Menu.types.ts +56 -0
- package/templates/primitives/Menu/Menu.variants.ts +73 -0
- package/templates/primitives/Menubar/Menubar.tsx +25 -0
- package/templates/primitives/Menubar/Menubar.types.ts +12 -0
- package/templates/primitives/Menubar/Menubar.variants.ts +22 -0
- package/templates/primitives/Meter/Meter.tsx +123 -0
- package/templates/primitives/Meter/Meter.types.ts +45 -0
- package/templates/primitives/Meter/Meter.variants.ts +47 -0
- package/templates/primitives/NavigationMenu/NavigationMenu.tsx +256 -0
- package/templates/primitives/NavigationMenu/NavigationMenu.types.ts +58 -0
- package/templates/primitives/NavigationMenu/NavigationMenu.variants.ts +40 -0
- package/templates/primitives/NumberField/NumberField.tsx +168 -0
- package/templates/primitives/NumberField/NumberField.types.ts +51 -0
- package/templates/primitives/NumberField/NumberField.variants.ts +92 -0
- package/templates/primitives/OtpField/OtpField.tsx +65 -0
- package/templates/primitives/OtpField/OtpField.types.ts +29 -0
- package/templates/primitives/OtpField/OtpField.variants.ts +45 -0
- package/templates/primitives/Popover/Popover.tsx +193 -0
- package/templates/primitives/Popover/Popover.types.ts +35 -0
- package/templates/primitives/Popover/Popover.variants.ts +68 -0
- package/templates/primitives/PreviewCard/PreviewCard.tsx +153 -0
- package/templates/primitives/PreviewCard/PreviewCard.types.ts +42 -0
- package/templates/primitives/PreviewCard/PreviewCard.variants.ts +24 -0
- package/templates/primitives/Progress/Progress.tsx +95 -0
- package/templates/primitives/Progress/Progress.types.ts +39 -0
- package/templates/primitives/Progress/Progress.variants.ts +39 -0
- package/templates/primitives/RadioGroup/RadioGroup.tsx +66 -0
- package/templates/primitives/RadioGroup/RadioGroup.types.ts +34 -0
- package/templates/primitives/RadioGroup/RadioGroup.variants.ts +59 -0
- package/templates/primitives/ScrollArea/ScrollArea.tsx +135 -0
- package/templates/primitives/ScrollArea/ScrollArea.types.ts +34 -0
- package/templates/primitives/ScrollArea/ScrollArea.variants.ts +38 -0
- package/templates/primitives/Select/Select.tsx +319 -0
- package/templates/primitives/Select/Select.types.ts +74 -0
- package/templates/primitives/Select/Select.variants.ts +94 -0
- package/templates/primitives/Separator/Separator.tsx +30 -0
- package/templates/primitives/Separator/Separator.types.ts +13 -0
- package/templates/primitives/Separator/Separator.variants.ts +19 -0
- package/templates/primitives/Slider/Slider.tsx +124 -0
- package/templates/primitives/Slider/Slider.types.ts +51 -0
- package/templates/primitives/Slider/Slider.variants.ts +38 -0
- package/templates/primitives/Switch/Switch.tsx +61 -0
- package/templates/primitives/Switch/Switch.types.ts +29 -0
- package/templates/primitives/Switch/Switch.variants.ts +48 -0
- package/templates/primitives/Tabs/Tabs.tsx +70 -0
- package/templates/primitives/Tabs/Tabs.types.ts +23 -0
- package/templates/primitives/Tabs/Tabs.variants.ts +29 -0
- package/templates/primitives/Textarea/Textarea.tsx +42 -0
- package/templates/primitives/Textarea/Textarea.types.ts +31 -0
- package/templates/primitives/Textarea/Textarea.variants.ts +46 -0
- package/templates/primitives/Toast/Toast.tsx +195 -0
- package/templates/primitives/Toast/Toast.types.ts +52 -0
- package/templates/primitives/Toast/Toast.variants.ts +88 -0
- package/templates/primitives/Toggle/Toggle.tsx +24 -0
- package/templates/primitives/Toggle/Toggle.types.ts +19 -0
- package/templates/primitives/Toggle/Toggle.variants.ts +32 -0
- package/templates/primitives/ToggleGroup/ToggleGroup.tsx +34 -0
- package/templates/primitives/ToggleGroup/ToggleGroup.types.ts +19 -0
- package/templates/primitives/ToggleGroup/ToggleGroup.variants.ts +32 -0
- package/templates/primitives/Toolbar/Toolbar.tsx +118 -0
- package/templates/primitives/Toolbar/Toolbar.types.ts +32 -0
- package/templates/primitives/Toolbar/Toolbar.variants.ts +84 -0
- package/templates/primitives/Tooltip/Tooltip.tsx +98 -0
- package/templates/primitives/Tooltip/Tooltip.types.ts +22 -0
- package/templates/primitives/Tooltip/Tooltip.variants.ts +24 -0
- package/templates/shared/utils/cn.ts +46 -0
- package/templates/styles/theme.css +311 -0
- package/templates/styles/tokens.css +1445 -0
- package/templates/templates/DashboardShell/DashboardShell.tsx +124 -0
- package/templates/templates/DashboardShell/DashboardShell.types.ts +37 -0
- package/templates/templates/DashboardShell/DashboardShell.variants.ts +25 -0
- 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
|
+
}
|