@spear-ai/spectral 1.7.0 → 1.8.1
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 +65 -65
- package/dist/Accordion.js +1 -1
- package/dist/Alert/AlertBase.js +1 -1
- package/dist/Alert.js +1 -1
- package/dist/Button.js +1 -1
- package/dist/ButtonIcon.js +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/DateTimePicker/Calendar.js +365 -360
- package/dist/DateTimePicker/DateTimeUtils.js +2 -2
- package/dist/DateTimePicker.js +1 -1
- package/dist/Icons/PolygonIcon.d.ts +5 -0
- package/dist/Icons/PolygonIcon.js +40 -0
- package/dist/Icons/index.d.ts +1 -1
- package/dist/Icons.js +34 -34
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +4 -4
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
- package/dist/Input.js +1 -1
- package/dist/InputOTP.js +1 -1
- package/dist/MultiSelect/MultiSelectBase.js +30 -30
- package/dist/RadioGroup.js +2 -2
- package/dist/Select.js +39 -39
- package/dist/Switch/SwitchBase.js +70 -106
- package/dist/Switch.d.ts +1 -1
- package/dist/Switch.js +122 -33
- package/dist/Tabs/TabsBase.js +2 -2
- package/dist/Textarea.js +1 -1
- package/dist/Toast.js +1 -1
- package/dist/Tray.js +3 -3
- package/dist/index-Cl8VeY0o.js +149 -0
- package/dist/primitives/select.js +1 -1
- package/dist/{proxy-CgaCj1WQ.js → proxy-CO_-Vget.js} +3107 -2803
- package/dist/styles/horizon/colors.css +3 -2
- package/dist/styles/main.css +1 -1
- package/dist/styles/spectral.css +2 -2
- package/dist/styles/theme.css +3 -2
- package/dist/{use-animation-CR-SdV2l.js → use-animation-DhEPRwZ3.js} +1 -1
- package/dist/utils/twUtils.js +528 -369
- package/package.json +33 -32
- package/dist/Icons/LineToolIcon2.d.ts +0 -5
- package/dist/Icons/LineToolIcon2.js +0 -49
- package/dist/index-DdFoGvON.js +0 -146
|
@@ -0,0 +1,149 @@
|
|
|
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
|
+
};
|
|
@@ -32,7 +32,6 @@ import "../Icons/KeyboardIcon.js";
|
|
|
32
32
|
import "../Icons/LabelIcon.js";
|
|
33
33
|
import "../Icons/LassoIcon.js";
|
|
34
34
|
import "../Icons/LineToolIcon.js";
|
|
35
|
-
import "../Icons/LineToolIcon2.js";
|
|
36
35
|
import "../Icons/LiveViewIcon.js";
|
|
37
36
|
import "../Icons/LoaderIcon.js";
|
|
38
37
|
import "../Icons/LocationIcon.js";
|
|
@@ -46,6 +45,7 @@ import "../Icons/PanelIconClose.js";
|
|
|
46
45
|
import "../Icons/PanelIconOpen.js";
|
|
47
46
|
import "../Icons/PlayIcon.js";
|
|
48
47
|
import "../Icons/PlusIcon.js";
|
|
48
|
+
import "../Icons/PolygonIcon.js";
|
|
49
49
|
import "../Icons/ResetIcon.js";
|
|
50
50
|
import "../Icons/ReviewedIcon.js";
|
|
51
51
|
import "../Icons/ScissorsIcon.js";
|