@spear-ai/spectral 1.1.3 → 1.2.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 +2 -7
- package/dist/assets/spectral.css +1 -1
- package/dist/favicon-invert.svg +5 -0
- package/dist/favicon.svg +5 -0
- package/dist/index.d.ts +1 -11
- package/dist/logo/wordmark-dark-side-by-side.svg +6 -0
- package/dist/logo/wordmark-light-side-by-side.svg +6 -0
- package/dist/spectral.cjs.js +75 -0
- package/dist/spectral.es.js +7578 -0
- package/package.json +6 -19
- package/src/styles/main.css +4 -2
- package/dist/Button.d.ts +0 -2
- package/dist/Button.js +0 -118
- package/dist/Card.d.ts +0 -2
- package/dist/Card.js +0 -25
- package/dist/Drawer.d.ts +0 -2
- package/dist/Drawer.js +0 -2163
- package/dist/Skeleton.d.ts +0 -2
- package/dist/Skeleton.js +0 -9
- package/dist/Slider.d.ts +0 -2
- package/dist/Slider.js +0 -563
- package/dist/components/Button/Button.d.ts +0 -20
- package/dist/components/Card/Card.d.ts +0 -9
- package/dist/components/Drawer/Drawer.d.ts +0 -10
- package/dist/components/Skeleton/Skeleton.d.ts +0 -3
- package/dist/components/Slider/Slider.d.ts +0 -18
- package/dist/hooks/useAccordionAutoScroll.d.ts +0 -8
- package/dist/hooks/useOutsideClick.d.ts +0 -7
- package/dist/hooks/useTheme.d.ts +0 -7
- package/dist/index-C-ErIYr7.js +0 -225
- package/dist/index.js +0 -33
- package/dist/loader-circle-Btf6jOd5.js +0 -101
- package/dist/primitives/button.d.ts +0 -10
- package/dist/primitives/input.d.ts +0 -3
- package/dist/primitives/tooltip.d.ts +0 -7
- package/dist/twUtils-B9ArqCOv.js +0 -2747
- package/dist/utils/twUtils.d.ts +0 -3
package/dist/Skeleton.d.ts
DELETED
package/dist/Skeleton.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { c as n } from "./twUtils-B9ArqCOv.js";
|
|
3
|
-
import "react";
|
|
4
|
-
function s({ className: t, ...e }) {
|
|
5
|
-
return /* @__PURE__ */ o("div", { "data-slot": "skeleton", className: n("bg-accent animate-pulse rounded-md", t), ...e });
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
s as Skeleton
|
|
9
|
-
};
|
package/dist/Slider.d.ts
DELETED
package/dist/Slider.js
DELETED
|
@@ -1,563 +0,0 @@
|
|
|
1
|
-
import { jsx as b, jsxs as X } from "react/jsx-runtime";
|
|
2
|
-
import * as d from "react";
|
|
3
|
-
import _ from "react";
|
|
4
|
-
import { u as me, b as G, a as E, e as j, g as Se, c as A, P as B } from "./index-C-ErIYr7.js";
|
|
5
|
-
import { c as H } from "./twUtils-B9ArqCOv.js";
|
|
6
|
-
function q(e, [t, o]) {
|
|
7
|
-
return Math.min(o, Math.max(t, e));
|
|
8
|
-
}
|
|
9
|
-
var he = d.createContext(void 0);
|
|
10
|
-
function pe(e) {
|
|
11
|
-
const t = d.useContext(he);
|
|
12
|
-
return e || t || "ltr";
|
|
13
|
-
}
|
|
14
|
-
function ge(e) {
|
|
15
|
-
const t = d.useRef({ value: e, previous: e });
|
|
16
|
-
return d.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
17
|
-
}
|
|
18
|
-
function ve(e) {
|
|
19
|
-
const [t, o] = d.useState(void 0);
|
|
20
|
-
return me(() => {
|
|
21
|
-
if (e) {
|
|
22
|
-
o({ width: e.offsetWidth, height: e.offsetHeight });
|
|
23
|
-
const n = new ResizeObserver((i) => {
|
|
24
|
-
if (!Array.isArray(i) || !i.length)
|
|
25
|
-
return;
|
|
26
|
-
const c = i[0];
|
|
27
|
-
let r, s;
|
|
28
|
-
if ("borderBoxSize" in c) {
|
|
29
|
-
const u = c.borderBoxSize, g = Array.isArray(u) ? u[0] : u;
|
|
30
|
-
r = g.inlineSize, s = g.blockSize;
|
|
31
|
-
} else
|
|
32
|
-
r = e.offsetWidth, s = e.offsetHeight;
|
|
33
|
-
o({ width: r, height: s });
|
|
34
|
-
});
|
|
35
|
-
return n.observe(e, { box: "border-box" }), () => n.unobserve(e);
|
|
36
|
-
} else
|
|
37
|
-
o(void 0);
|
|
38
|
-
}, [e]), t;
|
|
39
|
-
}
|
|
40
|
-
function be(e) {
|
|
41
|
-
const t = e + "CollectionProvider", [o, n] = G(t), [i, c] = o(
|
|
42
|
-
t,
|
|
43
|
-
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
44
|
-
), r = (f) => {
|
|
45
|
-
const { scope: l, children: m } = f, R = _.useRef(null), p = _.useRef(/* @__PURE__ */ new Map()).current;
|
|
46
|
-
return /* @__PURE__ */ b(i, { scope: l, itemMap: p, collectionRef: R, children: m });
|
|
47
|
-
};
|
|
48
|
-
r.displayName = t;
|
|
49
|
-
const s = e + "CollectionSlot", u = j(s), g = _.forwardRef(
|
|
50
|
-
(f, l) => {
|
|
51
|
-
const { scope: m, children: R } = f, p = c(s, m), S = E(l, p.collectionRef);
|
|
52
|
-
return /* @__PURE__ */ b(u, { ref: S, children: R });
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
g.displayName = s;
|
|
56
|
-
const v = e + "CollectionItemSlot", a = "data-radix-collection-item", h = j(v), w = _.forwardRef(
|
|
57
|
-
(f, l) => {
|
|
58
|
-
const { scope: m, children: R, ...p } = f, S = _.useRef(null), C = E(l, S), P = c(v, m);
|
|
59
|
-
return _.useEffect(() => (P.itemMap.set(S, { ref: S, ...p }), () => void P.itemMap.delete(S))), /* @__PURE__ */ b(h, { [a]: "", ref: C, children: R });
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
w.displayName = v;
|
|
63
|
-
function x(f) {
|
|
64
|
-
const l = c(e + "CollectionConsumer", f);
|
|
65
|
-
return _.useCallback(() => {
|
|
66
|
-
const R = l.collectionRef.current;
|
|
67
|
-
if (!R) return [];
|
|
68
|
-
const p = Array.from(R.querySelectorAll(`[${a}]`));
|
|
69
|
-
return Array.from(l.itemMap.values()).sort(
|
|
70
|
-
(P, T) => p.indexOf(P.ref.current) - p.indexOf(T.ref.current)
|
|
71
|
-
);
|
|
72
|
-
}, [l.collectionRef, l.itemMap]);
|
|
73
|
-
}
|
|
74
|
-
return [
|
|
75
|
-
{ Provider: r, Slot: g, ItemSlot: w },
|
|
76
|
-
x,
|
|
77
|
-
n
|
|
78
|
-
];
|
|
79
|
-
}
|
|
80
|
-
var J = ["PageUp", "PageDown"], Q = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Z = {
|
|
81
|
-
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
82
|
-
"from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
|
|
83
|
-
"from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
84
|
-
"from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
|
|
85
|
-
}, z = "Slider", [L, we, Re] = be(z), [ee, Fe] = G(z, [
|
|
86
|
-
Re
|
|
87
|
-
]), [xe, k] = ee(z), te = d.forwardRef(
|
|
88
|
-
(e, t) => {
|
|
89
|
-
const {
|
|
90
|
-
name: o,
|
|
91
|
-
min: n = 0,
|
|
92
|
-
max: i = 100,
|
|
93
|
-
step: c = 1,
|
|
94
|
-
orientation: r = "horizontal",
|
|
95
|
-
disabled: s = !1,
|
|
96
|
-
minStepsBetweenThumbs: u = 0,
|
|
97
|
-
defaultValue: g = [n],
|
|
98
|
-
value: v,
|
|
99
|
-
onValueChange: a = () => {
|
|
100
|
-
},
|
|
101
|
-
onValueCommit: h = () => {
|
|
102
|
-
},
|
|
103
|
-
inverted: w = !1,
|
|
104
|
-
form: x,
|
|
105
|
-
...f
|
|
106
|
-
} = e, l = d.useRef(/* @__PURE__ */ new Set()), m = d.useRef(0), p = r === "horizontal" ? ye : Ce, [S = [], C] = Se({
|
|
107
|
-
prop: v,
|
|
108
|
-
defaultProp: g,
|
|
109
|
-
onChange: (y) => {
|
|
110
|
-
[...l.current][m.current]?.focus(), a(y);
|
|
111
|
-
}
|
|
112
|
-
}), P = d.useRef(S);
|
|
113
|
-
function T(y) {
|
|
114
|
-
const M = _e(S, y);
|
|
115
|
-
N(y, M);
|
|
116
|
-
}
|
|
117
|
-
function ue(y) {
|
|
118
|
-
N(y, m.current);
|
|
119
|
-
}
|
|
120
|
-
function fe() {
|
|
121
|
-
const y = P.current[m.current];
|
|
122
|
-
S[m.current] !== y && h(S);
|
|
123
|
-
}
|
|
124
|
-
function N(y, M, { commit: V } = { commit: !1 }) {
|
|
125
|
-
const $ = Te(c), O = Ne(Math.round((y - n) / c) * c + n, $), K = q(O, [n, i]);
|
|
126
|
-
C((I = []) => {
|
|
127
|
-
const D = Me(I, K, M);
|
|
128
|
-
if (ze(D, u * c)) {
|
|
129
|
-
m.current = D.indexOf(K);
|
|
130
|
-
const W = String(D) !== String(I);
|
|
131
|
-
return W && V && h(D), W ? D : I;
|
|
132
|
-
} else
|
|
133
|
-
return I;
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
return /* @__PURE__ */ b(
|
|
137
|
-
xe,
|
|
138
|
-
{
|
|
139
|
-
scope: e.__scopeSlider,
|
|
140
|
-
name: o,
|
|
141
|
-
disabled: s,
|
|
142
|
-
min: n,
|
|
143
|
-
max: i,
|
|
144
|
-
valueIndexToChangeRef: m,
|
|
145
|
-
thumbs: l.current,
|
|
146
|
-
values: S,
|
|
147
|
-
orientation: r,
|
|
148
|
-
form: x,
|
|
149
|
-
children: /* @__PURE__ */ b(L.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ b(L.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ b(
|
|
150
|
-
p,
|
|
151
|
-
{
|
|
152
|
-
"aria-disabled": s,
|
|
153
|
-
"data-disabled": s ? "" : void 0,
|
|
154
|
-
...f,
|
|
155
|
-
ref: t,
|
|
156
|
-
onPointerDown: A(f.onPointerDown, () => {
|
|
157
|
-
s || (P.current = S);
|
|
158
|
-
}),
|
|
159
|
-
min: n,
|
|
160
|
-
max: i,
|
|
161
|
-
inverted: w,
|
|
162
|
-
onSlideStart: s ? void 0 : T,
|
|
163
|
-
onSlideMove: s ? void 0 : ue,
|
|
164
|
-
onSlideEnd: s ? void 0 : fe,
|
|
165
|
-
onHomeKeyDown: () => !s && N(n, 0, { commit: !0 }),
|
|
166
|
-
onEndKeyDown: () => !s && N(i, S.length - 1, { commit: !0 }),
|
|
167
|
-
onStepKeyDown: ({ event: y, direction: M }) => {
|
|
168
|
-
if (!s) {
|
|
169
|
-
const O = J.includes(y.key) || y.shiftKey && Q.includes(y.key) ? 10 : 1, K = m.current, I = S[K], D = c * O * M;
|
|
170
|
-
N(I + D, K, { commit: !0 });
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
) }) })
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
te.displayName = z;
|
|
180
|
-
var [oe, ne] = ee(z, {
|
|
181
|
-
startEdge: "left",
|
|
182
|
-
endEdge: "right",
|
|
183
|
-
size: "width",
|
|
184
|
-
direction: 1
|
|
185
|
-
}), ye = d.forwardRef(
|
|
186
|
-
(e, t) => {
|
|
187
|
-
const {
|
|
188
|
-
min: o,
|
|
189
|
-
max: n,
|
|
190
|
-
dir: i,
|
|
191
|
-
inverted: c,
|
|
192
|
-
onSlideStart: r,
|
|
193
|
-
onSlideMove: s,
|
|
194
|
-
onSlideEnd: u,
|
|
195
|
-
onStepKeyDown: g,
|
|
196
|
-
...v
|
|
197
|
-
} = e, [a, h] = d.useState(null), w = E(t, (p) => h(p)), x = d.useRef(void 0), f = pe(i), l = f === "ltr", m = l && !c || !l && c;
|
|
198
|
-
function R(p) {
|
|
199
|
-
const S = x.current || a.getBoundingClientRect(), C = [0, S.width], T = Y(C, m ? [o, n] : [n, o]);
|
|
200
|
-
return x.current = S, T(p - S.left);
|
|
201
|
-
}
|
|
202
|
-
return /* @__PURE__ */ b(
|
|
203
|
-
oe,
|
|
204
|
-
{
|
|
205
|
-
scope: e.__scopeSlider,
|
|
206
|
-
startEdge: m ? "left" : "right",
|
|
207
|
-
endEdge: m ? "right" : "left",
|
|
208
|
-
direction: m ? 1 : -1,
|
|
209
|
-
size: "width",
|
|
210
|
-
children: /* @__PURE__ */ b(
|
|
211
|
-
re,
|
|
212
|
-
{
|
|
213
|
-
dir: f,
|
|
214
|
-
"data-orientation": "horizontal",
|
|
215
|
-
...v,
|
|
216
|
-
ref: w,
|
|
217
|
-
style: {
|
|
218
|
-
...v.style,
|
|
219
|
-
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
220
|
-
},
|
|
221
|
-
onSlideStart: (p) => {
|
|
222
|
-
const S = R(p.clientX);
|
|
223
|
-
r?.(S);
|
|
224
|
-
},
|
|
225
|
-
onSlideMove: (p) => {
|
|
226
|
-
const S = R(p.clientX);
|
|
227
|
-
s?.(S);
|
|
228
|
-
},
|
|
229
|
-
onSlideEnd: () => {
|
|
230
|
-
x.current = void 0, u?.();
|
|
231
|
-
},
|
|
232
|
-
onStepKeyDown: (p) => {
|
|
233
|
-
const C = Z[m ? "from-left" : "from-right"].includes(p.key);
|
|
234
|
-
g?.({ event: p, direction: C ? -1 : 1 });
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
}
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
), Ce = d.forwardRef(
|
|
242
|
-
(e, t) => {
|
|
243
|
-
const {
|
|
244
|
-
min: o,
|
|
245
|
-
max: n,
|
|
246
|
-
inverted: i,
|
|
247
|
-
onSlideStart: c,
|
|
248
|
-
onSlideMove: r,
|
|
249
|
-
onSlideEnd: s,
|
|
250
|
-
onStepKeyDown: u,
|
|
251
|
-
...g
|
|
252
|
-
} = e, v = d.useRef(null), a = E(t, v), h = d.useRef(void 0), w = !i;
|
|
253
|
-
function x(f) {
|
|
254
|
-
const l = h.current || v.current.getBoundingClientRect(), m = [0, l.height], p = Y(m, w ? [n, o] : [o, n]);
|
|
255
|
-
return h.current = l, p(f - l.top);
|
|
256
|
-
}
|
|
257
|
-
return /* @__PURE__ */ b(
|
|
258
|
-
oe,
|
|
259
|
-
{
|
|
260
|
-
scope: e.__scopeSlider,
|
|
261
|
-
startEdge: w ? "bottom" : "top",
|
|
262
|
-
endEdge: w ? "top" : "bottom",
|
|
263
|
-
size: "height",
|
|
264
|
-
direction: w ? 1 : -1,
|
|
265
|
-
children: /* @__PURE__ */ b(
|
|
266
|
-
re,
|
|
267
|
-
{
|
|
268
|
-
"data-orientation": "vertical",
|
|
269
|
-
...g,
|
|
270
|
-
ref: a,
|
|
271
|
-
style: {
|
|
272
|
-
...g.style,
|
|
273
|
-
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
274
|
-
},
|
|
275
|
-
onSlideStart: (f) => {
|
|
276
|
-
const l = x(f.clientY);
|
|
277
|
-
c?.(l);
|
|
278
|
-
},
|
|
279
|
-
onSlideMove: (f) => {
|
|
280
|
-
const l = x(f.clientY);
|
|
281
|
-
r?.(l);
|
|
282
|
-
},
|
|
283
|
-
onSlideEnd: () => {
|
|
284
|
-
h.current = void 0, s?.();
|
|
285
|
-
},
|
|
286
|
-
onStepKeyDown: (f) => {
|
|
287
|
-
const m = Z[w ? "from-bottom" : "from-top"].includes(f.key);
|
|
288
|
-
u?.({ event: f, direction: m ? -1 : 1 });
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
)
|
|
292
|
-
}
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
), re = d.forwardRef(
|
|
296
|
-
(e, t) => {
|
|
297
|
-
const {
|
|
298
|
-
__scopeSlider: o,
|
|
299
|
-
onSlideStart: n,
|
|
300
|
-
onSlideMove: i,
|
|
301
|
-
onSlideEnd: c,
|
|
302
|
-
onHomeKeyDown: r,
|
|
303
|
-
onEndKeyDown: s,
|
|
304
|
-
onStepKeyDown: u,
|
|
305
|
-
...g
|
|
306
|
-
} = e, v = k(z, o);
|
|
307
|
-
return /* @__PURE__ */ b(
|
|
308
|
-
B.span,
|
|
309
|
-
{
|
|
310
|
-
...g,
|
|
311
|
-
ref: t,
|
|
312
|
-
onKeyDown: A(e.onKeyDown, (a) => {
|
|
313
|
-
a.key === "Home" ? (r(a), a.preventDefault()) : a.key === "End" ? (s(a), a.preventDefault()) : J.concat(Q).includes(a.key) && (u(a), a.preventDefault());
|
|
314
|
-
}),
|
|
315
|
-
onPointerDown: A(e.onPointerDown, (a) => {
|
|
316
|
-
const h = a.target;
|
|
317
|
-
h.setPointerCapture(a.pointerId), a.preventDefault(), v.thumbs.has(h) ? h.focus() : n(a);
|
|
318
|
-
}),
|
|
319
|
-
onPointerMove: A(e.onPointerMove, (a) => {
|
|
320
|
-
a.target.hasPointerCapture(a.pointerId) && i(a);
|
|
321
|
-
}),
|
|
322
|
-
onPointerUp: A(e.onPointerUp, (a) => {
|
|
323
|
-
const h = a.target;
|
|
324
|
-
h.hasPointerCapture(a.pointerId) && (h.releasePointerCapture(a.pointerId), c(a));
|
|
325
|
-
})
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
), ie = "SliderTrack", se = d.forwardRef(
|
|
330
|
-
(e, t) => {
|
|
331
|
-
const { __scopeSlider: o, ...n } = e, i = k(ie, o);
|
|
332
|
-
return /* @__PURE__ */ b(
|
|
333
|
-
B.span,
|
|
334
|
-
{
|
|
335
|
-
"data-disabled": i.disabled ? "" : void 0,
|
|
336
|
-
"data-orientation": i.orientation,
|
|
337
|
-
...n,
|
|
338
|
-
ref: t
|
|
339
|
-
}
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
);
|
|
343
|
-
se.displayName = ie;
|
|
344
|
-
var U = "SliderRange", ae = d.forwardRef(
|
|
345
|
-
(e, t) => {
|
|
346
|
-
const { __scopeSlider: o, ...n } = e, i = k(U, o), c = ne(U, o), r = d.useRef(null), s = E(t, r), u = i.values.length, g = i.values.map(
|
|
347
|
-
(h) => de(h, i.min, i.max)
|
|
348
|
-
), v = u > 1 ? Math.min(...g) : 0, a = 100 - Math.max(...g);
|
|
349
|
-
return /* @__PURE__ */ b(
|
|
350
|
-
B.span,
|
|
351
|
-
{
|
|
352
|
-
"data-orientation": i.orientation,
|
|
353
|
-
"data-disabled": i.disabled ? "" : void 0,
|
|
354
|
-
...n,
|
|
355
|
-
ref: s,
|
|
356
|
-
style: {
|
|
357
|
-
...e.style,
|
|
358
|
-
[c.startEdge]: v + "%",
|
|
359
|
-
[c.endEdge]: a + "%"
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
);
|
|
363
|
-
}
|
|
364
|
-
);
|
|
365
|
-
ae.displayName = U;
|
|
366
|
-
var F = "SliderThumb", ce = d.forwardRef(
|
|
367
|
-
(e, t) => {
|
|
368
|
-
const o = we(e.__scopeSlider), [n, i] = d.useState(null), c = E(t, (s) => i(s)), r = d.useMemo(
|
|
369
|
-
() => n ? o().findIndex((s) => s.ref.current === n) : -1,
|
|
370
|
-
[o, n]
|
|
371
|
-
);
|
|
372
|
-
return /* @__PURE__ */ b(Pe, { ...e, ref: c, index: r });
|
|
373
|
-
}
|
|
374
|
-
), Pe = d.forwardRef(
|
|
375
|
-
(e, t) => {
|
|
376
|
-
const { __scopeSlider: o, index: n, name: i, ...c } = e, r = k(F, o), s = ne(F, o), [u, g] = d.useState(null), v = E(t, (R) => g(R)), a = u ? r.form || !!u.closest("form") : !0, h = ve(u), w = r.values[n], x = w === void 0 ? 0 : de(w, r.min, r.max), f = De(n, r.values.length), l = h?.[s.size], m = l ? Ie(l, x, s.direction) : 0;
|
|
377
|
-
return d.useEffect(() => {
|
|
378
|
-
if (u)
|
|
379
|
-
return r.thumbs.add(u), () => {
|
|
380
|
-
r.thumbs.delete(u);
|
|
381
|
-
};
|
|
382
|
-
}, [u, r.thumbs]), /* @__PURE__ */ X(
|
|
383
|
-
"span",
|
|
384
|
-
{
|
|
385
|
-
style: {
|
|
386
|
-
transform: "var(--radix-slider-thumb-transform)",
|
|
387
|
-
position: "absolute",
|
|
388
|
-
[s.startEdge]: `calc(${x}% + ${m}px)`
|
|
389
|
-
},
|
|
390
|
-
children: [
|
|
391
|
-
/* @__PURE__ */ b(L.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ b(
|
|
392
|
-
B.span,
|
|
393
|
-
{
|
|
394
|
-
role: "slider",
|
|
395
|
-
"aria-label": e["aria-label"] || f,
|
|
396
|
-
"aria-valuemin": r.min,
|
|
397
|
-
"aria-valuenow": w,
|
|
398
|
-
"aria-valuemax": r.max,
|
|
399
|
-
"aria-orientation": r.orientation,
|
|
400
|
-
"data-orientation": r.orientation,
|
|
401
|
-
"data-disabled": r.disabled ? "" : void 0,
|
|
402
|
-
tabIndex: r.disabled ? void 0 : 0,
|
|
403
|
-
...c,
|
|
404
|
-
ref: v,
|
|
405
|
-
style: w === void 0 ? { display: "none" } : e.style,
|
|
406
|
-
onFocus: A(e.onFocus, () => {
|
|
407
|
-
r.valueIndexToChangeRef.current = n;
|
|
408
|
-
})
|
|
409
|
-
}
|
|
410
|
-
) }),
|
|
411
|
-
a && /* @__PURE__ */ b(
|
|
412
|
-
le,
|
|
413
|
-
{
|
|
414
|
-
name: i ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
|
|
415
|
-
form: r.form,
|
|
416
|
-
value: w
|
|
417
|
-
},
|
|
418
|
-
n
|
|
419
|
-
)
|
|
420
|
-
]
|
|
421
|
-
}
|
|
422
|
-
);
|
|
423
|
-
}
|
|
424
|
-
);
|
|
425
|
-
ce.displayName = F;
|
|
426
|
-
var Ee = "RadioBubbleInput", le = d.forwardRef(
|
|
427
|
-
({ __scopeSlider: e, value: t, ...o }, n) => {
|
|
428
|
-
const i = d.useRef(null), c = E(i, n), r = ge(t);
|
|
429
|
-
return d.useEffect(() => {
|
|
430
|
-
const s = i.current;
|
|
431
|
-
if (!s) return;
|
|
432
|
-
const u = window.HTMLInputElement.prototype, v = Object.getOwnPropertyDescriptor(u, "value").set;
|
|
433
|
-
if (r !== t && v) {
|
|
434
|
-
const a = new Event("input", { bubbles: !0 });
|
|
435
|
-
v.call(s, t), s.dispatchEvent(a);
|
|
436
|
-
}
|
|
437
|
-
}, [r, t]), /* @__PURE__ */ b(
|
|
438
|
-
B.input,
|
|
439
|
-
{
|
|
440
|
-
style: { display: "none" },
|
|
441
|
-
...o,
|
|
442
|
-
ref: c,
|
|
443
|
-
defaultValue: t
|
|
444
|
-
}
|
|
445
|
-
);
|
|
446
|
-
}
|
|
447
|
-
);
|
|
448
|
-
le.displayName = Ee;
|
|
449
|
-
function Me(e = [], t, o) {
|
|
450
|
-
const n = [...e];
|
|
451
|
-
return n[o] = t, n.sort((i, c) => i - c);
|
|
452
|
-
}
|
|
453
|
-
function de(e, t, o) {
|
|
454
|
-
const c = 100 / (o - t) * (e - t);
|
|
455
|
-
return q(c, [0, 100]);
|
|
456
|
-
}
|
|
457
|
-
function De(e, t) {
|
|
458
|
-
return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
|
|
459
|
-
}
|
|
460
|
-
function _e(e, t) {
|
|
461
|
-
if (e.length === 1) return 0;
|
|
462
|
-
const o = e.map((i) => Math.abs(i - t)), n = Math.min(...o);
|
|
463
|
-
return o.indexOf(n);
|
|
464
|
-
}
|
|
465
|
-
function Ie(e, t, o) {
|
|
466
|
-
const n = e / 2, c = Y([0, 50], [0, n]);
|
|
467
|
-
return (n - c(t) * o) * o;
|
|
468
|
-
}
|
|
469
|
-
function Ae(e) {
|
|
470
|
-
return e.slice(0, -1).map((t, o) => e[o + 1] - t);
|
|
471
|
-
}
|
|
472
|
-
function ze(e, t) {
|
|
473
|
-
if (t > 0) {
|
|
474
|
-
const o = Ae(e);
|
|
475
|
-
return Math.min(...o) >= t;
|
|
476
|
-
}
|
|
477
|
-
return !0;
|
|
478
|
-
}
|
|
479
|
-
function Y(e, t) {
|
|
480
|
-
return (o) => {
|
|
481
|
-
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
482
|
-
const n = (t[1] - t[0]) / (e[1] - e[0]);
|
|
483
|
-
return t[0] + n * (o - e[0]);
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
function Te(e) {
|
|
487
|
-
return (String(e).split(".")[1] || "").length;
|
|
488
|
-
}
|
|
489
|
-
function Ne(e, t) {
|
|
490
|
-
const o = Math.pow(10, t);
|
|
491
|
-
return Math.round(e * o) / o;
|
|
492
|
-
}
|
|
493
|
-
var Ke = te, Be = se, ke = ae, Ve = ce;
|
|
494
|
-
function Ye({
|
|
495
|
-
className: e,
|
|
496
|
-
defaultValue: t,
|
|
497
|
-
value: o,
|
|
498
|
-
min: n = 0,
|
|
499
|
-
max: i = 100,
|
|
500
|
-
step: c = 1,
|
|
501
|
-
minStepsBetweenThumbs: r = 1,
|
|
502
|
-
onValueChange: s,
|
|
503
|
-
orientation: u = "horizontal",
|
|
504
|
-
onValueCommit: g,
|
|
505
|
-
disabled: v,
|
|
506
|
-
name: a,
|
|
507
|
-
...h
|
|
508
|
-
}) {
|
|
509
|
-
const w = o || t || [n];
|
|
510
|
-
return /* @__PURE__ */ X(
|
|
511
|
-
Ke,
|
|
512
|
-
{
|
|
513
|
-
"data-slot": "slider",
|
|
514
|
-
defaultValue: t,
|
|
515
|
-
value: o,
|
|
516
|
-
min: n,
|
|
517
|
-
max: i,
|
|
518
|
-
step: c,
|
|
519
|
-
minStepsBetweenThumbs: r,
|
|
520
|
-
onValueChange: s,
|
|
521
|
-
orientation: u,
|
|
522
|
-
onValueCommit: g,
|
|
523
|
-
disabled: v,
|
|
524
|
-
name: a,
|
|
525
|
-
className: H(
|
|
526
|
-
"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",
|
|
527
|
-
e
|
|
528
|
-
),
|
|
529
|
-
...h,
|
|
530
|
-
children: [
|
|
531
|
-
/* @__PURE__ */ b(
|
|
532
|
-
Be,
|
|
533
|
-
{
|
|
534
|
-
"data-slot": "slider-track",
|
|
535
|
-
className: H(
|
|
536
|
-
"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"
|
|
537
|
-
),
|
|
538
|
-
children: /* @__PURE__ */ b(
|
|
539
|
-
ke,
|
|
540
|
-
{
|
|
541
|
-
"data-slot": "slider-range",
|
|
542
|
-
className: H(
|
|
543
|
-
"bg-slider-range absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
544
|
-
)
|
|
545
|
-
}
|
|
546
|
-
)
|
|
547
|
-
}
|
|
548
|
-
),
|
|
549
|
-
Array.from({ length: w.length }, (x, f) => /* @__PURE__ */ b(
|
|
550
|
-
Ve,
|
|
551
|
-
{
|
|
552
|
-
"data-slot": "slider-thumb",
|
|
553
|
-
className: "border-slider-thumb-border bg-slider-thumb-bg ring-slider-thumb-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
554
|
-
},
|
|
555
|
-
f
|
|
556
|
-
))
|
|
557
|
-
]
|
|
558
|
-
}
|
|
559
|
-
);
|
|
560
|
-
}
|
|
561
|
-
export {
|
|
562
|
-
Ye as Slider
|
|
563
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { ButtonHTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
3
|
-
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "primary" | "secondary" | "outline" | null | undefined;
|
|
5
|
-
state?: "default" | "error" | "loading" | null | undefined;
|
|
6
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
-
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'>, VariantProps<typeof buttonVariants> {
|
|
8
|
-
errorMessage?: string | ReactNode;
|
|
9
|
-
endIcon?: ReactNode;
|
|
10
|
-
label: string;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
startIcon?: ReactNode;
|
|
13
|
-
type?: 'button' | 'submit' | 'reset';
|
|
14
|
-
state?: 'loading' | 'error' | 'default';
|
|
15
|
-
dataTestId?: string;
|
|
16
|
-
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
-
isFullWidth?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
20
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> {
|
|
3
|
-
title?: string;
|
|
4
|
-
icon?: ReactNode;
|
|
5
|
-
width?: 'full' | 'fit';
|
|
6
|
-
isLoading?: boolean;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export declare const Card: import('react').ForwardRefExoticComponent<CardProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type DrawerProps = {
|
|
3
|
-
children?: ReactNode;
|
|
4
|
-
description?: string;
|
|
5
|
-
direction?: 'left' | 'right' | 'top' | 'bottom';
|
|
6
|
-
size?: string;
|
|
7
|
-
title?: string;
|
|
8
|
-
trigger: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
export declare const Drawer: ({ trigger, title, description, children, direction, size }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
3
|
-
export type SliderProps = ComponentProps<typeof SliderPrimitive.Root> & {
|
|
4
|
-
className?: string;
|
|
5
|
-
defaultValue?: number[];
|
|
6
|
-
value?: number[];
|
|
7
|
-
min?: number;
|
|
8
|
-
max?: number;
|
|
9
|
-
step?: number;
|
|
10
|
-
minStepsBetweenThumbs?: number;
|
|
11
|
-
onValueChange?: (value: number[]) => void;
|
|
12
|
-
orientation?: 'horizontal' | 'vertical';
|
|
13
|
-
onValueCommit?: (value: number[]) => void;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
name?: string;
|
|
16
|
-
};
|
|
17
|
-
declare function Slider({ className, defaultValue, value, min, max, step, minStepsBetweenThumbs, onValueChange, orientation, onValueCommit, disabled, name, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export { Slider };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MouseEvent, RefObject } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Hook that handles auto-scrolling for accordions with return-to-position functionality
|
|
4
|
-
*
|
|
5
|
-
* @param triggerRef Reference to the accordion trigger element
|
|
6
|
-
* @returns A click event handler for the accordion trigger
|
|
7
|
-
*/
|
|
8
|
-
export declare const useAccordionAutoScroll: (triggerRef: RefObject<HTMLElement>) => (_event?: MouseEvent<HTMLButtonElement>) => void;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Hook that handles clicks outside of the specified element
|
|
4
|
-
* @param callback Function to call when a click outside the element is detected
|
|
5
|
-
* @returns A ref to attach to the target element
|
|
6
|
-
*/
|
|
7
|
-
export declare function useOutsideClick<T extends HTMLElement>(callback: () => void): RefObject<T | null>;
|
package/dist/hooks/useTheme.d.ts
DELETED