@spear-ai/spectral 1.3.62 → 1.3.64
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 +205 -152
- package/dist/Accordion.d.ts +37 -0
- package/dist/Accordion.js +474 -0
- package/dist/Alert/AlertBase.js +2 -2
- package/dist/Alert.js +21 -11
- package/dist/Avatar.js +1 -1
- package/dist/Badge.d.ts +12 -2
- package/dist/Badge.js +28 -4
- package/dist/Button.d.ts +3 -3
- package/dist/Button.js +35 -28
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +13 -0
- package/dist/ButtonGroup/ButtonGroupButton.js +51 -0
- package/dist/ButtonGroup.d.ts +29 -0
- package/dist/ButtonGroup.js +89 -0
- package/dist/ButtonIcon.js +11 -1
- package/dist/Card.d.ts +16 -0
- package/dist/Card.js +32 -0
- package/dist/Checkbox/CheckboxBase.js +1 -1
- package/dist/Checkbox.js +22 -14
- package/dist/Dialog/DialogBase.d.ts +6 -3
- package/dist/Dialog/DialogBase.js +113 -98
- package/dist/Dialog.d.ts +1 -1
- package/dist/Dialog.js +42 -36
- package/dist/Drawer.js +24 -1283
- package/dist/HoverCard.d.ts +29 -0
- package/dist/HoverCard.js +207 -0
- package/dist/Icons/AnalyzeIcon.d.ts +3 -0
- package/dist/Icons/AnalyzeIcon.js +73 -0
- package/dist/Icons/AnnotationsIcon.js +4 -4
- package/dist/Icons/ApprovedIcon.d.ts +3 -0
- package/dist/Icons/ApprovedIcon.js +43 -0
- package/dist/Icons/CalendarIcon.js +7 -7
- package/dist/Icons/CheckCircleIcon.js +14 -14
- package/dist/Icons/CheckSquareIcon.js +14 -14
- package/dist/Icons/CheckmarkIcon.js +9 -9
- package/dist/Icons/ChevronDownIcon.js +6 -6
- package/dist/Icons/ChevronUpIcon.js +7 -7
- package/dist/Icons/ClockIcon.js +10 -10
- package/dist/Icons/CloseCircleIcon.js +10 -10
- package/dist/Icons/CloseIcon.js +5 -5
- package/dist/Icons/DashboardIcon.js +4 -4
- package/dist/Icons/DatabaseIcon.d.ts +3 -0
- package/dist/Icons/DatabaseIcon.js +53 -0
- package/dist/Icons/DeleteIcon.js +24 -6
- package/dist/Icons/DurationIcon.js +7 -7
- package/dist/Icons/EmailIcon.js +4 -4
- package/dist/Icons/EraserIcon.js +20 -11
- package/dist/Icons/ErrorIcon.js +3 -3
- package/dist/Icons/EyeClosedIcon.js +2 -2
- package/dist/Icons/EyeClosedIcon2.js +18 -18
- package/dist/Icons/EyeOpenIcon.js +8 -8
- package/dist/Icons/GoToFirstIcon.js +1 -1
- package/dist/Icons/GoToLastIcon.js +3 -3
- package/dist/Icons/HarmonicCursorsIcon.js +4 -4
- package/dist/Icons/IconBase.d.ts +1 -1
- package/dist/Icons/IconBase.js +15 -17
- package/dist/Icons/InfoIcon.js +4 -4
- package/dist/Icons/LabelIcon.js +6 -6
- package/dist/Icons/LassoIcon.js +6 -6
- package/dist/Icons/LineToolIcon.js +22 -93
- package/dist/Icons/LineToolIcon2.d.ts +3 -0
- package/dist/Icons/LineToolIcon2.js +73 -0
- package/dist/Icons/LiveViewIcon.js +5 -5
- package/dist/Icons/LoaderIcon.js +5 -5
- package/dist/Icons/LocationIcon.js +5 -5
- package/dist/Icons/LogoutIcon.js +11 -11
- package/dist/Icons/MessagesIcon.d.ts +3 -0
- package/dist/Icons/MessagesIcon.js +34 -0
- package/dist/Icons/MetadataIcon.js +5 -5
- package/dist/Icons/MinusIcon.js +9 -9
- package/dist/Icons/OntologyIcon.js +74 -21
- package/dist/Icons/PanelIconClose.js +11 -11
- package/dist/Icons/PanelIconOpen.js +11 -11
- package/dist/Icons/PlayIcon.js +5 -5
- package/dist/Icons/PlusIcon.js +9 -8
- package/dist/Icons/ResetIcon.js +6 -6
- package/dist/Icons/ReviewedIcon.d.ts +3 -0
- package/dist/Icons/ReviewedIcon.js +44 -0
- package/dist/Icons/ScissorsIcon.js +9 -9
- package/dist/Icons/SettingsIcon.js +20 -22
- package/dist/Icons/SortAscendingIcon.d.ts +3 -0
- package/dist/Icons/SortAscendingIcon.js +73 -0
- package/dist/Icons/SortDescendingIcon.d.ts +3 -0
- package/dist/Icons/SortDescendingIcon.js +73 -0
- package/dist/Icons/StackIcon.d.ts +3 -0
- package/dist/Icons/StackIcon.js +43 -0
- package/dist/Icons/StarIcon.d.ts +3 -0
- package/dist/Icons/StarIcon.js +31 -0
- package/dist/Icons/TrashIcon.js +10 -10
- package/dist/Icons/UndoIcon.js +1 -1
- package/dist/Icons/UserIcon.js +1 -1
- package/dist/Icons/WarningIcon.js +9 -9
- package/dist/Icons/ZoomAllIcon.js +97 -57
- package/dist/Icons/ZoomXIcon.js +6 -6
- package/dist/Icons/ZoomYIcon.js +17 -8
- package/dist/Icons/index.d.ts +10 -0
- package/dist/Icons.js +114 -94
- package/dist/Input.d.ts +2 -0
- package/dist/Input.js +100 -82
- package/dist/InputGroup.d.ts +16 -0
- package/dist/InputGroup.js +129 -0
- package/dist/InputOTP.d.ts +0 -2
- package/dist/InputOTP.js +148 -143
- package/dist/Label.d.ts +3 -7
- package/dist/Label.js +11 -11
- package/dist/MultiSelect/MultiSelectBase.js +28 -28
- package/dist/Popover.d.ts +6 -7
- package/dist/Popover.js +60 -71
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -1
- package/dist/RadioButtonGroup.js +1 -1
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup.js +141 -134
- package/dist/Select.d.ts +12 -12
- package/dist/Select.js +106 -895
- package/dist/Separator.d.ts +12 -0
- package/dist/Separator.js +24 -0
- package/dist/Skeleton.js +3 -3
- package/dist/Slider.d.ts +15 -3
- package/dist/Slider.js +464 -40
- package/dist/Switch/SwitchBase.js +1 -1
- package/dist/Switch.js +2 -2
- package/dist/Tabs/TabsBase.js +1 -1
- package/dist/Tabs.js +16 -16
- package/dist/Textarea.js +58 -50
- package/dist/Toggle.js +2 -2
- package/dist/ToggleGroup.js +1 -1
- package/dist/Tooltip/TooltipBase.js +29 -29
- package/dist/Tooltip.js +15 -15
- package/dist/Tray/TrayStoriesData.d.ts +39 -0
- package/dist/Tray/TrayStoriesData.js +438 -0
- package/dist/Tray.d.ts +28 -0
- package/dist/Tray.js +236 -0
- package/dist/analyzer/network.webp +0 -0
- package/dist/analyzer/sunburst.webp +0 -0
- package/dist/analyzer/visual.webp +0 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Accordion/Accordion.d.ts +37 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +12 -2
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +3 -3
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +29 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/dist/components/ButtonGroup/ButtonGroupButton.d.ts +13 -0
- package/dist/components/ButtonGroup/ButtonGroupButton.d.ts.map +1 -0
- package/dist/components/Card/Card.d.ts +16 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/DialogBase.d.ts +6 -3
- package/dist/components/Dialog/DialogBase.d.ts.map +1 -1
- package/dist/components/HoverCard/HoverCard.d.ts +29 -0
- package/dist/components/HoverCard/HoverCard.d.ts.map +1 -0
- package/dist/components/Icons/AnalyzeIcon.d.ts +3 -0
- package/dist/components/Icons/AnalyzeIcon.d.ts.map +1 -0
- package/dist/components/Icons/ApprovedIcon.d.ts +3 -0
- package/dist/components/Icons/ApprovedIcon.d.ts.map +1 -0
- package/dist/components/Icons/DatabaseIcon.d.ts +3 -0
- package/dist/components/Icons/DatabaseIcon.d.ts.map +1 -0
- package/dist/components/Icons/DeleteIcon.d.ts.map +1 -1
- package/dist/components/Icons/EraserIcon.d.ts.map +1 -1
- package/dist/components/Icons/IconBase.d.ts +1 -1
- package/dist/components/Icons/IconBase.d.ts.map +1 -1
- package/dist/components/Icons/LineToolIcon.d.ts.map +1 -1
- package/dist/components/Icons/LineToolIcon2.d.ts +3 -0
- package/dist/components/Icons/LineToolIcon2.d.ts.map +1 -0
- package/dist/components/Icons/MessagesIcon.d.ts +3 -0
- package/dist/components/Icons/MessagesIcon.d.ts.map +1 -0
- package/dist/components/Icons/OntologyIcon.d.ts.map +1 -1
- package/dist/components/Icons/PlusIcon.d.ts.map +1 -1
- package/dist/components/Icons/ReviewedIcon.d.ts +3 -0
- package/dist/components/Icons/ReviewedIcon.d.ts.map +1 -0
- package/dist/components/Icons/SettingsIcon.d.ts.map +1 -1
- package/dist/components/Icons/SortAscendingIcon.d.ts +3 -0
- package/dist/components/Icons/SortAscendingIcon.d.ts.map +1 -0
- package/dist/components/Icons/SortDescendingIcon.d.ts +3 -0
- package/dist/components/Icons/SortDescendingIcon.d.ts.map +1 -0
- package/dist/components/Icons/StackIcon.d.ts +3 -0
- package/dist/components/Icons/StackIcon.d.ts.map +1 -0
- package/dist/components/Icons/StarIcon.d.ts +3 -0
- package/dist/components/Icons/StarIcon.d.ts.map +1 -0
- package/dist/components/Icons/ZoomAllIcon.d.ts.map +1 -1
- package/dist/components/Icons/ZoomYIcon.d.ts.map +1 -1
- package/dist/components/Icons/index.d.ts +10 -0
- package/dist/components/Icons/index.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.d.ts +16 -0
- package/dist/components/InputGroup/InputGroup.d.ts.map +1 -0
- package/dist/components/InputOTP/InputOTP.d.ts +0 -2
- package/dist/components/InputOTP/InputOTP.d.ts.map +1 -1
- package/dist/components/Label/Label.d.ts +3 -7
- package/dist/components/Label/Label.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +6 -7
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +12 -12
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Separator/Separator.d.ts +12 -0
- package/dist/components/Separator/Separator.d.ts.map +1 -0
- package/dist/components/Slider/Slider.d.ts +15 -3
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Tray/Tray.d.ts +28 -0
- package/dist/components/Tray/Tray.d.ts.map +1 -0
- package/dist/components/Tray/TrayStoriesData.d.ts +39 -0
- package/dist/components/Tray/TrayStoriesData.d.ts.map +1 -0
- package/dist/{createLucideIcon-CI1yJrZf.js → createLucideIcon-B_8CJpcQ.js} +4 -4
- package/dist/features/AuthCard/ForgotPasswordEmailForm.js +13 -3
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +9 -9
- package/dist/features/AuthCard/PasswordInput.js +87 -9
- package/dist/features/AuthCard/SignInForm.js +25 -15
- package/dist/features/AuthCard/SignUpForm.js +24 -14
- package/dist/features/AuthCard.js +2 -2
- package/dist/features/LabelingTools.js +16 -6
- package/dist/features/SensorMetadata.js +15 -5
- package/dist/features/SettingsPopover.js +22 -12
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/{index-CBwRmAsQ.js → index-6Abv_Flm.js} +1 -1
- package/dist/{index-DUK1rxhf.js → index-B-GQStVW.js} +6 -5
- package/dist/index-B2oBi8ng.js +142 -0
- package/dist/index-BIpuW_o8.js +146 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-BhufZRa2.js +232 -0
- package/dist/index-CAKA12cC.js +1265 -0
- package/dist/{index-Cfyte2YO.js → index-CGALWSq_.js} +1 -1
- package/dist/index-CVSxKOPp.js +13 -0
- package/dist/index-CevVJ05e.js +822 -0
- package/dist/{index-CRBC94ik.js → index-D29mdTf5.js} +1 -1
- package/dist/{index-FeGk8zep.js → index-NzygPVvJ.js} +10 -9
- package/dist/index-UEFPWH8U.js +54 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/{index-Cb7rjMhE.js → index-y6Br5T4h.js} +6 -6
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/linear-cursor-small.png +0 -0
- package/dist/{loader-circle-CvdzOiQ_.js → loader-circle-CdRVlFhN.js} +2 -2
- package/dist/main.js +15630 -13510
- package/dist/message-alert-matte-glass-gradient.webp +0 -0
- package/dist/primitives/button.d.ts +10 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +42 -0
- package/dist/primitives/input.d.ts +3 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +18 -0
- package/dist/primitives/select.d.ts +16 -0
- package/dist/primitives/select.d.ts.map +1 -0
- package/dist/primitives/select.js +205 -0
- package/dist/primitives/slot.d.ts.map +1 -1
- package/dist/primitives/slot.js +21 -20
- package/dist/primitives/textarea.d.ts +3 -0
- package/dist/primitives/textarea.d.ts.map +1 -0
- package/dist/primitives/textarea.js +16 -0
- package/dist/{proxy-DD79Ok6n.js → proxy-C9AqCss6.js} +1 -1
- package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
- package/dist/styles/main.css +1 -1
- package/dist/utils/formFieldUtils.js +1 -1
- package/dist/utils/twUtils.js +2728 -2
- package/dist/{x-BBpi7a_7.js → x-Dl66o_vF.js} +2 -2
- package/package.json +28 -23
- package/dist/Accordion/AccordionBase.d.ts +0 -42
- package/dist/Accordion/AccordionBase.js +0 -225
- package/dist/Badge/BadgeBase.d.ts +0 -13
- package/dist/Badge/BadgeBase.js +0 -35
- package/dist/PasswordInput-ClY_hxuN.js +0 -261
- package/dist/components/Accordion/AccordionBase.d.ts +0 -42
- package/dist/components/Accordion/AccordionBase.d.ts.map +0 -1
- package/dist/components/Badge/BadgeBase.d.ts +0 -13
- package/dist/components/Badge/BadgeBase.d.ts.map +0 -1
- package/dist/index-CA7haECj.js +0 -248
- package/dist/index-CbXx14YO.js +0 -59
- package/dist/index-VXXKXen4.js +0 -15
- package/dist/index-cCg4yNa8.js +0 -132
- package/dist/primitives/label.d.ts +0 -5
- package/dist/primitives/label.d.ts.map +0 -1
- package/dist/primitives/label.js +0 -27
- package/dist/twUtils-CRiPKpXj.js +0 -2743
- /package/dist/{list.yml.webp → analyzer/list.yml.webp} +0 -0
|
@@ -1,62 +1,69 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../styles/main.css";
|
|
3
|
-
import { jsx as s, jsxs as
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
6
|
-
import { createContext as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import { X as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
const e = z
|
|
3
|
+
import { jsx as s, jsxs as E } from "react/jsx-runtime";
|
|
4
|
+
import { cn as f } from "../utils/twUtils.js";
|
|
5
|
+
import { c as P } from "../index-D29mdTf5.js";
|
|
6
|
+
import { createContext as V, useContext as L, useState as N, useMemo as I, useCallback as y, cloneElement as O, useEffect as w, useRef as k, isValidElement as B } from "react";
|
|
7
|
+
import { createPortal as j } from "react-dom";
|
|
8
|
+
import { X as A } from "../x-Dl66o_vF.js";
|
|
9
|
+
const z = V(null);
|
|
10
|
+
function m() {
|
|
11
|
+
const e = L(z);
|
|
12
12
|
if (!e)
|
|
13
13
|
throw new Error("Dialog components must be used within <Dialog>");
|
|
14
14
|
return e;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function R(e) {
|
|
17
|
+
return B(e) && typeof e.type != "string" ? !0 : B(e);
|
|
18
18
|
}
|
|
19
|
-
let
|
|
20
|
-
function
|
|
21
|
-
|
|
19
|
+
let D = 0;
|
|
20
|
+
function J({
|
|
21
|
+
isOpen: e,
|
|
22
|
+
defaultOpen: t = !1,
|
|
23
|
+
onOpenChange: n,
|
|
24
|
+
children: o,
|
|
25
|
+
modal: r = !0
|
|
26
|
+
}) {
|
|
27
|
+
const [u, i] = N(t), d = e !== void 0, g = d ? e : u, x = I(
|
|
22
28
|
() => ({
|
|
23
|
-
contentId: `dialog-content-${++
|
|
24
|
-
titleId: `dialog-title-${
|
|
25
|
-
descriptionId: `dialog-description-${
|
|
29
|
+
contentId: `dialog-content-${++D}`,
|
|
30
|
+
titleId: `dialog-title-${D}`,
|
|
31
|
+
descriptionId: `dialog-description-${D}`
|
|
26
32
|
}),
|
|
27
33
|
[]
|
|
28
|
-
),
|
|
34
|
+
), b = y(
|
|
29
35
|
(l) => {
|
|
30
|
-
|
|
36
|
+
d || i(l), n?.(l);
|
|
31
37
|
},
|
|
32
|
-
[
|
|
33
|
-
),
|
|
38
|
+
[d, n]
|
|
39
|
+
), C = I(
|
|
34
40
|
() => ({
|
|
35
|
-
isOpen:
|
|
36
|
-
setIsOpen:
|
|
37
|
-
|
|
41
|
+
isOpen: g,
|
|
42
|
+
setIsOpen: b,
|
|
43
|
+
modal: r,
|
|
44
|
+
...x
|
|
38
45
|
}),
|
|
39
|
-
[
|
|
46
|
+
[g, b, r, x]
|
|
40
47
|
);
|
|
41
|
-
return /* @__PURE__ */ s(
|
|
48
|
+
return /* @__PURE__ */ s(z.Provider, { value: C, children: o });
|
|
42
49
|
}
|
|
43
|
-
function
|
|
44
|
-
const { setIsOpen: n } =
|
|
50
|
+
function K({ children: e, asChild: t = !0 }) {
|
|
51
|
+
const { setIsOpen: n } = m(), o = y(() => {
|
|
45
52
|
n(!0);
|
|
46
53
|
}, [n]);
|
|
47
54
|
if (!t)
|
|
48
55
|
return /* @__PURE__ */ s("button", { onClick: o, children: e });
|
|
49
|
-
if (!
|
|
56
|
+
if (!R(e))
|
|
50
57
|
throw new Error("DialogTrigger expects a single React element as child");
|
|
51
58
|
const r = e.props.onClick;
|
|
52
|
-
return
|
|
53
|
-
onClick: (...
|
|
54
|
-
r?.(...
|
|
59
|
+
return O(e, {
|
|
60
|
+
onClick: (...u) => {
|
|
61
|
+
r?.(...u), o();
|
|
55
62
|
}
|
|
56
63
|
});
|
|
57
64
|
}
|
|
58
|
-
function
|
|
59
|
-
const { setIsOpen: n } =
|
|
65
|
+
function $({ children: e, asChild: t = !0 }) {
|
|
66
|
+
const { setIsOpen: n } = m(), o = y(() => {
|
|
60
67
|
n(!1);
|
|
61
68
|
}, [n]);
|
|
62
69
|
if (!t)
|
|
@@ -69,30 +76,30 @@ function L({ children: e, asChild: t = !0 }) {
|
|
|
69
76
|
children: e
|
|
70
77
|
}
|
|
71
78
|
);
|
|
72
|
-
if (!
|
|
79
|
+
if (!R(e))
|
|
73
80
|
throw new Error("DialogClose expects a single React element as child");
|
|
74
81
|
const r = e.props.onClick;
|
|
75
|
-
return
|
|
76
|
-
onClick: (...
|
|
77
|
-
r?.(...
|
|
82
|
+
return O(e, {
|
|
83
|
+
onClick: (...u) => {
|
|
84
|
+
r?.(...u), o();
|
|
78
85
|
}
|
|
79
86
|
});
|
|
80
87
|
}
|
|
81
|
-
function
|
|
82
|
-
const [n, o] =
|
|
83
|
-
return
|
|
88
|
+
function T({ children: e, container: t }) {
|
|
89
|
+
const [n, o] = N(!1);
|
|
90
|
+
return w(() => (o(!0), () => o(!1)), []), n ? j(e, t ?? document.body) : null;
|
|
84
91
|
}
|
|
85
|
-
function
|
|
86
|
-
const { isOpen: t, setIsOpen: n } =
|
|
92
|
+
function Q({ className: e }) {
|
|
93
|
+
const { isOpen: t, setIsOpen: n } = m(), o = y(
|
|
87
94
|
(r) => {
|
|
88
95
|
r.target === r.currentTarget && n(!1);
|
|
89
96
|
},
|
|
90
97
|
[n]
|
|
91
98
|
);
|
|
92
|
-
return t ? /* @__PURE__ */ s(
|
|
99
|
+
return t ? /* @__PURE__ */ s(T, { children: /* @__PURE__ */ s(
|
|
93
100
|
"div",
|
|
94
101
|
{
|
|
95
|
-
className:
|
|
102
|
+
className: f(
|
|
96
103
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed inset-0 z-40 bg-black/50 backdrop-blur-sm",
|
|
97
104
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
98
105
|
e
|
|
@@ -103,7 +110,7 @@ function X({ className: e }) {
|
|
|
103
110
|
}
|
|
104
111
|
) }) : null;
|
|
105
112
|
}
|
|
106
|
-
const
|
|
113
|
+
const M = P(
|
|
107
114
|
[
|
|
108
115
|
"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",
|
|
109
116
|
"data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
@@ -123,58 +130,66 @@ const R = B(
|
|
|
123
130
|
}
|
|
124
131
|
}
|
|
125
132
|
);
|
|
126
|
-
function
|
|
133
|
+
function W({
|
|
127
134
|
children: e,
|
|
128
135
|
className: t,
|
|
129
136
|
size: n,
|
|
130
137
|
onPointerDownOutside: o,
|
|
131
|
-
|
|
138
|
+
onInteractOutside: r,
|
|
139
|
+
onEscapeKeyDown: u
|
|
132
140
|
}) {
|
|
133
|
-
const { isOpen:
|
|
134
|
-
return
|
|
135
|
-
if (!
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
const { isOpen: i, setIsOpen: d, contentId: g, titleId: x, descriptionId: b, modal: C } = m(), l = k(null), p = k(null), v = k(!1);
|
|
142
|
+
return w(() => {
|
|
143
|
+
if (!i) {
|
|
144
|
+
v.current && p.current && typeof p.current.focus == "function" && p.current.focus(), p.current = null, v.current = !1;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (!l.current || v.current) return;
|
|
148
|
+
v.current = !0;
|
|
149
|
+
const c = l.current;
|
|
150
|
+
p.current = document.activeElement, setTimeout(() => {
|
|
151
|
+
if (!c || !l.current) return;
|
|
152
|
+
const a = document.activeElement;
|
|
153
|
+
(!c.contains(a) || a === document.body) && c.focus();
|
|
154
|
+
}, 0);
|
|
155
|
+
}, [i]), w(() => {
|
|
156
|
+
if (!i) return;
|
|
157
|
+
const c = (a) => {
|
|
158
|
+
a.key === "Escape" && (u?.(a), r?.(a), a.defaultPrevented || (a.preventDefault(), d(!1)));
|
|
144
159
|
};
|
|
145
|
-
return document.addEventListener("keydown",
|
|
146
|
-
document.removeEventListener("keydown",
|
|
160
|
+
return document.addEventListener("keydown", c, { capture: !0 }), () => {
|
|
161
|
+
document.removeEventListener("keydown", c, { capture: !0 });
|
|
147
162
|
};
|
|
148
|
-
}, [
|
|
149
|
-
if (!
|
|
150
|
-
const
|
|
151
|
-
const
|
|
152
|
-
|
|
163
|
+
}, [i, u, r, d]), w(() => {
|
|
164
|
+
if (!i) return;
|
|
165
|
+
const c = (a) => {
|
|
166
|
+
const h = a.target;
|
|
167
|
+
l.current && !l.current.contains(h) && (h.closest('[role="dialog"]') !== null || (o?.(a), r?.(a), !C && !a.defaultPrevented && d(!1)));
|
|
153
168
|
};
|
|
154
|
-
return document.addEventListener("pointerdown",
|
|
155
|
-
}, [
|
|
169
|
+
return document.addEventListener("pointerdown", c), () => document.removeEventListener("pointerdown", c);
|
|
170
|
+
}, [i, o, r, d, C]), i ? /* @__PURE__ */ s(T, { children: /* @__PURE__ */ E(
|
|
156
171
|
"div",
|
|
157
172
|
{
|
|
158
|
-
ref:
|
|
159
|
-
id:
|
|
173
|
+
ref: l,
|
|
174
|
+
id: g,
|
|
160
175
|
role: "dialog",
|
|
161
176
|
"aria-modal": "true",
|
|
162
|
-
"aria-labelledby":
|
|
163
|
-
"aria-describedby":
|
|
164
|
-
"data-state":
|
|
177
|
+
"aria-labelledby": x,
|
|
178
|
+
"aria-describedby": b,
|
|
179
|
+
"data-state": i ? "open" : "closed",
|
|
165
180
|
tabIndex: -1,
|
|
166
|
-
className:
|
|
181
|
+
className: f(M({ size: n }), t),
|
|
167
182
|
children: [
|
|
168
|
-
/* @__PURE__ */ s(
|
|
183
|
+
/* @__PURE__ */ s($, { asChild: !0, children: /* @__PURE__ */ E(
|
|
169
184
|
"button",
|
|
170
185
|
{
|
|
171
|
-
className:
|
|
186
|
+
className: f(
|
|
172
187
|
"ring-offset-background absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100",
|
|
173
188
|
"focus:ring-ring focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none"
|
|
174
189
|
),
|
|
175
190
|
"aria-label": "Close dialog",
|
|
176
191
|
children: [
|
|
177
|
-
/* @__PURE__ */ s(
|
|
192
|
+
/* @__PURE__ */ s(A, { className: "h-4 w-4" }),
|
|
178
193
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "Close" })
|
|
179
194
|
]
|
|
180
195
|
}
|
|
@@ -184,30 +199,30 @@ function q({
|
|
|
184
199
|
}
|
|
185
200
|
) }) : null;
|
|
186
201
|
}
|
|
187
|
-
function
|
|
188
|
-
const { titleId: n } =
|
|
189
|
-
return /* @__PURE__ */ s("h2", { id: n, className:
|
|
202
|
+
function Y({ children: e, className: t }) {
|
|
203
|
+
const { titleId: n } = m();
|
|
204
|
+
return /* @__PURE__ */ s("h2", { id: n, className: f("text-base leading-none font-semibold tracking-tight", t), children: e });
|
|
190
205
|
}
|
|
191
|
-
function
|
|
192
|
-
const { descriptionId: n } =
|
|
193
|
-
return /* @__PURE__ */ s("p", { id: n, className:
|
|
206
|
+
function Z({ children: e, className: t }) {
|
|
207
|
+
const { descriptionId: n } = m();
|
|
208
|
+
return /* @__PURE__ */ s("p", { id: n, className: f("text-text-secondary text-sm", t), children: e });
|
|
194
209
|
}
|
|
195
|
-
function
|
|
196
|
-
return /* @__PURE__ */ s("div", { className:
|
|
210
|
+
function _({ children: e, className: t }) {
|
|
211
|
+
return /* @__PURE__ */ s("div", { className: f("flex flex-col space-y-1.5 text-center text-left", t), children: e });
|
|
197
212
|
}
|
|
198
|
-
function
|
|
199
|
-
return /* @__PURE__ */ s("div", { className:
|
|
213
|
+
function ee({ children: e, className: t }) {
|
|
214
|
+
return /* @__PURE__ */ s("div", { className: f("flex flex-col-reverse flex-row justify-end space-x-2", t), children: e });
|
|
200
215
|
}
|
|
201
216
|
export {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
217
|
+
J as DialogBase,
|
|
218
|
+
$ as DialogCloseBase,
|
|
219
|
+
W as DialogContentBase,
|
|
220
|
+
Z as DialogDescriptionBase,
|
|
221
|
+
ee as DialogFooterBase,
|
|
222
|
+
_ as DialogHeaderBase,
|
|
223
|
+
Q as DialogOverlayBase,
|
|
224
|
+
T as DialogPortalBase,
|
|
225
|
+
Y as DialogTitleBase,
|
|
226
|
+
K as DialogTriggerBase,
|
|
227
|
+
m as useDialogContext
|
|
213
228
|
};
|
package/dist/Dialog.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare function DialogTrigger({ ...props }: ComponentProps<typeof DialogTrigger
|
|
|
5
5
|
declare function DialogPortal({ ...props }: ComponentProps<typeof DialogPortalBase>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function DialogClose({ ...props }: ComponentProps<typeof DialogCloseBase>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare function DialogOverlay({ className, ...props }: ComponentProps<typeof DialogOverlayBase>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare function DialogContent({ className, children, ...props }: ComponentProps<typeof DialogContentBase> & {
|
|
8
|
+
declare function DialogContent({ className, children, onInteractOutside, onPointerDownOutside, onEscapeKeyDown, ...props }: ComponentProps<typeof DialogContentBase> & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare function DialogHeader({ className, ...props }: ComponentProps<typeof DialogHeaderBase>): import("react/jsx-runtime").JSX.Element;
|
package/dist/Dialog.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
|
-
import { jsx as e, Fragment as
|
|
3
|
-
import { DialogBase as
|
|
4
|
-
import {
|
|
2
|
+
import { jsx as e, Fragment as s } from "react/jsx-runtime";
|
|
3
|
+
import { DialogBase as d, DialogCloseBase as g, DialogContentBase as c, DialogDescriptionBase as u, DialogFooterBase as f, DialogHeaderBase as m, DialogOverlayBase as D, DialogPortalBase as p, DialogTitleBase as x, DialogTriggerBase as B } from "./Dialog/DialogBase.js";
|
|
4
|
+
import { cn as o } from "./utils/twUtils.js";
|
|
5
5
|
import "react";
|
|
6
|
-
function
|
|
7
|
-
return /* @__PURE__ */ e(
|
|
6
|
+
function C({ ...a }) {
|
|
7
|
+
return /* @__PURE__ */ e(d, { "data-slot": "dialog", ...a });
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */ e(
|
|
9
|
+
function h({ ...a }) {
|
|
10
|
+
return /* @__PURE__ */ e(B, { asChild: !0, "data-slot": "dialog-trigger", ...a });
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */ e(
|
|
12
|
+
function v({ ...a }) {
|
|
13
|
+
return /* @__PURE__ */ e(p, { "data-slot": "dialog-portal", ...a });
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */ e(
|
|
15
|
+
function z({ ...a }) {
|
|
16
|
+
return /* @__PURE__ */ e(g, { "data-slot": "dialog-close", ...a });
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function T({ className: a, ...t }) {
|
|
19
19
|
return /* @__PURE__ */ e(
|
|
20
|
-
|
|
20
|
+
D,
|
|
21
21
|
{
|
|
22
22
|
"data-slot": "dialog-overlay",
|
|
23
23
|
className: o(
|
|
@@ -28,27 +28,33 @@ function h({ className: a, ...t }) {
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function F({
|
|
32
32
|
className: a,
|
|
33
33
|
children: t,
|
|
34
|
-
|
|
34
|
+
onInteractOutside: l,
|
|
35
|
+
onPointerDownOutside: i,
|
|
36
|
+
onEscapeKeyDown: n,
|
|
37
|
+
...r
|
|
35
38
|
}) {
|
|
36
|
-
return /* @__PURE__ */ e(
|
|
37
|
-
|
|
39
|
+
return /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
|
|
40
|
+
c,
|
|
38
41
|
{
|
|
39
42
|
"data-slot": "dialog-content",
|
|
40
43
|
className: o(
|
|
41
44
|
"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)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg p-6 shadow-lg duration-200",
|
|
42
45
|
a
|
|
43
46
|
),
|
|
44
|
-
|
|
47
|
+
onInteractOutside: l,
|
|
48
|
+
onPointerDownOutside: i,
|
|
49
|
+
onEscapeKeyDown: n,
|
|
50
|
+
...r,
|
|
45
51
|
children: t
|
|
46
52
|
}
|
|
47
53
|
) });
|
|
48
54
|
}
|
|
49
|
-
function
|
|
55
|
+
function j({ className: a, ...t }) {
|
|
50
56
|
return /* @__PURE__ */ e(
|
|
51
|
-
|
|
57
|
+
m,
|
|
52
58
|
{
|
|
53
59
|
"data-slot": "dialog-header",
|
|
54
60
|
className: o("flex flex-col gap-2 text-center sm:text-left", a),
|
|
@@ -56,9 +62,9 @@ function z({ className: a, ...t }) {
|
|
|
56
62
|
}
|
|
57
63
|
);
|
|
58
64
|
}
|
|
59
|
-
function
|
|
65
|
+
function H({ className: a, ...t }) {
|
|
60
66
|
return /* @__PURE__ */ e(
|
|
61
|
-
|
|
67
|
+
f,
|
|
62
68
|
{
|
|
63
69
|
"data-slot": "dialog-footer",
|
|
64
70
|
className: o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", a),
|
|
@@ -66,9 +72,9 @@ function T({ className: a, ...t }) {
|
|
|
66
72
|
}
|
|
67
73
|
);
|
|
68
74
|
}
|
|
69
|
-
function
|
|
75
|
+
function O({ className: a, ...t }) {
|
|
70
76
|
return /* @__PURE__ */ e(
|
|
71
|
-
|
|
77
|
+
x,
|
|
72
78
|
{
|
|
73
79
|
"data-slot": "dialog-title",
|
|
74
80
|
className: o("text-lg leading-none font-semibold", a),
|
|
@@ -76,9 +82,9 @@ function F({ className: a, ...t }) {
|
|
|
76
82
|
}
|
|
77
83
|
);
|
|
78
84
|
}
|
|
79
|
-
function
|
|
85
|
+
function P({ className: a, ...t }) {
|
|
80
86
|
return /* @__PURE__ */ e(
|
|
81
|
-
|
|
87
|
+
u,
|
|
82
88
|
{
|
|
83
89
|
"data-slot": "dialog-description",
|
|
84
90
|
className: o("text-muted-foreground text-sm", a),
|
|
@@ -87,14 +93,14 @@ function j({ className: a, ...t }) {
|
|
|
87
93
|
);
|
|
88
94
|
}
|
|
89
95
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
C as Dialog,
|
|
97
|
+
z as DialogClose,
|
|
98
|
+
F as DialogContent,
|
|
99
|
+
P as DialogDescription,
|
|
100
|
+
H as DialogFooter,
|
|
101
|
+
j as DialogHeader,
|
|
102
|
+
T as DialogOverlay,
|
|
103
|
+
v as DialogPortal,
|
|
104
|
+
O as DialogTitle,
|
|
105
|
+
h as DialogTrigger
|
|
100
106
|
};
|