@spear-ai/spectral 1.6.17 → 1.8.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.
Files changed (149) hide show
  1. package/dist/.js +201 -200
  2. package/dist/Accordion.d.ts +13 -15
  3. package/dist/Accordion.js +184 -179
  4. package/dist/Alert/AlertBase.d.ts +7 -7
  5. package/dist/Alert/AlertBase.js +21 -21
  6. package/dist/Alert.d.ts +2 -2
  7. package/dist/Alert.js +31 -31
  8. package/dist/Avatar.d.ts +2 -2
  9. package/dist/Avatar.js +30 -22
  10. package/dist/Badge.d.ts +1 -1
  11. package/dist/Badge.js +3 -2
  12. package/dist/Button.d.ts +3 -3
  13. package/dist/Button.js +108 -46
  14. package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
  15. package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
  16. package/dist/ButtonGroup.d.ts +5 -5
  17. package/dist/ButtonGroup.js +21 -21
  18. package/dist/ButtonIcon.d.ts +2 -2
  19. package/dist/ButtonIcon.js +30 -31
  20. package/dist/Checkbox/CheckboxBase.d.ts +2 -2
  21. package/dist/Checkbox/CheckboxBase.js +50 -57
  22. package/dist/Checkbox.js +15 -19
  23. package/dist/DataCard/Card.d.ts +1 -1
  24. package/dist/DataCard/Card.js +1 -1
  25. package/dist/DataCard.js +1 -1
  26. package/dist/DateTimePicker/Calendar.d.ts +4 -4
  27. package/dist/DateTimePicker/Calendar.js +3 -3
  28. package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
  29. package/dist/DateTimePicker/DateTimeInput.js +4 -4
  30. package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
  31. package/dist/DateTimePicker/DateTimeUtils.js +139 -197
  32. package/dist/DateTimePicker/TimePicker.d.ts +4 -4
  33. package/dist/DateTimePicker/TimePicker.js +3 -3
  34. package/dist/DateTimePicker.d.ts +5 -5
  35. package/dist/DateTimePicker.js +90 -70
  36. package/dist/Dialog.d.ts +13 -13
  37. package/dist/Dialog.js +57 -84
  38. package/dist/Drawer.d.ts +2 -2
  39. package/dist/Drawer.js +8 -8
  40. package/dist/HoverCard.d.ts +6 -5
  41. package/dist/HoverCard.js +64 -64
  42. package/dist/Icons/PolygonIcon.d.ts +5 -0
  43. package/dist/Icons/PolygonIcon.js +40 -0
  44. package/dist/Icons/index.d.ts +1 -1
  45. package/dist/Icons.js +34 -34
  46. package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
  47. package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
  48. package/dist/Input/InputUtils.d.ts +2 -2
  49. package/dist/Input/InputUtils.js +4 -4
  50. package/dist/Input.d.ts +1 -1
  51. package/dist/Input.js +19 -19
  52. package/dist/InputOTP.d.ts +10 -10
  53. package/dist/InputOTP.js +114 -114
  54. package/dist/Kbd.d.ts +8 -5
  55. package/dist/Kbd.js +85 -20
  56. package/dist/Label.d.ts +4 -2
  57. package/dist/Label.js +3 -3
  58. package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
  59. package/dist/MultiSelect/MultiSelectBase.js +278 -202
  60. package/dist/MultiSelect.d.ts +6 -6
  61. package/dist/MultiSelect.js +9 -9
  62. package/dist/Popover.js +22 -237
  63. package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
  64. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
  65. package/dist/RadioButtonGroup.d.ts +1 -1
  66. package/dist/RadioGroup.d.ts +15 -15
  67. package/dist/RadioGroup.js +253 -236
  68. package/dist/Select.d.ts +3 -1
  69. package/dist/Select.js +91 -88
  70. package/dist/Separator.js +4 -4
  71. package/dist/Skeleton.d.ts +1 -2
  72. package/dist/Skeleton.js +2 -4
  73. package/dist/Slider.d.ts +6 -6
  74. package/dist/Slider.js +78 -78
  75. package/dist/Switch/SwitchBase.d.ts +4 -4
  76. package/dist/Switch/SwitchBase.js +75 -111
  77. package/dist/Switch.d.ts +4 -4
  78. package/dist/Switch.js +122 -33
  79. package/dist/Tabs/TabsBase.js +39 -38
  80. package/dist/Tabs/tabsUtils.js +7 -7
  81. package/dist/Tabs.d.ts +0 -4
  82. package/dist/Tabs.js +62 -66
  83. package/dist/Textarea/TextareaUtils.d.ts +7 -7
  84. package/dist/Textarea/TextareaUtils.js +13 -13
  85. package/dist/Textarea.js +28 -18
  86. package/dist/Toast.d.ts +43 -0
  87. package/dist/Toast.js +883 -0
  88. package/dist/Toggle/ToggleBase.d.ts +4 -4
  89. package/dist/Toggle/ToggleBase.js +32 -33
  90. package/dist/Toggle.d.ts +1 -1
  91. package/dist/Toggle.js +7 -12
  92. package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
  93. package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
  94. package/dist/ToggleGroup.d.ts +1 -1
  95. package/dist/ToggleGroup.js +27 -30
  96. package/dist/Tooltip.d.ts +1 -1
  97. package/dist/Tooltip.js +97 -97
  98. package/dist/Tray.d.ts +9 -9
  99. package/dist/Tray.js +71 -70
  100. package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
  101. package/dist/hooks/useAccordionAutoScroll.js +42 -39
  102. package/dist/hooks/useControllableState.d.ts +2 -2
  103. package/dist/hooks/useControllableState.d.ts.map +1 -1
  104. package/dist/hooks/useControllableState.js +2 -2
  105. package/dist/index-C12FUuIW.js +13 -0
  106. package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
  107. package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
  108. package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
  109. package/dist/index-DEYs15GP.js +66 -0
  110. package/dist/index-DdFoGvON.js +146 -0
  111. package/dist/index-Q3N6lgwg.js +225 -0
  112. package/dist/index.d.ts +3 -3
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/primitives/button.d.ts +1 -1
  115. package/dist/primitives/button.js +4 -4
  116. package/dist/primitives/input.d.ts.map +1 -1
  117. package/dist/primitives/input.js +8 -5
  118. package/dist/primitives/select.d.ts +12 -13
  119. package/dist/primitives/select.d.ts.map +1 -1
  120. package/dist/primitives/select.js +59 -88
  121. package/dist/primitives/slot.d.ts +5 -5
  122. package/dist/primitives/slot.d.ts.map +1 -1
  123. package/dist/primitives/slot.js +24 -33
  124. package/dist/primitives/textarea.d.ts.map +1 -1
  125. package/dist/primitives/textarea.js +4 -3
  126. package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
  127. package/dist/styles/base-colors.css +30 -30
  128. package/dist/styles/horizon/base-colors.css +30 -30
  129. package/dist/styles/horizon/colors.css +43 -13
  130. package/dist/styles/horizon/utilities.css +26 -3
  131. package/dist/styles/main.css +1 -1
  132. package/dist/styles/spectral.css +2 -2
  133. package/dist/styles/theme.css +99 -46
  134. package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
  135. package/dist/utils/formFieldUtils.d.ts +2 -2
  136. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  137. package/dist/utils/formFieldUtils.js +14 -11
  138. package/dist/utils/sharedUtils.d.ts +3 -3
  139. package/dist/utils/sharedUtils.d.ts.map +1 -1
  140. package/dist/utils/sharedUtils.js +1 -4
  141. package/dist/utils/twUtils.d.ts +1 -1
  142. package/dist/utils/twUtils.d.ts.map +1 -1
  143. package/dist/utils/twUtils.js +1 -4
  144. package/package.json +6 -1
  145. package/dist/Icons/LineToolIcon2.d.ts +0 -5
  146. package/dist/Icons/LineToolIcon2.js +0 -49
  147. package/dist/createLucideIcon-D4r5Phnh.js +0 -70
  148. package/dist/index-CeP1E2kK.js +0 -209
  149. package/dist/index-Dy-Hzr7y.js +0 -13
@@ -1,209 +0,0 @@
1
- import "./styles/main.css";
2
- import { jsx as P, Fragment as K } from "react/jsx-runtime";
3
- import * as T from "react";
4
- import { useId as j, useRef as x, useContext as A, useInsertionEffect as N, useMemo as M, Children as U, isValidElement as V, useState as $, useEffect as R } from "react";
5
- import { M as Y, c as _, u as D, P as F, d as G, b as q, L as J } from "./proxy-Cukf-VVj.js";
6
- function k(e, n) {
7
- if (typeof e == "function")
8
- return e(n);
9
- e != null && (e.current = n);
10
- }
11
- function Q(...e) {
12
- return (n) => {
13
- let t = !1;
14
- const i = e.map((s) => {
15
- const o = k(s, n);
16
- return !t && typeof o == "function" && (t = !0), o;
17
- });
18
- if (t)
19
- return () => {
20
- for (let s = 0; s < i.length; s++) {
21
- const o = i[s];
22
- typeof o == "function" ? o() : k(e[s], null);
23
- }
24
- };
25
- };
26
- }
27
- function Z(...e) {
28
- return T.useCallback(Q(...e), e);
29
- }
30
- class ee extends T.Component {
31
- getSnapshotBeforeUpdate(n) {
32
- const t = this.props.childRef.current;
33
- if (t && n.isPresent && !this.props.isPresent) {
34
- const i = t.offsetParent, s = _(i) && i.offsetWidth || 0, o = this.props.sizeRef.current;
35
- o.height = t.offsetHeight || 0, o.width = t.offsetWidth || 0, o.top = t.offsetTop, o.left = t.offsetLeft, o.right = s - o.width - o.left;
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 te({ children: e, isPresent: n, anchorX: t, root: i }) {
49
- const s = j(), o = x(null), p = x({
50
- width: 0,
51
- height: 0,
52
- top: 0,
53
- left: 0,
54
- right: 0
55
- }), { nonce: r } = A(Y), C = Z(o, e?.ref);
56
- return N(() => {
57
- const { width: c, height: v, top: u, left: h, right: l } = p.current;
58
- if (n || !o.current || !c || !v)
59
- return;
60
- const m = t === "left" ? `left: ${h}` : `right: ${l}`;
61
- o.current.dataset.motionPopId = s;
62
- const a = document.createElement("style");
63
- r && (a.nonce = r);
64
- const b = i ?? document.head;
65
- return b.appendChild(a), a.sheet && a.sheet.insertRule(`
66
- [data-motion-pop-id="${s}"] {
67
- position: absolute !important;
68
- width: ${c}px !important;
69
- height: ${v}px !important;
70
- ${m}px !important;
71
- top: ${u}px !important;
72
- }
73
- `), () => {
74
- b.contains(a) && b.removeChild(a);
75
- };
76
- }, [n]), P(ee, { isPresent: n, childRef: o, sizeRef: p, children: T.cloneElement(e, { ref: C }) });
77
- }
78
- const ne = ({ children: e, initial: n, isPresent: t, onExitComplete: i, custom: s, presenceAffectsLayout: o, mode: p, anchorX: r, root: C }) => {
79
- const c = D(re), v = j();
80
- let u = !0, h = M(() => (u = !1, {
81
- id: v,
82
- initial: n,
83
- isPresent: t,
84
- custom: s,
85
- onExitComplete: (l) => {
86
- c.set(l, !0);
87
- for (const m of c.values())
88
- if (!m)
89
- return;
90
- i && i();
91
- },
92
- register: (l) => (c.set(l, !1), () => c.delete(l))
93
- }), [t, c, i]);
94
- return o && u && (h = { ...h }), M(() => {
95
- c.forEach((l, m) => c.set(m, !1));
96
- }, [t]), T.useEffect(() => {
97
- !t && !c.size && i && i();
98
- }, [t]), p === "popLayout" && (e = P(te, { isPresent: t, anchorX: r, root: C, children: e })), P(F.Provider, { value: h, children: e });
99
- };
100
- function re() {
101
- return /* @__PURE__ */ new Map();
102
- }
103
- const O = (e) => e.key || "";
104
- function B(e) {
105
- const n = [];
106
- return U.forEach(e, (t) => {
107
- V(t) && n.push(t);
108
- }), n;
109
- }
110
- const fe = ({ children: e, custom: n, initial: t = !0, onExitComplete: i, presenceAffectsLayout: s = !0, mode: o = "sync", propagate: p = !1, anchorX: r = "left", root: C }) => {
111
- const [c, v] = G(p), u = M(() => B(e), [e]), h = p && !c ? [] : u.map(O), l = x(!0), m = x(u), a = D(() => /* @__PURE__ */ new Map()), [b, f] = $(u), [g, H] = $(u);
112
- q(() => {
113
- l.current = !1, m.current = u;
114
- for (let w = 0; w < g.length; w++) {
115
- const d = O(g[w]);
116
- h.includes(d) ? a.delete(d) : a.get(d) !== !0 && a.set(d, !1);
117
- }
118
- }, [g, h.length, h.join("-")]);
119
- const z = [];
120
- if (u !== b) {
121
- let w = [...u];
122
- for (let d = 0; d < g.length; d++) {
123
- const E = g[d], L = O(E);
124
- h.includes(L) || (w.splice(d, 0, E), z.push(E));
125
- }
126
- return o === "wait" && z.length && (w = z), H(B(w)), f(u), null;
127
- }
128
- process.env.NODE_ENV !== "production" && o === "wait" && g.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.`);
129
- const { forceRender: S } = A(J);
130
- return P(K, { children: g.map((w) => {
131
- const d = O(w), E = p && !c ? !1 : u === g || h.includes(d), L = () => {
132
- if (a.has(d))
133
- a.set(d, !0);
134
- else
135
- return;
136
- let y = !0;
137
- a.forEach((X) => {
138
- X || (y = !1);
139
- }), y && (S?.(), H(m.current), p && v?.(), i && i());
140
- };
141
- return P(ne, { isPresent: E, initial: !l.current || t ? void 0 : !1, custom: n, presenceAffectsLayout: s, mode: o, root: C, onExitComplete: E ? void 0 : L, anchorX: r, children: w }, d);
142
- }) });
143
- };
144
- function W(e, n) {
145
- let t;
146
- return (...i) => {
147
- window.clearTimeout(t), t = window.setTimeout(() => e(...i), n);
148
- };
149
- }
150
- function de({ debounce: e, scroll: n, polyfill: t, offsetSize: i } = { debounce: 0, scroll: !1, offsetSize: !1 }) {
151
- const s = t || (typeof window > "u" ? class {
152
- } : window.ResizeObserver);
153
- if (!s) 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");
154
- const [o, p] = $({ left: 0, top: 0, width: 0, height: 0, bottom: 0, right: 0, x: 0, y: 0 }), r = x({ element: null, scrollContainers: null, resizeObserver: null, lastBounds: o, orientationHandler: null }), C = e ? typeof e == "number" ? e : e.scroll : null, c = e ? typeof e == "number" ? e : e.resize : null, v = x(!1);
155
- R(() => (v.current = !0, () => {
156
- v.current = !1;
157
- }));
158
- const [u, h, l] = M(() => {
159
- const f = () => {
160
- if (!r.current.element) return;
161
- const { left: g, top: H, width: z, height: S, bottom: w, right: d, x: E, y: L } = r.current.element.getBoundingClientRect(), y = { left: g, top: H, width: z, height: S, bottom: w, right: d, x: E, y: L };
162
- r.current.element instanceof HTMLElement && i && (y.height = r.current.element.offsetHeight, y.width = r.current.element.offsetWidth), Object.freeze(y), v.current && !ce(r.current.lastBounds, y) && p(r.current.lastBounds = y);
163
- };
164
- return [f, c ? W(f, c) : f, C ? W(f, C) : f];
165
- }, [p, i, C, c]);
166
- function m() {
167
- r.current.scrollContainers && (r.current.scrollContainers.forEach((f) => f.removeEventListener("scroll", l, !0)), r.current.scrollContainers = null), r.current.resizeObserver && (r.current.resizeObserver.disconnect(), r.current.resizeObserver = null), r.current.orientationHandler && ("orientation" in screen && "removeEventListener" in screen.orientation ? screen.orientation.removeEventListener("change", r.current.orientationHandler) : "onorientationchange" in window && window.removeEventListener("orientationchange", r.current.orientationHandler));
168
- }
169
- function a() {
170
- r.current.element && (r.current.resizeObserver = new s(l), r.current.resizeObserver.observe(r.current.element), n && r.current.scrollContainers && r.current.scrollContainers.forEach((f) => f.addEventListener("scroll", l, { capture: !0, passive: !0 })), r.current.orientationHandler = () => {
171
- l();
172
- }, "orientation" in screen && "addEventListener" in screen.orientation ? screen.orientation.addEventListener("change", r.current.orientationHandler) : "onorientationchange" in window && window.addEventListener("orientationchange", r.current.orientationHandler));
173
- }
174
- const b = (f) => {
175
- !f || f === r.current.element || (m(), r.current.element = f, r.current.scrollContainers = I(f), a());
176
- };
177
- return ie(l, !!n), oe(h), R(() => {
178
- m(), a();
179
- }, [n, l, h]), R(() => m, []), [b, o, u];
180
- }
181
- function oe(e) {
182
- R(() => {
183
- const n = e;
184
- return window.addEventListener("resize", n), () => {
185
- window.removeEventListener("resize", n);
186
- };
187
- }, [e]);
188
- }
189
- function ie(e, n) {
190
- R(() => {
191
- if (n) {
192
- const t = e;
193
- return window.addEventListener("scroll", t, { capture: !0, passive: !0 }), () => {
194
- window.removeEventListener("scroll", t, !0);
195
- };
196
- }
197
- }, [e, n]);
198
- }
199
- function I(e) {
200
- const n = [];
201
- if (!e || e === document.body) return n;
202
- const { overflow: t, overflowX: i, overflowY: s } = window.getComputedStyle(e);
203
- return [t, i, s].some((o) => o === "auto" || o === "scroll") && n.push(e), [...n, ...I(e.parentElement)];
204
- }
205
- const se = ["x", "y", "top", "bottom", "left", "right", "width", "height"], ce = (e, n) => se.every((t) => e[t] === n[t]);
206
- export {
207
- fe as A,
208
- de as j
209
- };
@@ -1,13 +0,0 @@
1
- import * as o from "react";
2
- import { f as u } from "./index-OnYbwQjk.js";
3
- var s = o[" useId ".trim().toString()] || (() => {
4
- }), f = 0;
5
- function n(t) {
6
- const [r, a] = o.useState(s());
7
- return u(() => {
8
- a((e) => e ?? String(f++));
9
- }, [t]), t || (r ? `radix-${r}` : "");
10
- }
11
- export {
12
- n as u
13
- };