@spear-ai/spectral 1.4.10 → 1.4.12
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 +119 -113
- package/dist/Accordion.d.ts +1 -0
- package/dist/Accordion.js +132 -129
- package/dist/Alert.js +5 -2
- package/dist/Button.js +19 -19
- package/dist/ButtonIcon.js +3 -0
- package/dist/Checkbox.js +3 -0
- package/dist/Icons/EditIcon.d.ts +3 -0
- package/dist/Icons/EditIcon.js +31 -0
- package/dist/Icons/SortAtoZIcon.d.ts +3 -0
- package/dist/Icons/SortAtoZIcon.js +16 -0
- package/dist/Icons/SortZtoAIcon.d.ts +3 -0
- package/dist/Icons/SortZtoAIcon.js +16 -0
- package/dist/Icons/index.d.ts +3 -0
- package/dist/Icons.js +102 -96
- package/dist/Input.js +18 -15
- package/dist/InputOTP.js +5 -2
- package/dist/MultiSelect/MultiSelectBase.js +3 -0
- package/dist/Select.js +14 -11
- package/dist/Textarea.js +9 -6
- package/dist/Tray.js +3 -0
- package/dist/primitives/select.js +19 -16
- package/dist/styles/base-colors.css +1 -1
- package/dist/styles/main.css +1 -1
- package/package.json +2 -2
package/dist/Accordion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as
|
|
3
|
+
import { jsx as a, jsxs as F } from "react/jsx-runtime";
|
|
4
4
|
import "./Icons/AnalyzeIcon.js";
|
|
5
5
|
import "./Icons/AnnotationsIcon.js";
|
|
6
6
|
import "./Icons/ApprovedIcon.js";
|
|
@@ -19,6 +19,7 @@ import "./Icons/DashboardIcon.js";
|
|
|
19
19
|
import "./Icons/DatabaseIcon.js";
|
|
20
20
|
import "./Icons/DeleteIcon.js";
|
|
21
21
|
import "./Icons/DurationIcon.js";
|
|
22
|
+
import "./Icons/EditIcon.js";
|
|
22
23
|
import "./Icons/EmailIcon.js";
|
|
23
24
|
import "./Icons/EraserIcon.js";
|
|
24
25
|
import "./Icons/ErrorIcon.js";
|
|
@@ -50,7 +51,9 @@ import "./Icons/ReviewedIcon.js";
|
|
|
50
51
|
import "./Icons/ScissorsIcon.js";
|
|
51
52
|
import "./Icons/SettingsIcon.js";
|
|
52
53
|
import "./Icons/SortAscendingIcon.js";
|
|
54
|
+
import "./Icons/SortAtoZIcon.js";
|
|
53
55
|
import "./Icons/SortDescendingIcon.js";
|
|
56
|
+
import "./Icons/SortZtoAIcon.js";
|
|
54
57
|
import "./Icons/StackIcon.js";
|
|
55
58
|
import "./Icons/StarIcon.js";
|
|
56
59
|
import "./Icons/TrashIcon.js";
|
|
@@ -61,43 +64,43 @@ import "./Icons/ZoomAllIcon.js";
|
|
|
61
64
|
import "./Icons/ZoomXIcon.js";
|
|
62
65
|
import "./Icons/ZoomYIcon.js";
|
|
63
66
|
import { useAccordionAutoScroll as ue } from "./hooks/useAccordionAutoScroll.js";
|
|
64
|
-
import * as
|
|
65
|
-
import
|
|
66
|
-
import { c as z, u as V, P as
|
|
67
|
-
import { c as
|
|
68
|
-
import { P as
|
|
67
|
+
import * as f from "react";
|
|
68
|
+
import u, { createContext as fe, forwardRef as w, Children as ve, isValidElement as Ce, cloneElement as ge, useContext as be, useRef as Ae, useCallback as he } from "react";
|
|
69
|
+
import { c as z, u as V, P as I, b as B, a as U, d as xe } from "./index-BhufZRa2.js";
|
|
70
|
+
import { c as ye, u as Ie } from "./index-UEFPWH8U.js";
|
|
71
|
+
import { P as Re } from "./index-6Abv_Flm.js";
|
|
69
72
|
import { u as q } from "./index-CVSxKOPp.js";
|
|
70
73
|
import { cn as _ } from "./utils/twUtils.js";
|
|
71
|
-
var P = "Collapsible", [Ne, J] = z(P), [we, $] = Ne(P), Y =
|
|
72
|
-
(e,
|
|
74
|
+
var P = "Collapsible", [Ne, J] = z(P), [we, $] = Ne(P), Y = f.forwardRef(
|
|
75
|
+
(e, i) => {
|
|
73
76
|
const {
|
|
74
77
|
__scopeCollapsible: o,
|
|
75
78
|
open: t,
|
|
76
79
|
defaultOpen: r,
|
|
77
80
|
disabled: n,
|
|
78
81
|
onOpenChange: c,
|
|
79
|
-
...
|
|
80
|
-
} = e, [
|
|
82
|
+
...l
|
|
83
|
+
} = e, [s, p] = V({
|
|
81
84
|
prop: t,
|
|
82
85
|
defaultProp: r ?? !1,
|
|
83
86
|
onChange: c,
|
|
84
87
|
caller: P
|
|
85
88
|
});
|
|
86
|
-
return /* @__PURE__ */
|
|
89
|
+
return /* @__PURE__ */ a(
|
|
87
90
|
we,
|
|
88
91
|
{
|
|
89
92
|
scope: o,
|
|
90
93
|
disabled: n,
|
|
91
94
|
contentId: q(),
|
|
92
|
-
open:
|
|
93
|
-
onOpenToggle:
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
|
|
95
|
+
open: s,
|
|
96
|
+
onOpenToggle: f.useCallback(() => p((m) => !m), [p]),
|
|
97
|
+
children: /* @__PURE__ */ a(
|
|
98
|
+
I.div,
|
|
96
99
|
{
|
|
97
|
-
"data-state": L(
|
|
100
|
+
"data-state": L(s),
|
|
98
101
|
"data-disabled": n ? "" : void 0,
|
|
99
|
-
...
|
|
100
|
-
ref:
|
|
102
|
+
...l,
|
|
103
|
+
ref: i
|
|
101
104
|
}
|
|
102
105
|
)
|
|
103
106
|
}
|
|
@@ -105,11 +108,11 @@ var P = "Collapsible", [Ne, J] = z(P), [we, $] = Ne(P), Y = u.forwardRef(
|
|
|
105
108
|
}
|
|
106
109
|
);
|
|
107
110
|
Y.displayName = P;
|
|
108
|
-
var Q = "CollapsibleTrigger", W =
|
|
109
|
-
(e,
|
|
111
|
+
var Q = "CollapsibleTrigger", W = f.forwardRef(
|
|
112
|
+
(e, i) => {
|
|
110
113
|
const { __scopeCollapsible: o, ...t } = e, r = $(Q, o);
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
|
|
114
|
+
return /* @__PURE__ */ a(
|
|
115
|
+
I.button,
|
|
113
116
|
{
|
|
114
117
|
type: "button",
|
|
115
118
|
"aria-controls": r.contentId,
|
|
@@ -118,23 +121,23 @@ var Q = "CollapsibleTrigger", W = u.forwardRef(
|
|
|
118
121
|
"data-disabled": r.disabled ? "" : void 0,
|
|
119
122
|
disabled: r.disabled,
|
|
120
123
|
...t,
|
|
121
|
-
ref:
|
|
124
|
+
ref: i,
|
|
122
125
|
onClick: B(e.onClick, r.onOpenToggle)
|
|
123
126
|
}
|
|
124
127
|
);
|
|
125
128
|
}
|
|
126
129
|
);
|
|
127
130
|
W.displayName = Q;
|
|
128
|
-
var H = "CollapsibleContent", X =
|
|
129
|
-
(e,
|
|
131
|
+
var H = "CollapsibleContent", X = f.forwardRef(
|
|
132
|
+
(e, i) => {
|
|
130
133
|
const { forceMount: o, ...t } = e, r = $(H, e.__scopeCollapsible);
|
|
131
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ a(Re, { present: o || r.open, children: ({ present: n }) => /* @__PURE__ */ a(_e, { ...t, ref: i, present: n }) });
|
|
132
135
|
}
|
|
133
136
|
);
|
|
134
137
|
X.displayName = H;
|
|
135
|
-
var _e =
|
|
136
|
-
const { __scopeCollapsible: o, present: t, children: r, ...n } = e, c = $(H, o), [
|
|
137
|
-
return
|
|
138
|
+
var _e = f.forwardRef((e, i) => {
|
|
139
|
+
const { __scopeCollapsible: o, present: t, children: r, ...n } = e, c = $(H, o), [l, s] = f.useState(t), p = f.useRef(null), m = U(i, p), v = f.useRef(0), x = v.current, g = f.useRef(0), R = g.current, b = c.open || l, A = f.useRef(b), h = f.useRef(void 0);
|
|
140
|
+
return f.useEffect(() => {
|
|
138
141
|
const d = requestAnimationFrame(() => A.current = !1);
|
|
139
142
|
return () => cancelAnimationFrame(d);
|
|
140
143
|
}, []), xe(() => {
|
|
@@ -144,21 +147,21 @@ var _e = u.forwardRef((e, a) => {
|
|
|
144
147
|
transitionDuration: d.style.transitionDuration,
|
|
145
148
|
animationName: d.style.animationName
|
|
146
149
|
}, d.style.transitionDuration = "0s", d.style.animationName = "none";
|
|
147
|
-
const
|
|
148
|
-
v.current =
|
|
150
|
+
const y = d.getBoundingClientRect();
|
|
151
|
+
v.current = y.height, g.current = y.width, A.current || (d.style.transitionDuration = h.current.transitionDuration, d.style.animationName = h.current.animationName), s(t);
|
|
149
152
|
}
|
|
150
|
-
}, [c.open, t]), /* @__PURE__ */
|
|
151
|
-
|
|
153
|
+
}, [c.open, t]), /* @__PURE__ */ a(
|
|
154
|
+
I.div,
|
|
152
155
|
{
|
|
153
156
|
"data-state": L(c.open),
|
|
154
157
|
"data-disabled": c.disabled ? "" : void 0,
|
|
155
158
|
id: c.contentId,
|
|
156
159
|
hidden: !b,
|
|
157
160
|
...n,
|
|
158
|
-
ref:
|
|
161
|
+
ref: m,
|
|
159
162
|
style: {
|
|
160
163
|
"--radix-collapsible-content-height": x ? `${x}px` : void 0,
|
|
161
|
-
"--radix-collapsible-content-width":
|
|
164
|
+
"--radix-collapsible-content-width": R ? `${R}px` : void 0,
|
|
162
165
|
...e.style
|
|
163
166
|
},
|
|
164
167
|
children: b && r
|
|
@@ -168,21 +171,21 @@ var _e = u.forwardRef((e, a) => {
|
|
|
168
171
|
function L(e) {
|
|
169
172
|
return e ? "open" : "closed";
|
|
170
173
|
}
|
|
171
|
-
var Pe = Y, Ee = W, Se = X, C = "Accordion", Oe = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [G, Te, ke] =
|
|
174
|
+
var Pe = Y, Ee = W, Se = X, C = "Accordion", Oe = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [G, Te, ke] = ye(C), [E] = z(C, [
|
|
172
175
|
ke,
|
|
173
176
|
J
|
|
174
|
-
]), K = J(), Z =
|
|
175
|
-
(e,
|
|
177
|
+
]), K = J(), Z = u.forwardRef(
|
|
178
|
+
(e, i) => {
|
|
176
179
|
const { type: o, ...t } = e, r = t, n = t;
|
|
177
|
-
return /* @__PURE__ */
|
|
180
|
+
return /* @__PURE__ */ a(G.Provider, { scope: e.__scopeAccordion, children: o === "multiple" ? /* @__PURE__ */ a($e, { ...n, ref: i }) : /* @__PURE__ */ a(Ve, { ...r, ref: i }) });
|
|
178
181
|
}
|
|
179
182
|
);
|
|
180
183
|
Z.displayName = C;
|
|
181
184
|
var [ee, De] = E(C), [oe, Me] = E(
|
|
182
185
|
C,
|
|
183
186
|
{ collapsible: !1 }
|
|
184
|
-
), Ve =
|
|
185
|
-
(e,
|
|
187
|
+
), Ve = u.forwardRef(
|
|
188
|
+
(e, i) => {
|
|
186
189
|
const {
|
|
187
190
|
value: o,
|
|
188
191
|
defaultValue: t,
|
|
@@ -190,68 +193,68 @@ var [ee, De] = E(C), [oe, Me] = E(
|
|
|
190
193
|
},
|
|
191
194
|
collapsible: n = !1,
|
|
192
195
|
...c
|
|
193
|
-
} = e, [
|
|
196
|
+
} = e, [l, s] = V({
|
|
194
197
|
prop: o,
|
|
195
198
|
defaultProp: t ?? "",
|
|
196
199
|
onChange: r,
|
|
197
200
|
caller: C
|
|
198
201
|
});
|
|
199
|
-
return /* @__PURE__ */
|
|
202
|
+
return /* @__PURE__ */ a(
|
|
200
203
|
ee,
|
|
201
204
|
{
|
|
202
205
|
scope: e.__scopeAccordion,
|
|
203
|
-
value:
|
|
204
|
-
onItemOpen:
|
|
205
|
-
onItemClose:
|
|
206
|
-
children: /* @__PURE__ */
|
|
206
|
+
value: u.useMemo(() => l ? [l] : [], [l]),
|
|
207
|
+
onItemOpen: s,
|
|
208
|
+
onItemClose: u.useCallback(() => n && s(""), [n, s]),
|
|
209
|
+
children: /* @__PURE__ */ a(oe, { scope: e.__scopeAccordion, collapsible: n, children: /* @__PURE__ */ a(te, { ...c, ref: i }) })
|
|
207
210
|
}
|
|
208
211
|
);
|
|
209
212
|
}
|
|
210
|
-
), $e =
|
|
213
|
+
), $e = u.forwardRef((e, i) => {
|
|
211
214
|
const {
|
|
212
215
|
value: o,
|
|
213
216
|
defaultValue: t,
|
|
214
217
|
onValueChange: r = () => {
|
|
215
218
|
},
|
|
216
219
|
...n
|
|
217
|
-
} = e, [c,
|
|
220
|
+
} = e, [c, l] = V({
|
|
218
221
|
prop: o,
|
|
219
222
|
defaultProp: t ?? [],
|
|
220
223
|
onChange: r,
|
|
221
224
|
caller: C
|
|
222
|
-
}),
|
|
223
|
-
(
|
|
224
|
-
[
|
|
225
|
-
), p =
|
|
226
|
-
(
|
|
227
|
-
[
|
|
225
|
+
}), s = u.useCallback(
|
|
226
|
+
(m) => l((v = []) => [...v, m]),
|
|
227
|
+
[l]
|
|
228
|
+
), p = u.useCallback(
|
|
229
|
+
(m) => l((v = []) => v.filter((x) => x !== m)),
|
|
230
|
+
[l]
|
|
228
231
|
);
|
|
229
|
-
return /* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ a(
|
|
230
233
|
ee,
|
|
231
234
|
{
|
|
232
235
|
scope: e.__scopeAccordion,
|
|
233
236
|
value: c,
|
|
234
|
-
onItemOpen:
|
|
237
|
+
onItemOpen: s,
|
|
235
238
|
onItemClose: p,
|
|
236
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ a(oe, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ a(te, { ...n, ref: i }) })
|
|
237
240
|
}
|
|
238
241
|
);
|
|
239
|
-
}), [He, S] = E(C), te =
|
|
240
|
-
(e,
|
|
241
|
-
const { __scopeAccordion: o, disabled: t, dir: r, orientation: n = "vertical", ...c } = e,
|
|
242
|
+
}), [He, S] = E(C), te = u.forwardRef(
|
|
243
|
+
(e, i) => {
|
|
244
|
+
const { __scopeAccordion: o, disabled: t, dir: r, orientation: n = "vertical", ...c } = e, l = u.useRef(null), s = U(l, i), p = Te(o), v = Ie(r) === "ltr", x = B(e.onKeyDown, (g) => {
|
|
242
245
|
if (!Oe.includes(g.key)) return;
|
|
243
|
-
const
|
|
246
|
+
const R = g.target, b = p().filter((D) => !D.ref.current?.disabled), A = b.findIndex((D) => D.ref.current === R), h = b.length;
|
|
244
247
|
if (A === -1) return;
|
|
245
248
|
g.preventDefault();
|
|
246
249
|
let d = A;
|
|
247
|
-
const
|
|
248
|
-
d = A + 1, d > O && (d =
|
|
250
|
+
const y = 0, O = h - 1, T = () => {
|
|
251
|
+
d = A + 1, d > O && (d = y);
|
|
249
252
|
}, k = () => {
|
|
250
|
-
d = A - 1, d <
|
|
253
|
+
d = A - 1, d < y && (d = O);
|
|
251
254
|
};
|
|
252
255
|
switch (g.key) {
|
|
253
256
|
case "Home":
|
|
254
|
-
d =
|
|
257
|
+
d = y;
|
|
255
258
|
break;
|
|
256
259
|
case "End":
|
|
257
260
|
d = O;
|
|
@@ -272,44 +275,44 @@ var [ee, De] = E(C), [oe, Me] = E(
|
|
|
272
275
|
const pe = d % h;
|
|
273
276
|
b[pe].ref.current?.focus();
|
|
274
277
|
});
|
|
275
|
-
return /* @__PURE__ */
|
|
278
|
+
return /* @__PURE__ */ a(
|
|
276
279
|
He,
|
|
277
280
|
{
|
|
278
281
|
scope: o,
|
|
279
282
|
disabled: t,
|
|
280
283
|
direction: r,
|
|
281
284
|
orientation: n,
|
|
282
|
-
children: /* @__PURE__ */
|
|
283
|
-
|
|
285
|
+
children: /* @__PURE__ */ a(G.Slot, { scope: o, children: /* @__PURE__ */ a(
|
|
286
|
+
I.div,
|
|
284
287
|
{
|
|
285
288
|
...c,
|
|
286
289
|
"data-orientation": n,
|
|
287
|
-
ref:
|
|
290
|
+
ref: s,
|
|
288
291
|
onKeyDown: t ? void 0 : x
|
|
289
292
|
}
|
|
290
293
|
) })
|
|
291
294
|
}
|
|
292
295
|
);
|
|
293
296
|
}
|
|
294
|
-
), N = "AccordionItem", [Le, j] = E(N), re =
|
|
295
|
-
(e,
|
|
296
|
-
const { __scopeAccordion: o, value: t, ...r } = e, n = S(N, o), c = De(N, o),
|
|
297
|
-
return /* @__PURE__ */
|
|
297
|
+
), N = "AccordionItem", [Le, j] = E(N), re = u.forwardRef(
|
|
298
|
+
(e, i) => {
|
|
299
|
+
const { __scopeAccordion: o, value: t, ...r } = e, n = S(N, o), c = De(N, o), l = K(o), s = q(), p = t && c.value.includes(t) || !1, m = n.disabled || e.disabled;
|
|
300
|
+
return /* @__PURE__ */ a(
|
|
298
301
|
Le,
|
|
299
302
|
{
|
|
300
303
|
scope: o,
|
|
301
304
|
open: p,
|
|
302
|
-
disabled:
|
|
303
|
-
triggerId:
|
|
304
|
-
children: /* @__PURE__ */
|
|
305
|
+
disabled: m,
|
|
306
|
+
triggerId: s,
|
|
307
|
+
children: /* @__PURE__ */ a(
|
|
305
308
|
Pe,
|
|
306
309
|
{
|
|
307
310
|
"data-orientation": n.orientation,
|
|
308
|
-
"data-state":
|
|
309
|
-
...
|
|
311
|
+
"data-state": se(p),
|
|
312
|
+
...l,
|
|
310
313
|
...r,
|
|
311
|
-
ref:
|
|
312
|
-
disabled:
|
|
314
|
+
ref: i,
|
|
315
|
+
disabled: m,
|
|
313
316
|
open: p,
|
|
314
317
|
onOpenChange: (v) => {
|
|
315
318
|
v ? c.onItemOpen(t) : c.onItemClose(t);
|
|
@@ -321,43 +324,43 @@ var [ee, De] = E(C), [oe, Me] = E(
|
|
|
321
324
|
}
|
|
322
325
|
);
|
|
323
326
|
re.displayName = N;
|
|
324
|
-
var ne = "AccordionHeader", ae =
|
|
325
|
-
(e,
|
|
327
|
+
var ne = "AccordionHeader", ae = u.forwardRef(
|
|
328
|
+
(e, i) => {
|
|
326
329
|
const { __scopeAccordion: o, ...t } = e, r = S(C, o), n = j(ne, o);
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
|
|
330
|
+
return /* @__PURE__ */ a(
|
|
331
|
+
I.h3,
|
|
329
332
|
{
|
|
330
333
|
"data-orientation": r.orientation,
|
|
331
|
-
"data-state":
|
|
334
|
+
"data-state": se(n.open),
|
|
332
335
|
"data-disabled": n.disabled ? "" : void 0,
|
|
333
336
|
...t,
|
|
334
|
-
ref:
|
|
337
|
+
ref: i
|
|
335
338
|
}
|
|
336
339
|
);
|
|
337
340
|
}
|
|
338
341
|
);
|
|
339
342
|
ae.displayName = ne;
|
|
340
|
-
var M = "AccordionTrigger", ie =
|
|
341
|
-
(e,
|
|
342
|
-
const { __scopeAccordion: o, ...t } = e, r = S(C, o), n = j(M, o), c = Me(M, o),
|
|
343
|
-
return /* @__PURE__ */
|
|
343
|
+
var M = "AccordionTrigger", ie = u.forwardRef(
|
|
344
|
+
(e, i) => {
|
|
345
|
+
const { __scopeAccordion: o, ...t } = e, r = S(C, o), n = j(M, o), c = Me(M, o), l = K(o);
|
|
346
|
+
return /* @__PURE__ */ a(G.ItemSlot, { scope: o, children: /* @__PURE__ */ a(
|
|
344
347
|
Ee,
|
|
345
348
|
{
|
|
346
349
|
"aria-disabled": n.open && !c.collapsible || void 0,
|
|
347
350
|
"data-orientation": r.orientation,
|
|
348
351
|
id: n.triggerId,
|
|
349
|
-
...
|
|
352
|
+
...l,
|
|
350
353
|
...t,
|
|
351
|
-
ref:
|
|
354
|
+
ref: i
|
|
352
355
|
}
|
|
353
356
|
) });
|
|
354
357
|
}
|
|
355
358
|
);
|
|
356
359
|
ie.displayName = M;
|
|
357
|
-
var ce = "AccordionContent",
|
|
358
|
-
(e,
|
|
360
|
+
var ce = "AccordionContent", le = u.forwardRef(
|
|
361
|
+
(e, i) => {
|
|
359
362
|
const { __scopeAccordion: o, ...t } = e, r = S(C, o), n = j(ce, o), c = K(o);
|
|
360
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ a(
|
|
361
364
|
Se,
|
|
362
365
|
{
|
|
363
366
|
role: "region",
|
|
@@ -365,7 +368,7 @@ var ce = "AccordionContent", se = m.forwardRef(
|
|
|
365
368
|
"data-orientation": r.orientation,
|
|
366
369
|
...c,
|
|
367
370
|
...t,
|
|
368
|
-
ref:
|
|
371
|
+
ref: i,
|
|
369
372
|
style: {
|
|
370
373
|
"--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
|
|
371
374
|
"--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
|
|
@@ -375,59 +378,59 @@ var ce = "AccordionContent", se = m.forwardRef(
|
|
|
375
378
|
);
|
|
376
379
|
}
|
|
377
380
|
);
|
|
378
|
-
|
|
379
|
-
function
|
|
381
|
+
le.displayName = ce;
|
|
382
|
+
function se(e) {
|
|
380
383
|
return e ? "open" : "closed";
|
|
381
384
|
}
|
|
382
|
-
var Ge = Z, Ke = re, je = ae, Fe = ie, ze =
|
|
385
|
+
var Ge = Z, Ke = re, je = ae, Fe = ie, ze = le;
|
|
383
386
|
const Be = {
|
|
384
387
|
default: "shadow-none",
|
|
385
388
|
contained: "rounded-md border border-level-four",
|
|
386
389
|
separated: "rounded-none space-y-2"
|
|
387
390
|
}, Ue = {
|
|
388
|
-
default: "",
|
|
389
|
-
contained: "last:border-b-
|
|
390
|
-
separated: "rounded-md"
|
|
391
|
-
}, de = fe({ variant: "default" }), qe = w(({ variant: e = "default", ...
|
|
392
|
-
const { autoScroll:
|
|
393
|
-
autoScroll:
|
|
394
|
-
scrollPadding:
|
|
395
|
-
},
|
|
396
|
-
...
|
|
397
|
-
ref:
|
|
391
|
+
default: "w-full py-4",
|
|
392
|
+
contained: "not-last:border-b border-level-four p-4",
|
|
393
|
+
separated: "border border-level-four rounded-md p-4"
|
|
394
|
+
}, de = fe({ variant: "default" }), qe = w(({ variant: e = "default", className: i, ...o }, t) => {
|
|
395
|
+
const { autoScroll: r = "never", scrollPadding: n = -20, children: c, ...l } = o, s = {
|
|
396
|
+
autoScroll: r,
|
|
397
|
+
scrollPadding: n
|
|
398
|
+
}, p = {
|
|
399
|
+
...l,
|
|
400
|
+
ref: t
|
|
398
401
|
};
|
|
399
|
-
return /* @__PURE__ */
|
|
402
|
+
return /* @__PURE__ */ a(de.Provider, { value: { variant: e }, children: /* @__PURE__ */ a(
|
|
400
403
|
Ge,
|
|
401
404
|
{
|
|
402
|
-
...
|
|
405
|
+
...p,
|
|
403
406
|
"data-slot": "accordion",
|
|
404
407
|
"data-testid": "spectral-accordion",
|
|
405
408
|
"data-scroll-options": JSON.stringify(s),
|
|
406
|
-
"data-auto-scroll":
|
|
407
|
-
"data-scroll-padding":
|
|
408
|
-
...
|
|
409
|
-
className: _("flex flex-col accordion-wrapper", Be[e]),
|
|
410
|
-
children: ve.map(
|
|
409
|
+
"data-auto-scroll": r,
|
|
410
|
+
"data-scroll-padding": n,
|
|
411
|
+
...o.type === "single" ? { collapsible: !0 } : {},
|
|
412
|
+
className: _("flex flex-col accordion-wrapper", Be[e], i),
|
|
413
|
+
children: ve.map(c, (m) => Ce(m) ? ge(m, { variant: e }) : m)
|
|
411
414
|
}
|
|
412
415
|
) });
|
|
413
416
|
});
|
|
414
417
|
qe.displayName = "Accordion";
|
|
415
|
-
const Je = w(({ className: e, ...
|
|
418
|
+
const Je = w(({ className: e, ...i }, o) => {
|
|
416
419
|
const { variant: t = "default" } = be(de);
|
|
417
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ a(Ke, { ref: o, "data-slot": "accordion-item", "data-testid": "spectral-accordion-item", className: _("w-full", Ue[t], e), ...i });
|
|
418
421
|
});
|
|
419
422
|
Je.displayName = "AccordionItem";
|
|
420
|
-
const Ye = w(({ className: e, title:
|
|
421
|
-
const n = Ae(null), c = ue(n),
|
|
422
|
-
(
|
|
423
|
-
typeof r == "function" ? r(
|
|
423
|
+
const Ye = w(({ className: e, title: i, subtitle: o, ...t }, r) => {
|
|
424
|
+
const n = Ae(null), c = ue(n), l = he(
|
|
425
|
+
(s) => {
|
|
426
|
+
typeof r == "function" ? r(s) : r && (r.current = s), n.current = s;
|
|
424
427
|
},
|
|
425
428
|
[r]
|
|
426
429
|
);
|
|
427
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ a(je, { className: "m-0 flex", children: /* @__PURE__ */ F(
|
|
428
431
|
Fe,
|
|
429
432
|
{
|
|
430
|
-
ref:
|
|
433
|
+
ref: l,
|
|
431
434
|
"data-slot": "accordion-trigger",
|
|
432
435
|
"data-testid": "spectral-accordion-trigger",
|
|
433
436
|
className: _("flex flex-1 items-center justify-between text-sm font-normal text-text-primary transition-all hover:no-underline", "disabled:cursor-not-allowed [&[data-state=open]>svg]:rotate-180", e),
|
|
@@ -435,16 +438,16 @@ const Ye = w(({ className: e, title: a, subtitle: o, ...t }, r) => {
|
|
|
435
438
|
...t,
|
|
436
439
|
children: [
|
|
437
440
|
/* @__PURE__ */ F("div", { className: "flex flex-col space-y-0.5 text-start w-full", children: [
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
o && /* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ a("div", { className: "text-base font-medium text-text-primary", children: i }),
|
|
442
|
+
o && /* @__PURE__ */ a("div", { className: "text-sm font-normal text-text-secondary", children: o })
|
|
440
443
|
] }),
|
|
441
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ a(me, { className: "shrink-0 transition-transform duration-200" })
|
|
442
445
|
]
|
|
443
446
|
}
|
|
444
447
|
) });
|
|
445
448
|
});
|
|
446
449
|
Ye.displayName = "AccordionTrigger";
|
|
447
|
-
const Qe = w(({ className: e, children:
|
|
450
|
+
const Qe = w(({ className: e, children: i, ...o }, t) => /* @__PURE__ */ a(ze, { ref: t, "data-slot": "accordion-content", "data-testid": "spectral-accordion-content", className: _("overflow-hidden pt-4 text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", e), ...o, children: /* @__PURE__ */ a("div", { className: "px-1 pb-4 pt-0", "data-slot": "accordion-content-inner", children: i }) }));
|
|
448
451
|
Qe.displayName = "AccordionContent";
|
|
449
452
|
export {
|
|
450
453
|
qe as Accordion,
|
package/dist/Alert.js
CHANGED
|
@@ -20,6 +20,7 @@ import "./Icons/DashboardIcon.js";
|
|
|
20
20
|
import "./Icons/DatabaseIcon.js";
|
|
21
21
|
import "./Icons/DeleteIcon.js";
|
|
22
22
|
import "./Icons/DurationIcon.js";
|
|
23
|
+
import "./Icons/EditIcon.js";
|
|
23
24
|
import "./Icons/EmailIcon.js";
|
|
24
25
|
import "./Icons/EraserIcon.js";
|
|
25
26
|
import "./Icons/ErrorIcon.js";
|
|
@@ -51,7 +52,9 @@ import "./Icons/ReviewedIcon.js";
|
|
|
51
52
|
import "./Icons/ScissorsIcon.js";
|
|
52
53
|
import "./Icons/SettingsIcon.js";
|
|
53
54
|
import "./Icons/SortAscendingIcon.js";
|
|
55
|
+
import "./Icons/SortAtoZIcon.js";
|
|
54
56
|
import "./Icons/SortDescendingIcon.js";
|
|
57
|
+
import "./Icons/SortZtoAIcon.js";
|
|
55
58
|
import "./Icons/StackIcon.js";
|
|
56
59
|
import "./Icons/StarIcon.js";
|
|
57
60
|
import "./Icons/TrashIcon.js";
|
|
@@ -63,7 +66,7 @@ import "./Icons/ZoomXIcon.js";
|
|
|
63
66
|
import "./Icons/ZoomYIcon.js";
|
|
64
67
|
import { cn as g } from "./utils/twUtils.js";
|
|
65
68
|
import { useRef as R, useEffect as T } from "react";
|
|
66
|
-
const
|
|
69
|
+
const Kt = ({ id: n, description: s, onClose: a, icon: l, title: c, className: d, variant: r = "default" }) => {
|
|
67
70
|
const o = R(null), u = l || {
|
|
68
71
|
info: /* @__PURE__ */ t(E, {}),
|
|
69
72
|
success: /* @__PURE__ */ t(w, {}),
|
|
@@ -107,5 +110,5 @@ const qt = ({ id: n, description: s, onClose: a, icon: l, title: c, className: d
|
|
|
107
110
|
] }) });
|
|
108
111
|
};
|
|
109
112
|
export {
|
|
110
|
-
|
|
113
|
+
Kt as Alert
|
|
111
114
|
};
|
package/dist/Button.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
3
|
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
4
|
-
import { ErrorMessage as
|
|
4
|
+
import { ErrorMessage as h } from "./utils/formFieldUtils.js";
|
|
5
5
|
import { cn as u } from "./utils/twUtils.js";
|
|
6
|
-
import { c as
|
|
7
|
-
import { forwardRef as
|
|
6
|
+
import { c as y } from "./index-D29mdTf5.js";
|
|
7
|
+
import { forwardRef as f } from "react";
|
|
8
8
|
import { c as w } from "./createLucideIcon-D4r5Phnh.js";
|
|
9
|
-
const N = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], _ = w("loader-circle", N), j =
|
|
9
|
+
const N = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], _ = w("loader-circle", N), j = y(
|
|
10
10
|
`
|
|
11
11
|
!font-sans flex relative items-center justify-center gap-2 whitespace-nowrap transition-colors cursor-pointer rounded-lg border font-semibold focus:outline-none focus:outline-none
|
|
12
|
-
focus-visible:outline-1 focus-visible:outline-offset-2 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0
|
|
12
|
+
focus-visible:outline-1 focus-visible:outline-offset-2 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 disabled:pointer-events-none
|
|
13
13
|
`,
|
|
14
14
|
{
|
|
15
15
|
variants: {
|
|
@@ -29,7 +29,7 @@ const N = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], _ = w
|
|
|
29
29
|
},
|
|
30
30
|
state: {
|
|
31
31
|
default: "",
|
|
32
|
-
error: "bg-button-danger text-text-primary transition
|
|
32
|
+
error: "bg-button-danger text-text-primary transition focus-visible:outline-button-danger",
|
|
33
33
|
loading: "cursor-wait pointer-events-none"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
@@ -39,13 +39,13 @@ const N = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], _ = w
|
|
|
39
39
|
size: "default"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
), z =
|
|
43
|
-
const
|
|
42
|
+
), z = f(({ className: l, dataTestId: g, disabled: r, endIcon: n, errorMessage: b, label: c, size: a, startIcon: d, state: t, type: p = "button", variant: e = "primary", ...x }, m) => {
|
|
43
|
+
const i = {
|
|
44
44
|
error: {
|
|
45
|
-
primary: "bg-button-danger border-button-danger text-
|
|
46
|
-
secondary: "bg-button-danger border-button-danger text-button-
|
|
47
|
-
outline: "bg-transparent border-button-danger text-button-danger
|
|
48
|
-
ghost: "bg-transparent text-button-danger
|
|
45
|
+
primary: "bg-button-danger border-button-danger text-text-primary hover:bg-button-danger--hover hover:text-text-primary",
|
|
46
|
+
secondary: "bg-button-danger border-button-danger text-text-primary hover:bg-button-danger--hover hover:text-text-primary",
|
|
47
|
+
outline: "bg-transparent border-button-danger text-button-danger hover:border-button-danger--hover hover:text-button-danger/80",
|
|
48
|
+
ghost: "bg-transparent text-button-danger hover:text-button-danger/80"
|
|
49
49
|
},
|
|
50
50
|
loading: {
|
|
51
51
|
primary: "bg-button-primary-bg--disabled border-button-primary-border--disabled text-button-primary-text--disabled pointer-events-none",
|
|
@@ -53,15 +53,15 @@ const N = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], _ = w
|
|
|
53
53
|
outline: "bg-button-outline-bg--disabled border-button-outline-border--disabled text-button-outline-text--disabled pointer-events-none",
|
|
54
54
|
ghost: "bg-transparent text-button-ghost-text--disabled pointer-events-none"
|
|
55
55
|
}
|
|
56
|
-
},
|
|
57
|
-
return /* @__PURE__ */ s("div", { className: u("flex flex-col justify-items-center",
|
|
58
|
-
/* @__PURE__ */ s("button", { "aria-disabled": r, className:
|
|
59
|
-
|
|
56
|
+
}, v = u(j({ variant: e, state: t, size: a }), t === "error" && i.error[e], t === "loading" && i.loading[e], l);
|
|
57
|
+
return /* @__PURE__ */ s("div", { className: u("flex flex-col justify-items-center", a), children: [
|
|
58
|
+
/* @__PURE__ */ s("button", { "aria-disabled": r, className: v, "data-state": t, "data-testid": g || `spectral-button-${e}`, disabled: r, ref: m, type: p, ...x, children: [
|
|
59
|
+
d && /* @__PURE__ */ o("span", { className: "flex pr-2", "aria-hidden": !0, "data-testid": "spectral-button-start-icon", children: d }),
|
|
60
60
|
t === "loading" && /* @__PURE__ */ o(_, { className: "ml-2 animate-spin", size: 16 }),
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
c,
|
|
62
|
+
n && t !== "loading" && /* @__PURE__ */ o("span", { className: "flex pl-2", "aria-hidden": !0, "data-testid": "spectral-button-end-icon", children: n })
|
|
63
63
|
] }),
|
|
64
|
-
t === "error" && b && /* @__PURE__ */ o(
|
|
64
|
+
t === "error" && b && /* @__PURE__ */ o(h, { message: b, dataTestId: "spectral-button-error-message", id: "button-error" })
|
|
65
65
|
] });
|
|
66
66
|
});
|
|
67
67
|
z.displayName = "Button";
|
package/dist/ButtonIcon.js
CHANGED
|
@@ -19,6 +19,7 @@ import "./Icons/DashboardIcon.js";
|
|
|
19
19
|
import "./Icons/DatabaseIcon.js";
|
|
20
20
|
import "./Icons/DeleteIcon.js";
|
|
21
21
|
import "./Icons/DurationIcon.js";
|
|
22
|
+
import "./Icons/EditIcon.js";
|
|
22
23
|
import "./Icons/EmailIcon.js";
|
|
23
24
|
import "./Icons/EraserIcon.js";
|
|
24
25
|
import "./Icons/ErrorIcon.js";
|
|
@@ -50,7 +51,9 @@ import "./Icons/ReviewedIcon.js";
|
|
|
50
51
|
import "./Icons/ScissorsIcon.js";
|
|
51
52
|
import "./Icons/SettingsIcon.js";
|
|
52
53
|
import "./Icons/SortAscendingIcon.js";
|
|
54
|
+
import "./Icons/SortAtoZIcon.js";
|
|
53
55
|
import "./Icons/SortDescendingIcon.js";
|
|
56
|
+
import "./Icons/SortZtoAIcon.js";
|
|
54
57
|
import "./Icons/StackIcon.js";
|
|
55
58
|
import "./Icons/StarIcon.js";
|
|
56
59
|
import "./Icons/TrashIcon.js";
|