@spear-ai/spectral 1.3.62 → 1.3.63
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 +181 -152
- package/dist/Accordion.d.ts +37 -0
- package/dist/Accordion.js +465 -0
- package/dist/Alert/AlertBase.js +2 -2
- package/dist/Alert.js +4 -3
- package/dist/Avatar.js +1 -1
- package/dist/Badge.d.ts +12 -2
- package/dist/Badge.js +28 -4
- package/dist/Button.js +2 -2
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +13 -0
- package/dist/ButtonGroup/ButtonGroupButton.js +51 -0
- package/dist/ButtonGroup.d.ts +29 -0
- package/dist/ButtonGroup.js +89 -0
- package/dist/ButtonIcon.js +2 -1
- package/dist/Checkbox/CheckboxBase.js +1 -1
- package/dist/Checkbox.js +11 -12
- package/dist/Dialog/DialogBase.d.ts +1 -1
- package/dist/Dialog/DialogBase.js +2 -2
- package/dist/Dialog.js +4 -4
- package/dist/Drawer.js +24 -1283
- package/dist/HoverCard.d.ts +29 -0
- package/dist/HoverCard.js +207 -0
- package/dist/Icons/MessagesIcon.d.ts +3 -0
- package/dist/Icons/MessagesIcon.js +31 -0
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons.js +50 -48
- package/dist/Input.d.ts +2 -0
- package/dist/Input.js +98 -89
- package/dist/InputGroup.d.ts +16 -0
- package/dist/InputGroup.js +129 -0
- package/dist/InputOTP.d.ts +0 -2
- package/dist/InputOTP.js +138 -142
- package/dist/Label.d.ts +3 -7
- package/dist/Label.js +11 -11
- package/dist/MultiSelect/MultiSelectBase.js +22 -22
- package/dist/Popover.d.ts +6 -7
- package/dist/Popover.js +60 -71
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -1
- package/dist/RadioButtonGroup.js +1 -1
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup.js +141 -134
- package/dist/Select.js +97 -895
- package/dist/Separator.d.ts +12 -0
- package/dist/Separator.js +24 -0
- package/dist/Skeleton.js +3 -3
- package/dist/Slider.d.ts +15 -3
- package/dist/Slider.js +464 -40
- package/dist/Switch/SwitchBase.js +1 -1
- package/dist/Switch.js +2 -2
- package/dist/Tabs/TabsBase.js +1 -1
- package/dist/Tabs.js +16 -16
- package/dist/Textarea.js +41 -42
- package/dist/Toggle.js +2 -2
- package/dist/ToggleGroup.js +1 -1
- package/dist/Tooltip/TooltipBase.js +29 -29
- package/dist/Tooltip.js +15 -15
- package/dist/Tray/TrayStoriesData.d.ts +39 -0
- package/dist/Tray/TrayStoriesData.js +438 -0
- package/dist/Tray.d.ts +28 -0
- package/dist/Tray.js +227 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Accordion/Accordion.d.ts +37 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +12 -2
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +29 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/dist/components/ButtonGroup/ButtonGroupButton.d.ts +13 -0
- package/dist/components/ButtonGroup/ButtonGroupButton.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Dialog/DialogBase.d.ts +1 -1
- package/dist/components/HoverCard/HoverCard.d.ts +29 -0
- package/dist/components/HoverCard/HoverCard.d.ts.map +1 -0
- package/dist/components/Icons/MessagesIcon.d.ts +3 -0
- package/dist/components/Icons/MessagesIcon.d.ts.map +1 -0
- package/dist/components/Icons/index.d.ts +1 -0
- package/dist/components/Icons/index.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.d.ts +16 -0
- package/dist/components/InputGroup/InputGroup.d.ts.map +1 -0
- package/dist/components/InputOTP/InputOTP.d.ts +0 -2
- package/dist/components/InputOTP/InputOTP.d.ts.map +1 -1
- package/dist/components/Label/Label.d.ts +3 -7
- package/dist/components/Label/Label.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +6 -7
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/Separator/Separator.d.ts +12 -0
- package/dist/components/Separator/Separator.d.ts.map +1 -0
- package/dist/components/Slider/Slider.d.ts +15 -3
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Tray/Tray.d.ts +28 -0
- package/dist/components/Tray/Tray.d.ts.map +1 -0
- package/dist/components/Tray/TrayStoriesData.d.ts +39 -0
- package/dist/components/Tray/TrayStoriesData.d.ts.map +1 -0
- package/dist/features/AuthCard/ForgotPasswordEmailForm.js +4 -3
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +9 -9
- package/dist/features/AuthCard/PasswordInput.js +78 -9
- package/dist/features/AuthCard/SignInForm.js +8 -7
- package/dist/features/AuthCard/SignUpForm.js +8 -7
- package/dist/features/AuthCard.js +2 -2
- package/dist/features/LabelingTools.js +7 -6
- package/dist/features/SensorMetadata.js +3 -2
- package/dist/features/SettingsPopover.js +3 -2
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/{index-CBwRmAsQ.js → index-6Abv_Flm.js} +1 -1
- package/dist/{index-DUK1rxhf.js → index-B-GQStVW.js} +6 -5
- package/dist/index-B2oBi8ng.js +142 -0
- package/dist/index-BIpuW_o8.js +146 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-BhufZRa2.js +232 -0
- package/dist/index-CAKA12cC.js +1265 -0
- package/dist/{index-Cfyte2YO.js → index-CGALWSq_.js} +1 -1
- package/dist/index-CVSxKOPp.js +13 -0
- package/dist/index-CevVJ05e.js +822 -0
- package/dist/{index-CRBC94ik.js → index-D29mdTf5.js} +1 -1
- package/dist/{index-FeGk8zep.js → index-NzygPVvJ.js} +10 -9
- package/dist/index-UEFPWH8U.js +54 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/{index-Cb7rjMhE.js → index-y6Br5T4h.js} +6 -6
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/linear-cursor-small.png +0 -0
- package/dist/message-alert-matte-glass-gradient.webp +0 -0
- package/dist/primitives/button.d.ts +10 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +42 -0
- package/dist/primitives/input.d.ts +3 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +18 -0
- package/dist/primitives/select.d.ts +16 -0
- package/dist/primitives/select.d.ts.map +1 -0
- package/dist/primitives/select.js +196 -0
- package/dist/primitives/slot.d.ts.map +1 -1
- package/dist/primitives/slot.js +21 -20
- package/dist/primitives/textarea.d.ts +3 -0
- package/dist/primitives/textarea.d.ts.map +1 -0
- package/dist/primitives/textarea.js +16 -0
- package/dist/{proxy-DD79Ok6n.js → proxy-C9AqCss6.js} +1 -1
- package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
- package/dist/styles/main.css +1 -1
- package/dist/utils/formFieldUtils.js +1 -1
- package/dist/utils/twUtils.js +2728 -2
- package/package.json +13 -8
- package/dist/Accordion/AccordionBase.d.ts +0 -42
- package/dist/Accordion/AccordionBase.js +0 -225
- package/dist/Badge/BadgeBase.d.ts +0 -13
- package/dist/Badge/BadgeBase.js +0 -35
- package/dist/PasswordInput-ClY_hxuN.js +0 -261
- package/dist/components/Accordion/AccordionBase.d.ts +0 -42
- package/dist/components/Accordion/AccordionBase.d.ts.map +0 -1
- package/dist/components/Badge/BadgeBase.d.ts +0 -13
- package/dist/components/Badge/BadgeBase.d.ts.map +0 -1
- package/dist/index-CA7haECj.js +0 -248
- package/dist/index-CbXx14YO.js +0 -59
- package/dist/index-VXXKXen4.js +0 -15
- package/dist/index-cCg4yNa8.js +0 -132
- package/dist/primitives/label.d.ts +0 -5
- package/dist/primitives/label.d.ts.map +0 -1
- package/dist/primitives/label.js +0 -27
- package/dist/twUtils-CRiPKpXj.js +0 -2743
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type SeparatorProps = {
|
|
3
|
+
orientation?: 'horizontal' | 'vertical';
|
|
4
|
+
decorative?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
7
|
+
export declare const Separator: import('react').ForwardRefExoticComponent<{
|
|
8
|
+
orientation?: "horizontal" | "vertical";
|
|
9
|
+
decorative?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
} & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//# sourceMappingURL=Separator.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./styles/main.css";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
import { cn as p } from "./utils/twUtils.js";
|
|
5
|
+
import { forwardRef as l } from "react";
|
|
6
|
+
const n = l(
|
|
7
|
+
({ className: o, orientation: r = "horizontal", decorative: a = !0, ...t }, e) => /* @__PURE__ */ i(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
ref: e,
|
|
11
|
+
"data-slot": "separator",
|
|
12
|
+
"data-orientation": r,
|
|
13
|
+
role: a ? "none" : "separator",
|
|
14
|
+
"aria-hidden": a ? "true" : void 0,
|
|
15
|
+
"aria-orientation": a ? void 0 : r,
|
|
16
|
+
className: p("bg-border shrink-0", r === "horizontal" ? "h-px w-full" : "h-full w-px", o),
|
|
17
|
+
...t
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
n.displayName = "Separator";
|
|
22
|
+
export {
|
|
23
|
+
n as Separator
|
|
24
|
+
};
|
package/dist/Skeleton.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { cn as n } from "./utils/twUtils.js";
|
|
4
4
|
import "react";
|
|
5
|
-
function
|
|
5
|
+
function i({ className: t, ...e }) {
|
|
6
6
|
return /* @__PURE__ */ o("div", { "data-slot": "skeleton", className: n("bg-accent animate-pulse rounded-md", t), ...e });
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
i as Skeleton
|
|
10
10
|
};
|
package/dist/Slider.d.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import * as SliderBase from '@radix-ui/react-slider';
|
|
3
|
+
export type SliderProps = {
|
|
3
4
|
className?: string;
|
|
5
|
+
defaultValue?: number[];
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
max?: number;
|
|
8
|
+
min?: number;
|
|
9
|
+
minStepsBetweenThumbs?: number;
|
|
10
|
+
name?: string;
|
|
11
|
+
onValueChange?: (value: number[]) => void;
|
|
12
|
+
onValueCommit?: (value: number[]) => void;
|
|
13
|
+
orientation?: 'horizontal' | 'vertical';
|
|
14
|
+
step?: number;
|
|
15
|
+
value?: number[];
|
|
4
16
|
};
|
|
5
|
-
export declare const Slider: ({ className, defaultValue,
|
|
17
|
+
export declare const Slider: ({ className, defaultValue, disabled, max, min, minStepsBetweenThumbs, name, onValueChange, onValueCommit, orientation, step, value, ...props }: ComponentProps<typeof SliderBase.Root>) => import("react/jsx-runtime").JSX.Element;
|
|
6
18
|
//# sourceMappingURL=Slider.d.ts.map
|
package/dist/Slider.js
CHANGED
|
@@ -1,74 +1,498 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import "./styles/main.css";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { jsx as m, jsxs as j } from "react/jsx-runtime";
|
|
4
|
+
import * as c from "react";
|
|
5
|
+
import { useMemo as de } from "react";
|
|
6
|
+
import { c as X } from "./index-rKs9bXHr.js";
|
|
7
|
+
import { u as ue, c as fe, b as _, P as B, a as C } from "./index-BhufZRa2.js";
|
|
8
|
+
import { c as me, u as he } from "./index-UEFPWH8U.js";
|
|
9
|
+
import { u as Se } from "./index-BZPx6jYI.js";
|
|
10
|
+
import { u as pe } from "./index-y6Br5T4h.js";
|
|
11
|
+
import { cn as H } from "./utils/twUtils.js";
|
|
12
|
+
var G = ["PageUp", "PageDown"], W = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], q = {
|
|
13
|
+
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
14
|
+
"from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
|
|
15
|
+
"from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
16
|
+
"from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
|
|
17
|
+
}, M = "Slider", [L, ge, ve] = me(M), [J] = fe(M, [
|
|
18
|
+
ve
|
|
19
|
+
]), [be, T] = J(M), Q = c.forwardRef(
|
|
20
|
+
(e, t) => {
|
|
21
|
+
const {
|
|
22
|
+
name: o,
|
|
23
|
+
min: n = 0,
|
|
24
|
+
max: i = 100,
|
|
25
|
+
step: l = 1,
|
|
26
|
+
orientation: a = "horizontal",
|
|
27
|
+
disabled: s = !1,
|
|
28
|
+
minStepsBetweenThumbs: u = 0,
|
|
29
|
+
defaultValue: b = [n],
|
|
30
|
+
value: h,
|
|
31
|
+
onValueChange: r = () => {
|
|
32
|
+
},
|
|
33
|
+
onValueCommit: d = () => {
|
|
34
|
+
},
|
|
35
|
+
inverted: p = !1,
|
|
36
|
+
form: R,
|
|
37
|
+
...S
|
|
38
|
+
} = e, g = c.useRef(/* @__PURE__ */ new Set()), f = c.useRef(0), w = a === "horizontal" ? we : ye, [v = [], A] = ue({
|
|
39
|
+
prop: h,
|
|
40
|
+
defaultProp: b,
|
|
41
|
+
onChange: (y) => {
|
|
42
|
+
[...g.current][f.current]?.focus(), r(y);
|
|
43
|
+
}
|
|
44
|
+
}), k = c.useRef(v);
|
|
45
|
+
function z(y) {
|
|
46
|
+
const P = Ee(v, y);
|
|
47
|
+
K(y, P);
|
|
48
|
+
}
|
|
49
|
+
function le(y) {
|
|
50
|
+
K(y, f.current);
|
|
51
|
+
}
|
|
52
|
+
function ce() {
|
|
53
|
+
const y = k.current[f.current];
|
|
54
|
+
v[f.current] !== y && d(v);
|
|
55
|
+
}
|
|
56
|
+
function K(y, P, { commit: V } = { commit: !1 }) {
|
|
57
|
+
const Y = Ae(l), N = Ke(Math.round((y - n) / l) * l + n, Y), I = X(N, [n, i]);
|
|
58
|
+
A((E = []) => {
|
|
59
|
+
const x = xe(E, I, P);
|
|
60
|
+
if (Me(x, u * l)) {
|
|
61
|
+
f.current = x.indexOf(I);
|
|
62
|
+
const $ = String(x) !== String(E);
|
|
63
|
+
return $ && V && d(x), $ ? x : E;
|
|
64
|
+
} else
|
|
65
|
+
return E;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return /* @__PURE__ */ m(
|
|
69
|
+
be,
|
|
70
|
+
{
|
|
71
|
+
scope: e.__scopeSlider,
|
|
72
|
+
name: o,
|
|
73
|
+
disabled: s,
|
|
74
|
+
min: n,
|
|
75
|
+
max: i,
|
|
76
|
+
valueIndexToChangeRef: f,
|
|
77
|
+
thumbs: g.current,
|
|
78
|
+
values: v,
|
|
79
|
+
orientation: a,
|
|
80
|
+
form: R,
|
|
81
|
+
children: /* @__PURE__ */ m(L.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ m(L.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ m(
|
|
82
|
+
w,
|
|
83
|
+
{
|
|
84
|
+
"aria-disabled": s,
|
|
85
|
+
"data-disabled": s ? "" : void 0,
|
|
86
|
+
...S,
|
|
87
|
+
ref: t,
|
|
88
|
+
onPointerDown: _(S.onPointerDown, () => {
|
|
89
|
+
s || (k.current = v);
|
|
90
|
+
}),
|
|
91
|
+
min: n,
|
|
92
|
+
max: i,
|
|
93
|
+
inverted: p,
|
|
94
|
+
onSlideStart: s ? void 0 : z,
|
|
95
|
+
onSlideMove: s ? void 0 : le,
|
|
96
|
+
onSlideEnd: s ? void 0 : ce,
|
|
97
|
+
onHomeKeyDown: () => !s && K(n, 0, { commit: !0 }),
|
|
98
|
+
onEndKeyDown: () => !s && K(i, v.length - 1, { commit: !0 }),
|
|
99
|
+
onStepKeyDown: ({ event: y, direction: P }) => {
|
|
100
|
+
if (!s) {
|
|
101
|
+
const N = G.includes(y.key) || y.shiftKey && W.includes(y.key) ? 10 : 1, I = f.current, E = v[I], x = l * N * P;
|
|
102
|
+
K(E + x, I, { commit: !0 });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
) }) })
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
Q.displayName = M;
|
|
112
|
+
var [Z, ee] = J(M, {
|
|
113
|
+
startEdge: "left",
|
|
114
|
+
endEdge: "right",
|
|
115
|
+
size: "width",
|
|
116
|
+
direction: 1
|
|
117
|
+
}), we = c.forwardRef(
|
|
118
|
+
(e, t) => {
|
|
119
|
+
const {
|
|
120
|
+
min: o,
|
|
121
|
+
max: n,
|
|
122
|
+
dir: i,
|
|
123
|
+
inverted: l,
|
|
124
|
+
onSlideStart: a,
|
|
125
|
+
onSlideMove: s,
|
|
126
|
+
onSlideEnd: u,
|
|
127
|
+
onStepKeyDown: b,
|
|
128
|
+
...h
|
|
129
|
+
} = e, [r, d] = c.useState(null), p = C(t, (w) => d(w)), R = c.useRef(void 0), S = he(i), g = S === "ltr", f = g && !l || !g && l;
|
|
130
|
+
function D(w) {
|
|
131
|
+
const v = R.current || r.getBoundingClientRect(), A = [0, v.width], z = F(A, f ? [o, n] : [n, o]);
|
|
132
|
+
return R.current = v, z(w - v.left);
|
|
133
|
+
}
|
|
134
|
+
return /* @__PURE__ */ m(
|
|
135
|
+
Z,
|
|
136
|
+
{
|
|
137
|
+
scope: e.__scopeSlider,
|
|
138
|
+
startEdge: f ? "left" : "right",
|
|
139
|
+
endEdge: f ? "right" : "left",
|
|
140
|
+
direction: f ? 1 : -1,
|
|
141
|
+
size: "width",
|
|
142
|
+
children: /* @__PURE__ */ m(
|
|
143
|
+
te,
|
|
144
|
+
{
|
|
145
|
+
dir: S,
|
|
146
|
+
"data-orientation": "horizontal",
|
|
147
|
+
...h,
|
|
148
|
+
ref: p,
|
|
149
|
+
style: {
|
|
150
|
+
...h.style,
|
|
151
|
+
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
152
|
+
},
|
|
153
|
+
onSlideStart: (w) => {
|
|
154
|
+
const v = D(w.clientX);
|
|
155
|
+
a?.(v);
|
|
156
|
+
},
|
|
157
|
+
onSlideMove: (w) => {
|
|
158
|
+
const v = D(w.clientX);
|
|
159
|
+
s?.(v);
|
|
160
|
+
},
|
|
161
|
+
onSlideEnd: () => {
|
|
162
|
+
R.current = void 0, u?.();
|
|
163
|
+
},
|
|
164
|
+
onStepKeyDown: (w) => {
|
|
165
|
+
const A = q[f ? "from-left" : "from-right"].includes(w.key);
|
|
166
|
+
b?.({ event: w, direction: A ? -1 : 1 });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
), ye = c.forwardRef(
|
|
174
|
+
(e, t) => {
|
|
175
|
+
const {
|
|
176
|
+
min: o,
|
|
177
|
+
max: n,
|
|
178
|
+
inverted: i,
|
|
179
|
+
onSlideStart: l,
|
|
180
|
+
onSlideMove: a,
|
|
181
|
+
onSlideEnd: s,
|
|
182
|
+
onStepKeyDown: u,
|
|
183
|
+
...b
|
|
184
|
+
} = e, h = c.useRef(null), r = C(t, h), d = c.useRef(void 0), p = !i;
|
|
185
|
+
function R(S) {
|
|
186
|
+
const g = d.current || h.current.getBoundingClientRect(), f = [0, g.height], w = F(f, p ? [n, o] : [o, n]);
|
|
187
|
+
return d.current = g, w(S - g.top);
|
|
188
|
+
}
|
|
189
|
+
return /* @__PURE__ */ m(
|
|
190
|
+
Z,
|
|
191
|
+
{
|
|
192
|
+
scope: e.__scopeSlider,
|
|
193
|
+
startEdge: p ? "bottom" : "top",
|
|
194
|
+
endEdge: p ? "top" : "bottom",
|
|
195
|
+
size: "height",
|
|
196
|
+
direction: p ? 1 : -1,
|
|
197
|
+
children: /* @__PURE__ */ m(
|
|
198
|
+
te,
|
|
199
|
+
{
|
|
200
|
+
"data-orientation": "vertical",
|
|
201
|
+
...b,
|
|
202
|
+
ref: r,
|
|
203
|
+
style: {
|
|
204
|
+
...b.style,
|
|
205
|
+
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
206
|
+
},
|
|
207
|
+
onSlideStart: (S) => {
|
|
208
|
+
const g = R(S.clientY);
|
|
209
|
+
l?.(g);
|
|
210
|
+
},
|
|
211
|
+
onSlideMove: (S) => {
|
|
212
|
+
const g = R(S.clientY);
|
|
213
|
+
a?.(g);
|
|
214
|
+
},
|
|
215
|
+
onSlideEnd: () => {
|
|
216
|
+
d.current = void 0, s?.();
|
|
217
|
+
},
|
|
218
|
+
onStepKeyDown: (S) => {
|
|
219
|
+
const f = q[p ? "from-bottom" : "from-top"].includes(S.key);
|
|
220
|
+
u?.({ event: S, direction: f ? -1 : 1 });
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
), te = c.forwardRef(
|
|
228
|
+
(e, t) => {
|
|
229
|
+
const {
|
|
230
|
+
__scopeSlider: o,
|
|
231
|
+
onSlideStart: n,
|
|
232
|
+
onSlideMove: i,
|
|
233
|
+
onSlideEnd: l,
|
|
234
|
+
onHomeKeyDown: a,
|
|
235
|
+
onEndKeyDown: s,
|
|
236
|
+
onStepKeyDown: u,
|
|
237
|
+
...b
|
|
238
|
+
} = e, h = T(M, o);
|
|
239
|
+
return /* @__PURE__ */ m(
|
|
240
|
+
B.span,
|
|
241
|
+
{
|
|
242
|
+
...b,
|
|
243
|
+
ref: t,
|
|
244
|
+
onKeyDown: _(e.onKeyDown, (r) => {
|
|
245
|
+
r.key === "Home" ? (a(r), r.preventDefault()) : r.key === "End" ? (s(r), r.preventDefault()) : G.concat(W).includes(r.key) && (u(r), r.preventDefault());
|
|
246
|
+
}),
|
|
247
|
+
onPointerDown: _(e.onPointerDown, (r) => {
|
|
248
|
+
const d = r.target;
|
|
249
|
+
d.setPointerCapture(r.pointerId), r.preventDefault(), h.thumbs.has(d) ? d.focus() : n(r);
|
|
250
|
+
}),
|
|
251
|
+
onPointerMove: _(e.onPointerMove, (r) => {
|
|
252
|
+
r.target.hasPointerCapture(r.pointerId) && i(r);
|
|
253
|
+
}),
|
|
254
|
+
onPointerUp: _(e.onPointerUp, (r) => {
|
|
255
|
+
const d = r.target;
|
|
256
|
+
d.hasPointerCapture(r.pointerId) && (d.releasePointerCapture(r.pointerId), l(r));
|
|
257
|
+
})
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
), ne = "SliderTrack", oe = c.forwardRef(
|
|
262
|
+
(e, t) => {
|
|
263
|
+
const { __scopeSlider: o, ...n } = e, i = T(ne, o);
|
|
264
|
+
return /* @__PURE__ */ m(
|
|
265
|
+
B.span,
|
|
266
|
+
{
|
|
267
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
268
|
+
"data-orientation": i.orientation,
|
|
269
|
+
...n,
|
|
270
|
+
ref: t
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
oe.displayName = ne;
|
|
276
|
+
var O = "SliderRange", re = c.forwardRef(
|
|
277
|
+
(e, t) => {
|
|
278
|
+
const { __scopeSlider: o, ...n } = e, i = T(O, o), l = ee(O, o), a = c.useRef(null), s = C(t, a), u = i.values.length, b = i.values.map(
|
|
279
|
+
(d) => se(d, i.min, i.max)
|
|
280
|
+
), h = u > 1 ? Math.min(...b) : 0, r = 100 - Math.max(...b);
|
|
281
|
+
return /* @__PURE__ */ m(
|
|
282
|
+
B.span,
|
|
283
|
+
{
|
|
284
|
+
"data-orientation": i.orientation,
|
|
285
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
286
|
+
...n,
|
|
287
|
+
ref: s,
|
|
288
|
+
style: {
|
|
289
|
+
...e.style,
|
|
290
|
+
[l.startEdge]: h + "%",
|
|
291
|
+
[l.endEdge]: r + "%"
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
re.displayName = O;
|
|
298
|
+
var U = "SliderThumb", ie = c.forwardRef(
|
|
299
|
+
(e, t) => {
|
|
300
|
+
const o = ge(e.__scopeSlider), [n, i] = c.useState(null), l = C(t, (s) => i(s)), a = c.useMemo(
|
|
301
|
+
() => n ? o().findIndex((s) => s.ref.current === n) : -1,
|
|
302
|
+
[o, n]
|
|
303
|
+
);
|
|
304
|
+
return /* @__PURE__ */ m(Re, { ...e, ref: l, index: a });
|
|
305
|
+
}
|
|
306
|
+
), Re = c.forwardRef(
|
|
307
|
+
(e, t) => {
|
|
308
|
+
const { __scopeSlider: o, index: n, name: i, ...l } = e, a = T(U, o), s = ee(U, o), [u, b] = c.useState(null), h = C(t, (D) => b(D)), r = u ? a.form || !!u.closest("form") : !0, d = pe(u), p = a.values[n], R = p === void 0 ? 0 : se(p, a.min, a.max), S = De(n, a.values.length), g = d?.[s.size], f = g ? _e(g, R, s.direction) : 0;
|
|
309
|
+
return c.useEffect(() => {
|
|
310
|
+
if (u)
|
|
311
|
+
return a.thumbs.add(u), () => {
|
|
312
|
+
a.thumbs.delete(u);
|
|
313
|
+
};
|
|
314
|
+
}, [u, a.thumbs]), /* @__PURE__ */ j(
|
|
315
|
+
"span",
|
|
316
|
+
{
|
|
317
|
+
style: {
|
|
318
|
+
transform: "var(--radix-slider-thumb-transform)",
|
|
319
|
+
position: "absolute",
|
|
320
|
+
[s.startEdge]: `calc(${R}% + ${f}px)`
|
|
321
|
+
},
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ m(L.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ m(
|
|
324
|
+
B.span,
|
|
325
|
+
{
|
|
326
|
+
role: "slider",
|
|
327
|
+
"aria-label": e["aria-label"] || S,
|
|
328
|
+
"aria-valuemin": a.min,
|
|
329
|
+
"aria-valuenow": p,
|
|
330
|
+
"aria-valuemax": a.max,
|
|
331
|
+
"aria-orientation": a.orientation,
|
|
332
|
+
"data-orientation": a.orientation,
|
|
333
|
+
"data-disabled": a.disabled ? "" : void 0,
|
|
334
|
+
tabIndex: a.disabled ? void 0 : 0,
|
|
335
|
+
...l,
|
|
336
|
+
ref: h,
|
|
337
|
+
style: p === void 0 ? { display: "none" } : e.style,
|
|
338
|
+
onFocus: _(e.onFocus, () => {
|
|
339
|
+
a.valueIndexToChangeRef.current = n;
|
|
340
|
+
})
|
|
341
|
+
}
|
|
342
|
+
) }),
|
|
343
|
+
r && /* @__PURE__ */ m(
|
|
344
|
+
ae,
|
|
345
|
+
{
|
|
346
|
+
name: i ?? (a.name ? a.name + (a.values.length > 1 ? "[]" : "") : void 0),
|
|
347
|
+
form: a.form,
|
|
348
|
+
value: p
|
|
349
|
+
},
|
|
350
|
+
n
|
|
351
|
+
)
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
ie.displayName = U;
|
|
358
|
+
var Pe = "RadioBubbleInput", ae = c.forwardRef(
|
|
359
|
+
({ __scopeSlider: e, value: t, ...o }, n) => {
|
|
360
|
+
const i = c.useRef(null), l = C(i, n), a = Se(t);
|
|
361
|
+
return c.useEffect(() => {
|
|
362
|
+
const s = i.current;
|
|
363
|
+
if (!s) return;
|
|
364
|
+
const u = window.HTMLInputElement.prototype, h = Object.getOwnPropertyDescriptor(u, "value").set;
|
|
365
|
+
if (a !== t && h) {
|
|
366
|
+
const r = new Event("input", { bubbles: !0 });
|
|
367
|
+
h.call(s, t), s.dispatchEvent(r);
|
|
368
|
+
}
|
|
369
|
+
}, [a, t]), /* @__PURE__ */ m(
|
|
370
|
+
B.input,
|
|
371
|
+
{
|
|
372
|
+
style: { display: "none" },
|
|
373
|
+
...o,
|
|
374
|
+
ref: l,
|
|
375
|
+
defaultValue: t
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
ae.displayName = Pe;
|
|
381
|
+
function xe(e = [], t, o) {
|
|
382
|
+
const n = [...e];
|
|
383
|
+
return n[o] = t, n.sort((i, l) => i - l);
|
|
384
|
+
}
|
|
385
|
+
function se(e, t, o) {
|
|
386
|
+
const l = 100 / (o - t) * (e - t);
|
|
387
|
+
return X(l, [0, 100]);
|
|
388
|
+
}
|
|
389
|
+
function De(e, t) {
|
|
390
|
+
return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
|
|
391
|
+
}
|
|
392
|
+
function Ee(e, t) {
|
|
393
|
+
if (e.length === 1) return 0;
|
|
394
|
+
const o = e.map((i) => Math.abs(i - t)), n = Math.min(...o);
|
|
395
|
+
return o.indexOf(n);
|
|
396
|
+
}
|
|
397
|
+
function _e(e, t, o) {
|
|
398
|
+
const n = e / 2, l = F([0, 50], [0, n]);
|
|
399
|
+
return (n - l(t) * o) * o;
|
|
400
|
+
}
|
|
401
|
+
function Ce(e) {
|
|
402
|
+
return e.slice(0, -1).map((t, o) => e[o + 1] - t);
|
|
403
|
+
}
|
|
404
|
+
function Me(e, t) {
|
|
405
|
+
if (t > 0) {
|
|
406
|
+
const o = Ce(e);
|
|
407
|
+
return Math.min(...o) >= t;
|
|
408
|
+
}
|
|
409
|
+
return !0;
|
|
410
|
+
}
|
|
411
|
+
function F(e, t) {
|
|
412
|
+
return (o) => {
|
|
413
|
+
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
414
|
+
const n = (t[1] - t[0]) / (e[1] - e[0]);
|
|
415
|
+
return t[0] + n * (o - e[0]);
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
function Ae(e) {
|
|
419
|
+
return (String(e).split(".")[1] || "").length;
|
|
420
|
+
}
|
|
421
|
+
function Ke(e, t) {
|
|
422
|
+
const o = Math.pow(10, t);
|
|
423
|
+
return Math.round(e * o) / o;
|
|
424
|
+
}
|
|
425
|
+
var Ie = Q, Be = oe, Te = re, ke = ie;
|
|
426
|
+
const Ye = ({
|
|
427
|
+
className: e,
|
|
428
|
+
defaultValue: t,
|
|
429
|
+
disabled: o,
|
|
430
|
+
max: n = 100,
|
|
9
431
|
min: i = 0,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
minStepsBetweenThumbs: d = 1,
|
|
432
|
+
minStepsBetweenThumbs: l = 1,
|
|
433
|
+
name: a,
|
|
13
434
|
onValueChange: s,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
...
|
|
435
|
+
onValueCommit: u,
|
|
436
|
+
orientation: b = "horizontal",
|
|
437
|
+
step: h = 1,
|
|
438
|
+
value: r,
|
|
439
|
+
...d
|
|
19
440
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
441
|
+
const p = de(
|
|
442
|
+
() => Array.isArray(r) ? r : Array.isArray(t) ? t : [i, n],
|
|
443
|
+
[r, t, i, n]
|
|
444
|
+
);
|
|
445
|
+
return /* @__PURE__ */ j(
|
|
446
|
+
Ie,
|
|
23
447
|
{
|
|
24
448
|
"data-slot": "slider",
|
|
25
|
-
defaultValue:
|
|
449
|
+
defaultValue: t,
|
|
26
450
|
value: r,
|
|
27
451
|
min: i,
|
|
28
|
-
max:
|
|
29
|
-
step:
|
|
30
|
-
minStepsBetweenThumbs:
|
|
452
|
+
max: n,
|
|
453
|
+
step: h,
|
|
454
|
+
minStepsBetweenThumbs: l,
|
|
31
455
|
onValueChange: s,
|
|
32
|
-
orientation:
|
|
33
|
-
onValueCommit:
|
|
34
|
-
disabled:
|
|
35
|
-
name:
|
|
36
|
-
className:
|
|
456
|
+
orientation: b,
|
|
457
|
+
onValueCommit: u,
|
|
458
|
+
disabled: o,
|
|
459
|
+
name: a,
|
|
460
|
+
className: H(
|
|
37
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",
|
|
38
|
-
|
|
462
|
+
e
|
|
39
463
|
),
|
|
40
|
-
...
|
|
464
|
+
...d,
|
|
41
465
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
466
|
+
/* @__PURE__ */ m(
|
|
467
|
+
Be,
|
|
44
468
|
{
|
|
45
469
|
"data-slot": "slider-track",
|
|
46
|
-
className:
|
|
470
|
+
className: H(
|
|
47
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"
|
|
48
472
|
),
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
-
|
|
473
|
+
children: /* @__PURE__ */ m(
|
|
474
|
+
Te,
|
|
51
475
|
{
|
|
52
476
|
"data-slot": "slider-range",
|
|
53
|
-
className:
|
|
477
|
+
className: H(
|
|
54
478
|
"bg-slider-range absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
55
479
|
)
|
|
56
480
|
}
|
|
57
481
|
)
|
|
58
482
|
}
|
|
59
483
|
),
|
|
60
|
-
Array.from({ length:
|
|
61
|
-
|
|
484
|
+
Array.from({ length: p.length }, (R, S) => /* @__PURE__ */ m(
|
|
485
|
+
ke,
|
|
62
486
|
{
|
|
63
487
|
"data-slot": "slider-thumb",
|
|
64
|
-
className: "border-slider-thumb-border bg-slider-thumb-bg ring-slider-thumb-ring/50 block size-
|
|
488
|
+
className: "border-slider-thumb-border bg-slider-thumb-bg ring-slider-thumb-ring/50 block size-5 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
|
65
489
|
},
|
|
66
|
-
|
|
490
|
+
S
|
|
67
491
|
))
|
|
68
492
|
]
|
|
69
493
|
}
|
|
70
494
|
);
|
|
71
495
|
};
|
|
72
496
|
export {
|
|
73
|
-
|
|
497
|
+
Ye as Slider
|
|
74
498
|
};
|
|
@@ -3,7 +3,7 @@ import "../styles/main.css";
|
|
|
3
3
|
import { jsx as h, jsxs as K } from "react/jsx-runtime";
|
|
4
4
|
import { useControllableState as M } from "../hooks/useControllableState.js";
|
|
5
5
|
import { Slot as g } from "../primitives/slot.js";
|
|
6
|
-
import {
|
|
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
8
|
const C = O(null), A = y(
|
|
9
9
|
({
|
package/dist/Switch.js
CHANGED
|
@@ -3,7 +3,7 @@ import "./styles/main.css";
|
|
|
3
3
|
import { jsxs as w, jsx as t } from "react/jsx-runtime";
|
|
4
4
|
import { Switch as p, SwitchThumb as k } from "./Switch/SwitchBase.js";
|
|
5
5
|
import { Label as r } from "./Label.js";
|
|
6
|
-
import { c } from "./twUtils
|
|
6
|
+
import { cn as c } from "./utils/twUtils.js";
|
|
7
7
|
import { forwardRef as x } from "react";
|
|
8
8
|
const v = x(
|
|
9
9
|
({
|
|
@@ -28,7 +28,7 @@ const v = x(
|
|
|
28
28
|
{
|
|
29
29
|
"data-testid": "switch-root",
|
|
30
30
|
className: c(
|
|
31
|
-
n ? "peer data-[state=checked]:bg-switch-bg--checked data-[state=unchecked]:bg-switch-bg inline-flex h-6 w-10 shrink-0 items-center rounded-sm border-2 border-transparent transition-all outline-none focus-visible:ring-[3px] focus-visible:ring-black disabled:cursor-not-allowed disabled:opacity-50 [&_span]:rounded-[4px]" : "focus-visible:ring-ring focus-visible:ring-offset-background peer data-[state=checked]:bg-switch-bg--checked data-[state=unchecked]:bg-switch-bg inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-2xs transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-
|
|
31
|
+
n ? "peer data-[state=checked]:bg-switch-bg--checked data-[state=unchecked]:bg-switch-bg inline-flex h-6 w-10 shrink-0 items-center rounded-sm border-2 border-transparent transition-all outline-none focus-visible:ring-[3px] focus-visible:ring-black disabled:cursor-not-allowed disabled:opacity-50 [&_span]:rounded-[4px]" : "focus-visible:ring-ring focus-visible:ring-offset-background peer data-[state=checked]:bg-switch-bg--checked data-[state=unchecked]:bg-switch-bg inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-2xs transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
32
32
|
o
|
|
33
33
|
),
|
|
34
34
|
disabled: d,
|
package/dist/Tabs/TabsBase.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "../styles/main.css";
|
|
3
3
|
import { jsx as x, jsxs as R } from "react/jsx-runtime";
|
|
4
4
|
import { generateId as $, prefersReducedMotion as _, debounce as L, getIndicatorPosition as S, calculateIndicatorStyle as K } from "./tabsUtils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { cn as y } from "../utils/twUtils.js";
|
|
6
6
|
import { createContext as M, forwardRef as z, useState as D, useId as N, useCallback as p, useRef as k, useEffect as O, useContext as P } from "react";
|
|
7
7
|
const E = M(null), C = (I = "Tabs") => {
|
|
8
8
|
const u = P(E);
|