@spear-ai/spectral 1.3.67 → 1.3.68
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/Accordion.js +7 -31
- package/dist/Alert/AlertBase.d.ts +10 -1
- package/dist/Alert/AlertBase.js +25 -42
- package/dist/Alert.d.ts +5 -5
- package/dist/Alert.js +43 -54
- package/dist/Avatar.js +4 -33
- package/dist/Badge.js +1 -6
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +32 -67
- package/dist/ButtonGroup/ButtonGroupButton.js +1 -10
- package/dist/ButtonGroup.js +6 -42
- package/dist/ButtonIcon.d.ts +4 -4
- package/dist/ButtonIcon.js +44 -53
- package/dist/Card.js +6 -13
- package/dist/Checkbox/CheckboxBase.js +4 -15
- package/dist/Checkbox.js +24 -40
- package/dist/Dialog/DialogBase.d.ts +17 -17
- package/dist/Dialog/DialogBase.js +13 -62
- package/dist/Dialog.d.ts +1 -1
- package/dist/Dialog.js +6 -44
- package/dist/Drawer.d.ts +6 -6
- package/dist/Drawer.js +6 -14
- package/dist/HoverCard.d.ts +5 -4
- package/dist/HoverCard.js +148 -138
- package/dist/Icons/AnalyzeIcon.js +52 -64
- package/dist/Icons/AnnotationsIcon.js +8 -20
- package/dist/Icons/ApprovedIcon.js +13 -34
- package/dist/Icons/CalendarIcon.js +15 -54
- package/dist/Icons/CheckCircleIcon.js +5 -21
- package/dist/Icons/CheckSquareIcon.js +5 -21
- package/dist/Icons/CheckmarkIcon.js +4 -20
- package/dist/Icons/ChevronDownIcon.js +4 -20
- package/dist/Icons/ChevronUpIcon.js +4 -20
- package/dist/Icons/ClockIcon.js +13 -34
- package/dist/Icons/CloseCircleIcon.js +5 -21
- package/dist/Icons/CloseIcon.js +4 -20
- package/dist/Icons/DashboardIcon.js +5 -44
- package/dist/Icons/DatabaseIcon.js +14 -44
- package/dist/Icons/DeleteIcon.js +14 -44
- package/dist/Icons/DurationIcon.js +17 -74
- package/dist/Icons/EmailIcon.js +5 -21
- package/dist/Icons/EraserIcon.js +16 -37
- package/dist/Icons/ErrorIcon.js +6 -22
- package/dist/Icons/EyeClosedIcon.js +8 -24
- package/dist/Icons/EyeClosedIcon2.js +6 -22
- package/dist/Icons/EyeOpenIcon.js +4 -20
- package/dist/Icons/GoToFirstIcon.js +4 -34
- package/dist/Icons/GoToLastIcon.js +4 -34
- package/dist/Icons/HarmonicCursorsIcon.js +4 -31
- package/dist/Icons/IconBase.js +5 -22
- package/dist/Icons/InfoIcon.js +5 -26
- package/dist/Icons/LabelIcon.js +7 -19
- package/dist/Icons/LassoIcon.js +23 -44
- package/dist/Icons/LineToolIcon.js +5 -17
- package/dist/Icons/LineToolIcon2.js +43 -64
- package/dist/Icons/LiveViewIcon.js +7 -64
- package/dist/Icons/LoaderIcon.js +18 -42
- package/dist/Icons/LocationIcon.js +22 -34
- package/dist/Icons/LogoutIcon.js +8 -20
- package/dist/Icons/MessagesIcon.js +13 -25
- package/dist/Icons/MetadataIcon.js +8 -20
- package/dist/Icons/MinusIcon.js +1 -17
- package/dist/Icons/OntologyIcon.js +66 -78
- package/dist/Icons/PanelIconClose.js +5 -21
- package/dist/Icons/PanelIconOpen.js +5 -21
- package/dist/Icons/PlayIcon.js +1 -22
- package/dist/Icons/PlusIcon.js +7 -20
- package/dist/Icons/ResetIcon.js +5 -17
- package/dist/Icons/ReviewedIcon.js +14 -35
- package/dist/Icons/ScissorsIcon.js +12 -30
- package/dist/Icons/SettingsIcon.js +22 -34
- package/dist/Icons/SortAscendingIcon.js +7 -64
- package/dist/Icons/SortDescendingIcon.js +7 -64
- package/dist/Icons/StackIcon.js +4 -34
- package/dist/Icons/StarIcon.js +1 -22
- package/dist/Icons/TrashIcon.js +5 -17
- package/dist/Icons/UndoIcon.js +8 -20
- package/dist/Icons/UserIcon.js +7 -19
- package/dist/Icons/WarningIcon.js +7 -19
- package/dist/Icons/ZoomAllIcon.js +10 -94
- package/dist/Icons/ZoomXIcon.js +5 -35
- package/dist/Icons/ZoomYIcon.js +5 -44
- package/dist/Input.d.ts +22 -20
- package/dist/Input.js +52 -92
- package/dist/InputGroup.js +2 -47
- package/dist/InputOTP.js +63 -99
- package/dist/Label.js +1 -12
- package/dist/MultiSelect/MultiSelectBase.d.ts +24 -24
- package/dist/MultiSelect/MultiSelectBase.js +82 -151
- package/dist/MultiSelect/MutiSelect.d.ts +6 -6
- package/dist/MultiSelect/MutiSelect.js +9 -21
- package/dist/Popover.js +2 -9
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +8 -8
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -27
- package/dist/RadioButtonGroup.d.ts +1 -1
- package/dist/RadioButtonGroup.js +1 -11
- package/dist/RadioGroup.d.ts +16 -16
- package/dist/RadioGroup.js +40 -92
- package/dist/Select.d.ts +7 -6
- package/dist/Select.js +81 -135
- package/dist/Separator.js +13 -15
- package/dist/Slider/SliderBase.js +129 -188
- package/dist/Slider.js +4 -41
- package/dist/Switch/SwitchBase.js +84 -106
- package/dist/Switch.d.ts +6 -6
- package/dist/Switch.js +34 -49
- package/dist/Tabs/TabsBase.d.ts +18 -18
- package/dist/Tabs/TabsBase.js +12 -71
- package/dist/Tabs/tabsStoryData.js +2 -2
- package/dist/Tabs/tabsUtils.d.ts +17 -17
- package/dist/Tabs.d.ts +14 -14
- package/dist/Tabs.js +67 -130
- package/dist/Textarea/TextareaUtils.d.ts +1 -1
- package/dist/Textarea.d.ts +9 -8
- package/dist/Textarea.js +49 -84
- package/dist/Toggle/ToggleBase.d.ts +4 -4
- package/dist/Toggle/ToggleBase.js +2 -27
- package/dist/Toggle.js +1 -11
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +8 -8
- package/dist/ToggleGroup/ToggleGroupBase.js +6 -35
- package/dist/ToggleGroup.js +1 -1
- package/dist/Tooltip/TooltipBase.d.ts +1 -1
- package/dist/Tooltip/TooltipBase.js +5 -47
- package/dist/Tray/TrayStoriesData.d.ts +1 -1
- package/dist/Tray/TrayStoriesData.js +22 -134
- package/dist/Tray.d.ts +6 -2
- package/dist/Tray.js +55 -68
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Alert/Alert.d.ts +5 -5
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/AlertBase.d.ts +10 -1
- package/dist/components/Alert/AlertBase.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroupButton.d.ts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.ts +4 -4
- package/dist/components/ButtonIcon/ButtonIcon.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/CheckboxBase.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/DialogBase.d.ts +17 -17
- package/dist/components/Dialog/DialogBase.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +6 -6
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/HoverCard/HoverCard.d.ts +5 -4
- package/dist/components/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/components/Icons/AnalyzeIcon.d.ts.map +1 -1
- package/dist/components/Icons/AnnotationsIcon.d.ts.map +1 -1
- package/dist/components/Icons/ApprovedIcon.d.ts.map +1 -1
- package/dist/components/Icons/CalendarIcon.d.ts.map +1 -1
- package/dist/components/Icons/CheckCircleIcon.d.ts.map +1 -1
- package/dist/components/Icons/CheckSquareIcon.d.ts.map +1 -1
- package/dist/components/Icons/CheckmarkIcon.d.ts.map +1 -1
- package/dist/components/Icons/ChevronDownIcon.d.ts.map +1 -1
- package/dist/components/Icons/ChevronUpIcon.d.ts.map +1 -1
- package/dist/components/Icons/ClockIcon.d.ts.map +1 -1
- package/dist/components/Icons/CloseCircleIcon.d.ts.map +1 -1
- package/dist/components/Icons/CloseIcon.d.ts.map +1 -1
- package/dist/components/Icons/DashboardIcon.d.ts.map +1 -1
- package/dist/components/Icons/DatabaseIcon.d.ts.map +1 -1
- package/dist/components/Icons/DeleteIcon.d.ts.map +1 -1
- package/dist/components/Icons/DurationIcon.d.ts.map +1 -1
- package/dist/components/Icons/EmailIcon.d.ts.map +1 -1
- package/dist/components/Icons/EraserIcon.d.ts.map +1 -1
- package/dist/components/Icons/ErrorIcon.d.ts.map +1 -1
- package/dist/components/Icons/EyeClosedIcon.d.ts.map +1 -1
- package/dist/components/Icons/EyeClosedIcon2.d.ts.map +1 -1
- package/dist/components/Icons/EyeOpenIcon.d.ts.map +1 -1
- package/dist/components/Icons/GoToFirstIcon.d.ts.map +1 -1
- package/dist/components/Icons/GoToLastIcon.d.ts.map +1 -1
- package/dist/components/Icons/HarmonicCursorsIcon.d.ts.map +1 -1
- package/dist/components/Icons/IconBase.d.ts.map +1 -1
- package/dist/components/Icons/InfoIcon.d.ts.map +1 -1
- package/dist/components/Icons/LabelIcon.d.ts.map +1 -1
- package/dist/components/Icons/LassoIcon.d.ts.map +1 -1
- package/dist/components/Icons/LineToolIcon.d.ts.map +1 -1
- package/dist/components/Icons/LineToolIcon2.d.ts.map +1 -1
- package/dist/components/Icons/LiveViewIcon.d.ts.map +1 -1
- package/dist/components/Icons/LoaderIcon.d.ts.map +1 -1
- package/dist/components/Icons/LocationIcon.d.ts.map +1 -1
- package/dist/components/Icons/LogoutIcon.d.ts.map +1 -1
- package/dist/components/Icons/MessagesIcon.d.ts.map +1 -1
- package/dist/components/Icons/MetadataIcon.d.ts.map +1 -1
- package/dist/components/Icons/MinusIcon.d.ts.map +1 -1
- package/dist/components/Icons/OntologyIcon.d.ts.map +1 -1
- package/dist/components/Icons/PanelIconClose.d.ts.map +1 -1
- package/dist/components/Icons/PanelIconOpen.d.ts.map +1 -1
- package/dist/components/Icons/PlayIcon.d.ts.map +1 -1
- package/dist/components/Icons/PlusIcon.d.ts.map +1 -1
- package/dist/components/Icons/ResetIcon.d.ts.map +1 -1
- package/dist/components/Icons/ReviewedIcon.d.ts.map +1 -1
- package/dist/components/Icons/ScissorsIcon.d.ts.map +1 -1
- package/dist/components/Icons/SettingsIcon.d.ts.map +1 -1
- package/dist/components/Icons/SortAscendingIcon.d.ts.map +1 -1
- package/dist/components/Icons/SortDescendingIcon.d.ts.map +1 -1
- package/dist/components/Icons/StackIcon.d.ts.map +1 -1
- package/dist/components/Icons/StarIcon.d.ts.map +1 -1
- package/dist/components/Icons/TrashIcon.d.ts.map +1 -1
- package/dist/components/Icons/UndoIcon.d.ts.map +1 -1
- package/dist/components/Icons/UserIcon.d.ts.map +1 -1
- package/dist/components/Icons/WarningIcon.d.ts.map +1 -1
- package/dist/components/Icons/ZoomAllIcon.d.ts.map +1 -1
- package/dist/components/Icons/ZoomXIcon.d.ts.map +1 -1
- package/dist/components/Icons/ZoomYIcon.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +22 -20
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/InputUtils.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/components/InputOTP/InputOTP.d.ts.map +1 -1
- package/dist/components/Label/Label.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelectBase.d.ts +24 -24
- package/dist/components/MultiSelect/MultiSelectBase.d.ts.map +1 -1
- package/dist/components/MultiSelect/MutiSelect.d.ts +6 -6
- package/dist/components/MultiSelect/MutiSelect.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
- package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -1
- package/dist/components/RadioButtonGroup/RadioButtonGroupBase.d.ts +8 -8
- package/dist/components/RadioButtonGroup/RadioButtonGroupBase.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +16 -16
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +7 -6
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Separator/Separator.d.ts.map +1 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/SliderBase.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts +6 -6
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/SwitchBase.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +14 -14
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/TabsBase.d.ts +18 -18
- package/dist/components/Tabs/TabsBase.d.ts.map +1 -1
- package/dist/components/Tabs/tabsStoryData.d.ts.map +1 -1
- package/dist/components/Tabs/tabsUtils.d.ts +17 -17
- package/dist/components/Tabs/tabsUtils.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +9 -8
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/TextareaUtils.d.ts +1 -1
- package/dist/components/Textarea/TextareaUtils.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/ToggleBase.d.ts +4 -4
- package/dist/components/Toggle/ToggleBase.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupBase.d.ts +8 -8
- package/dist/components/ToggleGroup/ToggleGroupBase.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/TooltipBase.d.ts +1 -1
- package/dist/components/Tooltip/TooltipBase.d.ts.map +1 -1
- package/dist/components/Tray/Tray.d.ts +6 -2
- package/dist/components/Tray/Tray.d.ts.map +1 -1
- package/dist/components/Tray/TrayStoriesData.d.ts +1 -1
- package/dist/components/Tray/TrayStoriesData.d.ts.map +1 -1
- package/dist/features/AuthCard/AuthCard.d.ts.map +1 -1
- package/dist/features/AuthCard/AuthToggle.d.ts.map +1 -1
- package/dist/features/AuthCard/AuthToggle.js +4 -20
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts +1 -1
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts.map +1 -1
- package/dist/features/AuthCard/ForgotPasswordEmailForm.js +5 -21
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts +1 -1
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts.map +1 -1
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +5 -50
- package/dist/features/AuthCard/OTPInput.d.ts +1 -1
- package/dist/features/AuthCard/OTPInput.d.ts.map +1 -1
- package/dist/features/AuthCard/OTPInput.js +3 -21
- package/dist/features/AuthCard/PasswordInput.d.ts +1 -1
- package/dist/features/AuthCard/PasswordInput.d.ts.map +1 -1
- package/dist/features/AuthCard/PasswordInput.js +9 -50
- package/dist/features/AuthCard/SignInForm.d.ts.map +1 -1
- package/dist/features/AuthCard/SignInForm.js +7 -51
- package/dist/features/AuthCard/SignUpForm.d.ts.map +1 -1
- package/dist/features/AuthCard/SignUpForm.js +10 -55
- package/dist/features/AuthCard.js +144 -248
- package/dist/features/ClearDialog/ClearDialog.d.ts.map +1 -1
- package/dist/features/ClearDialog.js +10 -10
- package/dist/features/LabelingTools/LabelingTools.d.ts.map +1 -1
- package/dist/features/LabelingTools.js +21 -56
- package/dist/features/SensorMetadata/SensorMetadata.d.ts.map +1 -1
- package/dist/features/SensorMetadata.js +20 -20
- package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +1 -1
- package/dist/features/SettingsPopover.js +14 -14
- package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
- package/dist/hooks/useControllableState.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/primitives/button.d.ts.map +1 -1
- package/dist/primitives/input.d.ts.map +1 -1
- package/dist/primitives/input.js +4 -1
- package/dist/primitives/select.d.ts +1 -1
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +7 -55
- package/dist/primitives/slot.d.ts.map +1 -1
- package/dist/primitives/slot.js +1 -4
- package/dist/primitives/textarea.d.ts.map +1 -1
- package/dist/primitives/textarea.js +3 -1
- package/dist/styles/main.css +1 -1
- package/dist/utils/formFieldUtils.d.ts +4 -2
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +3 -34
- package/dist/utils/refs.d.ts.map +1 -1
- package/package.json +23 -16
|
@@ -38,26 +38,7 @@ function nt(r) {
|
|
|
38
38
|
return [t, o];
|
|
39
39
|
}
|
|
40
40
|
const z = W(null), rt = E(
|
|
41
|
-
({
|
|
42
|
-
asChild: r,
|
|
43
|
-
className: i,
|
|
44
|
-
value: e,
|
|
45
|
-
defaultValue: a,
|
|
46
|
-
onValueChange: l,
|
|
47
|
-
onValueCommit: n,
|
|
48
|
-
min: s = 0,
|
|
49
|
-
max: t = 100,
|
|
50
|
-
step: o = 1,
|
|
51
|
-
minStepsBetweenThumbs: u = 0,
|
|
52
|
-
orientation: d = "horizontal",
|
|
53
|
-
dir: S = "ltr",
|
|
54
|
-
disabled: b = !1,
|
|
55
|
-
name: h,
|
|
56
|
-
form: N,
|
|
57
|
-
required: T,
|
|
58
|
-
children: V,
|
|
59
|
-
...$
|
|
60
|
-
}, c) => {
|
|
41
|
+
({ asChild: r, className: i, value: e, defaultValue: a, onValueChange: l, onValueCommit: n, min: s = 0, max: t = 100, step: o = 1, minStepsBetweenThumbs: u = 0, orientation: d = "horizontal", dir: S = "ltr", disabled: b = !1, name: h, form: N, required: T, children: V, ...$ }, c) => {
|
|
61
42
|
const [m, p] = nt({
|
|
62
43
|
value: e,
|
|
63
44
|
defaultValue: a && a.length > 0 ? a : [s],
|
|
@@ -94,36 +75,21 @@ const z = W(null), rt = E(
|
|
|
94
75
|
setActiveIndex: C,
|
|
95
76
|
updateAtIndex: K
|
|
96
77
|
}, J = r ? P : "div", O = c;
|
|
97
|
-
return /* @__PURE__ */ k(z.Provider, { value: M, children: /* @__PURE__ */ Q(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"input",
|
|
113
|
-
{
|
|
114
|
-
type: "hidden",
|
|
115
|
-
name: M.values.length > 1 ? `${h}[]` : h,
|
|
116
|
-
value: String(g),
|
|
117
|
-
form: N,
|
|
118
|
-
required: T && R === 0,
|
|
119
|
-
"aria-hidden": "true"
|
|
120
|
-
},
|
|
121
|
-
R
|
|
122
|
-
)),
|
|
123
|
-
V
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
) });
|
|
78
|
+
return /* @__PURE__ */ k(z.Provider, { value: M, children: /* @__PURE__ */ Q(J, { ref: O, role: "presentation", "data-orientation": d, "data-disabled": b ? "" : void 0, className: x("relative touch-none select-none", d === "horizontal" ? "h-6 w-full" : "h-full w-6", i), ...$, children: [
|
|
79
|
+
h && M.values.map((g, R) => /* @__PURE__ */ k(
|
|
80
|
+
"input",
|
|
81
|
+
{
|
|
82
|
+
type: "hidden",
|
|
83
|
+
name: M.values.length > 1 ? `${h}[]` : h,
|
|
84
|
+
value: String(g),
|
|
85
|
+
form: N,
|
|
86
|
+
required: T && R === 0,
|
|
87
|
+
"aria-hidden": "true"
|
|
88
|
+
},
|
|
89
|
+
R
|
|
90
|
+
)),
|
|
91
|
+
V
|
|
92
|
+
] }) });
|
|
127
93
|
}
|
|
128
94
|
);
|
|
129
95
|
rt.displayName = "SliderBase";
|
|
@@ -135,147 +101,122 @@ function X(r, i) {
|
|
|
135
101
|
s[o] - s[o - 1] < t && (s[o] = I(s[o - 1] + t, e, a));
|
|
136
102
|
return s;
|
|
137
103
|
}
|
|
138
|
-
const ot = E(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
(u)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
onPointerDown: o,
|
|
167
|
-
...a
|
|
168
|
-
}
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
);
|
|
104
|
+
const ot = E(({ asChild: r, className: i, onPointerDown: e, ...a }, l) => {
|
|
105
|
+
const n = F(z);
|
|
106
|
+
if (!n) throw new Error("SliderTrack must be used within Slider");
|
|
107
|
+
const s = r ? P : "div", t = (u) => {
|
|
108
|
+
n.trackRef.current = u, typeof l == "function" ? l(u) : l && "current" in l && (l.current = u);
|
|
109
|
+
}, o = A(
|
|
110
|
+
(u) => {
|
|
111
|
+
if (e?.(u), u.defaultPrevented || n.disabled) return;
|
|
112
|
+
const d = n.trackRef.current;
|
|
113
|
+
if (!d) return;
|
|
114
|
+
d.setPointerCapture?.(u.pointerId), u.preventDefault();
|
|
115
|
+
const S = d.getBoundingClientRect(), b = Y(u.clientX, u.clientY, S, n), h = et(n.values, b);
|
|
116
|
+
n.setActiveIndex(h), n.updateAtIndex(h, b), H(h, n);
|
|
117
|
+
},
|
|
118
|
+
[n, e]
|
|
119
|
+
);
|
|
120
|
+
return /* @__PURE__ */ k(
|
|
121
|
+
s,
|
|
122
|
+
{
|
|
123
|
+
ref: t,
|
|
124
|
+
"data-orientation": n.orientation,
|
|
125
|
+
className: x("bg-secondary relative grow rounded-full", n.orientation === "horizontal" ? "h-2" : "w-2", i),
|
|
126
|
+
style: { touchAction: "none" },
|
|
127
|
+
onPointerDown: o,
|
|
128
|
+
...a
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
});
|
|
172
132
|
ot.displayName = "SliderTrack";
|
|
173
|
-
const it = E(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
s,
|
|
180
|
-
{
|
|
181
|
-
ref: l,
|
|
182
|
-
"data-orientation": n.orientation,
|
|
183
|
-
className: x("bg-primary absolute rounded-full", n.orientation === "horizontal" ? "h-2" : "w-2", i),
|
|
184
|
-
style: { ...u, ...e },
|
|
185
|
-
...a
|
|
186
|
-
}
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
);
|
|
133
|
+
const it = E(({ asChild: r, className: i, style: e, ...a }, l) => {
|
|
134
|
+
const n = F(z);
|
|
135
|
+
if (!n) throw new Error("SliderRange must be used within Slider");
|
|
136
|
+
const s = r ? P : "div", t = L(n.values[0], n.min, n.max), o = L(n.values[n.values.length - 1], n.min, n.max), u = n.orientation === "horizontal" ? { left: `${t}%`, width: `${o - t}%` } : { bottom: `${t}%`, height: `${o - t}%` };
|
|
137
|
+
return /* @__PURE__ */ k(s, { ref: l, "data-orientation": n.orientation, className: x("bg-primary absolute rounded-full", n.orientation === "horizontal" ? "h-2" : "w-2", i), style: { ...u, ...e }, ...a });
|
|
138
|
+
});
|
|
190
139
|
it.displayName = "SliderRange";
|
|
191
|
-
const at = E(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
(c)
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
if (f === "End") {
|
|
209
|
-
c.preventDefault(), t.updateAtIndex(o, t.max, { commit: !0 });
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
const y = t.orientation === "horizontal", C = t.dir === "rtl";
|
|
213
|
-
if (f === "ArrowRight" && y) {
|
|
214
|
-
c.preventDefault(), v(t.step * (C ? -1 : 1));
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if (f === "ArrowLeft" && y) {
|
|
218
|
-
c.preventDefault(), v(t.step * (C ? 1 : -1));
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
if (f === "ArrowUp" && !y) {
|
|
222
|
-
c.preventDefault(), v(t.step);
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
if (f === "ArrowDown" && !y) {
|
|
226
|
-
c.preventDefault(), v(-t.step);
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
if (f === "PageUp") {
|
|
230
|
-
c.preventDefault(), v(p("inc") * m);
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
if (f === "PageDown") {
|
|
234
|
-
c.preventDefault(), v(p("dec") * m);
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
[t, o, a]
|
|
239
|
-
), V = A(
|
|
240
|
-
(c) => {
|
|
241
|
-
if (l?.(c), c.defaultPrevented || t.disabled) return;
|
|
242
|
-
const m = t.trackRef.current, p = t.thumbsRef.current[o].current;
|
|
243
|
-
!m || !p || (p.setPointerCapture?.(c.pointerId), c.preventDefault(), t.setActiveIndex(o), H(o, t));
|
|
244
|
-
},
|
|
245
|
-
[t, o, l]
|
|
246
|
-
), $ = t.orientation === "horizontal" ? { left: `${d}%`, transform: "translate(-50%, -50%)" } : { bottom: `${d}%`, transform: "translate(-50%, 50%)" };
|
|
247
|
-
return /* @__PURE__ */ k(
|
|
248
|
-
S,
|
|
249
|
-
{
|
|
250
|
-
ref: b,
|
|
251
|
-
role: "slider",
|
|
252
|
-
tabIndex: N,
|
|
253
|
-
"aria-valuemin": t.min,
|
|
254
|
-
"aria-valuemax": t.max,
|
|
255
|
-
"aria-valuenow": u,
|
|
256
|
-
"aria-orientation": t.orientation,
|
|
257
|
-
"aria-disabled": t.disabled || void 0,
|
|
258
|
-
"data-orientation": t.orientation,
|
|
259
|
-
"data-disabled": t.disabled ? "" : void 0,
|
|
260
|
-
className: x(
|
|
261
|
-
"absolute grid place-items-center rounded-full shadow",
|
|
262
|
-
"border-input border outline-none",
|
|
263
|
-
"focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
264
|
-
"h-5 w-5",
|
|
265
|
-
i
|
|
266
|
-
),
|
|
267
|
-
style: {
|
|
268
|
-
...$,
|
|
269
|
-
...t.orientation === "horizontal" ? { top: "50%" } : { left: "50%" },
|
|
270
|
-
touchAction: "none"
|
|
271
|
-
},
|
|
272
|
-
onKeyDown: T,
|
|
273
|
-
onPointerDown: V,
|
|
274
|
-
...n
|
|
140
|
+
const at = E(({ asChild: r, className: i, index: e, onKeyDown: a, onPointerDown: l, ...n }, s) => {
|
|
141
|
+
const t = F(z);
|
|
142
|
+
if (!t) throw new Error("SliderThumb must be used within Slider");
|
|
143
|
+
const [o] = B(() => {
|
|
144
|
+
const c = typeof e == "number" ? e : t.thumbsRef.current.length;
|
|
145
|
+
return t.thumbsRef.current[c] || (t.thumbsRef.current[c] = _()), c;
|
|
146
|
+
}), u = t.values[o] ?? t.values[t.values.length - 1], d = L(u, t.min, t.max), S = r ? P : "button", b = (c) => {
|
|
147
|
+
t.thumbsRef.current[o].current = c, typeof s == "function" ? s(c) : s && "current" in s && (s.current = c);
|
|
148
|
+
}, N = (t.activeIndex === null || t.activeIndex === o) && !t.disabled ? 0 : -1, T = A(
|
|
149
|
+
(c) => {
|
|
150
|
+
if (a?.(c), c.defaultPrevented || t.disabled) return;
|
|
151
|
+
const m = Math.max(t.step * 10, t.step), p = (w) => w === "inc" ? 1 : -1, v = (w) => st(o, w, t), f = c.key;
|
|
152
|
+
if (f === "Home") {
|
|
153
|
+
c.preventDefault(), t.updateAtIndex(o, t.min, { commit: !0 });
|
|
154
|
+
return;
|
|
275
155
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
156
|
+
if (f === "End") {
|
|
157
|
+
c.preventDefault(), t.updateAtIndex(o, t.max, { commit: !0 });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const y = t.orientation === "horizontal", C = t.dir === "rtl";
|
|
161
|
+
if (f === "ArrowRight" && y) {
|
|
162
|
+
c.preventDefault(), v(t.step * (C ? -1 : 1));
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (f === "ArrowLeft" && y) {
|
|
166
|
+
c.preventDefault(), v(t.step * (C ? 1 : -1));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (f === "ArrowUp" && !y) {
|
|
170
|
+
c.preventDefault(), v(t.step);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (f === "ArrowDown" && !y) {
|
|
174
|
+
c.preventDefault(), v(-t.step);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (f === "PageUp") {
|
|
178
|
+
c.preventDefault(), v(p("inc") * m);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (f === "PageDown") {
|
|
182
|
+
c.preventDefault(), v(p("dec") * m);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
[t, o, a]
|
|
187
|
+
), V = A(
|
|
188
|
+
(c) => {
|
|
189
|
+
if (l?.(c), c.defaultPrevented || t.disabled) return;
|
|
190
|
+
const m = t.trackRef.current, p = t.thumbsRef.current[o].current;
|
|
191
|
+
!m || !p || (p.setPointerCapture?.(c.pointerId), c.preventDefault(), t.setActiveIndex(o), H(o, t));
|
|
192
|
+
},
|
|
193
|
+
[t, o, l]
|
|
194
|
+
), $ = t.orientation === "horizontal" ? { left: `${d}%`, transform: "translate(-50%, -50%)" } : { bottom: `${d}%`, transform: "translate(-50%, 50%)" };
|
|
195
|
+
return /* @__PURE__ */ k(
|
|
196
|
+
S,
|
|
197
|
+
{
|
|
198
|
+
ref: b,
|
|
199
|
+
role: "slider",
|
|
200
|
+
tabIndex: N,
|
|
201
|
+
"aria-valuemin": t.min,
|
|
202
|
+
"aria-valuemax": t.max,
|
|
203
|
+
"aria-valuenow": u,
|
|
204
|
+
"aria-orientation": t.orientation,
|
|
205
|
+
"aria-disabled": t.disabled || void 0,
|
|
206
|
+
"data-orientation": t.orientation,
|
|
207
|
+
"data-disabled": t.disabled ? "" : void 0,
|
|
208
|
+
className: x("absolute grid place-items-center rounded-full shadow", "border-input border outline-none", "focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2", "h-5 w-5", i),
|
|
209
|
+
style: {
|
|
210
|
+
...$,
|
|
211
|
+
...t.orientation === "horizontal" ? { top: "50%" } : { left: "50%" },
|
|
212
|
+
touchAction: "none"
|
|
213
|
+
},
|
|
214
|
+
onKeyDown: T,
|
|
215
|
+
onPointerDown: V,
|
|
216
|
+
...n
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
});
|
|
279
220
|
at.displayName = "SliderThumb";
|
|
280
221
|
function Y(r, i, e, a) {
|
|
281
222
|
let l;
|
package/dist/Slider.js
CHANGED
|
@@ -423,25 +423,8 @@ function Ke(e, t) {
|
|
|
423
423
|
return Math.round(e * o) / o;
|
|
424
424
|
}
|
|
425
425
|
var Ie = Q, Be = oe, Te = re, ke = ie;
|
|
426
|
-
const Ye = ({
|
|
427
|
-
|
|
428
|
-
defaultValue: t,
|
|
429
|
-
disabled: o,
|
|
430
|
-
max: n = 100,
|
|
431
|
-
min: i = 0,
|
|
432
|
-
minStepsBetweenThumbs: l = 1,
|
|
433
|
-
name: a,
|
|
434
|
-
onValueChange: s,
|
|
435
|
-
onValueCommit: u,
|
|
436
|
-
orientation: b = "horizontal",
|
|
437
|
-
step: h = 1,
|
|
438
|
-
value: r,
|
|
439
|
-
...d
|
|
440
|
-
}) => {
|
|
441
|
-
const p = de(
|
|
442
|
-
() => Array.isArray(r) ? r : Array.isArray(t) ? t : [i, n],
|
|
443
|
-
[r, t, i, n]
|
|
444
|
-
);
|
|
426
|
+
const Ye = ({ className: e, defaultValue: t, disabled: o, max: n = 100, min: i = 0, minStepsBetweenThumbs: l = 1, name: a, onValueChange: s, onValueCommit: u, orientation: b = "horizontal", step: h = 1, value: r, ...d }) => {
|
|
427
|
+
const p = de(() => Array.isArray(r) ? r : Array.isArray(t) ? t : [i, n], [r, t, i, n]);
|
|
445
428
|
return /* @__PURE__ */ j(
|
|
446
429
|
Ie,
|
|
447
430
|
{
|
|
@@ -457,30 +440,10 @@ const Ye = ({
|
|
|
457
440
|
onValueCommit: u,
|
|
458
441
|
disabled: o,
|
|
459
442
|
name: a,
|
|
460
|
-
className: H(
|
|
461
|
-
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
462
|
-
e
|
|
463
|
-
),
|
|
443
|
+
className: H("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", e),
|
|
464
444
|
...d,
|
|
465
445
|
children: [
|
|
466
|
-
/* @__PURE__ */ m(
|
|
467
|
-
Be,
|
|
468
|
-
{
|
|
469
|
-
"data-slot": "slider-track",
|
|
470
|
-
className: H(
|
|
471
|
-
"bg-slider-track relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
472
|
-
),
|
|
473
|
-
children: /* @__PURE__ */ m(
|
|
474
|
-
Te,
|
|
475
|
-
{
|
|
476
|
-
"data-slot": "slider-range",
|
|
477
|
-
className: H(
|
|
478
|
-
"bg-slider-range absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
479
|
-
)
|
|
480
|
-
}
|
|
481
|
-
)
|
|
482
|
-
}
|
|
483
|
-
),
|
|
446
|
+
/* @__PURE__ */ m(Be, { "data-slot": "slider-track", className: H("bg-slider-track relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"), children: /* @__PURE__ */ m(Te, { "data-slot": "slider-range", className: H("bg-slider-range absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full") }) }),
|
|
484
447
|
Array.from({ length: p.length }, (R, S) => /* @__PURE__ */ m(
|
|
485
448
|
ke,
|
|
486
449
|
{
|
|
@@ -5,108 +5,90 @@ import { useControllableState as M } from "../hooks/useControllableState.js";
|
|
|
5
5
|
import { Slot as g } from "../primitives/slot.js";
|
|
6
6
|
import { cn as x } from "../utils/twUtils.js";
|
|
7
7
|
import { createContext as O, forwardRef as y, useRef as V, useId as $, useEffect as k, useCallback as d, useContext as z } from "react";
|
|
8
|
-
const C = O(null), A = y(
|
|
9
|
-
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
ref: c,
|
|
85
|
-
type: "checkbox",
|
|
86
|
-
name: m,
|
|
87
|
-
value: p,
|
|
88
|
-
required: E,
|
|
89
|
-
disabled: r,
|
|
90
|
-
form: S,
|
|
91
|
-
checked: t,
|
|
92
|
-
readOnly: !0,
|
|
93
|
-
tabIndex: -1,
|
|
94
|
-
"aria-hidden": "true",
|
|
95
|
-
style: {
|
|
96
|
-
position: "absolute",
|
|
97
|
-
opacity: 0,
|
|
98
|
-
width: 0,
|
|
99
|
-
height: 0,
|
|
100
|
-
pointerEvents: "none"
|
|
101
|
-
}
|
|
8
|
+
const C = O(null), A = y(({ asChild: u, className: l, checked: f, defaultChecked: n = !1, onCheckedChange: o, name: m, value: p = "on", required: E, form: S, disabled: r, id: R, onClick: b, onKeyDown: w, children: I, ...N }, P) => {
|
|
9
|
+
const c = V(null), T = $(), j = R ?? `swt-${T}`, [t, s] = M({
|
|
10
|
+
value: f,
|
|
11
|
+
defaultValue: n,
|
|
12
|
+
onChange: o
|
|
13
|
+
});
|
|
14
|
+
k(() => {
|
|
15
|
+
c.current && (c.current.checked = t);
|
|
16
|
+
}, [t]), k(() => {
|
|
17
|
+
const e = c.current?.form ?? null;
|
|
18
|
+
if (!e) return;
|
|
19
|
+
const a = () => s(n);
|
|
20
|
+
return e.addEventListener("reset", a), () => e.removeEventListener("reset", a);
|
|
21
|
+
}, [n, s]);
|
|
22
|
+
const v = d(() => {
|
|
23
|
+
const e = c.current;
|
|
24
|
+
if (!e) return;
|
|
25
|
+
e.checked = t;
|
|
26
|
+
const a = new Event("change", { bubbles: !0 });
|
|
27
|
+
e.dispatchEvent(a);
|
|
28
|
+
}, [t]), i = d(() => {
|
|
29
|
+
r || (s(!t), queueMicrotask(() => v()));
|
|
30
|
+
}, [r, v, t, s]), D = d(
|
|
31
|
+
(e) => {
|
|
32
|
+
b?.(e), !e.defaultPrevented && i();
|
|
33
|
+
},
|
|
34
|
+
[b, i]
|
|
35
|
+
), L = d(
|
|
36
|
+
(e) => {
|
|
37
|
+
w?.(e), !e.defaultPrevented && (e.key === " " || e.key === "Enter") && (e.preventDefault(), i());
|
|
38
|
+
},
|
|
39
|
+
[w, i]
|
|
40
|
+
), q = u ? g : "button", F = P;
|
|
41
|
+
return /* @__PURE__ */ h(C.Provider, { value: { checked: t, disabled: r }, children: /* @__PURE__ */ K(
|
|
42
|
+
q,
|
|
43
|
+
{
|
|
44
|
+
id: j,
|
|
45
|
+
ref: F,
|
|
46
|
+
type: "button",
|
|
47
|
+
role: "switch",
|
|
48
|
+
"aria-checked": t,
|
|
49
|
+
"aria-disabled": r || void 0,
|
|
50
|
+
"data-state": t ? "checked" : "unchecked",
|
|
51
|
+
"data-disabled": r || void 0,
|
|
52
|
+
onClick: D,
|
|
53
|
+
onKeyDown: L,
|
|
54
|
+
disabled: r,
|
|
55
|
+
className: x(
|
|
56
|
+
"peer border-input inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border",
|
|
57
|
+
"bg-input focus-visible:ring-ring transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
|
|
58
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
59
|
+
"data-[state=checked]:bg-primary",
|
|
60
|
+
l
|
|
61
|
+
),
|
|
62
|
+
...N,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ h(
|
|
65
|
+
"input",
|
|
66
|
+
{
|
|
67
|
+
ref: c,
|
|
68
|
+
type: "checkbox",
|
|
69
|
+
name: m,
|
|
70
|
+
value: p,
|
|
71
|
+
required: E,
|
|
72
|
+
disabled: r,
|
|
73
|
+
form: S,
|
|
74
|
+
checked: t,
|
|
75
|
+
readOnly: !0,
|
|
76
|
+
tabIndex: -1,
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
style: {
|
|
79
|
+
position: "absolute",
|
|
80
|
+
opacity: 0,
|
|
81
|
+
width: 0,
|
|
82
|
+
height: 0,
|
|
83
|
+
pointerEvents: "none"
|
|
102
84
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
);
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
I
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
) });
|
|
91
|
+
});
|
|
110
92
|
A.displayName = "Switch";
|
|
111
93
|
const B = y(({ asChild: u, className: l, ...f }, n) => {
|
|
112
94
|
const o = z(C);
|
|
@@ -117,11 +99,7 @@ const B = y(({ asChild: u, className: l, ...f }, n) => {
|
|
|
117
99
|
ref: n,
|
|
118
100
|
"data-state": o.checked ? "checked" : "unchecked",
|
|
119
101
|
"data-disabled": o.disabled || void 0,
|
|
120
|
-
className: x(
|
|
121
|
-
"bg-background pointer-events-none block h-5 w-5 rounded-full shadow-lg ring-0 transition-transform",
|
|
122
|
-
"translate-x-0 data-[state=checked]:translate-x-5",
|
|
123
|
-
l
|
|
124
|
-
),
|
|
102
|
+
className: x("bg-background pointer-events-none block h-5 w-5 rounded-full shadow-lg ring-0 transition-transform", "translate-x-0 data-[state=checked]:translate-x-5", l),
|
|
125
103
|
...f
|
|
126
104
|
}
|
|
127
105
|
);
|
package/dist/Switch.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SwitchProps as SwitchBaseProps } from './SwitchBase';
|
|
2
2
|
export declare const Switch: import('react').ForwardRefExoticComponent<Omit<SwitchBaseProps, "onCheckedChange"> & {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
labelPosition?: "left" | "right";
|
|
4
|
+
labelText: string;
|
|
5
|
+
id: string;
|
|
6
|
+
hideLabel?: boolean;
|
|
7
7
|
onChange?: (checked: boolean) => void;
|
|
8
|
-
|
|
8
|
+
required?: boolean;
|
|
9
9
|
value?: string;
|
|
10
|
-
|
|
10
|
+
variant?: "default" | "squared";
|
|
11
11
|
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
//# sourceMappingURL=Switch.d.ts.map
|