@spear-ai/spectral 1.3.42 → 1.3.44
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/dist/.js +152 -106
- package/dist/Accordion/AccordionBase.d.ts +8 -8
- package/dist/Alert/AlertBase.d.ts +14 -0
- package/dist/Alert/AlertBase.js +63 -0
- package/dist/Alert.d.ts +12 -0
- package/dist/Alert.js +102 -0
- package/dist/Avatar.d.ts +2 -0
- package/dist/Avatar.js +1 -0
- package/dist/Badge/BadgeBase.d.ts +1 -1
- package/dist/Button.d.ts +2 -2
- package/dist/Button.js +24 -30
- package/dist/Checkbox/CheckboxBase.d.ts +5 -5
- package/dist/Dialog/DialogBase.d.ts +7 -7
- package/dist/Dialog/DialogBase.js +87 -86
- package/dist/Dialog.d.ts +1 -1
- package/dist/Drawer.d.ts +1 -1
- package/dist/Drawer.js +141 -139
- package/dist/Icons/AnnotationsIcon.d.ts +1 -1
- package/dist/Icons/AnnotationsIcon.js +8 -7
- package/dist/Icons/CalendarIcon.d.ts +1 -1
- package/dist/Icons/CalendarIcon.js +9 -8
- package/dist/Icons/CheckCircleIcon.d.ts +3 -0
- package/dist/Icons/CheckCircleIcon.js +29 -0
- package/dist/Icons/CheckSquareIcon.d.ts +3 -0
- package/dist/Icons/CheckSquareIcon.js +29 -0
- package/dist/Icons/ChevronDownIcon.d.ts +3 -0
- package/dist/Icons/ChevronDownIcon.js +28 -0
- package/dist/Icons/ChevronUpIcon.d.ts +3 -0
- package/dist/Icons/ChevronUpIcon.js +28 -0
- package/dist/Icons/ClockIcon.d.ts +1 -1
- package/dist/Icons/ClockIcon.js +9 -8
- package/dist/Icons/CloseCircleIcon.d.ts +3 -0
- package/dist/Icons/CloseCircleIcon.js +29 -0
- package/dist/Icons/CloseIcon.d.ts +3 -0
- package/dist/Icons/CloseIcon.js +28 -0
- package/dist/Icons/DashboardIcon.d.ts +1 -1
- package/dist/Icons/DashboardIcon.js +9 -8
- package/dist/Icons/DeleteIcon.d.ts +1 -1
- package/dist/Icons/DeleteIcon.js +9 -8
- package/dist/Icons/DurationIcon.d.ts +1 -1
- package/dist/Icons/DurationIcon.js +9 -8
- package/dist/Icons/EraserIcon.d.ts +1 -1
- package/dist/Icons/EraserIcon.js +9 -8
- package/dist/Icons/ErrorIcon.d.ts +3 -0
- package/dist/Icons/ErrorIcon.js +30 -0
- package/dist/Icons/EyeClosedIcon.d.ts +3 -0
- package/dist/Icons/EyeClosedIcon.js +32 -0
- package/dist/Icons/EyeClosedIcon2.d.ts +3 -0
- package/dist/Icons/EyeClosedIcon2.js +30 -0
- package/dist/Icons/EyeOpenIcon.d.ts +3 -0
- package/dist/Icons/EyeOpenIcon.js +28 -0
- package/dist/Icons/GoToFirstIcon.d.ts +1 -1
- package/dist/Icons/GoToFirstIcon.js +9 -8
- package/dist/Icons/GoToLastIcon.d.ts +1 -1
- package/dist/Icons/GoToLastIcon.js +9 -8
- package/dist/Icons/HarmonicCursorsIcon.d.ts +1 -1
- package/dist/Icons/HarmonicCursorsIcon.js +9 -8
- package/dist/Icons/IconBase.d.ts +3 -3
- package/dist/Icons/InfoIcon.d.ts +1 -1
- package/dist/Icons/InfoIcon.js +9 -8
- package/dist/Icons/LabelIcon.d.ts +1 -1
- package/dist/Icons/LabelIcon.js +8 -7
- package/dist/Icons/LassoIcon.d.ts +1 -1
- package/dist/Icons/LassoIcon.js +9 -8
- package/dist/Icons/LineToolIcon.d.ts +1 -1
- package/dist/Icons/LineToolIcon.js +9 -8
- package/dist/Icons/LiveViewIcon.d.ts +1 -1
- package/dist/Icons/LiveViewIcon.js +9 -8
- package/dist/Icons/LoaderIcon.d.ts +3 -0
- package/dist/Icons/LoaderIcon.js +53 -0
- package/dist/Icons/LocationIcon.d.ts +1 -1
- package/dist/Icons/LocationIcon.js +9 -8
- package/dist/Icons/LogoutIcon.d.ts +1 -1
- package/dist/Icons/LogoutIcon.js +8 -7
- package/dist/Icons/MetadataIcon.d.ts +1 -1
- package/dist/Icons/MetadataIcon.js +8 -7
- package/dist/Icons/OntologyIcon.d.ts +1 -1
- package/dist/Icons/OntologyIcon.js +9 -8
- package/dist/Icons/PanelIcon.d.ts +1 -1
- package/dist/Icons/PanelIcon.js +9 -8
- package/dist/Icons/PlayIcon.d.ts +1 -1
- package/dist/Icons/PlayIcon.js +8 -7
- package/dist/Icons/PlusIcon.d.ts +1 -1
- package/dist/Icons/PlusIcon.js +8 -7
- package/dist/Icons/ResetIcon.d.ts +1 -1
- package/dist/Icons/ResetIcon.js +8 -7
- package/dist/Icons/ScissorsIcon.d.ts +1 -1
- package/dist/Icons/ScissorsIcon.js +9 -8
- package/dist/Icons/SettingsIcon.d.ts +1 -1
- package/dist/Icons/SettingsIcon.js +9 -8
- package/dist/Icons/TrashIcon.d.ts +1 -1
- package/dist/Icons/TrashIcon.js +8 -7
- package/dist/Icons/UndoIcon.d.ts +1 -1
- package/dist/Icons/UndoIcon.js +8 -7
- package/dist/Icons/UserIcon.d.ts +1 -1
- package/dist/Icons/UserIcon.js +8 -7
- package/dist/Icons/WarningIcon.d.ts +1 -1
- package/dist/Icons/WarningIcon.js +8 -7
- package/dist/Icons/ZoomAllIcon.d.ts +1 -1
- package/dist/Icons/ZoomAllIcon.js +9 -8
- package/dist/Icons/ZoomXIcon.d.ts +1 -1
- package/dist/Icons/ZoomXIcon.js +9 -8
- package/dist/Icons/ZoomYIcon.d.ts +1 -1
- package/dist/Icons/ZoomYIcon.js +9 -8
- package/dist/Icons/index.d.ts +11 -0
- package/dist/Icons.js +82 -60
- package/dist/Input/InputUtils.d.ts +15 -0
- package/dist/Input/InputUtils.js +54 -0
- package/dist/Input.d.ts +24 -0
- package/dist/Input.js +170 -0
- package/dist/Label.d.ts +2 -2
- package/dist/MultiSelect/MultiSelectBase.d.ts +34 -0
- package/dist/MultiSelect/MultiSelectBase.js +321 -0
- package/dist/MultiSelect/MutiSelect.d.ts +15 -0
- package/dist/MultiSelect/MutiSelect.js +30 -0
- package/dist/Popover.d.ts +2 -2
- package/dist/Popover.js +61 -59
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +5 -3
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +43 -40
- package/dist/RadioButtonGroup.d.ts +2 -2
- package/dist/RadioButtonGroup.js +6 -6
- package/dist/RadioGroup/RadioGroupBase.d.ts +7 -7
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/Select/SelectBase.d.ts +26 -0
- package/dist/Select/SelectBase.js +233 -0
- package/dist/Select.d.ts +50 -0
- package/dist/Select.js +136 -0
- package/dist/Skeleton.d.ts +1 -1
- package/dist/Slider/SliderBase.d.ts +7 -7
- package/dist/SpectralProvider.d.ts +1 -1
- package/dist/Switch/SwitchBase.d.ts +4 -4
- package/dist/Switch.d.ts +2 -2
- package/dist/Textarea/TextareaUtils.d.ts +19 -0
- package/dist/Textarea/TextareaUtils.js +54 -0
- package/dist/Textarea.d.ts +17 -0
- package/dist/Textarea.js +160 -0
- package/dist/Toggle/ToggleBase.d.ts +5 -4
- package/dist/Toggle/ToggleBase.js +30 -28
- package/dist/Toggle.d.ts +2 -2
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +2 -2
- package/dist/ToggleGroup.d.ts +3 -3
- package/dist/Tooltip/TooltipBase.d.ts +8 -8
- package/dist/Tooltip.d.ts +1 -1
- package/dist/chevron-down-UbkgS76q.js +19 -0
- package/dist/components/Accordion/AccordionBase.d.ts +8 -8
- package/dist/components/Alert/Alert.d.ts +12 -0
- package/dist/components/Alert/Alert.d.ts.map +1 -0
- package/dist/components/Alert/AlertBase.d.ts +14 -0
- package/dist/components/Alert/AlertBase.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/Badge/BadgeBase.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Checkbox/CheckboxBase.d.ts +5 -5
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/DialogBase.d.ts +7 -7
- package/dist/components/Dialog/DialogBase.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Icons/AnnotationsIcon.d.ts +1 -1
- package/dist/components/Icons/AnnotationsIcon.d.ts.map +1 -1
- package/dist/components/Icons/CalendarIcon.d.ts +1 -1
- package/dist/components/Icons/CalendarIcon.d.ts.map +1 -1
- package/dist/components/Icons/CheckCircleIcon.d.ts +3 -0
- package/dist/components/Icons/CheckCircleIcon.d.ts.map +1 -0
- package/dist/components/Icons/CheckSquareIcon.d.ts +3 -0
- package/dist/components/Icons/CheckSquareIcon.d.ts.map +1 -0
- package/dist/components/Icons/ChevronDownIcon.d.ts +3 -0
- package/dist/components/Icons/ChevronDownIcon.d.ts.map +1 -0
- package/dist/components/Icons/ChevronUpIcon.d.ts +3 -0
- package/dist/components/Icons/ChevronUpIcon.d.ts.map +1 -0
- package/dist/components/Icons/ClockIcon.d.ts +1 -1
- package/dist/components/Icons/ClockIcon.d.ts.map +1 -1
- package/dist/components/Icons/CloseCircleIcon.d.ts +3 -0
- package/dist/components/Icons/CloseCircleIcon.d.ts.map +1 -0
- package/dist/components/Icons/CloseIcon.d.ts +3 -0
- package/dist/components/Icons/CloseIcon.d.ts.map +1 -0
- package/dist/components/Icons/DashboardIcon.d.ts +1 -1
- package/dist/components/Icons/DashboardIcon.d.ts.map +1 -1
- package/dist/components/Icons/DeleteIcon.d.ts +1 -1
- package/dist/components/Icons/DeleteIcon.d.ts.map +1 -1
- package/dist/components/Icons/DurationIcon.d.ts +1 -1
- package/dist/components/Icons/DurationIcon.d.ts.map +1 -1
- package/dist/components/Icons/EraserIcon.d.ts +1 -1
- package/dist/components/Icons/EraserIcon.d.ts.map +1 -1
- package/dist/components/Icons/ErrorIcon.d.ts +3 -0
- package/dist/components/Icons/ErrorIcon.d.ts.map +1 -0
- package/dist/components/Icons/EyeClosedIcon.d.ts +3 -0
- package/dist/components/Icons/EyeClosedIcon.d.ts.map +1 -0
- package/dist/components/Icons/EyeClosedIcon2.d.ts +3 -0
- package/dist/components/Icons/EyeClosedIcon2.d.ts.map +1 -0
- package/dist/components/Icons/EyeOpenIcon.d.ts +3 -0
- package/dist/components/Icons/EyeOpenIcon.d.ts.map +1 -0
- package/dist/components/Icons/GoToFirstIcon.d.ts +1 -1
- package/dist/components/Icons/GoToFirstIcon.d.ts.map +1 -1
- package/dist/components/Icons/GoToLastIcon.d.ts +1 -1
- package/dist/components/Icons/GoToLastIcon.d.ts.map +1 -1
- package/dist/components/Icons/HarmonicCursorsIcon.d.ts +1 -1
- package/dist/components/Icons/HarmonicCursorsIcon.d.ts.map +1 -1
- package/dist/components/Icons/IconBase.d.ts +3 -3
- package/dist/components/Icons/InfoIcon.d.ts +1 -1
- package/dist/components/Icons/InfoIcon.d.ts.map +1 -1
- package/dist/components/Icons/LabelIcon.d.ts +1 -1
- package/dist/components/Icons/LabelIcon.d.ts.map +1 -1
- package/dist/components/Icons/LassoIcon.d.ts +1 -1
- package/dist/components/Icons/LassoIcon.d.ts.map +1 -1
- package/dist/components/Icons/LineToolIcon.d.ts +1 -1
- package/dist/components/Icons/LineToolIcon.d.ts.map +1 -1
- package/dist/components/Icons/LiveViewIcon.d.ts +1 -1
- package/dist/components/Icons/LiveViewIcon.d.ts.map +1 -1
- package/dist/components/Icons/LoaderIcon.d.ts +3 -0
- package/dist/components/Icons/LoaderIcon.d.ts.map +1 -0
- package/dist/components/Icons/LocationIcon.d.ts +1 -1
- package/dist/components/Icons/LocationIcon.d.ts.map +1 -1
- package/dist/components/Icons/LogoutIcon.d.ts +1 -1
- package/dist/components/Icons/LogoutIcon.d.ts.map +1 -1
- package/dist/components/Icons/MetadataIcon.d.ts +1 -1
- package/dist/components/Icons/MetadataIcon.d.ts.map +1 -1
- package/dist/components/Icons/OntologyIcon.d.ts +1 -1
- package/dist/components/Icons/OntologyIcon.d.ts.map +1 -1
- package/dist/components/Icons/PanelIcon.d.ts +1 -1
- package/dist/components/Icons/PanelIcon.d.ts.map +1 -1
- package/dist/components/Icons/PlayIcon.d.ts +1 -1
- package/dist/components/Icons/PlayIcon.d.ts.map +1 -1
- package/dist/components/Icons/PlusIcon.d.ts +1 -1
- package/dist/components/Icons/PlusIcon.d.ts.map +1 -1
- package/dist/components/Icons/ResetIcon.d.ts +1 -1
- package/dist/components/Icons/ResetIcon.d.ts.map +1 -1
- package/dist/components/Icons/ScissorsIcon.d.ts +1 -1
- package/dist/components/Icons/ScissorsIcon.d.ts.map +1 -1
- package/dist/components/Icons/SettingsIcon.d.ts +1 -1
- package/dist/components/Icons/SettingsIcon.d.ts.map +1 -1
- package/dist/components/Icons/TrashIcon.d.ts +1 -1
- package/dist/components/Icons/TrashIcon.d.ts.map +1 -1
- package/dist/components/Icons/UndoIcon.d.ts +1 -1
- package/dist/components/Icons/UndoIcon.d.ts.map +1 -1
- package/dist/components/Icons/UserIcon.d.ts +1 -1
- package/dist/components/Icons/UserIcon.d.ts.map +1 -1
- package/dist/components/Icons/WarningIcon.d.ts +1 -1
- package/dist/components/Icons/WarningIcon.d.ts.map +1 -1
- package/dist/components/Icons/ZoomAllIcon.d.ts +1 -1
- package/dist/components/Icons/ZoomAllIcon.d.ts.map +1 -1
- package/dist/components/Icons/ZoomXIcon.d.ts +1 -1
- package/dist/components/Icons/ZoomXIcon.d.ts.map +1 -1
- package/dist/components/Icons/ZoomYIcon.d.ts +1 -1
- package/dist/components/Icons/ZoomYIcon.d.ts.map +1 -1
- package/dist/components/Icons/iconTypes.d.ts +3 -3
- package/dist/components/Icons/iconTypes.d.ts.map +1 -1
- package/dist/components/Icons/index.d.ts +11 -0
- package/dist/components/Icons/index.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +24 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/InputUtils.d.ts +15 -0
- package/dist/components/Input/InputUtils.d.ts.map +1 -0
- package/dist/components/Label/Label.d.ts +2 -2
- package/dist/components/MultiSelect/MultiSelectBase.d.ts +34 -0
- package/dist/components/MultiSelect/MultiSelectBase.d.ts.map +1 -0
- package/dist/components/MultiSelect/MutiSelect.d.ts +15 -0
- package/dist/components/MultiSelect/MutiSelect.d.ts.map +1 -0
- package/dist/components/Popover/Popover.d.ts +2 -2
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +2 -2
- package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -1
- package/dist/components/RadioButtonGroup/RadioButtonGroupBase.d.ts +5 -3
- package/dist/components/RadioButtonGroup/RadioButtonGroupBase.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroupBase.d.ts +7 -7
- package/dist/components/Select/Select.d.ts +50 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/SelectBase.d.ts +26 -0
- package/dist/components/Select/SelectBase.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Slider/SliderBase.d.ts +7 -7
- package/dist/components/SpectralProvider/SpectralProvider.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +2 -2
- package/dist/components/Switch/SwitchBase.d.ts +4 -4
- package/dist/components/Textarea/Textarea.d.ts +17 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea/TextareaUtils.d.ts +19 -0
- package/dist/components/Textarea/TextareaUtils.d.ts.map +1 -0
- package/dist/components/Toggle/Toggle.d.ts +2 -2
- package/dist/components/Toggle/ToggleBase.d.ts +5 -4
- package/dist/components/Toggle/ToggleBase.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +3 -3
- package/dist/components/ToggleGroup/ToggleGroupBase.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/TooltipBase.d.ts +8 -8
- package/dist/features/HorizonColorGrid/HorizonColorGrid.d.ts +1 -1
- package/dist/features/LabelingToolbar/LabelingToolbar.d.ts +1 -1
- package/dist/features/LabelingTools.js +19 -8
- package/dist/features/SensorMetadata.js +21 -10
- package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +1 -1
- package/dist/features/SettingsPopover.js +36 -24
- package/dist/hooks/useAccordionAutoScroll.d.ts +1 -1
- package/dist/hooks/useOutsideClick.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/loader-circle-CvdzOiQ_.js +11 -0
- package/dist/primitives/label.d.ts +2 -2
- package/dist/primitives/slot.d.ts +3 -3
- package/dist/styles/base-colors.css +52 -42
- package/dist/styles/main.css +1 -1
- package/dist/utils/formFieldUtils.d.ts +70 -0
- package/dist/utils/formFieldUtils.d.ts.map +1 -0
- package/dist/utils/formFieldUtils.js +178 -0
- package/dist/utils/refs.d.ts +1 -1
- package/dist/x-BBpi7a_7.js +14 -0
- package/package.json +2 -1
|
@@ -1,58 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../styles/main.css";
|
|
3
3
|
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
+
import { Slot as m } from "../primitives/slot.js";
|
|
4
5
|
import { c as l } from "../twUtils-CRiPKpXj.js";
|
|
5
|
-
import { createContext as
|
|
6
|
-
const
|
|
7
|
-
value:
|
|
8
|
-
onValueChange:
|
|
6
|
+
import { createContext as x, useContext as h } from "react";
|
|
7
|
+
const c = x(null), G = ({
|
|
8
|
+
value: t,
|
|
9
|
+
onValueChange: n,
|
|
9
10
|
children: i,
|
|
10
|
-
className:
|
|
11
|
-
isKeptActive:
|
|
12
|
-
expanded:
|
|
13
|
-
}) => /* @__PURE__ */ s(
|
|
11
|
+
className: o,
|
|
12
|
+
isKeptActive: r = !1,
|
|
13
|
+
expanded: e = !1
|
|
14
|
+
}) => /* @__PURE__ */ s(c.Provider, { value: { value: t, onValueChange: n, isKeptActive: r, expanded: e }, children: /* @__PURE__ */ s(
|
|
14
15
|
"div",
|
|
15
16
|
{
|
|
16
17
|
role: "radiogroup",
|
|
17
|
-
"data-expanded":
|
|
18
|
+
"data-expanded": e,
|
|
18
19
|
className: l(
|
|
19
20
|
"flex h-fit w-fit items-center rounded-md [&_button:first-of-type]:rounded-l-md [&_button:last-of-type]:rounded-r-md",
|
|
20
21
|
"data-[expanded=true]:w-full",
|
|
21
|
-
|
|
22
|
+
o
|
|
22
23
|
),
|
|
23
24
|
children: i
|
|
24
25
|
}
|
|
25
|
-
) }),
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
) }), R = ({
|
|
27
|
+
value: t,
|
|
28
|
+
children: n,
|
|
29
|
+
className: i,
|
|
30
|
+
disabled: o = !1,
|
|
31
|
+
asChild: r = !1
|
|
32
|
+
}) => {
|
|
33
|
+
const e = h(c);
|
|
34
|
+
if (!e)
|
|
28
35
|
throw new Error("RadioButtonGroupItem must be used within a RadioButtonGroup");
|
|
29
|
-
const { value:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
),
|
|
51
|
-
children: r
|
|
52
|
-
}
|
|
53
|
-
);
|
|
36
|
+
const { value: g, onValueChange: a, isKeptActive: u, expanded: b } = e, d = g === t, f = () => {
|
|
37
|
+
!o && a && a(t);
|
|
38
|
+
}, v = r ? m : "button", p = {
|
|
39
|
+
role: "radio",
|
|
40
|
+
"aria-checked": d,
|
|
41
|
+
"data-state": d ? "on" : "off",
|
|
42
|
+
disabled: o,
|
|
43
|
+
onClick: f,
|
|
44
|
+
className: l(
|
|
45
|
+
"bg-toggle-bg inline-flex items-center justify-center gap-2 border text-sm font-medium disabled:pointer-events-none disabled:opacity-50",
|
|
46
|
+
"disabled:cursor-not-allowed hover:cursor-pointer text-toggle-text hover:bg-toggle-bg--hover hover:text-toggle-text--hover transition-[colors]",
|
|
47
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus:outline-none",
|
|
48
|
+
'outline-none border-toggle-border hover:border-toggle-border--hover h-9 px-3 min-w-9 [&_svg:not([class*="size-"]):not([width]):not([height])]:size-4',
|
|
49
|
+
"rounded-none shadow-none focus:z-10 focus-visible:z-10 [&:not(:first-child)]:border-l-0 active:bg-toggle-bg--active active:text-toggle-text--active",
|
|
50
|
+
"active:border-toggle-border--active",
|
|
51
|
+
b && "w-full",
|
|
52
|
+
u && "data-[state=on]:bg-toggle-bg--active data-[state=on]:text-toggle-text--active data-[state=on]:border-toggle-border--active",
|
|
53
|
+
i
|
|
54
|
+
)
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ s(v, { ...!r && { type: "button" }, ...p, children: n });
|
|
54
57
|
};
|
|
55
58
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
G as RadioButtonGroupBase,
|
|
60
|
+
R as RadioButtonGroupItem
|
|
58
61
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RadioButtonGroupBase } from './RadioButtonGroupBase';
|
|
2
|
-
import { ComponentProps } from '
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
3
|
export type RadioButtonGroupProps = ComponentProps<typeof RadioButtonGroupBase>;
|
|
4
4
|
export declare const RadioButtonGroup: ({ className, children, ...props }: RadioButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare const RadioButtonGroupItem: ({ value, children, className, disabled }: import('./RadioButtonGroupBase').RadioButtonGroupItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const RadioButtonGroupItem: ({ value, children, className, disabled, asChild, }: import('./RadioButtonGroupBase').RadioButtonGroupItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=RadioButtonGroup.d.ts.map
|
package/dist/RadioButtonGroup.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { RadioButtonGroupItem as
|
|
4
|
-
import { c as
|
|
3
|
+
import { RadioButtonGroupItem as n, RadioButtonGroupBase as u } from "./RadioButtonGroup/RadioButtonGroupBase.js";
|
|
4
|
+
import { c as m } from "./twUtils-CRiPKpXj.js";
|
|
5
5
|
import "react";
|
|
6
6
|
const s = ({ className: t, children: o, ...r }) => /* @__PURE__ */ e(
|
|
7
|
-
|
|
7
|
+
u,
|
|
8
8
|
{
|
|
9
|
-
className:
|
|
10
|
-
"flex h-fit w-fit items-center rounded-md [&_button:first-of-type]:rounded-l-md [&_button:last-of-type]:rounded-r-md",
|
|
9
|
+
className: m(
|
|
10
|
+
"flex h-fit w-fit items-center rounded-md px-2 whitespace-nowrap [&_button:first-of-type]:rounded-l-md [&_button:last-of-type]:rounded-r-md",
|
|
11
11
|
t
|
|
12
12
|
),
|
|
13
13
|
...r,
|
|
14
14
|
children: o
|
|
15
15
|
}
|
|
16
|
-
), f =
|
|
16
|
+
), f = n;
|
|
17
17
|
export {
|
|
18
18
|
s as RadioButtonGroup,
|
|
19
19
|
f as RadioButtonGroupItem
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsChildProp } from '../../primitives/slot';
|
|
2
|
-
import { ButtonHTMLAttributes, HTMLAttributes } from '
|
|
2
|
+
import { ButtonHTMLAttributes, HTMLAttributes } from 'react';
|
|
3
3
|
type Orientation = 'horizontal' | 'vertical';
|
|
4
4
|
type Dir = 'ltr' | 'rtl';
|
|
5
5
|
type GroupBaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'role'>;
|
|
@@ -26,7 +26,7 @@ export type RadioGroupItemProps = ItemBaseProps & AsChildProp & {
|
|
|
26
26
|
export type RadioGroupIndicatorProps = HTMLAttributes<HTMLSpanElement> & AsChildProp & {
|
|
27
27
|
forceMount?: boolean;
|
|
28
28
|
};
|
|
29
|
-
export declare const RadioGroup: import('
|
|
29
|
+
export declare const RadioGroup: import('react').ForwardRefExoticComponent<GroupBaseProps & AsChildProp & {
|
|
30
30
|
value?: string;
|
|
31
31
|
defaultValue?: string;
|
|
32
32
|
onValueChange?: (value: string | undefined) => void;
|
|
@@ -38,15 +38,15 @@ export declare const RadioGroup: import('../../../node_modules/react').ForwardRe
|
|
|
38
38
|
dir?: Dir;
|
|
39
39
|
loop?: boolean;
|
|
40
40
|
variant?: "default" | "unstyled";
|
|
41
|
-
} & import('
|
|
42
|
-
export declare const RadioGroupItem: import('
|
|
41
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
42
|
+
export declare const RadioGroupItem: import('react').ForwardRefExoticComponent<ItemBaseProps & AsChildProp & {
|
|
43
43
|
value: string;
|
|
44
44
|
disabled?: boolean;
|
|
45
45
|
id?: string;
|
|
46
46
|
'aria-label'?: string;
|
|
47
|
-
} & import('
|
|
48
|
-
export declare const RadioGroupIndicator: import('
|
|
47
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
export declare const RadioGroupIndicator: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & AsChildProp & {
|
|
49
49
|
forceMount?: boolean;
|
|
50
|
-
} & import('
|
|
50
|
+
} & import('react').RefAttributes<HTMLSpanElement>>;
|
|
51
51
|
export {};
|
|
52
52
|
//# sourceMappingURL=RadioGroupBase.d.ts.map
|
package/dist/RadioGroup.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from '
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
2
|
import * as RadioGroupPrimitive from './RadioGroupBase';
|
|
3
3
|
type RadioGroupVariant = 'default' | 'unstyled';
|
|
4
4
|
export type RadioGroupProps = ComponentProps<typeof RadioGroupPrimitive.RadioGroup> & {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type SelectState = 'default' | 'error' | 'disabled' | 'loading';
|
|
3
|
+
export interface SelectOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface SelectBaseProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange'> {
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
options: SelectOption[];
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
state?: SelectState;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
emptyMessage?: ReactNode;
|
|
18
|
+
loadingMessage?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
'aria-label'?: string;
|
|
23
|
+
'aria-describedby'?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const SelectBase: import('react').ForwardRefExoticComponent<SelectBaseProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
//# sourceMappingURL=SelectBase.d.ts.map
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../styles/main.css";
|
|
3
|
+
import { jsxs as p, jsx as n, Fragment as ee } from "react/jsx-runtime";
|
|
4
|
+
import { c as b } from "../twUtils-CRiPKpXj.js";
|
|
5
|
+
import { forwardRef as te, useId as re, useState as C, useRef as T, useMemo as _, useCallback as E, useEffect as S } from "react";
|
|
6
|
+
import { L as $ } from "../loader-circle-CvdzOiQ_.js";
|
|
7
|
+
import { C as se, a as ne } from "../chevron-down-UbkgS76q.js";
|
|
8
|
+
const B = "h-4 w-4", G = "h-5 w-5", ae = (t) => ({
|
|
9
|
+
error: "border-danger hover:border-danger focus-visible:border-danger focus-visible:ring-danger",
|
|
10
|
+
loading: "cursor-wait pointer-events-none border-input-border--disabled",
|
|
11
|
+
disabled: "cursor-not-allowed opacity-50 border-input-border--disabled bg-input-bg--disabled",
|
|
12
|
+
default: ""
|
|
13
|
+
})[t], de = (t, l, i) => b(
|
|
14
|
+
"flex h-12 w-full items-center justify-between rounded-lg border border-input-border bg-input-bg px-4 py-3 text-sm",
|
|
15
|
+
"hover:border-input-border--hover focus:border-input-border--focus focus:outline-none",
|
|
16
|
+
"focus:ring-2 focus:ring-black focus:ring-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black focus-visible:ring-offset-2",
|
|
17
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:border-input-border--disabled disabled:bg-input-bg--disabled",
|
|
18
|
+
"transition duration-200 text-input-text [&>span]:line-clamp-1",
|
|
19
|
+
l && "border-input-border--focus ring-2 ring-black ring-offset-2",
|
|
20
|
+
ae(t),
|
|
21
|
+
i
|
|
22
|
+
), le = (t) => b(
|
|
23
|
+
"absolute top-full left-0 right-0 z-50 mt-1 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-input-border bg-input-bg shadow-md",
|
|
24
|
+
"transition-all duration-200 origin-top",
|
|
25
|
+
t ? "scale-100 opacity-100 translate-y-0" : "scale-95 opacity-0 -translate-y-1 pointer-events-none"
|
|
26
|
+
), ie = (t) => {
|
|
27
|
+
const l = T(null);
|
|
28
|
+
return S(() => {
|
|
29
|
+
const i = (a) => {
|
|
30
|
+
l.current && !l.current.contains(a.target) && t();
|
|
31
|
+
};
|
|
32
|
+
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
33
|
+
}, [t]), l;
|
|
34
|
+
}, oe = (t, l, i, a, m) => {
|
|
35
|
+
const [r, c] = C(-1);
|
|
36
|
+
S(() => {
|
|
37
|
+
if (m) {
|
|
38
|
+
const s = t.findIndex((g) => g.value === l);
|
|
39
|
+
c(s >= 0 ? s : 0);
|
|
40
|
+
} else
|
|
41
|
+
c(-1);
|
|
42
|
+
}, [m, l, t]);
|
|
43
|
+
const k = E(
|
|
44
|
+
(s) => {
|
|
45
|
+
if (!m)
|
|
46
|
+
return s.key === "ArrowDown" || s.key === "ArrowUp" || s.key === " " || s.key === "Enter" ? (s.preventDefault(), "open") : void 0;
|
|
47
|
+
const y = {
|
|
48
|
+
ArrowDown: () => {
|
|
49
|
+
s.preventDefault(), c((h) => {
|
|
50
|
+
const o = Math.min(h + 1, t.length - 1);
|
|
51
|
+
return t[o]?.disabled && o < t.length - 1 ? Math.min(o + 1, t.length - 1) : o;
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
ArrowUp: () => {
|
|
55
|
+
s.preventDefault(), c((h) => {
|
|
56
|
+
const o = Math.max(h - 1, 0);
|
|
57
|
+
return t[o]?.disabled && o > 0 ? Math.max(o - 1, 0) : o;
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
Enter: () => {
|
|
61
|
+
s.preventDefault(), r >= 0 && t[r] && !t[r].disabled && (i(t[r].value), a());
|
|
62
|
+
},
|
|
63
|
+
" ": () => {
|
|
64
|
+
s.preventDefault(), r >= 0 && t[r] && !t[r].disabled && (i(t[r].value), a());
|
|
65
|
+
},
|
|
66
|
+
Escape: () => {
|
|
67
|
+
s.preventDefault(), a();
|
|
68
|
+
},
|
|
69
|
+
Home: () => {
|
|
70
|
+
s.preventDefault(), c(0);
|
|
71
|
+
},
|
|
72
|
+
End: () => {
|
|
73
|
+
s.preventDefault(), c(t.length - 1);
|
|
74
|
+
}
|
|
75
|
+
}[s.key];
|
|
76
|
+
y && y();
|
|
77
|
+
},
|
|
78
|
+
[t, r, i, a, m]
|
|
79
|
+
);
|
|
80
|
+
return { focusedIndex: r, setFocusedIndex: c, handleKeyDown: k };
|
|
81
|
+
}, ce = te(
|
|
82
|
+
({
|
|
83
|
+
value: t,
|
|
84
|
+
defaultValue: l,
|
|
85
|
+
onChange: i,
|
|
86
|
+
options: a = [],
|
|
87
|
+
placeholder: m = "Select an option",
|
|
88
|
+
state: r = "default",
|
|
89
|
+
errorMessage: c,
|
|
90
|
+
emptyMessage: k = "No options found",
|
|
91
|
+
loadingMessage: s = "Loading...",
|
|
92
|
+
name: g,
|
|
93
|
+
id: y,
|
|
94
|
+
label: h,
|
|
95
|
+
className: o,
|
|
96
|
+
"aria-label": I,
|
|
97
|
+
"aria-describedby": U,
|
|
98
|
+
...j
|
|
99
|
+
}, Z) => {
|
|
100
|
+
const z = re(), L = y || `${g}-${z}`, M = `${L}-error`, [f, x] = C(!1), [P, W] = C(l || ""), A = t !== void 0, w = A ? t : P, q = ie(() => x(!1)), D = T(null), O = j.disabled || r === "disabled", J = r === "loading", Q = r === "error", v = _(() => {
|
|
101
|
+
const e = {}, u = [];
|
|
102
|
+
return a.forEach((d) => {
|
|
103
|
+
d.group ? (e[d.group] || (e[d.group] = []), e[d.group].push(d)) : u.push(d);
|
|
104
|
+
}), { groups: e, ungrouped: u, hasGroups: Object.keys(e).length > 0 };
|
|
105
|
+
}, [a]), K = _(() => a.find((e) => e.value === w), [a, w]), { focusedIndex: N, handleKeyDown: R } = oe(
|
|
106
|
+
a,
|
|
107
|
+
w,
|
|
108
|
+
F,
|
|
109
|
+
() => x(!1),
|
|
110
|
+
f
|
|
111
|
+
), V = E(() => {
|
|
112
|
+
O || x((e) => !e);
|
|
113
|
+
}, [O]);
|
|
114
|
+
function F(e) {
|
|
115
|
+
a.find((d) => d.value === e)?.disabled || (A || W(e), i?.(e), x(!1));
|
|
116
|
+
}
|
|
117
|
+
const X = E(
|
|
118
|
+
(e) => {
|
|
119
|
+
R(e) === "open" && x(!0);
|
|
120
|
+
},
|
|
121
|
+
[R]
|
|
122
|
+
);
|
|
123
|
+
S(() => {
|
|
124
|
+
if (f && N >= 0 && D.current) {
|
|
125
|
+
const e = D.current.children[N];
|
|
126
|
+
e && e.scrollIntoView({ block: "nearest" });
|
|
127
|
+
}
|
|
128
|
+
}, [N, f]);
|
|
129
|
+
const H = (e, u) => {
|
|
130
|
+
const d = w === e.value;
|
|
131
|
+
return /* @__PURE__ */ p(
|
|
132
|
+
"button",
|
|
133
|
+
{
|
|
134
|
+
type: "button",
|
|
135
|
+
className: b(
|
|
136
|
+
"relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none",
|
|
137
|
+
"hover:bg-input-bg--hover focus:bg-input-bg--hover hover:cursor-pointer",
|
|
138
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
139
|
+
u === N && "bg-input-bg--hover",
|
|
140
|
+
d && "bg-input-bg--selected text-input-text"
|
|
141
|
+
),
|
|
142
|
+
onClick: () => F(e.value),
|
|
143
|
+
disabled: e.disabled,
|
|
144
|
+
"data-disabled": e.disabled,
|
|
145
|
+
"aria-selected": d,
|
|
146
|
+
role: "option",
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ n("span", { className: "block truncate", children: e.label }),
|
|
149
|
+
d && /* @__PURE__ */ n("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(ne, { className: b(B, "text-input-text") }) })
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
e.value
|
|
153
|
+
);
|
|
154
|
+
}, Y = () => ({
|
|
155
|
+
"--select-min-width": "8rem",
|
|
156
|
+
"--select-border-radius": "0.5rem",
|
|
157
|
+
"--select-trigger-height": "3rem"
|
|
158
|
+
});
|
|
159
|
+
return /* @__PURE__ */ p("div", { className: "w-full", "data-testid": "select-root", children: [
|
|
160
|
+
/* @__PURE__ */ p("div", { ref: q, className: "relative", "data-testid": "select-wrapper", children: [
|
|
161
|
+
/* @__PURE__ */ p(
|
|
162
|
+
"button",
|
|
163
|
+
{
|
|
164
|
+
ref: Z,
|
|
165
|
+
type: "button",
|
|
166
|
+
id: L,
|
|
167
|
+
name: g,
|
|
168
|
+
className: de(r, f, o),
|
|
169
|
+
onClick: V,
|
|
170
|
+
onKeyDown: X,
|
|
171
|
+
disabled: O,
|
|
172
|
+
"aria-label": I || h,
|
|
173
|
+
"aria-describedby": b(Q && M, U),
|
|
174
|
+
"aria-expanded": f,
|
|
175
|
+
"aria-haspopup": "listbox",
|
|
176
|
+
"data-state": r,
|
|
177
|
+
style: Y(),
|
|
178
|
+
...j,
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ n("span", { className: "block truncate", children: K ? K.label : /* @__PURE__ */ n("span", { className: "text-input-text-placeholder", children: m }) }),
|
|
181
|
+
/* @__PURE__ */ n("div", { className: "flex items-center", children: r === "loading" ? /* @__PURE__ */ n($, { className: b(G, "text-input-icon animate-spin") }) : /* @__PURE__ */ n(
|
|
182
|
+
se,
|
|
183
|
+
{
|
|
184
|
+
className: b(
|
|
185
|
+
G,
|
|
186
|
+
"text-input-icon transition-transform duration-200",
|
|
187
|
+
f && "rotate-180"
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
) })
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
/* @__PURE__ */ n("div", { className: le(f), "data-testid": "select-dropdown", children: /* @__PURE__ */ n("div", { className: "p-1", children: /* @__PURE__ */ n(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
ref: D,
|
|
198
|
+
className: "max-h-80 overflow-x-hidden overflow-y-auto",
|
|
199
|
+
role: "listbox",
|
|
200
|
+
"aria-multiselectable": "false",
|
|
201
|
+
tabIndex: -1,
|
|
202
|
+
children: J ? /* @__PURE__ */ p("div", { className: "text-input-text-secondary flex items-center justify-center gap-2 py-6 text-sm", children: [
|
|
203
|
+
/* @__PURE__ */ n($, { className: b(B, "animate-spin") }),
|
|
204
|
+
s
|
|
205
|
+
] }) : a.length === 0 ? /* @__PURE__ */ n("div", { className: "text-input-text-secondary py-6 text-center text-sm", children: k }) : /* @__PURE__ */ p(ee, { children: [
|
|
206
|
+
v.ungrouped.length > 0 && /* @__PURE__ */ n("div", { className: "mb-1", children: v.ungrouped.map((e) => H(e, a.indexOf(e))) }),
|
|
207
|
+
Object.entries(v.groups).map(([e, u]) => /* @__PURE__ */ p("div", { className: "mb-1", children: [
|
|
208
|
+
(v.ungrouped.length > 0 || Object.keys(v.groups).indexOf(e) > 0) && /* @__PURE__ */ n("div", { className: "bg-input-border -mx-1 my-1 h-px" }),
|
|
209
|
+
/* @__PURE__ */ n("div", { className: "text-input-text-secondary px-2 py-1.5 text-sm font-semibold", children: e }),
|
|
210
|
+
u.map((d) => H(d, a.indexOf(d)))
|
|
211
|
+
] }, e))
|
|
212
|
+
] })
|
|
213
|
+
}
|
|
214
|
+
) }) })
|
|
215
|
+
] }),
|
|
216
|
+
r === "error" && c && /* @__PURE__ */ n(
|
|
217
|
+
"p",
|
|
218
|
+
{
|
|
219
|
+
id: M,
|
|
220
|
+
className: "text-danger mt-1.5 text-sm",
|
|
221
|
+
"data-testid": "select-error-message",
|
|
222
|
+
"aria-live": "polite",
|
|
223
|
+
"aria-atomic": "true",
|
|
224
|
+
children: c
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
] });
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
ce.displayName = "SelectBase";
|
|
231
|
+
export {
|
|
232
|
+
ce as SelectBase
|
|
233
|
+
};
|
package/dist/Select.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SelectBase, SelectBaseProps, SelectOption } from './SelectBase';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type SelectState = 'default' | 'error' | 'disabled' | 'loading';
|
|
4
|
+
export type SelectItem = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export interface SelectProps extends Omit<SelectBaseProps, 'options' | 'onChange'> {
|
|
10
|
+
contentClassName?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
itemClassName?: string;
|
|
13
|
+
items: SelectItem[];
|
|
14
|
+
onValueChange?: (value: string) => void;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
triggerClassName?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
name?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
state?: SelectState;
|
|
22
|
+
emptyMessage?: ReactNode;
|
|
23
|
+
errorMessage?: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
'aria-describedby'?: string;
|
|
27
|
+
}
|
|
28
|
+
declare const Select: import('react').ForwardRefExoticComponent<SelectProps & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
29
|
+
Root: ({ children, ...props }: {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
} & any) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
Group: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
33
|
+
Value: ({ placeholder, children }: {
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
Trigger: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
Content: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
39
|
+
Label: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
40
|
+
Item: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
43
|
+
Separator: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
44
|
+
EmptyMessage: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
45
|
+
LoadingMessage: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
46
|
+
message?: string;
|
|
47
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
48
|
+
};
|
|
49
|
+
export { Select, SelectBase, type SelectBaseProps, type SelectOption };
|
|
50
|
+
//# sourceMappingURL=Select.d.ts.map
|
package/dist/Select.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./styles/main.css";
|
|
3
|
+
import { jsx as s, jsxs as m } from "react/jsx-runtime";
|
|
4
|
+
import { SelectBase as E } from "./Select/SelectBase.js";
|
|
5
|
+
import { c as i } from "./twUtils-CRiPKpXj.js";
|
|
6
|
+
import { forwardRef as o, useId as $ } from "react";
|
|
7
|
+
import { a as k } from "./chevron-down-UbkgS76q.js";
|
|
8
|
+
import { L as O } from "./loader-circle-CvdzOiQ_.js";
|
|
9
|
+
const q = ({ children: e, ...t }) => /* @__PURE__ */ s("div", { ...t, children: e }), p = o(({ className: e, ...t }, a) => /* @__PURE__ */ s("div", { ref: a, className: i("text-text-secondary px-2 py-1.5 text-sm font-semibold", e), ...t }));
|
|
10
|
+
p.displayName = "SelectGroup";
|
|
11
|
+
const z = ({ placeholder: e, children: t }) => /* @__PURE__ */ s("span", { children: t || e }), b = o(
|
|
12
|
+
({ className: e, children: t, ...a }, l) => /* @__PURE__ */ s("button", { ref: l, className: e, ...a, children: t })
|
|
13
|
+
);
|
|
14
|
+
b.displayName = "SelectTrigger";
|
|
15
|
+
const u = o(
|
|
16
|
+
({ className: e, children: t, ...a }, l) => /* @__PURE__ */ s("div", { ref: l, className: e, ...a, children: t })
|
|
17
|
+
);
|
|
18
|
+
u.displayName = "SelectContent";
|
|
19
|
+
const g = o(({ className: e, ...t }, a) => /* @__PURE__ */ s("div", { ref: a, className: i("text-input-text-secondary px-2 py-1.5 text-sm font-semibold", e), ...t }));
|
|
20
|
+
g.displayName = "SelectLabel";
|
|
21
|
+
const y = o(
|
|
22
|
+
({ className: e, children: t, disabled: a, ...l }, r) => /* @__PURE__ */ m(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref: r,
|
|
26
|
+
className: i(
|
|
27
|
+
"relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none",
|
|
28
|
+
"hover:bg-input-bg--hover focus:bg-input-bg--hover hover:cursor-pointer",
|
|
29
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
30
|
+
e
|
|
31
|
+
),
|
|
32
|
+
"data-disabled": a,
|
|
33
|
+
...l,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ s("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ s(k, { className: "text-input-text h-4 w-4" }) }),
|
|
36
|
+
/* @__PURE__ */ s("span", { children: t })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
y.displayName = "SelectItem";
|
|
42
|
+
const x = o(({ className: e, ...t }, a) => /* @__PURE__ */ s("div", { ref: a, className: i("bg-input-border -mx-1 my-1 h-px", e), ...t }));
|
|
43
|
+
x.displayName = "SelectSeparator";
|
|
44
|
+
const S = o(
|
|
45
|
+
({ className: e, children: t, ...a }, l) => /* @__PURE__ */ s(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
ref: l,
|
|
49
|
+
className: i("text-input-text-secondary py-6 text-center text-sm", e),
|
|
50
|
+
role: "status",
|
|
51
|
+
...a,
|
|
52
|
+
children: t
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
S.displayName = "SelectEmptyMessage";
|
|
57
|
+
const f = o(
|
|
58
|
+
({ className: e, message: t = "Loading...", children: a, ...l }, r) => /* @__PURE__ */ m(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
ref: r,
|
|
62
|
+
className: i("text-input-text-secondary flex items-center justify-center gap-2 py-6 text-sm", e),
|
|
63
|
+
role: "status",
|
|
64
|
+
"aria-live": "polite",
|
|
65
|
+
...l,
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ s(O, { className: "h-4 w-4 animate-spin" }),
|
|
68
|
+
a || t
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
f.displayName = "SelectLoadingMessage";
|
|
74
|
+
const N = o((e, t) => {
|
|
75
|
+
const {
|
|
76
|
+
defaultValue: a,
|
|
77
|
+
items: l = [],
|
|
78
|
+
onValueChange: r,
|
|
79
|
+
placeholder: v,
|
|
80
|
+
triggerClassName: h,
|
|
81
|
+
value: C,
|
|
82
|
+
disabled: L,
|
|
83
|
+
name: c,
|
|
84
|
+
id: I,
|
|
85
|
+
state: d = "default",
|
|
86
|
+
emptyMessage: M = "No items found",
|
|
87
|
+
errorMessage: j,
|
|
88
|
+
label: w,
|
|
89
|
+
"aria-label": V,
|
|
90
|
+
"aria-describedby": D,
|
|
91
|
+
...G
|
|
92
|
+
} = e, R = $(), T = I || `${c}-${R}`, B = l.map((n) => ({
|
|
93
|
+
label: n.label,
|
|
94
|
+
value: n.value,
|
|
95
|
+
disabled: n.disabled
|
|
96
|
+
}));
|
|
97
|
+
return /* @__PURE__ */ s(
|
|
98
|
+
E,
|
|
99
|
+
{
|
|
100
|
+
ref: t,
|
|
101
|
+
id: T,
|
|
102
|
+
name: c,
|
|
103
|
+
value: C,
|
|
104
|
+
defaultValue: a,
|
|
105
|
+
onChange: r,
|
|
106
|
+
options: B,
|
|
107
|
+
placeholder: v,
|
|
108
|
+
state: d,
|
|
109
|
+
errorMessage: j,
|
|
110
|
+
emptyMessage: M,
|
|
111
|
+
label: w,
|
|
112
|
+
disabled: L || d === "disabled",
|
|
113
|
+
"aria-label": V,
|
|
114
|
+
"aria-describedby": D,
|
|
115
|
+
className: h,
|
|
116
|
+
...G
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
N.displayName = "Select";
|
|
121
|
+
const U = Object.assign(N, {
|
|
122
|
+
Root: q,
|
|
123
|
+
Group: p,
|
|
124
|
+
Value: z,
|
|
125
|
+
Trigger: b,
|
|
126
|
+
Content: u,
|
|
127
|
+
Label: g,
|
|
128
|
+
Item: y,
|
|
129
|
+
Separator: x,
|
|
130
|
+
EmptyMessage: S,
|
|
131
|
+
LoadingMessage: f
|
|
132
|
+
});
|
|
133
|
+
export {
|
|
134
|
+
U as Select,
|
|
135
|
+
E as SelectBase
|
|
136
|
+
};
|
package/dist/Skeleton.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from '
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
2
|
declare function Skeleton({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { Skeleton };
|
|
4
4
|
//# sourceMappingURL=Skeleton.d.ts.map
|