@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/index-C-ErIYr7.js
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import * as s from "react";
|
|
2
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import * as x from "react-dom";
|
|
4
|
-
function M(e, t, { checkForDefaultPrevented: o = !0 } = {}) {
|
|
5
|
-
return function(n) {
|
|
6
|
-
if (e?.(n), o === !1 || !n.defaultPrevented)
|
|
7
|
-
return t?.(n);
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function h(e, t) {
|
|
11
|
-
if (typeof e == "function")
|
|
12
|
-
return e(t);
|
|
13
|
-
e != null && (e.current = t);
|
|
14
|
-
}
|
|
15
|
-
function y(...e) {
|
|
16
|
-
return (t) => {
|
|
17
|
-
let o = !1;
|
|
18
|
-
const c = e.map((n) => {
|
|
19
|
-
const r = h(n, t);
|
|
20
|
-
return !o && typeof r == "function" && (o = !0), r;
|
|
21
|
-
});
|
|
22
|
-
if (o)
|
|
23
|
-
return () => {
|
|
24
|
-
for (let n = 0; n < c.length; n++) {
|
|
25
|
-
const r = c[n];
|
|
26
|
-
typeof r == "function" ? r() : h(e[n], null);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function W(...e) {
|
|
32
|
-
return s.useCallback(y(...e), e);
|
|
33
|
-
}
|
|
34
|
-
function A(e, t) {
|
|
35
|
-
const o = s.createContext(t), c = (r) => {
|
|
36
|
-
const { children: u, ...i } = r, l = s.useMemo(() => i, Object.values(i));
|
|
37
|
-
return /* @__PURE__ */ m(o.Provider, { value: l, children: u });
|
|
38
|
-
};
|
|
39
|
-
c.displayName = e + "Provider";
|
|
40
|
-
function n(r) {
|
|
41
|
-
const u = s.useContext(o);
|
|
42
|
-
if (u) return u;
|
|
43
|
-
if (t !== void 0) return t;
|
|
44
|
-
throw new Error(`\`${r}\` must be used within \`${e}\``);
|
|
45
|
-
}
|
|
46
|
-
return [c, n];
|
|
47
|
-
}
|
|
48
|
-
function H(e, t = []) {
|
|
49
|
-
let o = [];
|
|
50
|
-
function c(r, u) {
|
|
51
|
-
const i = s.createContext(u), l = o.length;
|
|
52
|
-
o = [...o, u];
|
|
53
|
-
const a = (f) => {
|
|
54
|
-
const { scope: v, children: C, ...d } = f, S = v?.[e]?.[l] || i, E = s.useMemo(() => d, Object.values(d));
|
|
55
|
-
return /* @__PURE__ */ m(S.Provider, { value: E, children: C });
|
|
56
|
-
};
|
|
57
|
-
a.displayName = r + "Provider";
|
|
58
|
-
function p(f, v) {
|
|
59
|
-
const C = v?.[e]?.[l] || i, d = s.useContext(C);
|
|
60
|
-
if (d) return d;
|
|
61
|
-
if (u !== void 0) return u;
|
|
62
|
-
throw new Error(`\`${f}\` must be used within \`${r}\``);
|
|
63
|
-
}
|
|
64
|
-
return [a, p];
|
|
65
|
-
}
|
|
66
|
-
const n = () => {
|
|
67
|
-
const r = o.map((u) => s.createContext(u));
|
|
68
|
-
return function(i) {
|
|
69
|
-
const l = i?.[e] || r;
|
|
70
|
-
return s.useMemo(
|
|
71
|
-
() => ({ [`__scope${e}`]: { ...i, [e]: l } }),
|
|
72
|
-
[i, l]
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
return n.scopeName = e, [c, g(n, ...t)];
|
|
77
|
-
}
|
|
78
|
-
function g(...e) {
|
|
79
|
-
const t = e[0];
|
|
80
|
-
if (e.length === 1) return t;
|
|
81
|
-
const o = () => {
|
|
82
|
-
const c = e.map((n) => ({
|
|
83
|
-
useScope: n(),
|
|
84
|
-
scopeName: n.scopeName
|
|
85
|
-
}));
|
|
86
|
-
return function(r) {
|
|
87
|
-
const u = c.reduce((i, { useScope: l, scopeName: a }) => {
|
|
88
|
-
const f = l(r)[`__scope${a}`];
|
|
89
|
-
return { ...i, ...f };
|
|
90
|
-
}, {});
|
|
91
|
-
return s.useMemo(() => ({ [`__scope${t.scopeName}`]: u }), [u]);
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
return o.scopeName = t.scopeName, o;
|
|
95
|
-
}
|
|
96
|
-
var P = globalThis?.document ? s.useLayoutEffect : () => {
|
|
97
|
-
}, b = s[" useInsertionEffect ".trim().toString()] || P;
|
|
98
|
-
function L({
|
|
99
|
-
prop: e,
|
|
100
|
-
defaultProp: t,
|
|
101
|
-
onChange: o = () => {
|
|
102
|
-
},
|
|
103
|
-
caller: c
|
|
104
|
-
}) {
|
|
105
|
-
const [n, r, u] = R({
|
|
106
|
-
defaultProp: t,
|
|
107
|
-
onChange: o
|
|
108
|
-
}), i = e !== void 0, l = i ? e : n;
|
|
109
|
-
{
|
|
110
|
-
const p = s.useRef(e !== void 0);
|
|
111
|
-
s.useEffect(() => {
|
|
112
|
-
const f = p.current;
|
|
113
|
-
f !== i && console.warn(
|
|
114
|
-
`${c} is changing from ${f ? "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.`
|
|
115
|
-
), p.current = i;
|
|
116
|
-
}, [i, c]);
|
|
117
|
-
}
|
|
118
|
-
const a = s.useCallback(
|
|
119
|
-
(p) => {
|
|
120
|
-
if (i) {
|
|
121
|
-
const f = w(p) ? p(e) : p;
|
|
122
|
-
f !== e && u.current?.(f);
|
|
123
|
-
} else
|
|
124
|
-
r(p);
|
|
125
|
-
},
|
|
126
|
-
[i, e, r, u]
|
|
127
|
-
);
|
|
128
|
-
return [l, a];
|
|
129
|
-
}
|
|
130
|
-
function R({
|
|
131
|
-
defaultProp: e,
|
|
132
|
-
onChange: t
|
|
133
|
-
}) {
|
|
134
|
-
const [o, c] = s.useState(e), n = s.useRef(o), r = s.useRef(t);
|
|
135
|
-
return b(() => {
|
|
136
|
-
r.current = t;
|
|
137
|
-
}, [t]), s.useEffect(() => {
|
|
138
|
-
n.current !== o && (r.current?.(o), n.current = o);
|
|
139
|
-
}, [o, n]), [o, c, r];
|
|
140
|
-
}
|
|
141
|
-
function w(e) {
|
|
142
|
-
return typeof e == "function";
|
|
143
|
-
}
|
|
144
|
-
// @__NO_SIDE_EFFECTS__
|
|
145
|
-
function $(e) {
|
|
146
|
-
const t = /* @__PURE__ */ _(e), o = s.forwardRef((c, n) => {
|
|
147
|
-
const { children: r, ...u } = c, i = s.Children.toArray(r), l = i.find(N);
|
|
148
|
-
if (l) {
|
|
149
|
-
const a = l.props.children, p = i.map((f) => f === l ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : f);
|
|
150
|
-
return /* @__PURE__ */ m(t, { ...u, ref: n, children: s.isValidElement(a) ? s.cloneElement(a, void 0, p) : null });
|
|
151
|
-
}
|
|
152
|
-
return /* @__PURE__ */ m(t, { ...u, ref: n, children: r });
|
|
153
|
-
});
|
|
154
|
-
return o.displayName = `${e}.Slot`, o;
|
|
155
|
-
}
|
|
156
|
-
// @__NO_SIDE_EFFECTS__
|
|
157
|
-
function _(e) {
|
|
158
|
-
const t = s.forwardRef((o, c) => {
|
|
159
|
-
const { children: n, ...r } = o;
|
|
160
|
-
if (s.isValidElement(n)) {
|
|
161
|
-
const u = I(n), i = D(r, n.props);
|
|
162
|
-
return n.type !== s.Fragment && (i.ref = c ? y(c, u) : u), s.cloneElement(n, i);
|
|
163
|
-
}
|
|
164
|
-
return s.Children.count(n) > 1 ? s.Children.only(null) : null;
|
|
165
|
-
});
|
|
166
|
-
return t.displayName = `${e}.SlotClone`, t;
|
|
167
|
-
}
|
|
168
|
-
var O = Symbol("radix.slottable");
|
|
169
|
-
function N(e) {
|
|
170
|
-
return s.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === O;
|
|
171
|
-
}
|
|
172
|
-
function D(e, t) {
|
|
173
|
-
const o = { ...t };
|
|
174
|
-
for (const c in t) {
|
|
175
|
-
const n = e[c], r = t[c];
|
|
176
|
-
/^on[A-Z]/.test(c) ? n && r ? o[c] = (...i) => {
|
|
177
|
-
const l = r(...i);
|
|
178
|
-
return n(...i), l;
|
|
179
|
-
} : n && (o[c] = n) : c === "style" ? o[c] = { ...n, ...r } : c === "className" && (o[c] = [n, r].filter(Boolean).join(" "));
|
|
180
|
-
}
|
|
181
|
-
return { ...e, ...o };
|
|
182
|
-
}
|
|
183
|
-
function I(e) {
|
|
184
|
-
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, o = t && "isReactWarning" in t && t.isReactWarning;
|
|
185
|
-
return o ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, o = t && "isReactWarning" in t && t.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
|
|
186
|
-
}
|
|
187
|
-
var j = [
|
|
188
|
-
"a",
|
|
189
|
-
"button",
|
|
190
|
-
"div",
|
|
191
|
-
"form",
|
|
192
|
-
"h2",
|
|
193
|
-
"h3",
|
|
194
|
-
"img",
|
|
195
|
-
"input",
|
|
196
|
-
"label",
|
|
197
|
-
"li",
|
|
198
|
-
"nav",
|
|
199
|
-
"ol",
|
|
200
|
-
"p",
|
|
201
|
-
"select",
|
|
202
|
-
"span",
|
|
203
|
-
"svg",
|
|
204
|
-
"ul"
|
|
205
|
-
], T = j.reduce((e, t) => {
|
|
206
|
-
const o = /* @__PURE__ */ $(`Primitive.${t}`), c = s.forwardRef((n, r) => {
|
|
207
|
-
const { asChild: u, ...i } = n, l = u ? o : t;
|
|
208
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ m(l, { ...i, ref: r });
|
|
209
|
-
});
|
|
210
|
-
return c.displayName = `Primitive.${t}`, { ...e, [t]: c };
|
|
211
|
-
}, {});
|
|
212
|
-
function k(e, t) {
|
|
213
|
-
e && x.flushSync(() => e.dispatchEvent(t));
|
|
214
|
-
}
|
|
215
|
-
export {
|
|
216
|
-
T as P,
|
|
217
|
-
W as a,
|
|
218
|
-
H as b,
|
|
219
|
-
M as c,
|
|
220
|
-
k as d,
|
|
221
|
-
$ as e,
|
|
222
|
-
A as f,
|
|
223
|
-
L as g,
|
|
224
|
-
P as u
|
|
225
|
-
};
|
package/dist/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "./assets/spectral.css";
|
|
3
|
-
import { Button as i } from "./Button.js";
|
|
4
|
-
import { Card as p } from "./Card.js";
|
|
5
|
-
import { Drawer as g } from "./Drawer.js";
|
|
6
|
-
import { Skeleton as k } from "./Skeleton.js";
|
|
7
|
-
import { Slider as w } from "./Slider.js";
|
|
8
|
-
import { useState as n, useEffect as s } from "react";
|
|
9
|
-
import { c as E, p as I } from "./twUtils-B9ArqCOv.js";
|
|
10
|
-
const d = (o = "dark") => {
|
|
11
|
-
const [t, m] = n(() => {
|
|
12
|
-
if (typeof window > "u") return o;
|
|
13
|
-
const e = localStorage.getItem("theme");
|
|
14
|
-
return e === "light" || e === "dark" ? e : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
15
|
-
}), r = (e) => {
|
|
16
|
-
m(e);
|
|
17
|
-
}, a = () => {
|
|
18
|
-
r(t === "dark" ? "light" : "dark");
|
|
19
|
-
};
|
|
20
|
-
return s(() => {
|
|
21
|
-
document.documentElement.setAttribute("data-theme", t), localStorage.setItem("theme", t);
|
|
22
|
-
}, [t]), { theme: t, setTheme: r, toggleTheme: a };
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
i as Button,
|
|
26
|
-
p as Card,
|
|
27
|
-
g as Drawer,
|
|
28
|
-
k as Skeleton,
|
|
29
|
-
w as Slider,
|
|
30
|
-
E as cn,
|
|
31
|
-
I as pxToRem,
|
|
32
|
-
d as useTheme
|
|
33
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { forwardRef as l, createElement as n } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v0.542.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
const h = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (t) => t.replace(
|
|
9
|
-
/^([A-Z])|[\s-_]+(\w)/g,
|
|
10
|
-
(e, r, o) => o ? o.toUpperCase() : r.toLowerCase()
|
|
11
|
-
), i = (t) => {
|
|
12
|
-
const e = w(t);
|
|
13
|
-
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
14
|
-
}, u = (...t) => t.filter((e, r, o) => !!e && e.trim() !== "" && o.indexOf(e) === r).join(" ").trim(), f = (t) => {
|
|
15
|
-
for (const e in t)
|
|
16
|
-
if (e.startsWith("aria-") || e === "role" || e === "title")
|
|
17
|
-
return !0;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* @license lucide-react v0.542.0 - ISC
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the ISC license.
|
|
23
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
|
-
var g = {
|
|
26
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
-
width: 24,
|
|
28
|
-
height: 24,
|
|
29
|
-
viewBox: "0 0 24 24",
|
|
30
|
-
fill: "none",
|
|
31
|
-
stroke: "currentColor",
|
|
32
|
-
strokeWidth: 2,
|
|
33
|
-
strokeLinecap: "round",
|
|
34
|
-
strokeLinejoin: "round"
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* @license lucide-react v0.542.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/
|
|
42
|
-
const A = l(
|
|
43
|
-
({
|
|
44
|
-
color: t = "currentColor",
|
|
45
|
-
size: e = 24,
|
|
46
|
-
strokeWidth: r = 2,
|
|
47
|
-
absoluteStrokeWidth: o,
|
|
48
|
-
className: s = "",
|
|
49
|
-
children: a,
|
|
50
|
-
iconNode: d,
|
|
51
|
-
...c
|
|
52
|
-
}, p) => n(
|
|
53
|
-
"svg",
|
|
54
|
-
{
|
|
55
|
-
ref: p,
|
|
56
|
-
...g,
|
|
57
|
-
width: e,
|
|
58
|
-
height: e,
|
|
59
|
-
stroke: t,
|
|
60
|
-
strokeWidth: o ? Number(r) * 24 / Number(e) : r,
|
|
61
|
-
className: u("lucide", s),
|
|
62
|
-
...!a && !f(c) && { "aria-hidden": "true" },
|
|
63
|
-
...c
|
|
64
|
-
},
|
|
65
|
-
[
|
|
66
|
-
...d.map(([C, m]) => n(C, m)),
|
|
67
|
-
...Array.isArray(a) ? a : [a]
|
|
68
|
-
]
|
|
69
|
-
)
|
|
70
|
-
);
|
|
71
|
-
/**
|
|
72
|
-
* @license lucide-react v0.542.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/
|
|
77
|
-
const L = (t, e) => {
|
|
78
|
-
const r = l(
|
|
79
|
-
({ className: o, ...s }, a) => n(A, {
|
|
80
|
-
ref: a,
|
|
81
|
-
iconNode: e,
|
|
82
|
-
className: u(
|
|
83
|
-
`lucide-${h(i(t))}`,
|
|
84
|
-
`lucide-${t}`,
|
|
85
|
-
o
|
|
86
|
-
),
|
|
87
|
-
...s
|
|
88
|
-
})
|
|
89
|
-
);
|
|
90
|
-
return r.displayName = i(t), r;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* @license lucide-react v0.542.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/
|
|
98
|
-
const k = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], y = L("loader-circle", k);
|
|
99
|
-
export {
|
|
100
|
-
y as L
|
|
101
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "secondary" | "outline" | "default" | "link" | "destructive" | "ghost" | null | undefined;
|
|
5
|
-
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
-
declare function ButtonPrimitive({ className, variant, size, asChild, ...props }: ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
8
|
-
asChild?: boolean;
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export { ButtonPrimitive, buttonVariants };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import * as TooltipRadix from '@radix-ui/react-tooltip';
|
|
3
|
-
declare function TooltipPrimitiveProvider({ delayDuration, ...props }: ComponentProps<typeof TooltipRadix.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function TooltipPrimitive({ ...props }: ComponentProps<typeof TooltipRadix.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function TooltipPrimitiveTrigger({ ...props }: ComponentProps<typeof TooltipRadix.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function TooltipPrimitiveContent({ className, sideOffset, children, ...props }: ComponentProps<typeof TooltipRadix.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export { TooltipPrimitive, TooltipPrimitiveTrigger, TooltipPrimitiveContent, TooltipPrimitiveProvider };
|