@spear-ai/spectral 1.4.1 → 1.4.3
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/Accordion.d.ts +7 -7
- package/dist/Accordion.js +53 -51
- package/dist/Alert/AlertBase.js +6 -6
- package/dist/Alert.js +1 -1
- package/dist/Avatar.d.ts +2 -2
- package/dist/Avatar.js +46 -46
- package/dist/Badge.js +3 -3
- package/dist/Button.js +19 -12
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroupButton.js +10 -10
- package/dist/ButtonGroup.d.ts +8 -5
- package/dist/ButtonGroup.js +22 -14
- package/dist/ButtonIcon.d.ts +1 -1
- package/dist/ButtonIcon.js +5 -5
- package/dist/Card.d.ts +1 -1
- package/dist/Card.js +10 -10
- package/dist/Checkbox/CheckboxBase.d.ts +6 -6
- package/dist/Checkbox/CheckboxBase.js +65 -63
- package/dist/Checkbox.js +16 -14
- package/dist/Dialog/DialogBase.d.ts +37 -25
- package/dist/Dialog/DialogBase.js +130 -104
- package/dist/Dialog.d.ts +8 -8
- package/dist/Dialog.js +46 -36
- package/dist/Drawer.js +17 -17
- package/dist/HoverCard.d.ts +4 -4
- package/dist/HoverCard.js +34 -33
- package/dist/Input.js +58 -58
- package/dist/InputOTP.d.ts +1 -1
- package/dist/InputOTP.js +113 -112
- package/dist/MultiSelect/MultiSelectBase.d.ts +16 -16
- package/dist/MultiSelect/MultiSelectBase.js +236 -177
- package/dist/MultiSelect/MutiSelect.d.ts +6 -4
- package/dist/MultiSelect/MutiSelect.js +13 -12
- package/dist/Popover.js +2 -1
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +18 -17
- package/dist/RadioGroup.js +5 -3
- package/dist/Select.js +70 -51
- package/dist/Slider.js +8 -4
- package/dist/Switch/SwitchBase.d.ts +6 -6
- package/dist/Switch/SwitchBase.js +39 -38
- package/dist/Switch.js +17 -16
- package/dist/Tabs/TabsBase.js +40 -25
- package/dist/Tabs.js +18 -21
- package/dist/Textarea.d.ts +1 -0
- package/dist/Textarea.js +33 -33
- package/dist/Toggle.js +4 -4
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +7 -7
- package/dist/ToggleGroup/ToggleGroupBase.js +64 -64
- package/dist/ToggleGroup.js +19 -17
- package/dist/Tooltip/TooltipBase.d.ts +8 -8
- package/dist/Tooltip/TooltipBase.js +76 -74
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +12 -11
- package/dist/Tray.d.ts +1 -1
- package/dist/Tray.js +4910 -117
- package/dist/primitives/input.js +4 -4
- package/dist/primitives/select.d.ts +11 -11
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +28 -21
- package/dist/styles/main.css +1 -1
- package/dist/utils/{refs.d.ts → createForwardRef.d.ts} +1 -1
- package/dist/utils/createForwardRef.d.ts.map +1 -0
- package/dist/utils/formFieldUtils.d.ts +22 -18
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +46 -46
- package/package.json +9 -5
- package/dist/analyzer/list.yml.webp +0 -0
- package/dist/analyzer/network.webp +0 -0
- package/dist/analyzer/sunburst.webp +0 -0
- package/dist/analyzer/visual.webp +0 -0
- package/dist/auth-background.json +0 -90
- package/dist/favicon-invert.svg +0 -5
- package/dist/favicon.svg +0 -5
- package/dist/features/AuthCard/AuthCard.d.ts +0 -3
- package/dist/features/AuthCard/AuthCard.d.ts.map +0 -1
- package/dist/features/AuthCard/AuthToggle.d.ts +0 -9
- package/dist/features/AuthCard/AuthToggle.d.ts.map +0 -1
- package/dist/features/AuthCard/AuthToggle.js +0 -20
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts +0 -11
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts.map +0 -1
- package/dist/features/AuthCard/ForgotPasswordEmailForm.js +0 -86
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts +0 -11
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts.map +0 -1
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +0 -21
- package/dist/features/AuthCard/OTPInput.d.ts +0 -12
- package/dist/features/AuthCard/OTPInput.d.ts.map +0 -1
- package/dist/features/AuthCard/OTPInput.js +0 -12
- package/dist/features/AuthCard/PasswordInput.d.ts +0 -13
- package/dist/features/AuthCard/PasswordInput.d.ts.map +0 -1
- package/dist/features/AuthCard/PasswordInput.js +0 -93
- package/dist/features/AuthCard/SignInForm.d.ts +0 -9
- package/dist/features/AuthCard/SignInForm.d.ts.map +0 -1
- package/dist/features/AuthCard/SignInForm.js +0 -86
- package/dist/features/AuthCard/SignUpForm.d.ts +0 -8
- package/dist/features/AuthCard/SignUpForm.d.ts.map +0 -1
- package/dist/features/AuthCard/SignUpForm.js +0 -100
- package/dist/features/AuthCard.js +0 -202
- package/dist/features/ClearDialog/ClearDialog.d.ts +0 -2
- package/dist/features/ClearDialog/ClearDialog.d.ts.map +0 -1
- package/dist/features/ClearDialog.js +0 -31
- package/dist/features/LabelingToolbar/LabelingToolbar.d.ts +0 -8
- package/dist/features/LabelingToolbar/LabelingToolbar.d.ts.map +0 -1
- package/dist/features/LabelingToolbar.js +0 -13
- package/dist/features/LabelingTools/LabelingTools.d.ts +0 -2
- package/dist/features/LabelingTools/LabelingTools.d.ts.map +0 -1
- package/dist/features/LabelingTools.js +0 -134
- package/dist/features/SensorMetadata/SensorMetadata.d.ts +0 -2
- package/dist/features/SensorMetadata/SensorMetadata.d.ts.map +0 -1
- package/dist/features/SensorMetadata.js +0 -117
- package/dist/features/SettingsPopover/SettingsPopover.d.ts +0 -2
- package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +0 -1
- package/dist/features/SettingsPopover.js +0 -204
- package/dist/index-BIpuW_o8.js +0 -146
- package/dist/linear-cursor-small.png +0 -0
- package/dist/loader-circle-CdRVlFhN.js +0 -11
- package/dist/logo/wordmark-dark-side-by-side.svg +0 -6
- package/dist/logo/wordmark-light-side-by-side.svg +0 -6
- package/dist/message-alert-matte-glass-gradient.webp +0 -0
- package/dist/proxy-C9AqCss6.js +0 -4670
- package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
- package/dist/themes/grayscale-theme.webp +0 -0
- package/dist/themes/green-black-theme.webp +0 -0
- package/dist/themes/reverse-grayscale-theme.webp +0 -0
- package/dist/themes/viridis-theme.webp +0 -0
- package/dist/utils/refs.d.ts.map +0 -1
- package/dist/x-Dl66o_vF.js +0 -14
- /package/dist/utils/{refs.js → createForwardRef.js} +0 -0
|
@@ -1,98 +1,99 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../styles/main.css";
|
|
3
|
-
import { jsx as
|
|
3
|
+
import { jsx as r, jsxs as I } from "react/jsx-runtime";
|
|
4
|
+
import { CloseIcon as V } from "../Icons/CloseIcon.js";
|
|
4
5
|
import { cn as f } from "../utils/twUtils.js";
|
|
5
|
-
import { c as
|
|
6
|
-
import { createContext as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
|
|
9
|
-
const z = V(null);
|
|
6
|
+
import { c as L } from "../index-D29mdTf5.js";
|
|
7
|
+
import { createContext as j, useContext as A, useState as z, useMemo as B, useCallback as k, cloneElement as R, useEffect as y, useRef as D, isValidElement as N } from "react";
|
|
8
|
+
import { createPortal as $ } from "react-dom";
|
|
9
|
+
const T = j(null);
|
|
10
10
|
function m() {
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
11
|
+
const t = A(T);
|
|
12
|
+
if (!t)
|
|
13
13
|
throw new Error("Dialog components must be used within <Dialog>");
|
|
14
|
-
return
|
|
14
|
+
return t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function O(t) {
|
|
17
|
+
return N(t) && typeof t.type != "string" ? !0 : N(t);
|
|
18
18
|
}
|
|
19
|
-
let
|
|
20
|
-
function
|
|
21
|
-
const [
|
|
19
|
+
let h = 0;
|
|
20
|
+
function Q({ open: t, defaultOpen: o = !1, onOpenChange: e, children: n, modal: a = !0 }) {
|
|
21
|
+
const [l, d] = z(o), s = t !== void 0, u = s ? t : l, b = B(
|
|
22
22
|
() => ({
|
|
23
|
-
contentId: `dialog-content-${++
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
contentId: `dialog-content-${++h}`,
|
|
24
|
+
descriptionId: `dialog-description-${h}`,
|
|
25
|
+
titleId: `dialog-title-${h}`
|
|
26
26
|
}),
|
|
27
27
|
[]
|
|
28
|
-
),
|
|
29
|
-
(
|
|
30
|
-
|
|
28
|
+
), C = k(
|
|
29
|
+
(p) => {
|
|
30
|
+
s || d(p), e?.(p);
|
|
31
31
|
},
|
|
32
|
-
[
|
|
33
|
-
),
|
|
32
|
+
[s, e]
|
|
33
|
+
), w = B(
|
|
34
34
|
() => ({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...
|
|
35
|
+
modal: a,
|
|
36
|
+
open: u,
|
|
37
|
+
setOpen: C,
|
|
38
|
+
...b
|
|
39
39
|
}),
|
|
40
|
-
[
|
|
40
|
+
[u, C, a, b]
|
|
41
41
|
);
|
|
42
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ r(T.Provider, { value: w, children: n });
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const {
|
|
44
|
+
function W({ children: t, asChild: o = !0, dataTestId: e }) {
|
|
45
|
+
const { setOpen: n } = m(), a = k(() => {
|
|
46
46
|
n(!0);
|
|
47
47
|
}, [n]);
|
|
48
|
-
if (!
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
if (!
|
|
48
|
+
if (!o)
|
|
49
|
+
return /* @__PURE__ */ r("button", { "data-slot": "dialog-trigger", "data-testid": e, onClick: a, tabIndex: 0, children: t });
|
|
50
|
+
if (!O(t))
|
|
51
51
|
throw new Error("DialogTrigger expects a single React element as child");
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
onClick: (...
|
|
55
|
-
|
|
52
|
+
const l = t.props.onClick;
|
|
53
|
+
return R(t, {
|
|
54
|
+
onClick: (...d) => {
|
|
55
|
+
l?.(...d), a();
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
const {
|
|
59
|
+
function M({ children: t, asChild: o = !0, dataTestId: e }) {
|
|
60
|
+
const { setOpen: n } = m(), a = k(() => {
|
|
61
61
|
n(!1);
|
|
62
62
|
}, [n]);
|
|
63
|
-
if (!
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
if (!
|
|
63
|
+
if (!o)
|
|
64
|
+
return /* @__PURE__ */ r("button", { className: "cursor-pointer focus-visible:outline-none outline-transparent focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1", "data-slot": "dialog-close", "data-testid": e, onClick: a, tabIndex: 0, children: t });
|
|
65
|
+
if (!O(t))
|
|
66
66
|
throw new Error("DialogClose expects a single React element as child");
|
|
67
|
-
const
|
|
68
|
-
return
|
|
69
|
-
onClick: (...
|
|
70
|
-
|
|
67
|
+
const l = t.props.onClick;
|
|
68
|
+
return R(t, {
|
|
69
|
+
onClick: (...d) => {
|
|
70
|
+
l?.(...d), a();
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const [
|
|
76
|
-
return
|
|
74
|
+
function P({ children: t, container: o }) {
|
|
75
|
+
const [e, n] = z(!1);
|
|
76
|
+
return y(() => (n(!0), () => n(!1)), []), e ? $(t, o ?? document.body) : null;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
const {
|
|
80
|
-
(
|
|
81
|
-
|
|
78
|
+
function X({ className: t, dataTestId: o }) {
|
|
79
|
+
const { open: e, setOpen: n } = m(), a = k(
|
|
80
|
+
(l) => {
|
|
81
|
+
l.target === l.currentTarget && n(!1);
|
|
82
82
|
},
|
|
83
83
|
[n]
|
|
84
84
|
);
|
|
85
|
-
return
|
|
85
|
+
return e ? /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(
|
|
86
86
|
"div",
|
|
87
87
|
{
|
|
88
|
-
|
|
89
|
-
"data-state
|
|
90
|
-
|
|
91
|
-
"
|
|
88
|
+
"aria-hidden": "true",
|
|
89
|
+
className: f("fixed inset-0 z-40 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=open]:fade-in-0", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0", t),
|
|
90
|
+
"data-state": e ? "open" : "closed",
|
|
91
|
+
"data-testid": o,
|
|
92
|
+
onClick: a
|
|
92
93
|
}
|
|
93
94
|
) }) : null;
|
|
94
95
|
}
|
|
95
|
-
const
|
|
96
|
+
const F = L(
|
|
96
97
|
[
|
|
97
98
|
"fixed left-1/2 top-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 rounded-lg p-6 shadow-lg outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
98
99
|
"data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
@@ -112,68 +113,93 @@ const M = P(
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
);
|
|
115
|
-
function
|
|
116
|
-
const {
|
|
117
|
-
return
|
|
118
|
-
if (!
|
|
119
|
-
v.current &&
|
|
116
|
+
function Y({ children: t, className: o, dataTestId: e, onEscapeKeyDown: n, onInteractOutside: a, onPointerDownOutside: l, size: d }) {
|
|
117
|
+
const { open: s, setOpen: u, contentId: b, titleId: C, descriptionId: w, modal: p } = m(), g = D(null), x = D(null), v = D(!1);
|
|
118
|
+
return y(() => {
|
|
119
|
+
if (!s) {
|
|
120
|
+
v.current && x.current && typeof x.current.focus == "function" && x.current.focus(), x.current = null, v.current = !1;
|
|
120
121
|
return;
|
|
121
122
|
}
|
|
122
|
-
if (!
|
|
123
|
+
if (!g.current || v.current) return;
|
|
123
124
|
v.current = !0;
|
|
124
|
-
const c =
|
|
125
|
-
|
|
126
|
-
if (!c || !
|
|
127
|
-
const
|
|
128
|
-
(!c.contains(
|
|
125
|
+
const c = g.current;
|
|
126
|
+
x.current = document.activeElement, setTimeout(() => {
|
|
127
|
+
if (!c || !g.current) return;
|
|
128
|
+
const i = document.activeElement;
|
|
129
|
+
(!c.contains(i) || i === document.body) && c.focus();
|
|
129
130
|
}, 0);
|
|
130
|
-
}, [
|
|
131
|
-
if (!
|
|
132
|
-
const c = (
|
|
133
|
-
|
|
131
|
+
}, [s]), y(() => {
|
|
132
|
+
if (!s) return;
|
|
133
|
+
const c = (i) => {
|
|
134
|
+
i.key === "Escape" && (n?.(i), a?.(i), i.defaultPrevented || (i.preventDefault(), u(!1)));
|
|
134
135
|
};
|
|
135
136
|
return document.addEventListener("keydown", c, { capture: !0 }), () => {
|
|
136
137
|
document.removeEventListener("keydown", c, { capture: !0 });
|
|
137
138
|
};
|
|
138
|
-
}, [
|
|
139
|
-
if (!
|
|
140
|
-
const c = (
|
|
141
|
-
const
|
|
142
|
-
|
|
139
|
+
}, [s, n, a, u]), y(() => {
|
|
140
|
+
if (!s) return;
|
|
141
|
+
const c = (i) => {
|
|
142
|
+
const E = i.target;
|
|
143
|
+
g.current && !g.current.contains(E) && (E.closest("[role='dialog']") !== null || (l?.(i), a?.(i), !p && !i.defaultPrevented && u(!1)));
|
|
143
144
|
};
|
|
144
145
|
return document.addEventListener("pointerdown", c), () => document.removeEventListener("pointerdown", c);
|
|
145
|
-
}, [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
}, [s, l, a, u, p]), s ? /* @__PURE__ */ r(P, { children: /* @__PURE__ */ I(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
"aria-describedby": w,
|
|
150
|
+
"aria-labelledby": C,
|
|
151
|
+
"aria-modal": "true",
|
|
152
|
+
className: f(F({ size: d }), o),
|
|
153
|
+
"data-slot": "dialog-content",
|
|
154
|
+
"data-state": s ? "open" : "closed",
|
|
155
|
+
"data-testid": e,
|
|
156
|
+
id: b,
|
|
157
|
+
ref: g,
|
|
158
|
+
role: "dialog",
|
|
159
|
+
tabIndex: -1,
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ I(
|
|
162
|
+
"button",
|
|
163
|
+
{
|
|
164
|
+
"aria-label": "Close dialog",
|
|
165
|
+
className: f("absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100", "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none cursor-pointer"),
|
|
166
|
+
"data-slot": "dialog-close",
|
|
167
|
+
"data-testid": "spectral-dialog-close-icon",
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ r(V, { size: 16 }),
|
|
170
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: "Close" })
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
) }),
|
|
174
|
+
t
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
) }) : null;
|
|
152
178
|
}
|
|
153
|
-
function
|
|
179
|
+
function Z({ children: t, className: o, dataTestId: e }) {
|
|
154
180
|
const { titleId: n } = m();
|
|
155
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ r("h2", { className: f("text-base font-semibold leading-none tracking-tight", o), "data-slot": "dialog-title", "data-testid": e, id: n, children: t });
|
|
156
182
|
}
|
|
157
|
-
function
|
|
183
|
+
function _({ children: t, className: o, dataTestId: e }) {
|
|
158
184
|
const { descriptionId: n } = m();
|
|
159
|
-
return /* @__PURE__ */
|
|
185
|
+
return /* @__PURE__ */ r("p", { className: f("text-sm text-text-secondary", o), "data-slot": "dialog-description", "data-testid": e, id: n, children: t });
|
|
160
186
|
}
|
|
161
|
-
function
|
|
162
|
-
return /* @__PURE__ */
|
|
187
|
+
function tt({ children: t, className: o, dataTestId: e }) {
|
|
188
|
+
return /* @__PURE__ */ r("div", { className: f("flex flex-col space-y-1.5 text-center text-left", o), "data-slot": "dialog-header", "data-testid": e, children: t });
|
|
163
189
|
}
|
|
164
|
-
function
|
|
165
|
-
return /* @__PURE__ */
|
|
190
|
+
function et({ children: t, className: o, dataTestId: e }) {
|
|
191
|
+
return /* @__PURE__ */ r("div", { className: f("flex flex-col-reverse flex-row justify-end space-x-2", o), "data-slot": "dialog-footer", "data-testid": e, children: t });
|
|
166
192
|
}
|
|
167
193
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
194
|
+
Q as DialogBase,
|
|
195
|
+
M as DialogCloseBase,
|
|
196
|
+
Y as DialogContentBase,
|
|
197
|
+
_ as DialogDescriptionBase,
|
|
198
|
+
et as DialogFooterBase,
|
|
199
|
+
tt as DialogHeaderBase,
|
|
200
|
+
X as DialogOverlayBase,
|
|
201
|
+
P as DialogPortalBase,
|
|
202
|
+
Z as DialogTitleBase,
|
|
203
|
+
W as DialogTriggerBase,
|
|
178
204
|
m as useDialogContext
|
|
179
205
|
};
|
package/dist/Dialog.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DialogBaseProps } from './DialogBase';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
declare function Dialog({ ...props }: DialogBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function DialogTrigger({ ...props }: ComponentProps<typeof DialogTriggerBase>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ dataTestId, ...props }: ComponentProps<typeof DialogTriggerBase>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function DialogPortal({ ...props }: ComponentProps<typeof DialogPortalBase>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function DialogClose({ ...props }: ComponentProps<typeof DialogCloseBase>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function DialogOverlay({ className, ...props }: ComponentProps<typeof DialogOverlayBase>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare function DialogContent({ className, children, onInteractOutside, onPointerDownOutside, onEscapeKeyDown, ...props }: ComponentProps<typeof DialogContentBase> & {
|
|
6
|
+
declare function DialogClose({ dataTestId, ...props }: ComponentProps<typeof DialogCloseBase>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, dataTestId, ...props }: ComponentProps<typeof DialogOverlayBase>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, dataTestId, onInteractOutside, onPointerDownOutside, onEscapeKeyDown, ...props }: ComponentProps<typeof DialogContentBase> & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare function DialogHeader({ className, ...props }: ComponentProps<typeof DialogHeaderBase>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function DialogFooter({ className, ...props }: ComponentProps<typeof DialogFooterBase>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare function DialogTitle({ className, ...props }: ComponentProps<typeof DialogTitleBase>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
declare function DialogDescription({ className, ...props }: ComponentProps<typeof DialogDescriptionBase>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, dataTestId, ...props }: ComponentProps<typeof DialogHeaderBase>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, dataTestId, ...props }: ComponentProps<typeof DialogFooterBase>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, dataTestId, ...props }: ComponentProps<typeof DialogTitleBase>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, dataTestId, ...props }: ComponentProps<typeof DialogDescriptionBase>): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
16
16
|
//# sourceMappingURL=Dialog.d.ts.map
|
package/dist/Dialog.js
CHANGED
|
@@ -1,68 +1,78 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { DialogBase as
|
|
4
|
-
import { cn as
|
|
2
|
+
import { jsx as o, Fragment as n } from "react/jsx-runtime";
|
|
3
|
+
import { DialogBase as g, DialogCloseBase as c, DialogContentBase as f, DialogDescriptionBase as u, DialogFooterBase as m, DialogHeaderBase as p, DialogOverlayBase as D, DialogPortalBase as x, DialogTitleBase as T, DialogTriggerBase as B } from "./Dialog/DialogBase.js";
|
|
4
|
+
import { cn as l } from "./utils/twUtils.js";
|
|
5
5
|
import "react";
|
|
6
|
-
function C({ ...a }) {
|
|
7
|
-
return /* @__PURE__ */ e(d, { "data-slot": "dialog", ...a });
|
|
8
|
-
}
|
|
9
6
|
function h({ ...a }) {
|
|
10
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ o(g, { "data-slot": "dialog", "data-testid": "spectral-dialog", ...a });
|
|
8
|
+
}
|
|
9
|
+
function v({ dataTestId: a, ...t }) {
|
|
10
|
+
return /* @__PURE__ */ o(B, { asChild: !0, "data-slot": "dialog-trigger", dataTestId: a || "dialog-trigger", ...t });
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */
|
|
12
|
+
function w({ ...a }) {
|
|
13
|
+
return /* @__PURE__ */ o(x, { "data-slot": "dialog-portal", "data-testid": "dialog-portal", ...a });
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */
|
|
15
|
+
function C({ dataTestId: a, ...t }) {
|
|
16
|
+
return /* @__PURE__ */ o(c, { "data-slot": "dialog-close", dataTestId: a || "dialog-close", ...t });
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return /* @__PURE__ */
|
|
18
|
+
function z({ className: a, dataTestId: t, ...e }) {
|
|
19
|
+
return /* @__PURE__ */ o(
|
|
20
|
+
D,
|
|
21
|
+
{
|
|
22
|
+
className: l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-bg-primary/50", a),
|
|
23
|
+
"data-slot": "dialog-overlay",
|
|
24
|
+
dataTestId: t || "dialog-overlay",
|
|
25
|
+
...e
|
|
26
|
+
}
|
|
27
|
+
);
|
|
20
28
|
}
|
|
21
29
|
function F({
|
|
22
30
|
className: a,
|
|
23
31
|
children: t,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
dataTestId: e,
|
|
33
|
+
onInteractOutside: i,
|
|
34
|
+
onPointerDownOutside: d,
|
|
35
|
+
onEscapeKeyDown: s,
|
|
27
36
|
...r
|
|
28
37
|
}) {
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
38
|
+
return /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(
|
|
39
|
+
f,
|
|
31
40
|
{
|
|
32
|
-
|
|
33
|
-
className: o(
|
|
41
|
+
className: l(
|
|
34
42
|
"bg-dialog-bg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg p-6 shadow-lg duration-200 max-w-lg",
|
|
35
43
|
a
|
|
36
44
|
),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onEscapeKeyDown:
|
|
45
|
+
"data-slot": "dialog-content",
|
|
46
|
+
dataTestId: e || "dialog-content",
|
|
47
|
+
onEscapeKeyDown: s,
|
|
48
|
+
onInteractOutside: i,
|
|
49
|
+
onPointerDownOutside: d,
|
|
40
50
|
...r,
|
|
41
51
|
children: t
|
|
42
52
|
}
|
|
43
53
|
) });
|
|
44
54
|
}
|
|
45
|
-
function j({ className: a,
|
|
46
|
-
return /* @__PURE__ */
|
|
55
|
+
function j({ className: a, dataTestId: t, ...e }) {
|
|
56
|
+
return /* @__PURE__ */ o(p, { className: l("flex flex-col gap-2 text-center sm:text-left", a), "data-slot": "dialog-header", dataTestId: t || "dialog-header", ...e });
|
|
47
57
|
}
|
|
48
|
-
function H({ className: a,
|
|
49
|
-
return /* @__PURE__ */
|
|
58
|
+
function H({ className: a, dataTestId: t, ...e }) {
|
|
59
|
+
return /* @__PURE__ */ o(m, { className: l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", a), "data-slot": "dialog-footer", dataTestId: t || "dialog-footer", ...e });
|
|
50
60
|
}
|
|
51
|
-
function O({ className: a,
|
|
52
|
-
return /* @__PURE__ */
|
|
61
|
+
function O({ className: a, dataTestId: t, ...e }) {
|
|
62
|
+
return /* @__PURE__ */ o(T, { className: l("text-lg leading-none font-semibold", a), "data-slot": "dialog-title", dataTestId: t || "dialog-title", ...e });
|
|
53
63
|
}
|
|
54
|
-
function P({ className: a,
|
|
55
|
-
return /* @__PURE__ */
|
|
64
|
+
function P({ className: a, dataTestId: t, ...e }) {
|
|
65
|
+
return /* @__PURE__ */ o(u, { className: l("text-muted-foreground text-sm", a), "data-slot": "dialog-description", dataTestId: t || "dialog-description", ...e });
|
|
56
66
|
}
|
|
57
67
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
h as Dialog,
|
|
69
|
+
C as DialogClose,
|
|
60
70
|
F as DialogContent,
|
|
61
71
|
P as DialogDescription,
|
|
62
72
|
H as DialogFooter,
|
|
63
73
|
j as DialogHeader,
|
|
64
|
-
|
|
65
|
-
|
|
74
|
+
z as DialogOverlay,
|
|
75
|
+
w as DialogPortal,
|
|
66
76
|
O as DialogTitle,
|
|
67
|
-
|
|
77
|
+
v as DialogTrigger
|
|
68
78
|
};
|
package/dist/Drawer.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
2
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
3
3
|
import { SpectralProvider as x } from "./SpectralProvider.js";
|
|
4
4
|
import { D as e } from "./index-CAKA12cC.js";
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const b = ({ trigger: d, title: o, description: i, children: c, direction: l = "right", size: r = "380px" }) => {
|
|
6
|
+
const a = "!font-sans fixed", p = {
|
|
7
7
|
left: {
|
|
8
|
-
className: `${
|
|
8
|
+
className: `${a} top-0 bottom-0 left-0 shadow-[20px_0_20px_rgba(0,0,0,0.4)]`,
|
|
9
9
|
style: { width: r }
|
|
10
10
|
},
|
|
11
11
|
right: {
|
|
12
|
-
className: `${
|
|
12
|
+
className: `${a} top-0 bottom-0 right-0 shadow-[-20px_0_20px_rgba(0,0,0,0.4)]`,
|
|
13
13
|
style: { width: r }
|
|
14
14
|
},
|
|
15
15
|
top: {
|
|
16
|
-
className: `${
|
|
16
|
+
className: `${a} top-0 left-0 right-0 shadow-[0_20px_20px_rgba(0,0,0,0.4)]`,
|
|
17
17
|
style: { height: r }
|
|
18
18
|
},
|
|
19
19
|
bottom: {
|
|
20
|
-
className: `${
|
|
20
|
+
className: `${a} bottom-0 left-0 right-0 shadow-[0_-20px_20px_rgba(0,0,0,0.4)]`,
|
|
21
21
|
style: { height: r }
|
|
22
22
|
}
|
|
23
|
-
}, { className:
|
|
24
|
-
return /* @__PURE__ */ t(x, { children: /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */ t(e.Trigger, { asChild: !0, children:
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */ t(e.Overlay, { className: "fixed inset-0 bg-transparent" }),
|
|
28
|
-
/* @__PURE__ */ t(e.Content, { asChild: !0, className: `bg-drawer-bg z-10 flex flex-col outline-none [&_*]:box-border ${
|
|
23
|
+
}, { className: n, style: m } = p[l];
|
|
24
|
+
return /* @__PURE__ */ t(x, { children: /* @__PURE__ */ s(e.Root, { direction: l, "data-testid": "spectral-drawer", children: [
|
|
25
|
+
/* @__PURE__ */ t(e.Trigger, { asChild: !0, "data-testid": "spectral-drawer-trigger", children: d }),
|
|
26
|
+
/* @__PURE__ */ s(e.Portal, { children: [
|
|
27
|
+
/* @__PURE__ */ t(e.Overlay, { className: "fixed inset-0 bg-transparent", "data-testid": "spectral-drawer-overlay" }),
|
|
28
|
+
/* @__PURE__ */ t(e.Content, { asChild: !0, className: `bg-drawer-bg z-10 flex flex-col outline-none [&_*]:box-border ${n}`, style: m, "data-testid": "spectral-drawer-content", children: /* @__PURE__ */ s("div", { children: [
|
|
29
29
|
/* @__PURE__ */ t(e.Close, {}),
|
|
30
|
-
/* @__PURE__ */ t(e.Title, { className: "text-text-primary px-3 pt-4 text-lg font-medium", children:
|
|
31
|
-
/* @__PURE__ */ t(e.Description, { className: "!text-text-secondary mb-2 px-3 !text-xs uppercase", children:
|
|
32
|
-
/* @__PURE__ */ t("div", { className: "py-2 px-3 min-w-0 w-auto overflow-hidden [&>*]:min-w-0 [&_*]:min-w-0", children:
|
|
30
|
+
/* @__PURE__ */ t(e.Title, { className: "text-text-primary px-3 pt-4 text-lg font-medium", "data-testid": "spectral-drawer-title", children: o }),
|
|
31
|
+
/* @__PURE__ */ t(e.Description, { className: "!text-text-secondary mb-2 px-3 !text-xs uppercase", "data-testid": "spectral-drawer-description", children: i }),
|
|
32
|
+
/* @__PURE__ */ t("div", { className: "py-2 px-3 min-w-0 w-auto overflow-hidden [&>*]:min-w-0 [&_*]:min-w-0", "data-testid": "spectral-drawer-body", children: c })
|
|
33
33
|
] }) })
|
|
34
34
|
] })
|
|
35
35
|
] }) });
|
|
36
36
|
};
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
b as Drawer
|
|
39
39
|
};
|
package/dist/HoverCard.d.ts
CHANGED
|
@@ -3,17 +3,17 @@ import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
|
3
3
|
type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
4
4
|
type Align = 'start' | 'center' | 'end';
|
|
5
5
|
type HoverCardContentProps = {
|
|
6
|
-
side?: Side;
|
|
7
|
-
sideOffset?: number;
|
|
8
6
|
align?: Align;
|
|
9
7
|
alignOffset?: number;
|
|
10
8
|
collisionBoundary?: Element | null | Array<Element | null>;
|
|
11
9
|
collisionPadding?: number | Partial<Record<Side, number>>;
|
|
10
|
+
side?: Side;
|
|
11
|
+
sideOffset?: number;
|
|
12
12
|
width?: number | 'w-fit' | 'trigger-width';
|
|
13
13
|
};
|
|
14
14
|
export type HoverCardProps = ComponentProps<typeof HoverCardPrimitive.Root> & HoverCardContentProps;
|
|
15
15
|
export declare const HoverCard: {
|
|
16
|
-
({
|
|
16
|
+
({ align, alignOffset, collisionBoundary, collisionPadding, side, sideOffset, width, ...props }: HoverCardProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
19
|
export declare const HoverCardTrigger: {
|
|
@@ -21,7 +21,7 @@ export declare const HoverCardTrigger: {
|
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
23
23
|
export declare const HoverCardContent: {
|
|
24
|
-
({
|
|
24
|
+
({ align: alignProp, alignOffset: alignOffsetProp, className, collisionBoundary: collisionBoundaryProp, collisionPadding: collisionPaddingProp, side: sideProp, sideOffset: sideOffsetProp, width: widthProp, ...props }: ComponentProps<typeof HoverCardPrimitive.Content> & {
|
|
25
25
|
width?: number | "w-fit" | "trigger-width";
|
|
26
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
displayName: string;
|