@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spear-ai/spectral",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -25,15 +25,7 @@
|
|
|
25
25
|
"**/*.css"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@radix-ui/react-
|
|
29
|
-
"@radix-ui/react-checkbox": "^1.3.3",
|
|
30
|
-
"@radix-ui/react-label": "^2.1.7",
|
|
31
|
-
"@radix-ui/react-radio-group": "^1.3.8",
|
|
32
|
-
"@radix-ui/react-select": "^2.2.6",
|
|
33
|
-
"@radix-ui/react-slider": "^1.3.6",
|
|
34
|
-
"@radix-ui/react-slot": "^1.2.3",
|
|
35
|
-
"@radix-ui/react-switch": "^1.2.6",
|
|
36
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
28
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
37
29
|
"class-variance-authority": "^0.7.1",
|
|
38
30
|
"clsx": "^2.1.1",
|
|
39
31
|
"cmdk": "^1.1.1",
|
|
@@ -61,16 +53,18 @@
|
|
|
61
53
|
"@vitejs/plugin-react-swc": "^4.0.1",
|
|
62
54
|
"@vitest/browser": "3.2.4",
|
|
63
55
|
"@vitest/coverage-v8": "3.2.4",
|
|
56
|
+
"autoprefixer": "^10.4.21",
|
|
64
57
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
65
58
|
"husky": "^9.1.7",
|
|
66
59
|
"oxlint": "^1.14.0",
|
|
67
60
|
"playwright": "^1.55.0",
|
|
61
|
+
"postcss": "^8.5.6",
|
|
62
|
+
"postcss-load-config": "^6.0.1",
|
|
68
63
|
"prettier": "^3.6.2",
|
|
69
64
|
"prettier-plugin-sort-imports": "^1.8.8",
|
|
70
65
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
71
66
|
"storybook": "^9.1.3",
|
|
72
67
|
"tailwindcss": "^4.1.11",
|
|
73
|
-
"tsup": "^8.5.0",
|
|
74
68
|
"tw-animate-css": "^1.3.7",
|
|
75
69
|
"typescript": "^5.9.2",
|
|
76
70
|
"vite": "^7.1.3",
|
|
@@ -82,12 +76,6 @@
|
|
|
82
76
|
"react": "^18.0.0 || ^19.0.0",
|
|
83
77
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
84
78
|
},
|
|
85
|
-
"lint-staged": {
|
|
86
|
-
"/**/*.{js,jsx,ts,tsx}": [
|
|
87
|
-
"prettier --write",
|
|
88
|
-
"oxlint --fix"
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
79
|
"scripts": {
|
|
92
80
|
"dev": "vite --force",
|
|
93
81
|
"build": "vite build",
|
|
@@ -97,12 +85,11 @@
|
|
|
97
85
|
"storybook:build": "storybook build",
|
|
98
86
|
"lint": "oxlint --react-plugin --jsx-a11y-plugin --import-plugin src/",
|
|
99
87
|
"lint:fix": "oxlint --react-plugin --jsx-a11y-plugin --import-plugin --fix src/",
|
|
100
|
-
"format:fix": "prettier --write --ignore-unknown '**/**/*.{!(css|md|mdx|json|html),}'",
|
|
101
88
|
"format": "prettier --check --ignore-unknown '**/**/*.{!(css|md|mdx|json|html),}'",
|
|
89
|
+
"format:fix": "prettier --write --ignore-unknown '**/**/*.{!(css|md|mdx|json|html),}'",
|
|
102
90
|
"changeset": "changeset",
|
|
103
91
|
"changeset:version": "changeset version",
|
|
104
92
|
"changeset:publish": "changeset publish",
|
|
105
|
-
"lint-staged": "lint-staged",
|
|
106
93
|
"clean": "rm -rf $(find dist -maxdepth 1 ! -name \"node_modules\") && rm pnpm-lock.yaml",
|
|
107
94
|
"clean:build-artifacts": "find .storybook -name '*.js' -not -name '*.config.js' -delete && find .storybook -name '*.d.ts' -delete && find . -name '*.d.ts' -path './vite.config.d.ts' -delete && rm -rf storybook-static"
|
|
108
95
|
}
|
package/src/styles/main.css
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
@import 'tailwindcss';
|
|
2
2
|
@import 'tw-animate-css';
|
|
3
|
-
@import './
|
|
4
|
-
@import './
|
|
3
|
+
@import './horizon/colors.css';
|
|
4
|
+
@import './horizon/theme.css';
|
|
5
|
+
@import './horizon/base.css';
|
|
6
|
+
@import './horizon/utilities.css';
|
package/dist/Button.d.ts
DELETED
package/dist/Button.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { jsxs as f, jsx as v } from "react/jsx-runtime";
|
|
2
|
-
import { a as V, c as p } from "./twUtils-B9ArqCOv.js";
|
|
3
|
-
import { forwardRef as j } from "react";
|
|
4
|
-
import { L as w } from "./loader-circle-Btf6jOd5.js";
|
|
5
|
-
const N = (o) => typeof o == "boolean" ? `${o}` : o === 0 ? "0" : o, h = V, C = (o, e) => (t) => {
|
|
6
|
-
var l;
|
|
7
|
-
if (e?.variants == null) return h(o, t?.class, t?.className);
|
|
8
|
-
const { variants: r, defaultVariants: i } = e, u = Object.keys(r).map((n) => {
|
|
9
|
-
const a = t?.[n], s = i?.[n];
|
|
10
|
-
if (a === null) return null;
|
|
11
|
-
const d = N(a) || N(s);
|
|
12
|
-
return r[n][d];
|
|
13
|
-
}), b = t && Object.entries(t).reduce((n, a) => {
|
|
14
|
-
let [s, d] = a;
|
|
15
|
-
return d === void 0 || (n[s] = d), n;
|
|
16
|
-
}, {}), y = e == null || (l = e.compoundVariants) === null || l === void 0 ? void 0 : l.reduce((n, a) => {
|
|
17
|
-
let { class: s, className: d, ...c } = a;
|
|
18
|
-
return Object.entries(c).every((m) => {
|
|
19
|
-
let [g, x] = m;
|
|
20
|
-
return Array.isArray(x) ? x.includes({
|
|
21
|
-
...i,
|
|
22
|
-
...b
|
|
23
|
-
}[g]) : {
|
|
24
|
-
...i,
|
|
25
|
-
...b
|
|
26
|
-
}[g] === x;
|
|
27
|
-
}) ? [
|
|
28
|
-
...n,
|
|
29
|
-
s,
|
|
30
|
-
d
|
|
31
|
-
] : n;
|
|
32
|
-
}, []);
|
|
33
|
-
return h(o, u, y, t?.class, t?.className);
|
|
34
|
-
}, _ = C(
|
|
35
|
-
`
|
|
36
|
-
!font-sans flex relative items-center justify-center gap-2 whitespace-nowrap transition-colors cursor-pointer py-2 px-6 rounded-lg border font-semibold
|
|
37
|
-
focus:outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
38
|
-
focus-visible:ring-offset-2 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0
|
|
39
|
-
`,
|
|
40
|
-
{
|
|
41
|
-
variants: {
|
|
42
|
-
variant: {
|
|
43
|
-
primary: "bg-button-primary-bg text-button-primary-text border-button-primary-border disabled:bg-button-primary-bg--disabled disabled:text-button-primary-text--disabled disabled:border-button-primary-border--disabled",
|
|
44
|
-
secondary: "bg-button-secondary-bg border-button-secondary-border text-button-secondary-text disabled:bg-button-secondary-bg--disabled disabled:text-button-secondary-text--disabled disabled:border-button-secondary-border--disabled",
|
|
45
|
-
outline: "bg-button-outline-bg border-button-outline-border text-button-outline-text disabled:text-button-outline-text--disabled disabled:border-button-outline-border--disabled"
|
|
46
|
-
},
|
|
47
|
-
state: {
|
|
48
|
-
default: "",
|
|
49
|
-
error: "bg-button-danger text-button-primary-text transition pointer-events-none",
|
|
50
|
-
loading: "cursor-wait pointer-events-none"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
defaultVariants: {
|
|
54
|
-
variant: "primary",
|
|
55
|
-
state: "default"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
), k = j(
|
|
59
|
-
({
|
|
60
|
-
className: o,
|
|
61
|
-
variant: e,
|
|
62
|
-
label: t,
|
|
63
|
-
endIcon: l,
|
|
64
|
-
state: r,
|
|
65
|
-
errorMessage: i,
|
|
66
|
-
startIcon: u,
|
|
67
|
-
disabled: b,
|
|
68
|
-
type: y = "button",
|
|
69
|
-
dataTestId: n = `button-${e}`,
|
|
70
|
-
isFullWidth: a,
|
|
71
|
-
...s
|
|
72
|
-
}, d) => {
|
|
73
|
-
const c = {
|
|
74
|
-
error: {
|
|
75
|
-
primary: "bg-button-danger border-button-danger text-button-primary-text pointer-events-none",
|
|
76
|
-
secondary: "bg-button-danger border-button-danger text-button-secondary-text pointer-events-none",
|
|
77
|
-
outline: "bg-transparent border-button-danger text-button-danger pointer-events-none"
|
|
78
|
-
},
|
|
79
|
-
loading: {
|
|
80
|
-
primary: "bg-button-primary-bg--disabled border-button-primary-border--disabled text-button-primary-text--disabled pointer-events-none",
|
|
81
|
-
secondary: "bg-button-secondary-bg--disabled border-button-secondary-border--disabled text-button-secondary-text--disabled pointer-events-none",
|
|
82
|
-
outline: "bg-button-outline-bg--disabled border-button-outline-border--disabled text-button-outline-text--disabled pointer-events-none"
|
|
83
|
-
}
|
|
84
|
-
}, m = a ? "w-full" : "w-auto", g = p(
|
|
85
|
-
_({ variant: e, state: r }),
|
|
86
|
-
r === "error" && c.error[e || "primary"],
|
|
87
|
-
r === "loading" && c.loading[e || "primary"],
|
|
88
|
-
m,
|
|
89
|
-
o
|
|
90
|
-
);
|
|
91
|
-
return /* @__PURE__ */ f("div", { className: p("flex justify-items-center", m), children: [
|
|
92
|
-
/* @__PURE__ */ f(
|
|
93
|
-
"button",
|
|
94
|
-
{
|
|
95
|
-
className: g,
|
|
96
|
-
ref: d,
|
|
97
|
-
type: y,
|
|
98
|
-
"aria-disabled": b,
|
|
99
|
-
disabled: b,
|
|
100
|
-
"data-testid": n,
|
|
101
|
-
...s,
|
|
102
|
-
"data-state": r,
|
|
103
|
-
children: [
|
|
104
|
-
u && /* @__PURE__ */ v("span", { className: "flex pr-2", "aria-hidden": !0, children: u }),
|
|
105
|
-
t,
|
|
106
|
-
r === "loading" && /* @__PURE__ */ v(w, { className: "ml-2 animate-spin", size: 16 }),
|
|
107
|
-
l && r !== "loading" && /* @__PURE__ */ v("span", { className: "flex pl-2", "aria-hidden": !0, children: l })
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
),
|
|
111
|
-
r === "error" && i && /* @__PURE__ */ v("p", { className: "text-danger text-xs", role: "alert", "aria-live": "polite", children: i })
|
|
112
|
-
] });
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
k.displayName = "Button";
|
|
116
|
-
export {
|
|
117
|
-
k as Button
|
|
118
|
-
};
|
package/dist/Card.d.ts
DELETED
package/dist/Card.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { c as a } from "./twUtils-B9ArqCOv.js";
|
|
3
|
-
import { forwardRef as u } from "react";
|
|
4
|
-
import { L as b } from "./loader-circle-Btf6jOd5.js";
|
|
5
|
-
const p = u(
|
|
6
|
-
({ className: n, title: s, icon: r, width: l = "full", isLoading: c = !1, children: d, ...f }, o) => {
|
|
7
|
-
const i = s || r, m = a(
|
|
8
|
-
"!font-sans relative bg-card-bg rounded-2xl p-4 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
9
|
-
l === "full" ? "w-full" : "w-fit",
|
|
10
|
-
n
|
|
11
|
-
);
|
|
12
|
-
return /* @__PURE__ */ t("div", { ref: o, className: m, ...f, children: [
|
|
13
|
-
c && /* @__PURE__ */ e("div", { className: "bg-card-bg/50 absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(b, { className: "text-muted-foreground animate-spin", size: 24 }) }),
|
|
14
|
-
i && /* @__PURE__ */ t("div", { className: a("flex items-center pb-4", s ? "justify-between" : "justify-end"), children: [
|
|
15
|
-
s && /* @__PURE__ */ e("h3", { className: "text-card-text truncate text-base font-semibold", children: s }),
|
|
16
|
-
r && /* @__PURE__ */ e("div", { className: "flex-shrink-0", "aria-hidden": "true", children: r })
|
|
17
|
-
] }),
|
|
18
|
-
/* @__PURE__ */ e("div", { className: a("min-h-40 p-4", i && "pt-0"), children: d })
|
|
19
|
-
] });
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
p.displayName = "Card";
|
|
23
|
-
export {
|
|
24
|
-
p as Card
|
|
25
|
-
};
|
package/dist/Drawer.d.ts
DELETED