@spear-ai/spectral 1.3.32 → 1.3.34
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 +70 -66
- package/dist/Badge/BadgeBase.js +13 -13
- package/dist/Button.js +11 -11
- package/dist/Dialog/DialogBase.js +205 -0
- package/dist/Dialog.js +99 -0
- package/dist/Icons/DashboardIcon.js +4 -4
- package/dist/Icons/HarmonicCursorsIcon.js +37 -0
- package/dist/Icons/WarningIcon.js +27 -0
- package/dist/Icons.js +46 -42
- package/dist/Toggle.js +5 -5
- package/dist/assets/main.css +1 -1
- package/dist/components/Dialog/Dialog.d.ts +16 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/DialogBase.d.ts +71 -0
- package/dist/components/Dialog/DialogBase.d.ts.map +1 -0
- package/dist/components/Icons/HarmonicCursorsIcon.d.ts +3 -0
- package/dist/components/Icons/HarmonicCursorsIcon.d.ts.map +1 -0
- package/dist/components/Icons/WarningIcon.d.ts +3 -0
- package/dist/components/Icons/WarningIcon.d.ts.map +1 -0
- package/dist/components/Icons/index.d.ts +2 -0
- package/dist/components/Icons/index.d.ts.map +1 -1
- package/dist/features/ClearDialog/ClearDialog.d.ts +2 -0
- package/dist/features/ClearDialog/ClearDialog.d.ts.map +1 -0
- package/dist/features/ClearDialog.js +30 -0
- package/dist/features/LabelingTools/LabelingTools.d.ts.map +1 -1
- package/dist/features/LabelingTools.js +105 -68
- package/dist/features/SensorMetadata.js +4 -2
- package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +1 -1
- package/dist/features/SettingsPopover.js +60 -54
- package/package.json +1 -1
package/dist/.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Badge as e } from "./Badge.js";
|
|
2
2
|
import { Button as p } from "./Button.js";
|
|
3
|
-
import { Drawer as
|
|
3
|
+
import { Drawer as m } from "./Drawer.js";
|
|
4
4
|
import { Popover as x, PopoverContent as c, PopoverTrigger as I } from "./Popover.js";
|
|
5
|
-
import { RadioGroup as
|
|
5
|
+
import { RadioGroup as s, RadioGroupItem as i } from "./RadioGroup.js";
|
|
6
6
|
import { Skeleton as g } from "./Skeleton.js";
|
|
7
|
-
import { Slider as
|
|
8
|
-
import { Switch as
|
|
7
|
+
import { Slider as T } from "./Slider.js";
|
|
8
|
+
import { Switch as C } from "./Switch.js";
|
|
9
9
|
import { Toggle as G } from "./Toggle.js";
|
|
10
10
|
import { ToggleGroup as S, ToggleGroupItem as v } from "./ToggleGroup.js";
|
|
11
11
|
import { Tooltip as D, TooltipContent as k, TooltipTrigger as w } from "./Tooltip.js";
|
|
@@ -14,35 +14,37 @@ import { CalendarIcon as b } from "./Icons/CalendarIcon.js";
|
|
|
14
14
|
import { ClockIcon as A } from "./Icons/ClockIcon.js";
|
|
15
15
|
import { DashboardIcon as U } from "./Icons/DashboardIcon.js";
|
|
16
16
|
import { DeleteIcon as F } from "./Icons/DeleteIcon.js";
|
|
17
|
-
import { DurationIcon as
|
|
18
|
-
import { EraserIcon as
|
|
19
|
-
import { GoToFirstIcon as
|
|
20
|
-
import { GoToLastIcon as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
17
|
+
import { DurationIcon as M } from "./Icons/DurationIcon.js";
|
|
18
|
+
import { EraserIcon as W } from "./Icons/EraserIcon.js";
|
|
19
|
+
import { GoToFirstIcon as Y } from "./Icons/GoToFirstIcon.js";
|
|
20
|
+
import { GoToLastIcon as q } from "./Icons/GoToLastIcon.js";
|
|
21
|
+
import { HarmonicCursorsIcon as J } from "./Icons/HarmonicCursorsIcon.js";
|
|
22
|
+
import { InfoIcon as N } from "./Icons/InfoIcon.js";
|
|
23
|
+
import { LabelIcon as _ } from "./Icons/LabelIcon.js";
|
|
24
|
+
import { LassoIcon as oo } from "./Icons/LassoIcon.js";
|
|
25
|
+
import { LineToolIcon as eo } from "./Icons/LineToolIcon.js";
|
|
26
|
+
import { LiveViewIcon as po } from "./Icons/LiveViewIcon.js";
|
|
27
|
+
import { LocationIcon as mo } from "./Icons/LocationIcon.js";
|
|
28
|
+
import { LogoutIcon as xo } from "./Icons/LogoutIcon.js";
|
|
29
|
+
import { MetadataIcon as Io } from "./Icons/MetadataIcon.js";
|
|
30
|
+
import { OntologyIcon as so } from "./Icons/OntologyIcon.js";
|
|
30
31
|
import { PanelIcon as lo } from "./Icons/PanelIcon.js";
|
|
31
|
-
import { PlayIcon as
|
|
32
|
-
import { PlusIcon as
|
|
33
|
-
import { ResetIcon as
|
|
34
|
-
import { ScissorsIcon as
|
|
35
|
-
import { SettingsIcon as
|
|
36
|
-
import { TrashIcon as
|
|
37
|
-
import { UndoIcon as
|
|
38
|
-
import { UserIcon as
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
32
|
+
import { PlayIcon as uo } from "./Icons/PlayIcon.js";
|
|
33
|
+
import { PlusIcon as Co } from "./Icons/PlusIcon.js";
|
|
34
|
+
import { ResetIcon as Go } from "./Icons/ResetIcon.js";
|
|
35
|
+
import { ScissorsIcon as So } from "./Icons/ScissorsIcon.js";
|
|
36
|
+
import { SettingsIcon as ho } from "./Icons/SettingsIcon.js";
|
|
37
|
+
import { TrashIcon as ko } from "./Icons/TrashIcon.js";
|
|
38
|
+
import { UndoIcon as Bo } from "./Icons/UndoIcon.js";
|
|
39
|
+
import { UserIcon as Zo } from "./Icons/UserIcon.js";
|
|
40
|
+
import { WarningIcon as yo } from "./Icons/WarningIcon.js";
|
|
41
|
+
import { ZoomAllIcon as Oo } from "./Icons/ZoomAllIcon.js";
|
|
42
|
+
import { ZoomXIcon as Eo } from "./Icons/ZoomXIcon.js";
|
|
43
|
+
import { ZoomYIcon as Ho } from "./Icons/ZoomYIcon.js";
|
|
44
|
+
import { default as Vo, SvgIdContext as Wo } from "./Icons/IconBase.js";
|
|
45
|
+
import { useOutsideClick as Yo } from "./hooks/useOutsideClick.js";
|
|
46
|
+
import { useTheme as qo } from "./hooks/useTheme.js";
|
|
47
|
+
import { c as Jo } from "./twUtils-CRiPKpXj.js";
|
|
46
48
|
export {
|
|
47
49
|
R as AnnotationsIcon,
|
|
48
50
|
e as Badge,
|
|
@@ -51,49 +53,51 @@ export {
|
|
|
51
53
|
A as ClockIcon,
|
|
52
54
|
U as DashboardIcon,
|
|
53
55
|
F as DeleteIcon,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
_ as
|
|
63
|
-
oo as
|
|
64
|
-
eo as
|
|
65
|
-
po as
|
|
66
|
-
|
|
67
|
-
xo as
|
|
68
|
-
Io as
|
|
56
|
+
m as Drawer,
|
|
57
|
+
M as DurationIcon,
|
|
58
|
+
W as EraserIcon,
|
|
59
|
+
Y as GoToFirstIcon,
|
|
60
|
+
q as GoToLastIcon,
|
|
61
|
+
J as HarmonicCursorsIcon,
|
|
62
|
+
Vo as IconBase,
|
|
63
|
+
N as InfoIcon,
|
|
64
|
+
_ as LabelIcon,
|
|
65
|
+
oo as LassoIcon,
|
|
66
|
+
eo as LineToolIcon,
|
|
67
|
+
po as LiveViewIcon,
|
|
68
|
+
mo as LocationIcon,
|
|
69
|
+
xo as LogoutIcon,
|
|
70
|
+
Io as MetadataIcon,
|
|
71
|
+
so as OntologyIcon,
|
|
69
72
|
lo as PanelIcon,
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
uo as PlayIcon,
|
|
74
|
+
Co as PlusIcon,
|
|
72
75
|
x as Popover,
|
|
73
76
|
c as PopoverContent,
|
|
74
77
|
I as PopoverTrigger,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
s as RadioGroup,
|
|
79
|
+
i as RadioGroupItem,
|
|
80
|
+
Go as ResetIcon,
|
|
81
|
+
So as ScissorsIcon,
|
|
82
|
+
ho as SettingsIcon,
|
|
80
83
|
g as Skeleton,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
T as Slider,
|
|
85
|
+
Wo as SvgIdContext,
|
|
86
|
+
C as Switch,
|
|
84
87
|
G as Toggle,
|
|
85
88
|
S as ToggleGroup,
|
|
86
89
|
v as ToggleGroupItem,
|
|
87
90
|
D as Tooltip,
|
|
88
91
|
k as TooltipContent,
|
|
89
92
|
w as TooltipTrigger,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
Yo as
|
|
93
|
+
ko as TrashIcon,
|
|
94
|
+
Bo as UndoIcon,
|
|
95
|
+
Zo as UserIcon,
|
|
96
|
+
yo as WarningIcon,
|
|
97
|
+
Oo as ZoomAllIcon,
|
|
98
|
+
Eo as ZoomXIcon,
|
|
99
|
+
Ho as ZoomYIcon,
|
|
100
|
+
Jo as cn,
|
|
101
|
+
Yo as useOutsideClick,
|
|
102
|
+
qo as useTheme
|
|
99
103
|
};
|
package/dist/Badge/BadgeBase.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Slot as
|
|
3
|
-
import { c as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as t } from "../primitives/slot.js";
|
|
3
|
+
import { c as o } from "../twUtils-CRiPKpXj.js";
|
|
4
4
|
import { c as s } from "../index-CRBC94ik.js";
|
|
5
5
|
const d = s(
|
|
6
|
-
`inline-flex items-center justify-center rounded-sm
|
|
7
|
-
focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-
|
|
6
|
+
`inline-flex items-center justify-center rounded-sm px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none
|
|
7
|
+
focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-danger-100/20 dark:aria-invalid:ring-danger-100/40 aria-invalid:border-danger-200
|
|
8
8
|
transition-[color,box-shadow] overflow-hidden`,
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default: "
|
|
13
|
-
secondary: "
|
|
14
|
-
destructive: "
|
|
12
|
+
default: "bg-badge-primary-bg text-text-primary [a&]:hover:bg-badge-primary-bg--hover group-data-[state=on]:bg-badge-primary-bg--active",
|
|
13
|
+
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
14
|
+
destructive: "bg-danger-100 text-white [a&]:hover:bg-danger-100/90 focus-visible:ring-danger-100/20 dark:focus-visible:ring-danger-100/40 dark:bg-danger-100/60",
|
|
15
15
|
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
@@ -20,15 +20,15 @@ const d = s(
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
|
-
function
|
|
23
|
+
function l({
|
|
24
24
|
className: r,
|
|
25
25
|
variant: e,
|
|
26
|
-
asChild:
|
|
27
|
-
...
|
|
26
|
+
asChild: a = !1,
|
|
27
|
+
...i
|
|
28
28
|
}) {
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ n(a ? t : "span", { "data-slot": "badge", className: o(d({ variant: e }), r), ...i });
|
|
30
30
|
}
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
l as BadgeBase,
|
|
33
33
|
d as badgeVariants
|
|
34
34
|
};
|
package/dist/Button.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as l, jsx as
|
|
2
|
+
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
3
3
|
import { c as u } from "./twUtils-CRiPKpXj.js";
|
|
4
4
|
import { c as v } from "./index-CRBC94ik.js";
|
|
5
5
|
import { forwardRef as h } from "react";
|
|
@@ -46,7 +46,7 @@ const w = v(
|
|
|
46
46
|
disabled: s,
|
|
47
47
|
type: p = "button",
|
|
48
48
|
dataTestId: c = `button-${r}`,
|
|
49
|
-
size:
|
|
49
|
+
size: e,
|
|
50
50
|
children: x,
|
|
51
51
|
...m
|
|
52
52
|
}, y) => {
|
|
@@ -64,13 +64,13 @@ const w = v(
|
|
|
64
64
|
ghost: "bg-transparent text-button-ghost-text--disabled pointer-events-none"
|
|
65
65
|
}
|
|
66
66
|
}, f = u(
|
|
67
|
-
w({ variant: r, state: t, size:
|
|
67
|
+
w({ variant: r, state: t, size: e }),
|
|
68
68
|
t === "error" && b.error[r || "primary"],
|
|
69
69
|
t === "loading" && b.loading[r || "primary"],
|
|
70
|
-
|
|
70
|
+
e,
|
|
71
71
|
g
|
|
72
72
|
);
|
|
73
|
-
return /* @__PURE__ */ l("div", { className: u("flex flex-col justify-items-center",
|
|
73
|
+
return /* @__PURE__ */ l("div", { className: u("flex flex-col justify-items-center", e), children: [
|
|
74
74
|
/* @__PURE__ */ l(
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
@@ -83,15 +83,15 @@ const w = v(
|
|
|
83
83
|
...m,
|
|
84
84
|
"data-state": t,
|
|
85
85
|
children: [
|
|
86
|
-
d && /* @__PURE__ */
|
|
87
|
-
|
|
88
|
-
t === "loading" && /* @__PURE__ */
|
|
89
|
-
i && t !== "loading" && /* @__PURE__ */
|
|
90
|
-
x
|
|
86
|
+
d && /* @__PURE__ */ n("span", { className: "flex pr-2", "aria-hidden": !0, children: d }),
|
|
87
|
+
e === "icon" ? /* @__PURE__ */ n("span", { className: "sr-only", children: o }) : o,
|
|
88
|
+
t === "loading" && /* @__PURE__ */ n(N, { className: "ml-2 animate-spin", size: 16 }),
|
|
89
|
+
i && t !== "loading" && /* @__PURE__ */ n("span", { className: "flex pl-2", "aria-hidden": !0, children: i }),
|
|
90
|
+
e === "icon" && x
|
|
91
91
|
]
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
|
-
t === "error" && a && /* @__PURE__ */
|
|
94
|
+
t === "error" && a && /* @__PURE__ */ n("p", { className: "text-danger-100 mt-2 text-xs", role: "alert", "aria-live": "assertive", children: a })
|
|
95
95
|
] });
|
|
96
96
|
}
|
|
97
97
|
);
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a, jsxs as v } from "react/jsx-runtime";
|
|
3
|
+
import { c as u } from "../twUtils-CRiPKpXj.js";
|
|
4
|
+
import { c as N } from "../index-CRBC94ik.js";
|
|
5
|
+
import { createContext as z, useContext as L, useState as C, useMemo as w, useCallback as b, cloneElement as k, useEffect as x, useRef as O, isValidElement as y } from "react";
|
|
6
|
+
import { createPortal as P } from "react-dom";
|
|
7
|
+
import { c as T } from "../createLucideIcon-CI1yJrZf.js";
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v0.542.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
const V = [
|
|
15
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
16
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
17
|
+
], R = T("x", V), D = z(null);
|
|
18
|
+
function f() {
|
|
19
|
+
const e = L(D);
|
|
20
|
+
if (!e)
|
|
21
|
+
throw new Error("Dialog components must be used within <Dialog>");
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
function E(e) {
|
|
25
|
+
return y(e) && typeof e.type != "string" ? !0 : y(e);
|
|
26
|
+
}
|
|
27
|
+
let h = 0;
|
|
28
|
+
function U({ open: e, defaultOpen: t = !1, onOpenChange: n, children: o }) {
|
|
29
|
+
const [c, s] = C(t), l = e !== void 0, m = l ? e : c, p = w(
|
|
30
|
+
() => ({
|
|
31
|
+
contentId: `dialog-content-${++h}`,
|
|
32
|
+
titleId: `dialog-title-${h}`,
|
|
33
|
+
descriptionId: `dialog-description-${h}`
|
|
34
|
+
}),
|
|
35
|
+
[]
|
|
36
|
+
), g = b(
|
|
37
|
+
(i) => {
|
|
38
|
+
l || s(i), n?.(i);
|
|
39
|
+
},
|
|
40
|
+
[l, n]
|
|
41
|
+
), d = w(
|
|
42
|
+
() => ({
|
|
43
|
+
open: m,
|
|
44
|
+
setOpen: g,
|
|
45
|
+
...p
|
|
46
|
+
}),
|
|
47
|
+
[m, g, p]
|
|
48
|
+
);
|
|
49
|
+
return /* @__PURE__ */ a(D.Provider, { value: d, children: o });
|
|
50
|
+
}
|
|
51
|
+
function X({ children: e, asChild: t = !0 }) {
|
|
52
|
+
const { setOpen: n } = f(), o = b(() => {
|
|
53
|
+
n(!0);
|
|
54
|
+
}, [n]);
|
|
55
|
+
if (!t)
|
|
56
|
+
return /* @__PURE__ */ a("button", { onClick: o, children: e });
|
|
57
|
+
if (!E(e))
|
|
58
|
+
throw new Error("DialogTrigger expects a single React element as child");
|
|
59
|
+
return k(e, {
|
|
60
|
+
onClick: o
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function j({ children: e, asChild: t = !0 }) {
|
|
64
|
+
const { setOpen: n } = f(), o = b(() => {
|
|
65
|
+
n(!1);
|
|
66
|
+
}, [n]);
|
|
67
|
+
if (!t)
|
|
68
|
+
return /* @__PURE__ */ a("button", { onClick: o, children: e });
|
|
69
|
+
if (!E(e))
|
|
70
|
+
throw new Error("DialogClose expects a single React element as child");
|
|
71
|
+
return k(e, {
|
|
72
|
+
onClick: o
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function B({ children: e, container: t }) {
|
|
76
|
+
const [n, o] = C(!1);
|
|
77
|
+
return x(() => (o(!0), () => o(!1)), []), n ? P(e, t ?? document.body) : null;
|
|
78
|
+
}
|
|
79
|
+
function q({ className: e }) {
|
|
80
|
+
const { open: t, setOpen: n } = f(), o = b(
|
|
81
|
+
(c) => {
|
|
82
|
+
c.target === c.currentTarget && n(!1);
|
|
83
|
+
},
|
|
84
|
+
[n]
|
|
85
|
+
);
|
|
86
|
+
return t ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: u(
|
|
90
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed inset-0 z-40 bg-black/50 backdrop-blur-sm",
|
|
91
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
92
|
+
e
|
|
93
|
+
),
|
|
94
|
+
"data-state": t ? "open" : "closed",
|
|
95
|
+
onClick: o,
|
|
96
|
+
"aria-hidden": "true"
|
|
97
|
+
}
|
|
98
|
+
) }) : null;
|
|
99
|
+
}
|
|
100
|
+
const M = N(
|
|
101
|
+
[
|
|
102
|
+
"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",
|
|
103
|
+
"data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
104
|
+
],
|
|
105
|
+
{
|
|
106
|
+
variants: {
|
|
107
|
+
size: {
|
|
108
|
+
sm: "max-w-sm",
|
|
109
|
+
md: "max-w-md",
|
|
110
|
+
lg: "max-w-lg",
|
|
111
|
+
xl: "max-w-xl",
|
|
112
|
+
"2xl": "max-w-2xl"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
defaultVariants: {
|
|
116
|
+
size: "md"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
function G({
|
|
121
|
+
children: e,
|
|
122
|
+
className: t,
|
|
123
|
+
size: n,
|
|
124
|
+
onPointerDownOutside: o,
|
|
125
|
+
onEscapeKeyDown: c
|
|
126
|
+
}) {
|
|
127
|
+
const { open: s, setOpen: l, contentId: m, titleId: p, descriptionId: g } = f(), d = O(null);
|
|
128
|
+
return x(() => {
|
|
129
|
+
if (!s || !d.current) return;
|
|
130
|
+
const i = d.current, r = document.activeElement;
|
|
131
|
+
return i.focus(), () => {
|
|
132
|
+
r && typeof r.focus == "function" && r.focus();
|
|
133
|
+
};
|
|
134
|
+
}, [s]), x(() => {
|
|
135
|
+
if (!s) return;
|
|
136
|
+
const i = (r) => {
|
|
137
|
+
r.key === "Escape" && (r.preventDefault(), c?.(r), r.defaultPrevented || l(!1));
|
|
138
|
+
};
|
|
139
|
+
return document.addEventListener("keydown", i, { capture: !0 }), () => document.removeEventListener("keydown", i, { capture: !0 });
|
|
140
|
+
}, [s, c, l]), x(() => {
|
|
141
|
+
if (!s) return;
|
|
142
|
+
const i = (r) => {
|
|
143
|
+
const I = r.target;
|
|
144
|
+
d.current && !d.current.contains(I) && (o?.(r), r.defaultPrevented || l(!1));
|
|
145
|
+
};
|
|
146
|
+
return document.addEventListener("pointerdown", i, { capture: !0 }), () => document.removeEventListener("pointerdown", i, { capture: !0 });
|
|
147
|
+
}, [s, o, l]), s ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ v(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
ref: d,
|
|
151
|
+
id: m,
|
|
152
|
+
role: "dialog",
|
|
153
|
+
"aria-modal": "true",
|
|
154
|
+
"aria-labelledby": p,
|
|
155
|
+
"aria-describedby": g,
|
|
156
|
+
"data-state": s ? "open" : "closed",
|
|
157
|
+
tabIndex: -1,
|
|
158
|
+
className: u(M({ size: n }), t),
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ a(j, { asChild: !0, children: /* @__PURE__ */ v(
|
|
161
|
+
"button",
|
|
162
|
+
{
|
|
163
|
+
className: u(
|
|
164
|
+
"ring-offset-background absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100",
|
|
165
|
+
"focus:ring-ring focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none"
|
|
166
|
+
),
|
|
167
|
+
"aria-label": "Close dialog",
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ a(R, { className: "h-4 w-4" }),
|
|
170
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "Close" })
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
) }),
|
|
174
|
+
e
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
) }) : null;
|
|
178
|
+
}
|
|
179
|
+
function J({ children: e, className: t }) {
|
|
180
|
+
const { titleId: n } = f();
|
|
181
|
+
return /* @__PURE__ */ a("h2", { id: n, className: u("text-lg leading-none font-semibold tracking-tight", t), children: e });
|
|
182
|
+
}
|
|
183
|
+
function K({ children: e, className: t }) {
|
|
184
|
+
const { descriptionId: n } = f();
|
|
185
|
+
return /* @__PURE__ */ a("p", { id: n, className: u("text-text-secondary text-sm", t), children: e });
|
|
186
|
+
}
|
|
187
|
+
function Q({ children: e, className: t }) {
|
|
188
|
+
return /* @__PURE__ */ a("div", { className: u("flex flex-col space-y-1.5 text-center text-left", t), children: e });
|
|
189
|
+
}
|
|
190
|
+
function W({ children: e, className: t }) {
|
|
191
|
+
return /* @__PURE__ */ a("div", { className: u("flex flex-col-reverse flex-row justify-end space-x-2", t), children: e });
|
|
192
|
+
}
|
|
193
|
+
export {
|
|
194
|
+
U as DialogBase,
|
|
195
|
+
j as DialogCloseBase,
|
|
196
|
+
G as DialogContentBase,
|
|
197
|
+
K as DialogDescriptionBase,
|
|
198
|
+
W as DialogFooterBase,
|
|
199
|
+
Q as DialogHeaderBase,
|
|
200
|
+
q as DialogOverlayBase,
|
|
201
|
+
B as DialogPortalBase,
|
|
202
|
+
J as DialogTitleBase,
|
|
203
|
+
X as DialogTriggerBase,
|
|
204
|
+
f as useDialogContext
|
|
205
|
+
};
|
package/dist/Dialog.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as e, Fragment as i } from "react/jsx-runtime";
|
|
2
|
+
import { DialogBase as n, DialogCloseBase as s, DialogContentBase as r, DialogDescriptionBase as d, DialogFooterBase as g, DialogHeaderBase as c, DialogOverlayBase as f, DialogPortalBase as u, DialogTitleBase as m, DialogTriggerBase as D } from "./Dialog/DialogBase.js";
|
|
3
|
+
import { c as o } from "./twUtils-CRiPKpXj.js";
|
|
4
|
+
import "react";
|
|
5
|
+
function N({ ...a }) {
|
|
6
|
+
return /* @__PURE__ */ e(n, { "data-slot": "dialog", ...a });
|
|
7
|
+
}
|
|
8
|
+
function b({ ...a }) {
|
|
9
|
+
return /* @__PURE__ */ e(D, { "data-slot": "dialog-trigger", ...a });
|
|
10
|
+
}
|
|
11
|
+
function w({ ...a }) {
|
|
12
|
+
return /* @__PURE__ */ e(u, { "data-slot": "dialog-portal", ...a });
|
|
13
|
+
}
|
|
14
|
+
function v({ ...a }) {
|
|
15
|
+
return /* @__PURE__ */ e(s, { "data-slot": "dialog-close", ...a });
|
|
16
|
+
}
|
|
17
|
+
function z({ className: a, ...t }) {
|
|
18
|
+
return /* @__PURE__ */ e(
|
|
19
|
+
f,
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "dialog-overlay",
|
|
22
|
+
className: o(
|
|
23
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-bg-primary/50 fixed inset-0 z-50",
|
|
24
|
+
a
|
|
25
|
+
),
|
|
26
|
+
...t
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function C({
|
|
31
|
+
className: a,
|
|
32
|
+
children: t,
|
|
33
|
+
...l
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(
|
|
36
|
+
r,
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "dialog-content",
|
|
39
|
+
className: o(
|
|
40
|
+
"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",
|
|
41
|
+
a
|
|
42
|
+
),
|
|
43
|
+
...l,
|
|
44
|
+
children: t
|
|
45
|
+
}
|
|
46
|
+
) });
|
|
47
|
+
}
|
|
48
|
+
function T({ className: a, ...t }) {
|
|
49
|
+
return /* @__PURE__ */ e(
|
|
50
|
+
c,
|
|
51
|
+
{
|
|
52
|
+
"data-slot": "dialog-header",
|
|
53
|
+
className: o("flex flex-col gap-2 text-center sm:text-left", a),
|
|
54
|
+
...t
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function h({ className: a, ...t }) {
|
|
59
|
+
return /* @__PURE__ */ e(
|
|
60
|
+
g,
|
|
61
|
+
{
|
|
62
|
+
"data-slot": "dialog-footer",
|
|
63
|
+
className: o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", a),
|
|
64
|
+
...t
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function F({ className: a, ...t }) {
|
|
69
|
+
return /* @__PURE__ */ e(
|
|
70
|
+
m,
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "dialog-title",
|
|
73
|
+
className: o("text-lg leading-none font-semibold", a),
|
|
74
|
+
...t
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function j({ className: a, ...t }) {
|
|
79
|
+
return /* @__PURE__ */ e(
|
|
80
|
+
d,
|
|
81
|
+
{
|
|
82
|
+
"data-slot": "dialog-description",
|
|
83
|
+
className: o("text-muted-foreground text-sm", a),
|
|
84
|
+
...t
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
N as Dialog,
|
|
90
|
+
v as DialogClose,
|
|
91
|
+
C as DialogContent,
|
|
92
|
+
j as DialogDescription,
|
|
93
|
+
h as DialogFooter,
|
|
94
|
+
T as DialogHeader,
|
|
95
|
+
z as DialogOverlay,
|
|
96
|
+
w as DialogPortal,
|
|
97
|
+
F as DialogTitle,
|
|
98
|
+
b as DialogTrigger
|
|
99
|
+
};
|
|
@@ -15,7 +15,7 @@ const C = ({ className: r, ariaHidden: t, title: e = "Dashboard", description: n
|
|
|
15
15
|
/* @__PURE__ */ o(
|
|
16
16
|
"path",
|
|
17
17
|
{
|
|
18
|
-
d: "
|
|
18
|
+
d: "M3.16962 6.91225C3.16962 5.60219 3.16962 4.94715 3.4247 4.44677C3.64907 4.00662 4.0071 3.64877 4.44747 3.42451C4.9481 3.16956 5.60346 3.16956 6.91418 3.16956H10.1907V7.84792H3.16962V6.91225Z",
|
|
19
19
|
stroke: "currentColor",
|
|
20
20
|
strokeWidth: "2",
|
|
21
21
|
strokeLinecap: "round",
|
|
@@ -25,7 +25,7 @@ const C = ({ className: r, ariaHidden: t, title: e = "Dashboard", description: n
|
|
|
25
25
|
/* @__PURE__ */ o(
|
|
26
26
|
"path",
|
|
27
27
|
{
|
|
28
|
-
d: "
|
|
28
|
+
d: "M13.345 15.6842H20.3661V16.6199C20.3661 17.9299 20.3661 18.585 20.111 19.0854C19.8867 19.5255 19.5286 19.8834 19.0883 20.1076C18.5877 20.3626 17.9322 20.3626 16.6215 20.3626H13.345V15.6842Z",
|
|
29
29
|
stroke: "currentColor",
|
|
30
30
|
strokeWidth: "2",
|
|
31
31
|
strokeLinecap: "round",
|
|
@@ -35,7 +35,7 @@ const C = ({ className: r, ariaHidden: t, title: e = "Dashboard", description: n
|
|
|
35
35
|
/* @__PURE__ */ o(
|
|
36
36
|
"path",
|
|
37
37
|
{
|
|
38
|
-
d: "
|
|
38
|
+
d: "M3.16956 11.0059H10.1906V20.3626H6.91412C5.6034 20.3626 4.94804 20.3626 4.44741 20.1076C4.00704 19.8834 3.64901 19.5255 3.42464 19.0854C3.16956 18.585 3.16956 17.93 3.16956 16.6199V11.0059Z",
|
|
39
39
|
stroke: "currentColor",
|
|
40
40
|
strokeWidth: "2",
|
|
41
41
|
strokeLinecap: "round",
|
|
@@ -45,7 +45,7 @@ const C = ({ className: r, ariaHidden: t, title: e = "Dashboard", description: n
|
|
|
45
45
|
/* @__PURE__ */ o(
|
|
46
46
|
"path",
|
|
47
47
|
{
|
|
48
|
-
d: "
|
|
48
|
+
d: "M13.345 3.16956H16.6215C17.9322 3.16956 18.5877 3.16956 19.0883 3.42451C19.5286 3.64877 19.8867 4.00662 20.111 4.44677C20.3661 4.94715 20.3661 5.60219 20.3661 6.91225V12.5263H13.345V3.16956Z",
|
|
49
49
|
stroke: "currentColor",
|
|
50
50
|
strokeWidth: "2",
|
|
51
51
|
strokeLinecap: "round",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import a from "./IconBase.js";
|
|
4
|
+
import { forwardRef as d } from "react";
|
|
5
|
+
const m = ({ className: o, ariaHidden: t, title: s = "Harmonic Cursors", description: n, size: e = 24 }, i) => /* @__PURE__ */ c(
|
|
6
|
+
a,
|
|
7
|
+
{
|
|
8
|
+
size: e,
|
|
9
|
+
className: o,
|
|
10
|
+
title: s,
|
|
11
|
+
description: n,
|
|
12
|
+
"aria-hidden": t,
|
|
13
|
+
ref: i,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ r(
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
d: "M2.45453 13.4347C2.45453 13.4347 11.2804 -1.47771 21.5454 13.2072",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
strokeWidth: "1.85"
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ r(
|
|
24
|
+
"path",
|
|
25
|
+
{
|
|
26
|
+
d: "M21.5454 12.9565C12.5912 43.9337 11.4062 -17.8068 2.45453 13.4348C7.71677 -11.6145 6.88298 16.2733 10.0909 16.3044C14.0847 16.3431 16.4288 -11.9102 21.5454 12.9565Z",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: "1.85",
|
|
29
|
+
strokeLinejoin: "round"
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
), p = d(m);
|
|
35
|
+
export {
|
|
36
|
+
p as HarmonicCursorsIcon
|
|
37
|
+
};
|