@spear-ai/spectral 1.9.0 → 1.10.0
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/README.md +6 -5
- package/dist/.js +112 -239
- package/dist/Accordion-CDXdSAST.js +363 -0
- package/dist/Accordion.js +3 -498
- package/dist/Alert/AlertBase.js +69 -152
- package/dist/Alert.js +58 -106
- package/dist/AnimatePresence-D-9jXfgI.js +178 -0
- package/dist/App.js +6 -6
- package/dist/Avatar.js +83 -65
- package/dist/Badge.d.ts +1 -3
- package/dist/Badge.js +21 -25
- package/dist/Button.js +102 -178
- package/dist/ButtonGroup/ButtonGroupButton.js +38 -40
- package/dist/ButtonGroup.js +55 -59
- package/dist/ButtonIcon.js +58 -134
- package/dist/Calendar-s4lyijkn.js +3109 -0
- package/dist/Checkbox/CheckboxBase.js +94 -126
- package/dist/Checkbox.d.ts +1 -1
- package/dist/Checkbox.js +40 -105
- package/dist/Combobox/ComboboxBase.js +2 -79
- package/dist/Combobox.js +106 -172
- package/dist/ComboboxBase-D8Nf4xC-.js +491 -0
- package/dist/ControlGroup/ControlGroupSelect.d.ts +1 -1
- package/dist/ControlGroup/ControlGroupSelect.js +85 -101
- package/dist/ControlGroup.js +45 -48
- package/dist/DataCard/Card.js +37 -12
- package/dist/DataCard.d.ts +1 -1
- package/dist/DataCard.js +36 -16
- package/dist/DateTimePicker/Calendar.js +2 -2967
- package/dist/DateTimePicker/DateTimeDisplayInput.d.ts +1 -1
- package/dist/DateTimePicker/DateTimeDisplayInput.js +379 -274
- package/dist/DateTimePicker/DateTimeInput.d.ts +5 -3
- package/dist/DateTimePicker/DateTimeInput.js +133 -88
- package/dist/DateTimePicker/DateTimeUtils.js +2 -2193
- package/dist/DateTimePicker/TimePeriodSelect.d.ts +1 -1
- package/dist/DateTimePicker/TimePeriodSelect.js +45 -20
- package/dist/DateTimePicker/TimePicker.d.ts +1 -1
- package/dist/DateTimePicker/TimePicker.js +76 -60
- package/dist/DateTimePicker.d.ts +2 -2
- package/dist/DateTimePicker.js +87 -205
- package/dist/DateTimeUtils-DVvG6H-p.js +2098 -0
- package/dist/Dialog.js +74 -74
- package/dist/Drawer.js +67 -37
- package/dist/HoverCard-CYDsIiVK.js +201 -0
- package/dist/HoverCard.d.ts +1 -1
- package/dist/HoverCard.js +2 -218
- package/dist/Icons/AnalyzeIcon.js +50 -57
- package/dist/Icons/AnnotationsIcon.js +20 -15
- package/dist/Icons/ApprovedIcon.js +26 -18
- package/dist/Icons/ArrowDownIcon.js +20 -6
- package/dist/Icons/ArrowUpIcon.js +20 -6
- package/dist/Icons/BoxToolIcon.js +17 -12
- package/dist/Icons/CalendarIcon.js +43 -20
- package/dist/Icons/CheckCircleIcon.js +26 -10
- package/dist/Icons/CheckSquareIcon.js +26 -10
- package/dist/Icons/CheckmarkIcon.js +22 -9
- package/dist/Icons/ChevronDownIcon.js +22 -9
- package/dist/Icons/ChevronUpIcon.js +22 -9
- package/dist/Icons/ClockIcon.js +26 -18
- package/dist/Icons/CloseCircleIcon.js +26 -10
- package/dist/Icons/CloseIcon.js +18 -9
- package/dist/Icons/DashboardIcon.js +36 -10
- package/dist/Icons/DatabaseIcon.js +36 -19
- package/dist/Icons/DeleteIcon.js +36 -19
- package/dist/Icons/DurationIcon.js +57 -22
- package/dist/Icons/EditIcon.js +26 -27
- package/dist/Icons/EmailIcon.js +26 -10
- package/dist/Icons/EraserIcon.js +41 -25
- package/dist/Icons/ErrorIcon.js +27 -11
- package/dist/Icons/EyeClosedIcon.js +29 -13
- package/dist/Icons/EyeClosedIcon2.js +27 -11
- package/dist/Icons/EyeOpenIcon.js +22 -9
- package/dist/Icons/FileDownloadIcon.js +43 -20
- package/dist/Icons/GoToFirstIcon.js +26 -9
- package/dist/Icons/GoToLastIcon.js +26 -9
- package/dist/Icons/HarmonicCursorsIcon.js +23 -9
- package/dist/Icons/IconBase.d.ts +3 -3
- package/dist/Icons/IconBase.js +49 -23
- package/dist/Icons/InfoIcon.js +36 -10
- package/dist/Icons/KeyboardIcon.js +26 -27
- package/dist/Icons/LabelIcon.js +19 -14
- package/dist/Icons/LassoIcon.js +36 -28
- package/dist/Icons/LineToolIcon.js +48 -39
- package/dist/Icons/LiveViewIcon.js +50 -12
- package/dist/Icons/LoaderIcon.js +67 -27
- package/dist/Icons/LocationIcon.js +26 -27
- package/dist/Icons/LogoutIcon.js +20 -15
- package/dist/Icons/MeasureIcon.js +78 -25
- package/dist/Icons/MessagesIcon.js +33 -18
- package/dist/Icons/MetadataIcon.js +20 -15
- package/dist/Icons/MinusIcon.d.ts +1 -1
- package/dist/Icons/MinusIcon.js +18 -6
- package/dist/Icons/OntologyIcon.js +87 -71
- package/dist/Icons/PanelIconClose.js +28 -10
- package/dist/Icons/PanelIconOpen.js +28 -10
- package/dist/Icons/PlayIcon.js +20 -6
- package/dist/Icons/PlusIcon.js +20 -14
- package/dist/Icons/PolygonIcon.js +50 -39
- package/dist/Icons/ProgressCheckIcon.d.ts +5 -0
- package/dist/Icons/ProgressCheckIcon.js +58 -0
- package/dist/Icons/ResetIcon.js +17 -12
- package/dist/Icons/ReviewedIcon.js +36 -19
- package/dist/Icons/ScissorsIcon.js +22 -17
- package/dist/Icons/SearchIcon.js +26 -9
- package/dist/Icons/SettingsIcon.js +26 -27
- package/dist/Icons/SortAscendingIcon.js +50 -12
- package/dist/Icons/SortAtoZIcon.js +50 -12
- package/dist/Icons/SortDescendingIcon.js +50 -12
- package/dist/Icons/SortZtoAIcon.js +50 -12
- package/dist/Icons/StackIcon.js +26 -9
- package/dist/Icons/StarIcon.js +20 -6
- package/dist/Icons/TrashIcon.js +17 -12
- package/dist/Icons/UndoIcon.js +20 -15
- package/dist/Icons/User2Icon.js +26 -10
- package/dist/Icons/UserIcon.js +19 -14
- package/dist/Icons/WarningIcon.js +19 -14
- package/dist/Icons/ZoomAllIcon.js +71 -15
- package/dist/Icons/ZoomXIcon.js +36 -10
- package/dist/Icons/ZoomYIcon.js +36 -10
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons.js +68 -136
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +66 -36
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +66 -36
- package/dist/IconsAnimated.js +3 -6
- package/dist/Input/InputUtils.js +51 -52
- package/dist/Input.js +132 -185
- package/dist/InputOTP-XUWW9xcI.js +461 -0
- package/dist/InputOTP.js +2 -382
- package/dist/Kbd.d.ts +1 -1
- package/dist/Kbd.js +182 -86
- package/dist/Label.js +12 -14
- package/dist/MultiSelect/MultiSelectBase.js +331 -403
- package/dist/MultiSelect.d.ts +1 -1
- package/dist/MultiSelect.js +23 -23
- package/dist/Popover.js +28 -32
- package/dist/RadioButton.d.ts +17 -0
- package/dist/RadioButton.js +33 -0
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +3 -1
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +49 -46
- package/dist/RadioButtonGroup.d.ts +1 -1
- package/dist/RadioButtonGroup.js +11 -8
- package/dist/RadioGroup-w_q6RGEK.js +447 -0
- package/dist/RadioGroup.js +2 -505
- package/dist/Select.js +163 -186
- package/dist/Separator.js +16 -19
- package/dist/Skeleton.js +10 -6
- package/dist/Slider-BzzZT3Zm.js +490 -0
- package/dist/Slider.js +2 -562
- package/dist/SpectralProvider.js +8 -5
- package/dist/Switch/SwitchBase.js +91 -95
- package/dist/Switch-CVzRJ-0n.js +126 -0
- package/dist/Switch.d.ts +1 -1
- package/dist/Switch.js +2 -134
- package/dist/Tabs/TabsBase.js +242 -250
- package/dist/Tabs/tabsUtils.js +65 -73
- package/dist/Tabs.d.ts +1 -1
- package/dist/Tabs.js +73 -103
- package/dist/Textarea/TextareaUtils.js +35 -46
- package/dist/Textarea.js +83 -160
- package/dist/Toast-9zqXxKKO.js +711 -0
- package/dist/Toast.js +2 -885
- package/dist/Toggle/ToggleBase.js +46 -56
- package/dist/Toggle.d.ts +1 -1
- package/dist/Toggle.js +52 -62
- package/dist/ToggleGroup/ToggleGroupBase.js +128 -104
- package/dist/ToggleGroup.d.ts +1 -1
- package/dist/ToggleGroup.js +52 -63
- package/dist/Tooltip-D1K8kY1y.js +389 -0
- package/dist/Tooltip.js +2 -365
- package/dist/Tray.js +174 -217
- package/dist/chunk-h9knIhTc.js +20 -0
- package/dist/clsx-jM1GlMvB.js +16 -0
- package/dist/dist-3Af8168y.js +913 -0
- package/dist/dist-7HRQ5IKN.js +249 -0
- package/dist/dist-B2k1iWFp.js +129 -0
- package/dist/dist-B4FgboI8.js +122 -0
- package/dist/dist-B4g6zpUF.js +33 -0
- package/dist/dist-B9tup-4O.js +216 -0
- package/dist/dist-BK1K0g9W.js +29 -0
- package/dist/dist-Bfjk-jx9.js +28 -0
- package/dist/dist-Bft31cJh.js +65 -0
- package/dist/dist-BtdmHAzK.js +190 -0
- package/dist/dist-C0Hifjgh.js +1287 -0
- package/dist/dist-CGzgmYB9.js +68 -0
- package/dist/dist-ClmepHp4.js +10 -0
- package/dist/dist-D8Wb_MX9.js +6 -0
- package/dist/dist-Dtvmk11N.js +12 -0
- package/dist/dist-fW81qjVl.js +677 -0
- package/dist/dist-s1uWaZYZ.js +11 -0
- package/dist/es2015-YHaMV-St.js +701 -0
- package/dist/hooks/useAccordionAutoScroll.js +66 -67
- package/dist/hooks/useControllableState.js +14 -13
- package/dist/hooks/useTheme.js +21 -17
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/main.js +18954 -27224
- package/dist/primitives/button.js +39 -41
- package/dist/primitives/input-group.js +57 -73
- package/dist/primitives/input.js +11 -20
- package/dist/primitives/popover.d.ts.map +1 -1
- package/dist/primitives/popover.js +34 -25
- package/dist/primitives/select.js +70 -138
- package/dist/primitives/slot.js +32 -31
- package/dist/primitives/textarea.js +10 -16
- package/dist/proxy-Dn10Pl_g.js +4920 -0
- package/dist/styles/main.css +2 -1
- package/dist/styles/spectral.css +1 -1
- package/dist/twUtils-VNWgstKL.js +1673 -0
- package/dist/use-animation-CBUDycyW.js +57 -0
- package/dist/utils/constants.js +4 -4
- package/dist/utils/formFieldUtils.js +136 -148
- package/dist/utils/sharedUtils.js +26 -7
- package/dist/utils/twUtils.js +2 -2919
- package/package.json +24 -28
- package/dist/ComboboxBase-CxNxYtdT.js +0 -408
- package/dist/clsx-OuTLNxxd.js +0 -16
- package/dist/index-0ioNhtNM.js +0 -10
- package/dist/index-6oYKCvIn.js +0 -677
- package/dist/index-BFOf48AQ.js +0 -69
- package/dist/index-BZPx6jYI.js +0 -8
- package/dist/index-BlHU_t18.js +0 -142
- package/dist/index-Bm1RbF6w.js +0 -1037
- package/dist/index-Bv2OIg5P.js +0 -225
- package/dist/index-CKEI0pDv.js +0 -56
- package/dist/index-CM_hWgfC.js +0 -32
- package/dist/index-C_YVr64u.js +0 -1538
- package/dist/index-Cl8VeY0o.js +0 -149
- package/dist/index-CwSyIPrv.js +0 -13
- package/dist/index-D29mdTf5.js +0 -34
- package/dist/index-DEYs15GP.js +0 -66
- package/dist/index-Dc0No4pV.js +0 -233
- package/dist/index-T6XEa11q.js +0 -822
- package/dist/index-pBCLb6Gr.js +0 -240
- package/dist/index-psiVrsnE.js +0 -27
- package/dist/index-rKs9bXHr.js +0 -6
- package/dist/proxy-CO_-Vget.js +0 -4975
- package/dist/use-animation-DhEPRwZ3.js +0 -62
package/dist/index-Cl8VeY0o.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import "./styles/main.css";
|
|
2
|
-
import { jsx as b, Fragment as U } from "react/jsx-runtime";
|
|
3
|
-
import * as v from "react";
|
|
4
|
-
import { useId as W, useRef as P, useContext as Y, useInsertionEffect as V, useMemo as A, Children as X, isValidElement as _, useState as I } from "react";
|
|
5
|
-
import { M as B, d as T, u as j, P as F, e as G, b as O, L as q } from "./proxy-CO_-Vget.js";
|
|
6
|
-
function D(e, s) {
|
|
7
|
-
if (typeof e == "function")
|
|
8
|
-
return e(s);
|
|
9
|
-
e != null && (e.current = s);
|
|
10
|
-
}
|
|
11
|
-
function J(...e) {
|
|
12
|
-
return (s) => {
|
|
13
|
-
let t = !1;
|
|
14
|
-
const o = e.map((l) => {
|
|
15
|
-
const r = D(l, s);
|
|
16
|
-
return !t && typeof r == "function" && (t = !0), r;
|
|
17
|
-
});
|
|
18
|
-
if (t)
|
|
19
|
-
return () => {
|
|
20
|
-
for (let l = 0; l < o.length; l++) {
|
|
21
|
-
const r = o[l];
|
|
22
|
-
typeof r == "function" ? r() : D(e[l], null);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function Q(...e) {
|
|
28
|
-
return v.useCallback(J(...e), e);
|
|
29
|
-
}
|
|
30
|
-
class Z extends v.Component {
|
|
31
|
-
getSnapshotBeforeUpdate(s) {
|
|
32
|
-
const t = this.props.childRef.current;
|
|
33
|
-
if (t && s.isPresent && !this.props.isPresent && this.props.pop !== !1) {
|
|
34
|
-
const o = t.offsetParent, l = T(o) && o.offsetWidth || 0, r = T(o) && o.offsetHeight || 0, n = this.props.sizeRef.current;
|
|
35
|
-
n.height = t.offsetHeight || 0, n.width = t.offsetWidth || 0, n.top = t.offsetTop, n.left = t.offsetLeft, n.right = l - n.width - n.left, n.bottom = r - n.height - n.top;
|
|
36
|
-
}
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
41
|
-
*/
|
|
42
|
-
componentDidUpdate() {
|
|
43
|
-
}
|
|
44
|
-
render() {
|
|
45
|
-
return this.props.children;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function ee({ children: e, isPresent: s, anchorX: t, anchorY: o, root: l, pop: r }) {
|
|
49
|
-
const n = W(), h = P(null), g = P({
|
|
50
|
-
width: 0,
|
|
51
|
-
height: 0,
|
|
52
|
-
top: 0,
|
|
53
|
-
left: 0,
|
|
54
|
-
right: 0,
|
|
55
|
-
bottom: 0
|
|
56
|
-
}), { nonce: y } = Y(B), u = e.props?.ref ?? e?.ref, w = Q(h, u);
|
|
57
|
-
return V(() => {
|
|
58
|
-
const { width: c, height: a, top: p, left: m, right: C, bottom: E } = g.current;
|
|
59
|
-
if (s || r === !1 || !h.current || !c || !a)
|
|
60
|
-
return;
|
|
61
|
-
const M = t === "left" ? `left: ${m}` : `right: ${C}`, L = o === "bottom" ? `bottom: ${E}` : `top: ${p}`;
|
|
62
|
-
h.current.dataset.motionPopId = n;
|
|
63
|
-
const f = document.createElement("style");
|
|
64
|
-
y && (f.nonce = y);
|
|
65
|
-
const x = l ?? document.head;
|
|
66
|
-
return x.appendChild(f), f.sheet && f.sheet.insertRule(`
|
|
67
|
-
[data-motion-pop-id="${n}"] {
|
|
68
|
-
position: absolute !important;
|
|
69
|
-
width: ${c}px !important;
|
|
70
|
-
height: ${a}px !important;
|
|
71
|
-
${M}px !important;
|
|
72
|
-
${L}px !important;
|
|
73
|
-
}
|
|
74
|
-
`), () => {
|
|
75
|
-
x.contains(f) && x.removeChild(f);
|
|
76
|
-
};
|
|
77
|
-
}, [s]), b(Z, { isPresent: s, childRef: h, sizeRef: g, pop: r, children: r === !1 ? e : v.cloneElement(e, { ref: w }) });
|
|
78
|
-
}
|
|
79
|
-
const te = ({ children: e, initial: s, isPresent: t, onExitComplete: o, custom: l, presenceAffectsLayout: r, mode: n, anchorX: h, anchorY: g, root: y }) => {
|
|
80
|
-
const u = j(ne), w = W();
|
|
81
|
-
let c = !0, a = A(() => (c = !1, {
|
|
82
|
-
id: w,
|
|
83
|
-
initial: s,
|
|
84
|
-
isPresent: t,
|
|
85
|
-
custom: l,
|
|
86
|
-
onExitComplete: (p) => {
|
|
87
|
-
u.set(p, !0);
|
|
88
|
-
for (const m of u.values())
|
|
89
|
-
if (!m)
|
|
90
|
-
return;
|
|
91
|
-
o && o();
|
|
92
|
-
},
|
|
93
|
-
register: (p) => (u.set(p, !1), () => u.delete(p))
|
|
94
|
-
}), [t, u, o]);
|
|
95
|
-
return r && c && (a = { ...a }), A(() => {
|
|
96
|
-
u.forEach((p, m) => u.set(m, !1));
|
|
97
|
-
}, [t]), v.useEffect(() => {
|
|
98
|
-
!t && !u.size && o && o();
|
|
99
|
-
}, [t]), e = b(ee, { pop: n === "popLayout", isPresent: t, anchorX: h, anchorY: g, root: y, children: e }), b(F.Provider, { value: a, children: e });
|
|
100
|
-
};
|
|
101
|
-
function ne() {
|
|
102
|
-
return /* @__PURE__ */ new Map();
|
|
103
|
-
}
|
|
104
|
-
const $ = (e) => e.key || "";
|
|
105
|
-
function S(e) {
|
|
106
|
-
const s = [];
|
|
107
|
-
return X.forEach(e, (t) => {
|
|
108
|
-
_(t) && s.push(t);
|
|
109
|
-
}), s;
|
|
110
|
-
}
|
|
111
|
-
const ie = ({ children: e, custom: s, initial: t = !0, onExitComplete: o, presenceAffectsLayout: l = !0, mode: r = "sync", propagate: n = !1, anchorX: h = "left", anchorY: g = "top", root: y }) => {
|
|
112
|
-
const [u, w] = G(n), c = A(() => S(e), [e]), a = n && !u ? [] : c.map($), p = P(!0), m = P(c), C = j(() => /* @__PURE__ */ new Map()), E = P(/* @__PURE__ */ new Set()), [M, L] = I(c), [f, x] = I(c);
|
|
113
|
-
O(() => {
|
|
114
|
-
p.current = !1, m.current = c;
|
|
115
|
-
for (let d = 0; d < f.length; d++) {
|
|
116
|
-
const i = $(f[d]);
|
|
117
|
-
a.includes(i) ? (C.delete(i), E.current.delete(i)) : C.get(i) !== !0 && C.set(i, !1);
|
|
118
|
-
}
|
|
119
|
-
}, [f, a.length, a.join("-")]);
|
|
120
|
-
const k = [];
|
|
121
|
-
if (c !== M) {
|
|
122
|
-
let d = [...c];
|
|
123
|
-
for (let i = 0; i < f.length; i++) {
|
|
124
|
-
const R = f[i], z = $(R);
|
|
125
|
-
a.includes(z) || (d.splice(i, 0, R), k.push(R));
|
|
126
|
-
}
|
|
127
|
-
return r === "wait" && k.length && (d = k), x(S(d)), L(c), null;
|
|
128
|
-
}
|
|
129
|
-
process.env.NODE_ENV !== "production" && r === "wait" && f.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
130
|
-
const { forceRender: K } = Y(q);
|
|
131
|
-
return b(U, { children: f.map((d) => {
|
|
132
|
-
const i = $(d), R = n && !u ? !1 : c === f || a.includes(i), z = () => {
|
|
133
|
-
if (E.current.has(i))
|
|
134
|
-
return;
|
|
135
|
-
if (E.current.add(i), C.has(i))
|
|
136
|
-
C.set(i, !0);
|
|
137
|
-
else
|
|
138
|
-
return;
|
|
139
|
-
let H = !0;
|
|
140
|
-
C.forEach((N) => {
|
|
141
|
-
N || (H = !1);
|
|
142
|
-
}), H && (K?.(), x(m.current), n && w?.(), o && o());
|
|
143
|
-
};
|
|
144
|
-
return b(te, { isPresent: R, initial: !p.current || t ? void 0 : !1, custom: s, presenceAffectsLayout: l, mode: r, root: y, onExitComplete: R ? void 0 : z, anchorX: h, anchorY: g, children: d }, i);
|
|
145
|
-
}) });
|
|
146
|
-
};
|
|
147
|
-
export {
|
|
148
|
-
ie as A
|
|
149
|
-
};
|
package/dist/index-CwSyIPrv.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as r from "react";
|
|
2
|
-
import { f as s } from "./index-Dc0No4pV.js";
|
|
3
|
-
var u = r[" useId ".trim().toString()] || (() => {
|
|
4
|
-
}), i = 0;
|
|
5
|
-
function n(e) {
|
|
6
|
-
const [t, o] = r.useState(u());
|
|
7
|
-
return s(() => {
|
|
8
|
-
o((a) => a ?? String(i++));
|
|
9
|
-
}, [e]), t ? `radix-${t}` : "";
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
n as u
|
|
13
|
-
};
|
package/dist/index-D29mdTf5.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { c as O } from "./clsx-OuTLNxxd.js";
|
|
2
|
-
const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
|
|
3
|
-
var u;
|
|
4
|
-
if (l?.variants == null) return y(e, n?.class, n?.className);
|
|
5
|
-
const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
|
|
6
|
-
const a = n?.[t], s = d?.[t];
|
|
7
|
-
if (a === null) return null;
|
|
8
|
-
const i = m(a) || m(s);
|
|
9
|
-
return r[t][i];
|
|
10
|
-
}), v = n && Object.entries(n).reduce((t, a) => {
|
|
11
|
-
let [s, i] = a;
|
|
12
|
-
return i === void 0 || (t[s] = i), t;
|
|
13
|
-
}, {}), N = l == null || (u = l.compoundVariants) === null || u === void 0 ? void 0 : u.reduce((t, a) => {
|
|
14
|
-
let { class: s, className: i, ...f } = a;
|
|
15
|
-
return Object.entries(f).every((C) => {
|
|
16
|
-
let [c, o] = C;
|
|
17
|
-
return Array.isArray(o) ? o.includes({
|
|
18
|
-
...d,
|
|
19
|
-
...v
|
|
20
|
-
}[c]) : {
|
|
21
|
-
...d,
|
|
22
|
-
...v
|
|
23
|
-
}[c] === o;
|
|
24
|
-
}) ? [
|
|
25
|
-
...t,
|
|
26
|
-
s,
|
|
27
|
-
i
|
|
28
|
-
] : t;
|
|
29
|
-
}, []);
|
|
30
|
-
return y(e, V, N, n?.class, n?.className);
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
j as c
|
|
34
|
-
};
|
package/dist/index-DEYs15GP.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { useState as T, useRef as g, useEffect as u, useMemo as j } from "react";
|
|
2
|
-
function p(t, r) {
|
|
3
|
-
let o;
|
|
4
|
-
return (...i) => {
|
|
5
|
-
window.clearTimeout(o), o = window.setTimeout(() => t(...i), r);
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
function Y({ debounce: t, scroll: r, polyfill: o, offsetSize: i } = { debounce: 0, scroll: !1, offsetSize: !1 }) {
|
|
9
|
-
const a = o || (typeof window > "u" ? class {
|
|
10
|
-
} : window.ResizeObserver);
|
|
11
|
-
if (!a) throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
|
|
12
|
-
const [c, h] = T({ left: 0, top: 0, width: 0, height: 0, bottom: 0, right: 0, x: 0, y: 0 }), e = g({ element: null, scrollContainers: null, resizeObserver: null, lastBounds: c, orientationHandler: null }), d = t ? typeof t == "number" ? t : t.scroll : null, f = t ? typeof t == "number" ? t : t.resize : null, w = g(!1);
|
|
13
|
-
u(() => (w.current = !0, () => {
|
|
14
|
-
w.current = !1;
|
|
15
|
-
}));
|
|
16
|
-
const [z, m, s] = j(() => {
|
|
17
|
-
const n = () => {
|
|
18
|
-
if (!e.current.element) return;
|
|
19
|
-
const { left: y, top: C, width: H, height: O, bottom: x, right: S, x: B, y: R } = e.current.element.getBoundingClientRect(), l = { left: y, top: C, width: H, height: O, bottom: x, right: S, x: B, y: R };
|
|
20
|
-
e.current.element instanceof HTMLElement && i && (l.height = e.current.element.offsetHeight, l.width = e.current.element.offsetWidth), Object.freeze(l), w.current && !k(e.current.lastBounds, l) && h(e.current.lastBounds = l);
|
|
21
|
-
};
|
|
22
|
-
return [n, f ? p(n, f) : n, d ? p(n, d) : n];
|
|
23
|
-
}, [h, i, d, f]);
|
|
24
|
-
function v() {
|
|
25
|
-
e.current.scrollContainers && (e.current.scrollContainers.forEach((n) => n.removeEventListener("scroll", s, !0)), e.current.scrollContainers = null), e.current.resizeObserver && (e.current.resizeObserver.disconnect(), e.current.resizeObserver = null), e.current.orientationHandler && ("orientation" in screen && "removeEventListener" in screen.orientation ? screen.orientation.removeEventListener("change", e.current.orientationHandler) : "onorientationchange" in window && window.removeEventListener("orientationchange", e.current.orientationHandler));
|
|
26
|
-
}
|
|
27
|
-
function b() {
|
|
28
|
-
e.current.element && (e.current.resizeObserver = new a(s), e.current.resizeObserver.observe(e.current.element), r && e.current.scrollContainers && e.current.scrollContainers.forEach((n) => n.addEventListener("scroll", s, { capture: !0, passive: !0 })), e.current.orientationHandler = () => {
|
|
29
|
-
s();
|
|
30
|
-
}, "orientation" in screen && "addEventListener" in screen.orientation ? screen.orientation.addEventListener("change", e.current.orientationHandler) : "onorientationchange" in window && window.addEventListener("orientationchange", e.current.orientationHandler));
|
|
31
|
-
}
|
|
32
|
-
const L = (n) => {
|
|
33
|
-
!n || n === e.current.element || (v(), e.current.element = n, e.current.scrollContainers = E(n), b());
|
|
34
|
-
};
|
|
35
|
-
return W(s, !!r), M(m), u(() => {
|
|
36
|
-
v(), b();
|
|
37
|
-
}, [r, s, m]), u(() => v, []), [L, c, z];
|
|
38
|
-
}
|
|
39
|
-
function M(t) {
|
|
40
|
-
u(() => {
|
|
41
|
-
const r = t;
|
|
42
|
-
return window.addEventListener("resize", r), () => {
|
|
43
|
-
window.removeEventListener("resize", r);
|
|
44
|
-
};
|
|
45
|
-
}, [t]);
|
|
46
|
-
}
|
|
47
|
-
function W(t, r) {
|
|
48
|
-
u(() => {
|
|
49
|
-
if (r) {
|
|
50
|
-
const o = t;
|
|
51
|
-
return window.addEventListener("scroll", o, { capture: !0, passive: !0 }), () => {
|
|
52
|
-
window.removeEventListener("scroll", o, !0);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}, [t, r]);
|
|
56
|
-
}
|
|
57
|
-
function E(t) {
|
|
58
|
-
const r = [];
|
|
59
|
-
if (!t || t === document.body) return r;
|
|
60
|
-
const { overflow: o, overflowX: i, overflowY: a } = window.getComputedStyle(t);
|
|
61
|
-
return [o, i, a].some((c) => c === "auto" || c === "scroll") && r.push(t), [...r, ...E(t.parentElement)];
|
|
62
|
-
}
|
|
63
|
-
const X = ["x", "y", "top", "bottom", "left", "right", "width", "height"], k = (t, r) => X.every((o) => t[o] === r[o]);
|
|
64
|
-
export {
|
|
65
|
-
Y as j
|
|
66
|
-
};
|
package/dist/index-Dc0No4pV.js
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import "./styles/main.css";
|
|
2
|
-
import * as s from "react";
|
|
3
|
-
import { jsx as p, Fragment as x } from "react/jsx-runtime";
|
|
4
|
-
import * as g from "react-dom";
|
|
5
|
-
function W(e, t) {
|
|
6
|
-
const n = s.createContext(t), c = (r) => {
|
|
7
|
-
const { children: u, ...i } = r, l = s.useMemo(() => i, Object.values(i));
|
|
8
|
-
return /* @__PURE__ */ p(n.Provider, { value: l, children: u });
|
|
9
|
-
};
|
|
10
|
-
c.displayName = e + "Provider";
|
|
11
|
-
function o(r) {
|
|
12
|
-
const u = s.useContext(n);
|
|
13
|
-
if (u) return u;
|
|
14
|
-
if (t !== void 0) return t;
|
|
15
|
-
throw new Error(`\`${r}\` must be used within \`${e}\``);
|
|
16
|
-
}
|
|
17
|
-
return [c, o];
|
|
18
|
-
}
|
|
19
|
-
function A(e, t = []) {
|
|
20
|
-
let n = [];
|
|
21
|
-
function c(r, u) {
|
|
22
|
-
const i = s.createContext(u), l = n.length;
|
|
23
|
-
n = [...n, u];
|
|
24
|
-
const f = (a) => {
|
|
25
|
-
const { scope: v, children: C, ...m } = a, E = v?.[e]?.[l] || i, b = s.useMemo(() => m, Object.values(m));
|
|
26
|
-
return /* @__PURE__ */ p(E.Provider, { value: b, children: C });
|
|
27
|
-
};
|
|
28
|
-
f.displayName = r + "Provider";
|
|
29
|
-
function d(a, v) {
|
|
30
|
-
const C = v?.[e]?.[l] || i, m = s.useContext(C);
|
|
31
|
-
if (m) return m;
|
|
32
|
-
if (u !== void 0) return u;
|
|
33
|
-
throw new Error(`\`${a}\` must be used within \`${r}\``);
|
|
34
|
-
}
|
|
35
|
-
return [f, d];
|
|
36
|
-
}
|
|
37
|
-
const o = () => {
|
|
38
|
-
const r = n.map((u) => s.createContext(u));
|
|
39
|
-
return function(i) {
|
|
40
|
-
const l = i?.[e] || r;
|
|
41
|
-
return s.useMemo(
|
|
42
|
-
() => ({ [`__scope${e}`]: { ...i, [e]: l } }),
|
|
43
|
-
[i, l]
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
return o.scopeName = e, [c, P(o, ...t)];
|
|
48
|
-
}
|
|
49
|
-
function P(...e) {
|
|
50
|
-
const t = e[0];
|
|
51
|
-
if (e.length === 1) return t;
|
|
52
|
-
const n = () => {
|
|
53
|
-
const c = e.map((o) => ({
|
|
54
|
-
useScope: o(),
|
|
55
|
-
scopeName: o.scopeName
|
|
56
|
-
}));
|
|
57
|
-
return function(r) {
|
|
58
|
-
const u = c.reduce((i, { useScope: l, scopeName: f }) => {
|
|
59
|
-
const a = l(r)[`__scope${f}`];
|
|
60
|
-
return { ...i, ...a };
|
|
61
|
-
}, {});
|
|
62
|
-
return s.useMemo(() => ({ [`__scope${t.scopeName}`]: u }), [u]);
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
return n.scopeName = t.scopeName, n;
|
|
66
|
-
}
|
|
67
|
-
function h(e, t) {
|
|
68
|
-
if (typeof e == "function")
|
|
69
|
-
return e(t);
|
|
70
|
-
e != null && (e.current = t);
|
|
71
|
-
}
|
|
72
|
-
function S(...e) {
|
|
73
|
-
return (t) => {
|
|
74
|
-
let n = !1;
|
|
75
|
-
const c = e.map((o) => {
|
|
76
|
-
const r = h(o, t);
|
|
77
|
-
return !n && typeof r == "function" && (n = !0), r;
|
|
78
|
-
});
|
|
79
|
-
if (n)
|
|
80
|
-
return () => {
|
|
81
|
-
for (let o = 0; o < c.length; o++) {
|
|
82
|
-
const r = c[o];
|
|
83
|
-
typeof r == "function" ? r() : h(e[o], null);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
function F(...e) {
|
|
89
|
-
return s.useCallback(S(...e), e);
|
|
90
|
-
}
|
|
91
|
-
// @__NO_SIDE_EFFECTS__
|
|
92
|
-
function R(e) {
|
|
93
|
-
const t = /* @__PURE__ */ w(e), n = s.forwardRef((c, o) => {
|
|
94
|
-
const { children: r, ...u } = c, i = s.Children.toArray(r), l = i.find($);
|
|
95
|
-
if (l) {
|
|
96
|
-
const f = l.props.children, d = i.map((a) => a === l ? s.Children.count(f) > 1 ? s.Children.only(null) : s.isValidElement(f) ? f.props.children : null : a);
|
|
97
|
-
return /* @__PURE__ */ p(t, { ...u, ref: o, children: s.isValidElement(f) ? s.cloneElement(f, void 0, d) : null });
|
|
98
|
-
}
|
|
99
|
-
return /* @__PURE__ */ p(t, { ...u, ref: o, children: r });
|
|
100
|
-
});
|
|
101
|
-
return n.displayName = `${e}.Slot`, n;
|
|
102
|
-
}
|
|
103
|
-
// @__NO_SIDE_EFFECTS__
|
|
104
|
-
function w(e) {
|
|
105
|
-
const t = s.forwardRef((n, c) => {
|
|
106
|
-
const { children: o, ...r } = n;
|
|
107
|
-
if (s.isValidElement(o)) {
|
|
108
|
-
const u = N(o), i = _(r, o.props);
|
|
109
|
-
return o.type !== s.Fragment && (i.ref = c ? S(c, u) : u), s.cloneElement(o, i);
|
|
110
|
-
}
|
|
111
|
-
return s.Children.count(o) > 1 ? s.Children.only(null) : null;
|
|
112
|
-
});
|
|
113
|
-
return t.displayName = `${e}.SlotClone`, t;
|
|
114
|
-
}
|
|
115
|
-
var y = /* @__PURE__ */ Symbol("radix.slottable");
|
|
116
|
-
// @__NO_SIDE_EFFECTS__
|
|
117
|
-
function H(e) {
|
|
118
|
-
const t = ({ children: n }) => /* @__PURE__ */ p(x, { children: n });
|
|
119
|
-
return t.displayName = `${e}.Slottable`, t.__radixId = y, t;
|
|
120
|
-
}
|
|
121
|
-
function $(e) {
|
|
122
|
-
return s.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === y;
|
|
123
|
-
}
|
|
124
|
-
function _(e, t) {
|
|
125
|
-
const n = { ...t };
|
|
126
|
-
for (const c in t) {
|
|
127
|
-
const o = e[c], r = t[c];
|
|
128
|
-
/^on[A-Z]/.test(c) ? o && r ? n[c] = (...i) => {
|
|
129
|
-
const l = r(...i);
|
|
130
|
-
return o(...i), l;
|
|
131
|
-
} : o && (n[c] = o) : c === "style" ? n[c] = { ...o, ...r } : c === "className" && (n[c] = [o, r].filter(Boolean).join(" "));
|
|
132
|
-
}
|
|
133
|
-
return { ...e, ...n };
|
|
134
|
-
}
|
|
135
|
-
function N(e) {
|
|
136
|
-
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
137
|
-
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
138
|
-
}
|
|
139
|
-
function L(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
140
|
-
return function(o) {
|
|
141
|
-
if (e?.(o), n === !1 || !o.defaultPrevented)
|
|
142
|
-
return t?.(o);
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
var O = globalThis?.document ? s.useLayoutEffect : () => {
|
|
146
|
-
}, I = s[" useInsertionEffect ".trim().toString()] || O;
|
|
147
|
-
function T({
|
|
148
|
-
prop: e,
|
|
149
|
-
defaultProp: t,
|
|
150
|
-
onChange: n = () => {
|
|
151
|
-
},
|
|
152
|
-
caller: c
|
|
153
|
-
}) {
|
|
154
|
-
const [o, r, u] = D({
|
|
155
|
-
defaultProp: t,
|
|
156
|
-
onChange: n
|
|
157
|
-
}), i = e !== void 0, l = i ? e : o;
|
|
158
|
-
{
|
|
159
|
-
const d = s.useRef(e !== void 0);
|
|
160
|
-
s.useEffect(() => {
|
|
161
|
-
const a = d.current;
|
|
162
|
-
a !== i && console.warn(
|
|
163
|
-
`${c} is changing from ${a ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
164
|
-
), d.current = i;
|
|
165
|
-
}, [i, c]);
|
|
166
|
-
}
|
|
167
|
-
const f = s.useCallback(
|
|
168
|
-
(d) => {
|
|
169
|
-
if (i) {
|
|
170
|
-
const a = j(d) ? d(e) : d;
|
|
171
|
-
a !== e && u.current?.(a);
|
|
172
|
-
} else
|
|
173
|
-
r(d);
|
|
174
|
-
},
|
|
175
|
-
[i, e, r, u]
|
|
176
|
-
);
|
|
177
|
-
return [l, f];
|
|
178
|
-
}
|
|
179
|
-
function D({
|
|
180
|
-
defaultProp: e,
|
|
181
|
-
onChange: t
|
|
182
|
-
}) {
|
|
183
|
-
const [n, c] = s.useState(e), o = s.useRef(n), r = s.useRef(t);
|
|
184
|
-
return I(() => {
|
|
185
|
-
r.current = t;
|
|
186
|
-
}, [t]), s.useEffect(() => {
|
|
187
|
-
o.current !== n && (r.current?.(n), o.current = n);
|
|
188
|
-
}, [n, o]), [n, c, r];
|
|
189
|
-
}
|
|
190
|
-
function j(e) {
|
|
191
|
-
return typeof e == "function";
|
|
192
|
-
}
|
|
193
|
-
var V = [
|
|
194
|
-
"a",
|
|
195
|
-
"button",
|
|
196
|
-
"div",
|
|
197
|
-
"form",
|
|
198
|
-
"h2",
|
|
199
|
-
"h3",
|
|
200
|
-
"img",
|
|
201
|
-
"input",
|
|
202
|
-
"label",
|
|
203
|
-
"li",
|
|
204
|
-
"nav",
|
|
205
|
-
"ol",
|
|
206
|
-
"p",
|
|
207
|
-
"select",
|
|
208
|
-
"span",
|
|
209
|
-
"svg",
|
|
210
|
-
"ul"
|
|
211
|
-
], k = V.reduce((e, t) => {
|
|
212
|
-
const n = /* @__PURE__ */ R(`Primitive.${t}`), c = s.forwardRef((o, r) => {
|
|
213
|
-
const { asChild: u, ...i } = o, l = u ? n : t;
|
|
214
|
-
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(l, { ...i, ref: r });
|
|
215
|
-
});
|
|
216
|
-
return c.displayName = `Primitive.${t}`, { ...e, [t]: c };
|
|
217
|
-
}, {});
|
|
218
|
-
function B(e, t) {
|
|
219
|
-
e && g.flushSync(() => e.dispatchEvent(t));
|
|
220
|
-
}
|
|
221
|
-
export {
|
|
222
|
-
k as P,
|
|
223
|
-
A as a,
|
|
224
|
-
R as b,
|
|
225
|
-
L as c,
|
|
226
|
-
W as d,
|
|
227
|
-
T as e,
|
|
228
|
-
O as f,
|
|
229
|
-
H as g,
|
|
230
|
-
S as h,
|
|
231
|
-
B as i,
|
|
232
|
-
F as u
|
|
233
|
-
};
|