@spear-ai/spectral 1.8.9 → 1.9.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/dist/.js +214 -210
- package/dist/Accordion.js +4 -4
- package/dist/Combobox/ComboboxBase.d.ts +8 -0
- package/dist/Combobox/ComboboxBase.js +80 -0
- package/dist/Combobox.d.ts +20 -0
- package/dist/Combobox.js +175 -0
- package/dist/ComboboxBase-CxNxYtdT.js +408 -0
- package/dist/ControlGroup/ControlGroupSelect.d.ts +33 -0
- package/dist/ControlGroup/ControlGroupSelect.js +104 -0
- package/dist/ControlGroup.d.ts +24 -0
- package/dist/ControlGroup.js +51 -0
- package/dist/Dialog.js +2 -2
- package/dist/Drawer.js +1 -1
- package/dist/HoverCard.js +4 -4
- package/dist/MultiSelect/MultiSelectBase.js +128 -126
- package/dist/Popover.js +1 -1
- package/dist/RadioGroup.js +5 -5
- package/dist/Select.js +1 -1
- package/dist/Slider.js +3 -3
- package/dist/Tooltip.js +6 -6
- package/dist/Tray.d.ts +3 -1
- package/dist/Tray.js +36 -32
- package/dist/{Combination-CQ5bXZqE.js → index-6oYKCvIn.js} +179 -178
- package/dist/{index-CtqlhLRO.js → index-BFOf48AQ.js} +1 -1
- package/dist/{index-BJ6qs9i5.js → index-BlHU_t18.js} +7 -7
- package/dist/{index-D2Qxe4uK.js → index-Bm1RbF6w.js} +1 -1
- package/dist/{index-CXltlPV-.js → index-Bv2OIg5P.js} +6 -6
- package/dist/{index-Cgdmxb3F.js → index-CKEI0pDv.js} +1 -1
- package/dist/{index-CDkQCeZY.js → index-CM_hWgfC.js} +1 -1
- package/dist/{index-CJKg3MVV.js → index-C_YVr64u.js} +2 -2
- package/dist/{index-obMGvcdD.js → index-CwSyIPrv.js} +1 -1
- package/dist/{index-9OmOYyjJ.js → index-Dc0No4pV.js} +2 -1
- package/dist/{index-DqvTB1Bv.js → index-T6XEa11q.js} +7 -7
- package/dist/{index-CmWCa9Ae.js → index-pBCLb6Gr.js} +5 -5
- package/dist/{index-WBfSMXvE.js → index-psiVrsnE.js} +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.d.ts.map +1 -1
- package/dist/primitives/button.js +4 -4
- package/dist/{InputGroup.d.ts → primitives/input-group.d.ts} +10 -7
- package/dist/primitives/input-group.d.ts.map +1 -0
- package/dist/primitives/input-group.js +74 -0
- package/dist/primitives/input.d.ts +6 -1
- package/dist/primitives/input.d.ts.map +1 -1
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/popover.d.ts +10 -0
- package/dist/primitives/popover.d.ts.map +1 -0
- package/dist/primitives/popover.js +26 -0
- package/dist/primitives/select.js +2 -2
- package/dist/styles/spectral.css +2 -2
- package/package.json +1 -1
- package/dist/InputGroup.js +0 -84
package/dist/Tray.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as e, jsxs as
|
|
3
|
+
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
4
4
|
import { ButtonIcon as K } from "./ButtonIcon.js";
|
|
5
5
|
import "./Icons/AnalyzeIcon.js";
|
|
6
6
|
import "./Icons/AnnotationsIcon.js";
|
|
@@ -16,7 +16,7 @@ import "./Icons/ChevronDownIcon.js";
|
|
|
16
16
|
import "./Icons/ChevronUpIcon.js";
|
|
17
17
|
import "./Icons/ClockIcon.js";
|
|
18
18
|
import "./Icons/CloseCircleIcon.js";
|
|
19
|
-
import { CloseIcon as
|
|
19
|
+
import { CloseIcon as h } from "./Icons/CloseIcon.js";
|
|
20
20
|
import "./Icons/DashboardIcon.js";
|
|
21
21
|
import "./Icons/DatabaseIcon.js";
|
|
22
22
|
import "./Icons/DeleteIcon.js";
|
|
@@ -72,10 +72,10 @@ import "./Icons/ZoomXIcon.js";
|
|
|
72
72
|
import "./Icons/ZoomYIcon.js";
|
|
73
73
|
import { cn as a } from "./utils/twUtils.js";
|
|
74
74
|
import { c as M } from "./index-D29mdTf5.js";
|
|
75
|
-
import { createContext as H, useRef as
|
|
76
|
-
import { j as
|
|
77
|
-
import { D as
|
|
78
|
-
import { m as
|
|
75
|
+
import { createContext as H, useRef as f, useMemo as T, useContext as I } from "react";
|
|
76
|
+
import { j as v } from "./index-DEYs15GP.js";
|
|
77
|
+
import { D as m } from "./index-Bm1RbF6w.js";
|
|
78
|
+
import { m as g } from "./proxy-CO_-Vget.js";
|
|
79
79
|
import { A as O } from "./index-Cl8VeY0o.js";
|
|
80
80
|
const j = M("fixed bottom-4 left-1/2 z-10 -translate-x-1/2 overflow-hidden rounded-2xl bg-drawer-bg outline-none w-full sm:max-md:max-w-full", {
|
|
81
81
|
variants: {
|
|
@@ -95,7 +95,7 @@ const j = M("fixed bottom-4 left-1/2 z-10 -translate-x-1/2 overflow-hidden round
|
|
|
95
95
|
throw new Error("Tray components must be used within Tray root");
|
|
96
96
|
return t;
|
|
97
97
|
}, B = ({ children: t, size: r = "sm", ...o }) => {
|
|
98
|
-
const i =
|
|
98
|
+
const i = f("default"), n = T(
|
|
99
99
|
() => ({
|
|
100
100
|
animationKey: i.current,
|
|
101
101
|
setAnimationKey: (p) => {
|
|
@@ -105,39 +105,40 @@ const j = M("fixed bottom-4 left-1/2 z-10 -translate-x-1/2 overflow-hidden round
|
|
|
105
105
|
}),
|
|
106
106
|
[r]
|
|
107
107
|
);
|
|
108
|
-
return /* @__PURE__ */ e(N.Provider, { value: n, children: /* @__PURE__ */ e(
|
|
108
|
+
return /* @__PURE__ */ e(N.Provider, { value: n, children: /* @__PURE__ */ e(m.Root, { "data-testid": "spectral-tray", ...o, children: t }) });
|
|
109
109
|
};
|
|
110
110
|
B.displayName = "Tray";
|
|
111
111
|
const P = ({
|
|
112
112
|
className: t,
|
|
113
113
|
ref: r,
|
|
114
114
|
...o
|
|
115
|
-
}) => /* @__PURE__ */ e(
|
|
115
|
+
}) => /* @__PURE__ */ e(m.Trigger, { className: a(t), "data-testid": "spectral-tray-trigger", "data-vaul-no-drag": "", ref: r, ...o });
|
|
116
116
|
P.displayName = "TrayTrigger";
|
|
117
117
|
const C = ({
|
|
118
118
|
className: t,
|
|
119
119
|
ref: r,
|
|
120
120
|
...o
|
|
121
|
-
}) => /* @__PURE__ */ e(
|
|
121
|
+
}) => /* @__PURE__ */ e(m.Close, { asChild: !0, className: a(t), "data-testid": "spectral-tray-close", "data-vaul-no-drag": "", ref: r, ...o, children: /* @__PURE__ */ e(h, {}) });
|
|
122
122
|
C.displayName = "TrayClose";
|
|
123
123
|
const w = ({
|
|
124
124
|
className: t,
|
|
125
125
|
ref: r,
|
|
126
126
|
...o
|
|
127
|
-
}) => /* @__PURE__ */ e(
|
|
127
|
+
}) => /* @__PURE__ */ e(m.Overlay, { className: a("bg-overlay fixed inset-0 z-10", t), ref: r, ...o });
|
|
128
128
|
w.displayName = "TrayOverlay";
|
|
129
129
|
const S = ({
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
"aria-label": t,
|
|
131
|
+
children: r,
|
|
132
|
+
className: o,
|
|
133
|
+
ref: i,
|
|
134
|
+
size: n,
|
|
135
|
+
...p
|
|
135
136
|
}) => {
|
|
136
|
-
const { size:
|
|
137
|
-
return /* @__PURE__ */
|
|
137
|
+
const { size: l } = b(), s = n ?? l, [d, c] = v();
|
|
138
|
+
return /* @__PURE__ */ u(m.Portal, { children: [
|
|
138
139
|
/* @__PURE__ */ e(w, {}),
|
|
139
|
-
/* @__PURE__ */ e(
|
|
140
|
-
|
|
140
|
+
/* @__PURE__ */ e(m.Content, { "aria-describedby": void 0, asChild: !0, className: a(j({ size: s }), o), "data-testid": "spectral-tray-content", ref: i, ...p, children: /* @__PURE__ */ u(
|
|
141
|
+
g.div,
|
|
141
142
|
{
|
|
142
143
|
animate: {
|
|
143
144
|
height: c.height,
|
|
@@ -146,7 +147,10 @@ const S = ({
|
|
|
146
147
|
ease: [0.25, 1, 0.5, 1]
|
|
147
148
|
}
|
|
148
149
|
},
|
|
149
|
-
children:
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ e(m.Title, { className: "sr-only", children: t ?? "Tray" }),
|
|
152
|
+
/* @__PURE__ */ e("div", { ref: d, className: "px-6 pt-2.5 pb-6 antialiased", children: r })
|
|
153
|
+
]
|
|
150
154
|
}
|
|
151
155
|
) })
|
|
152
156
|
] });
|
|
@@ -157,9 +161,9 @@ const V = ({
|
|
|
157
161
|
className: r,
|
|
158
162
|
ref: o,
|
|
159
163
|
...i
|
|
160
|
-
}) => /* @__PURE__ */
|
|
164
|
+
}) => /* @__PURE__ */ u("div", { className: a("relative flex flex-col space-y-1.5 pb-4 text-start", r), "data-testid": "spectral-tray-header", ref: o, ...i, children: [
|
|
161
165
|
t,
|
|
162
|
-
/* @__PURE__ */ e(C, { className: "hover:bg-level-four absolute top-0 right-[-14px] z-10 cursor-pointer rounded-full p-1 text-neutral-400 transition-colors hover:scale-110 hover:text-neutral-100", children: /* @__PURE__ */ e(K, { icon: /* @__PURE__ */ e(
|
|
166
|
+
/* @__PURE__ */ e(C, { className: "hover:bg-level-four absolute top-0 right-[-14px] z-10 cursor-pointer rounded-full p-1 text-neutral-400 transition-colors hover:scale-110 hover:text-neutral-100", children: /* @__PURE__ */ e(K, { icon: /* @__PURE__ */ e(h, {}), label: "Close tray", shape: "circle" }) })
|
|
163
167
|
] });
|
|
164
168
|
V.displayName = "TrayHeader";
|
|
165
169
|
const U = ({
|
|
@@ -182,20 +186,20 @@ const k = ({
|
|
|
182
186
|
ref: i,
|
|
183
187
|
...n
|
|
184
188
|
}) => {
|
|
185
|
-
const { animationKey: p } = b(), l = t ?? p,
|
|
186
|
-
const
|
|
187
|
-
if (!
|
|
188
|
-
return
|
|
189
|
-
const D = Math.abs(
|
|
190
|
-
return
|
|
191
|
-
}, [
|
|
189
|
+
const { animationKey: p } = b(), l = t ?? p, s = f(null), [d, c] = v(), z = T(() => {
|
|
190
|
+
const y = c.height, R = s.current, A = 0.27, x = 0.15;
|
|
191
|
+
if (!s.current)
|
|
192
|
+
return s.current = y, x;
|
|
193
|
+
const D = Math.abs(y - (R ?? 0));
|
|
194
|
+
return s.current = y, Math.min(Math.max(D / 500, x), A);
|
|
195
|
+
}, [c.height]);
|
|
192
196
|
return /* @__PURE__ */ e("div", { ref: i, "data-testid": "spectral-tray-body", className: a(o), ...n, children: /* @__PURE__ */ e(O, { initial: !1, mode: "popLayout", custom: l, children: /* @__PURE__ */ e(
|
|
193
|
-
|
|
197
|
+
g.div,
|
|
194
198
|
{
|
|
195
199
|
animate: { opacity: 1, scale: 1, y: 0 },
|
|
196
200
|
exit: { opacity: 0, scale: 0.96 },
|
|
197
201
|
initial: { opacity: 0, scale: 0.96 },
|
|
198
|
-
ref:
|
|
202
|
+
ref: d,
|
|
199
203
|
transition: {
|
|
200
204
|
duration: z,
|
|
201
205
|
ease: [0.26, 0.08, 0.25, 1]
|