@spear-ai/spectral 1.6.17 → 1.8.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 +201 -200
- package/dist/Accordion.d.ts +13 -15
- package/dist/Accordion.js +184 -179
- package/dist/Alert/AlertBase.d.ts +7 -7
- package/dist/Alert/AlertBase.js +21 -21
- package/dist/Alert.d.ts +2 -2
- package/dist/Alert.js +31 -31
- package/dist/Avatar.d.ts +2 -2
- package/dist/Avatar.js +30 -22
- package/dist/Badge.d.ts +1 -1
- package/dist/Badge.js +3 -2
- package/dist/Button.d.ts +3 -3
- package/dist/Button.js +108 -46
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
- package/dist/ButtonGroup.d.ts +5 -5
- package/dist/ButtonGroup.js +21 -21
- package/dist/ButtonIcon.d.ts +2 -2
- package/dist/ButtonIcon.js +30 -31
- package/dist/Checkbox/CheckboxBase.d.ts +2 -2
- package/dist/Checkbox/CheckboxBase.js +50 -57
- package/dist/Checkbox.js +15 -19
- package/dist/DataCard/Card.d.ts +1 -1
- package/dist/DataCard/Card.js +1 -1
- package/dist/DataCard.js +1 -1
- package/dist/DateTimePicker/Calendar.d.ts +4 -4
- package/dist/DateTimePicker/Calendar.js +3 -3
- package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
- package/dist/DateTimePicker/DateTimeInput.js +4 -4
- package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
- package/dist/DateTimePicker/DateTimeUtils.js +139 -197
- package/dist/DateTimePicker/TimePicker.d.ts +4 -4
- package/dist/DateTimePicker/TimePicker.js +3 -3
- package/dist/DateTimePicker.d.ts +5 -5
- package/dist/DateTimePicker.js +90 -70
- package/dist/Dialog.d.ts +13 -13
- package/dist/Dialog.js +57 -84
- package/dist/Drawer.d.ts +2 -2
- package/dist/Drawer.js +8 -8
- package/dist/HoverCard.d.ts +6 -5
- package/dist/HoverCard.js +64 -64
- package/dist/Icons/PolygonIcon.d.ts +5 -0
- package/dist/Icons/PolygonIcon.js +40 -0
- package/dist/Icons/index.d.ts +1 -1
- package/dist/Icons.js +34 -34
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
- package/dist/Input/InputUtils.d.ts +2 -2
- package/dist/Input/InputUtils.js +4 -4
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +19 -19
- package/dist/InputOTP.d.ts +10 -10
- package/dist/InputOTP.js +114 -114
- package/dist/Kbd.d.ts +8 -5
- package/dist/Kbd.js +85 -20
- package/dist/Label.d.ts +4 -2
- package/dist/Label.js +3 -3
- package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
- package/dist/MultiSelect/MultiSelectBase.js +278 -202
- package/dist/MultiSelect.d.ts +6 -6
- package/dist/MultiSelect.js +9 -9
- package/dist/Popover.js +22 -237
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
- package/dist/RadioButtonGroup.d.ts +1 -1
- package/dist/RadioGroup.d.ts +15 -15
- package/dist/RadioGroup.js +253 -236
- package/dist/Select.d.ts +3 -1
- package/dist/Select.js +91 -88
- package/dist/Separator.js +4 -4
- package/dist/Skeleton.d.ts +1 -2
- package/dist/Skeleton.js +2 -4
- package/dist/Slider.d.ts +6 -6
- package/dist/Slider.js +78 -78
- package/dist/Switch/SwitchBase.d.ts +4 -4
- package/dist/Switch/SwitchBase.js +75 -111
- package/dist/Switch.d.ts +4 -4
- package/dist/Switch.js +122 -33
- package/dist/Tabs/TabsBase.js +39 -38
- package/dist/Tabs/tabsUtils.js +7 -7
- package/dist/Tabs.d.ts +0 -4
- package/dist/Tabs.js +62 -66
- package/dist/Textarea/TextareaUtils.d.ts +7 -7
- package/dist/Textarea/TextareaUtils.js +13 -13
- package/dist/Textarea.js +28 -18
- package/dist/Toast.d.ts +43 -0
- package/dist/Toast.js +883 -0
- package/dist/Toggle/ToggleBase.d.ts +4 -4
- package/dist/Toggle/ToggleBase.js +32 -33
- package/dist/Toggle.d.ts +1 -1
- package/dist/Toggle.js +7 -12
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
- package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
- package/dist/ToggleGroup.d.ts +1 -1
- package/dist/ToggleGroup.js +27 -30
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +97 -97
- package/dist/Tray.d.ts +9 -9
- package/dist/Tray.js +71 -70
- package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
- package/dist/hooks/useAccordionAutoScroll.js +42 -39
- package/dist/hooks/useControllableState.d.ts +2 -2
- package/dist/hooks/useControllableState.d.ts.map +1 -1
- package/dist/hooks/useControllableState.js +2 -2
- package/dist/index-C12FUuIW.js +13 -0
- package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
- package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
- package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
- package/dist/index-DEYs15GP.js +66 -0
- package/dist/index-DdFoGvON.js +146 -0
- package/dist/index-Q3N6lgwg.js +225 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.js +4 -4
- package/dist/primitives/input.d.ts.map +1 -1
- package/dist/primitives/input.js +8 -5
- package/dist/primitives/select.d.ts +12 -13
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +59 -88
- package/dist/primitives/slot.d.ts +5 -5
- package/dist/primitives/slot.d.ts.map +1 -1
- package/dist/primitives/slot.js +24 -33
- package/dist/primitives/textarea.d.ts.map +1 -1
- package/dist/primitives/textarea.js +4 -3
- package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
- package/dist/styles/base-colors.css +30 -30
- package/dist/styles/horizon/base-colors.css +30 -30
- package/dist/styles/horizon/colors.css +43 -13
- package/dist/styles/horizon/utilities.css +26 -3
- package/dist/styles/main.css +1 -1
- package/dist/styles/spectral.css +2 -2
- package/dist/styles/theme.css +99 -46
- package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
- package/dist/utils/formFieldUtils.d.ts +2 -2
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +14 -11
- package/dist/utils/sharedUtils.d.ts +3 -3
- package/dist/utils/sharedUtils.d.ts.map +1 -1
- package/dist/utils/sharedUtils.js +1 -4
- package/dist/utils/twUtils.d.ts +1 -1
- package/dist/utils/twUtils.d.ts.map +1 -1
- package/dist/utils/twUtils.js +1 -4
- package/package.json +6 -1
- package/dist/Icons/LineToolIcon2.d.ts +0 -5
- package/dist/Icons/LineToolIcon2.js +0 -49
- package/dist/createLucideIcon-D4r5Phnh.js +0 -70
- package/dist/index-CeP1E2kK.js +0 -209
- package/dist/index-Dy-Hzr7y.js +0 -13
package/dist/Alert/AlertBase.js
CHANGED
|
@@ -34,7 +34,6 @@ import "../Icons/KeyboardIcon.js";
|
|
|
34
34
|
import "../Icons/LabelIcon.js";
|
|
35
35
|
import "../Icons/LassoIcon.js";
|
|
36
36
|
import "../Icons/LineToolIcon.js";
|
|
37
|
-
import "../Icons/LineToolIcon2.js";
|
|
38
37
|
import "../Icons/LiveViewIcon.js";
|
|
39
38
|
import "../Icons/LoaderIcon.js";
|
|
40
39
|
import "../Icons/LocationIcon.js";
|
|
@@ -48,6 +47,7 @@ import "../Icons/PanelIconClose.js";
|
|
|
48
47
|
import "../Icons/PanelIconOpen.js";
|
|
49
48
|
import "../Icons/PlayIcon.js";
|
|
50
49
|
import "../Icons/PlusIcon.js";
|
|
50
|
+
import "../Icons/PolygonIcon.js";
|
|
51
51
|
import "../Icons/ResetIcon.js";
|
|
52
52
|
import "../Icons/ReviewedIcon.js";
|
|
53
53
|
import "../Icons/ScissorsIcon.js";
|
|
@@ -68,12 +68,12 @@ import "../Icons/ZoomAllIcon.js";
|
|
|
68
68
|
import "../Icons/ZoomXIcon.js";
|
|
69
69
|
import "../Icons/ZoomYIcon.js";
|
|
70
70
|
import { cn as a } from "../utils/twUtils.js";
|
|
71
|
-
import { c as
|
|
72
|
-
import { useState as
|
|
71
|
+
import { c as m } from "../index-D29mdTf5.js";
|
|
72
|
+
import { useState as p, useEffect as n } from "react";
|
|
73
73
|
import { createPortal as d } from "react-dom";
|
|
74
|
-
const c =
|
|
74
|
+
const c = m(
|
|
75
75
|
`fixed top-2 left-1/2 -translate-x-1/2 z-50 w-full max-w-md rounded-md border px-4 py-3 text-sm flex flex-col gap-y-1
|
|
76
|
-
transform transition-all duration-300 ease-in-out translate-y-0 opacity-100 scale-100 animate-in slide-in-from-top-full fade-in duration-300`,
|
|
76
|
+
transform transition-all duration-300 ease-in-out translate-y-0 opacity-100 scale-100 motion-safe:animate-in motion-safe:slide-in-from-top-full motion-safe:fade-in motion-safe:duration-300`,
|
|
77
77
|
{
|
|
78
78
|
variants: {
|
|
79
79
|
variant: {
|
|
@@ -102,48 +102,48 @@ const c = p(
|
|
|
102
102
|
}) => /* @__PURE__ */ i("div", { className: a(c({ variant: e }), r), "data-slot": "alert", "data-testid": "spectral-alert", ref: t, role: "alert", ...o });
|
|
103
103
|
f.displayName = "AlertBase";
|
|
104
104
|
const u = ({
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
className: t,
|
|
106
|
+
ref: r,
|
|
107
107
|
...e
|
|
108
|
-
}) => /* @__PURE__ */ i("div", { className: a("flex items-center gap-2 [&>svg]:size-6 [&>svg]:shrink-0",
|
|
108
|
+
}) => /* @__PURE__ */ i("div", { className: a("flex items-center gap-2 [&>svg]:size-6 [&>svg]:shrink-0", t), "data-slot": "alert-header", ref: r, ...e });
|
|
109
109
|
u.displayName = "AlertHeader";
|
|
110
110
|
const x = ({
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
className: t,
|
|
112
|
+
ref: r,
|
|
113
113
|
variant: e,
|
|
114
114
|
...o
|
|
115
|
-
}) => /* @__PURE__ */ i("div", { className: a(l[e], "line-clamp-1 flex-1 text-base font-semibold tracking-tight",
|
|
115
|
+
}) => /* @__PURE__ */ i("div", { className: a(l[e], "line-clamp-1 flex-1 text-base font-semibold tracking-tight", t), "data-slot": "alert-title", "data-testid": "spectral-alert-title", ref: r, ...o });
|
|
116
116
|
x.displayName = "AlertTitle";
|
|
117
117
|
const g = ({
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
className: t,
|
|
119
|
+
ref: r,
|
|
120
120
|
variant: e,
|
|
121
121
|
...o
|
|
122
|
-
}) => /* @__PURE__ */ i("div", { className: a(l[e], "grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
122
|
+
}) => /* @__PURE__ */ i("div", { className: a(l[e], "grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", t), "data-slot": "alert-description", "data-testid": "spectral-alert-description", ref: r, ...o });
|
|
123
123
|
g.displayName = "AlertDescription";
|
|
124
124
|
const b = ({
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
className: t,
|
|
126
|
+
ref: r,
|
|
127
127
|
variant: e,
|
|
128
128
|
...o
|
|
129
129
|
}) => /* @__PURE__ */ i(
|
|
130
130
|
s,
|
|
131
131
|
{
|
|
132
132
|
"aria-label": "Close alert",
|
|
133
|
-
className: a(l[e], "focus-visible:outline-text-secondary shrink-0 cursor-pointer rounded outline-transparent focus-visible:outline-1 focus-visible:outline-offset-1",
|
|
133
|
+
className: a(l[e], "focus-visible:outline-text-secondary shrink-0 cursor-pointer rounded outline-transparent focus-visible:outline-1 focus-visible:outline-offset-1", t),
|
|
134
134
|
"data-slot": "close-icon",
|
|
135
135
|
"data-testid": "spectral-alert-close-button",
|
|
136
|
-
ref:
|
|
136
|
+
ref: r,
|
|
137
137
|
size: 20,
|
|
138
138
|
tabIndex: 0,
|
|
139
139
|
...o
|
|
140
140
|
}
|
|
141
141
|
);
|
|
142
142
|
b.displayName = "AlertCloseButton";
|
|
143
|
-
|
|
144
|
-
const [e, o] =
|
|
143
|
+
const Vt = ({ children: t, container: r }) => {
|
|
144
|
+
const [e, o] = p(!1);
|
|
145
145
|
return n(() => (o(!0), () => o(!1)), []), e ? d(t, r ?? document.body) : null;
|
|
146
|
-
}
|
|
146
|
+
};
|
|
147
147
|
export {
|
|
148
148
|
f as AlertBase,
|
|
149
149
|
b as AlertCloseButton,
|
package/dist/Alert.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface AlertProps {
|
|
3
|
-
onClose?: () => void;
|
|
4
3
|
className?: string;
|
|
5
4
|
description: string | ReactNode | undefined;
|
|
6
5
|
icon?: ReactNode;
|
|
7
6
|
id: string | undefined;
|
|
7
|
+
onClose?: () => void;
|
|
8
8
|
title: string | undefined;
|
|
9
9
|
variant?: 'default' | 'info' | 'success' | 'warning' | 'danger';
|
|
10
10
|
}
|
|
11
|
-
export declare const Alert: ({
|
|
11
|
+
export declare const Alert: ({ className, description, icon, id, onClose, title, variant }: AlertProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=Alert.d.ts.map
|
package/dist/Alert.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as t, jsxs as
|
|
4
|
-
import { AlertPortal as
|
|
3
|
+
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
4
|
+
import { AlertPortal as y, AlertBase as I, AlertHeader as N, AlertTitle as h, AlertCloseButton as w, AlertDescription as g } from "./Alert/AlertBase.js";
|
|
5
5
|
import "./Icons/AnalyzeIcon.js";
|
|
6
6
|
import "./Icons/AnnotationsIcon.js";
|
|
7
7
|
import "./Icons/ApprovedIcon.js";
|
|
@@ -9,12 +9,12 @@ import "./Icons/ArrowDownIcon.js";
|
|
|
9
9
|
import "./Icons/ArrowUpIcon.js";
|
|
10
10
|
import "./Icons/CalendarIcon.js";
|
|
11
11
|
import "./Icons/CheckCircleIcon.js";
|
|
12
|
-
import { CheckSquareIcon as
|
|
12
|
+
import { CheckSquareIcon as E } from "./Icons/CheckSquareIcon.js";
|
|
13
13
|
import "./Icons/CheckmarkIcon.js";
|
|
14
14
|
import "./Icons/ChevronDownIcon.js";
|
|
15
15
|
import "./Icons/ChevronUpIcon.js";
|
|
16
16
|
import "./Icons/ClockIcon.js";
|
|
17
|
-
import { CloseCircleIcon as
|
|
17
|
+
import { CloseCircleIcon as k } from "./Icons/CloseCircleIcon.js";
|
|
18
18
|
import "./Icons/CloseIcon.js";
|
|
19
19
|
import "./Icons/DashboardIcon.js";
|
|
20
20
|
import "./Icons/DatabaseIcon.js";
|
|
@@ -35,7 +35,6 @@ import "./Icons/KeyboardIcon.js";
|
|
|
35
35
|
import "./Icons/LabelIcon.js";
|
|
36
36
|
import "./Icons/LassoIcon.js";
|
|
37
37
|
import "./Icons/LineToolIcon.js";
|
|
38
|
-
import "./Icons/LineToolIcon2.js";
|
|
39
38
|
import "./Icons/LiveViewIcon.js";
|
|
40
39
|
import "./Icons/LoaderIcon.js";
|
|
41
40
|
import "./Icons/LocationIcon.js";
|
|
@@ -49,6 +48,7 @@ import "./Icons/PanelIconClose.js";
|
|
|
49
48
|
import "./Icons/PanelIconOpen.js";
|
|
50
49
|
import "./Icons/PlayIcon.js";
|
|
51
50
|
import "./Icons/PlusIcon.js";
|
|
51
|
+
import "./Icons/PolygonIcon.js";
|
|
52
52
|
import "./Icons/ResetIcon.js";
|
|
53
53
|
import "./Icons/ReviewedIcon.js";
|
|
54
54
|
import "./Icons/ScissorsIcon.js";
|
|
@@ -69,39 +69,39 @@ import "./Icons/ZoomAllIcon.js";
|
|
|
69
69
|
import "./Icons/ZoomXIcon.js";
|
|
70
70
|
import "./Icons/ZoomYIcon.js";
|
|
71
71
|
import { cn as T } from "./utils/twUtils.js";
|
|
72
|
-
import { useRef as
|
|
73
|
-
const
|
|
74
|
-
const o =
|
|
72
|
+
import { useRef as v, useCallback as s, useEffect as S } from "react";
|
|
73
|
+
const Ot = ({ className: c, description: e, icon: d, id: u, onClose: m, title: f, variant: r = "default" }) => {
|
|
74
|
+
const o = v(null), p = d ?? {
|
|
75
75
|
info: /* @__PURE__ */ t(C, { className: "text-alert-info-text" }),
|
|
76
|
-
success: /* @__PURE__ */ t(
|
|
76
|
+
success: /* @__PURE__ */ t(E, { className: "text-alert-success-text" }),
|
|
77
77
|
warning: /* @__PURE__ */ t(R, { className: "text-alert-warning-text" }),
|
|
78
|
-
danger: /* @__PURE__ */ t(
|
|
78
|
+
danger: /* @__PURE__ */ t(k, { className: "text-alert-danger-text" }),
|
|
79
79
|
default: null
|
|
80
|
-
}[r]
|
|
81
|
-
v(() => {
|
|
82
|
-
const p = (n) => {
|
|
83
|
-
n.key === "Escape" && o.current && (n.preventDefault(), m());
|
|
84
|
-
};
|
|
85
|
-
return document.addEventListener("keydown", p), () => {
|
|
86
|
-
document.removeEventListener("keydown", p);
|
|
87
|
-
};
|
|
88
|
-
}, []);
|
|
89
|
-
const m = () => {
|
|
80
|
+
}[r], i = s(() => {
|
|
90
81
|
o.current && (o.current.style.opacity = "0", setTimeout(() => {
|
|
91
|
-
o.current && (o.current.style.display = "none"),
|
|
82
|
+
o.current && (o.current.style.display = "none"), m?.();
|
|
92
83
|
}, 300));
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
84
|
+
}, [m]);
|
|
85
|
+
S(() => {
|
|
86
|
+
const n = (a) => {
|
|
87
|
+
a.key === "Escape" && o.current && (a.preventDefault(), i());
|
|
88
|
+
};
|
|
89
|
+
return document.addEventListener("keydown", n), () => {
|
|
90
|
+
document.removeEventListener("keydown", n);
|
|
91
|
+
};
|
|
92
|
+
}, [i]);
|
|
93
|
+
const A = s(() => {
|
|
94
|
+
i();
|
|
95
|
+
}, [i]), x = (/* @__PURE__ */ new Set(["danger", "warning"])).has(r) ? "assertive" : "polite";
|
|
96
|
+
return /* @__PURE__ */ t(y, { children: /* @__PURE__ */ l(I, { "aria-live": x, className: T("alert-wrapper transition-opacity duration-300", c), "data-slot": "alert", "data-variant": r, id: u, ref: o, variant: r, children: [
|
|
97
|
+
/* @__PURE__ */ l(N, { children: [
|
|
98
|
+
p,
|
|
99
|
+
/* @__PURE__ */ t(h, { variant: r, children: f }),
|
|
100
|
+
/* @__PURE__ */ t(w, { onClick: A, variant: r })
|
|
101
101
|
] }),
|
|
102
|
-
|
|
102
|
+
e && /* @__PURE__ */ t(g, { className: p ? "ml-8" : void 0, variant: r, children: e })
|
|
103
103
|
] }) });
|
|
104
104
|
};
|
|
105
105
|
export {
|
|
106
|
-
|
|
106
|
+
Ot as Alert
|
|
107
107
|
};
|
package/dist/Avatar.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ export interface AvatarProps {
|
|
|
4
4
|
alt?: string;
|
|
5
5
|
className?: string;
|
|
6
6
|
fallback?: ReactNode | string;
|
|
7
|
-
imageSource?: string;
|
|
8
7
|
icon?: ReactElement;
|
|
8
|
+
imageSource?: string;
|
|
9
9
|
size?: AvatarSize;
|
|
10
10
|
userFullName?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare const Avatar: ({ alt, className, icon, imageSource,
|
|
12
|
+
export declare const Avatar: ({ alt, className, fallback, icon, imageSource, size, userFullName }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=Avatar.d.ts.map
|
package/dist/Avatar.js
CHANGED
|
@@ -16,44 +16,52 @@ const j = {
|
|
|
16
16
|
sm: 24,
|
|
17
17
|
md: 32,
|
|
18
18
|
lg: 40
|
|
19
|
-
}, N = (
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
22
|
-
const t =
|
|
19
|
+
}, N = (n) => {
|
|
20
|
+
const l = n.trim();
|
|
21
|
+
if (!l) return "?";
|
|
22
|
+
const t = l.split(/\s+/).filter(Boolean);
|
|
23
23
|
return t.length === 0 ? "?" : t.length === 1 ? t[0].charAt(0).toUpperCase() : (t[0].charAt(0) + t[t.length - 1].charAt(0)).toUpperCase();
|
|
24
|
-
}, k = ({ alt:
|
|
24
|
+
}, k = ({ alt: n, className: l, fallback: t, icon: r, imageSource: a, size: i = "md", userFullName: c }) => {
|
|
25
25
|
const [d, f] = v("loading");
|
|
26
26
|
w(() => {
|
|
27
|
-
if (!
|
|
27
|
+
if (!a) return;
|
|
28
28
|
f("loading");
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
|
|
29
|
+
const s = new Image();
|
|
30
|
+
return s.src = a, s.onload = () => f("loaded"), s.onerror = () => f("error"), () => {
|
|
31
|
+
s.onload = null, s.onerror = null;
|
|
32
32
|
};
|
|
33
|
-
}, [
|
|
33
|
+
}, [a]);
|
|
34
34
|
const h = () => {
|
|
35
35
|
if (c)
|
|
36
|
-
return /* @__PURE__ */ e(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
return /* @__PURE__ */ e(
|
|
37
|
+
"span",
|
|
38
|
+
{
|
|
39
|
+
"aria-label": c + " avatar",
|
|
40
|
+
className: o("text-text-primary flex h-full w-full items-center justify-center font-bold tracking-tighter font-stretch-condensed", p[i]),
|
|
41
|
+
"data-testid": "spectral-avatar-initials",
|
|
42
|
+
children: N(c)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
if (r) {
|
|
46
|
+
const s = I[i];
|
|
47
|
+
return /* @__PURE__ */ e("span", { className: "flex h-full w-full items-center justify-center", children: y(r) ? (() => {
|
|
40
48
|
const m = {
|
|
41
|
-
className: o("shrink-0",
|
|
49
|
+
className: o("shrink-0", r.props.className),
|
|
42
50
|
"aria-hidden": "true"
|
|
43
51
|
};
|
|
44
|
-
if (
|
|
52
|
+
if (r.type.displayName?.includes("Icon") ?? !1) {
|
|
45
53
|
const x = {
|
|
46
54
|
...m,
|
|
47
|
-
size:
|
|
55
|
+
size: s
|
|
48
56
|
};
|
|
49
|
-
return u(
|
|
57
|
+
return u(r, x);
|
|
50
58
|
}
|
|
51
|
-
return u(
|
|
52
|
-
})() :
|
|
59
|
+
return u(r, m);
|
|
60
|
+
})() : r });
|
|
53
61
|
}
|
|
54
|
-
return
|
|
62
|
+
return a && d === "loaded" ? /* @__PURE__ */ e("img", { alt: n ?? "Avatar", "aria-label": n ?? "Avatar", className: "absolute inset-0 h-full w-full rounded-full object-cover", "data-testid": "spectral-avatar-image", role: "img", src: a }) : a && d === "error" && t ? /* @__PURE__ */ e("span", { className: "flex h-full w-full items-center justify-center", "data-testid": "spectral-avatar-img-error-fallback", children: t }) : t ? /* @__PURE__ */ e("span", { className: o("text-text-primary flex h-full w-full items-center justify-center", p[i]), "data-testid": "spectral-avatar-fallback", children: t }) : a && d === "loading" ? /* @__PURE__ */ e("span", { className: "flex h-full w-full items-center justify-center motion-safe:animate-pulse", "data-testid": "spectral-avatar-loading" }) : /* @__PURE__ */ e(g, {});
|
|
55
63
|
};
|
|
56
|
-
return /* @__PURE__ */ e("div", { className: o("bg-level-two relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full", j[i],
|
|
64
|
+
return /* @__PURE__ */ e("div", { className: o("bg-level-two relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full", j[i], l), "data-slot": "avatar", "data-testid": "spectral-avatar", children: h() });
|
|
57
65
|
};
|
|
58
66
|
export {
|
|
59
67
|
k as Avatar
|
package/dist/Badge.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type BadgeProps = ComponentProps<'span'> & VariantProps<typeof badgeVaria
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
-
export declare const Badge: ({ className, variant,
|
|
9
|
+
export declare const Badge: ({ asChild, className, variant, ...props }: ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
10
10
|
asChild?: boolean;
|
|
11
11
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
package/dist/Badge.js
CHANGED
|
@@ -3,6 +3,7 @@ import { jsx as i } from "react/jsx-runtime";
|
|
|
3
3
|
import { Slot as o } from "./primitives/slot.js";
|
|
4
4
|
import { cn as d } from "./utils/twUtils.js";
|
|
5
5
|
import { c as n } from "./index-D29mdTf5.js";
|
|
6
|
+
import "react";
|
|
6
7
|
const g = n(
|
|
7
8
|
`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
|
|
8
9
|
focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-danger-200 aria-invalid:border-danger-200
|
|
@@ -20,7 +21,7 @@ const g = n(
|
|
|
20
21
|
variant: "default"
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
),
|
|
24
|
+
), l = ({ asChild: e = !1, className: r, variant: a, ...t }) => /* @__PURE__ */ i(e ? o : "span", { className: d(g({ variant: a }), r), "data-slot": "badge", "data-testid": "spectral-badge", ...t });
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
l as Badge
|
|
26
27
|
};
|
package/dist/Button.d.ts
CHANGED
|
@@ -7,12 +7,12 @@ declare const buttonVariants: (props?: ({
|
|
|
7
7
|
state?: "default" | "error" | "loading" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
9
|
export interface ButtonProps extends AsChildProp, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'>, VariantProps<typeof buttonVariants> {
|
|
10
|
+
dataTestId?: string;
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
endIcon?: ReactNode;
|
|
12
13
|
errorMessage?: string | ReactNode;
|
|
13
|
-
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
14
|
-
dataTestId?: string;
|
|
15
14
|
label?: string;
|
|
15
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
16
16
|
size?: 'small' | 'default' | 'fullWidth';
|
|
17
17
|
startIcon?: ReactNode;
|
|
18
18
|
state?: 'default' | 'error' | 'loading';
|
|
@@ -20,7 +20,7 @@ export interface ButtonProps extends AsChildProp, Omit<ButtonHTMLAttributes<HTML
|
|
|
20
20
|
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'unstyled';
|
|
21
21
|
}
|
|
22
22
|
export declare const Button: {
|
|
23
|
-
({
|
|
23
|
+
({ asChild, children, className, dataTestId, disabled, endIcon, errorMessage, label, onClick, ref, size, startIcon, state, type, variant, ...props }: ButtonProps & {
|
|
24
24
|
ref?: Ref<HTMLButtonElement>;
|
|
25
25
|
}): import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
displayName: string;
|
package/dist/Button.js
CHANGED
|
@@ -1,13 +1,78 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsxs as g, jsx as n, Fragment as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
3
|
+
import { jsxs as g, jsx as n, Fragment as z } from "react/jsx-runtime";
|
|
4
|
+
import "./Icons/AnalyzeIcon.js";
|
|
5
|
+
import "./Icons/AnnotationsIcon.js";
|
|
6
|
+
import "./Icons/ApprovedIcon.js";
|
|
7
|
+
import "./Icons/ArrowDownIcon.js";
|
|
8
|
+
import "./Icons/ArrowUpIcon.js";
|
|
9
|
+
import "./Icons/CalendarIcon.js";
|
|
10
|
+
import "./Icons/CheckCircleIcon.js";
|
|
11
|
+
import "./Icons/CheckSquareIcon.js";
|
|
12
|
+
import "./Icons/CheckmarkIcon.js";
|
|
13
|
+
import "./Icons/ChevronDownIcon.js";
|
|
14
|
+
import "./Icons/ChevronUpIcon.js";
|
|
15
|
+
import "./Icons/ClockIcon.js";
|
|
16
|
+
import "./Icons/CloseCircleIcon.js";
|
|
17
|
+
import "./Icons/CloseIcon.js";
|
|
18
|
+
import "./Icons/DashboardIcon.js";
|
|
19
|
+
import "./Icons/DatabaseIcon.js";
|
|
20
|
+
import "./Icons/DeleteIcon.js";
|
|
21
|
+
import "./Icons/DurationIcon.js";
|
|
22
|
+
import "./Icons/EditIcon.js";
|
|
23
|
+
import "./Icons/EmailIcon.js";
|
|
24
|
+
import "./Icons/EraserIcon.js";
|
|
25
|
+
import "./Icons/ErrorIcon.js";
|
|
26
|
+
import "./Icons/EyeClosedIcon.js";
|
|
27
|
+
import "./Icons/EyeClosedIcon2.js";
|
|
28
|
+
import "./Icons/EyeOpenIcon.js";
|
|
29
|
+
import "./Icons/GoToFirstIcon.js";
|
|
30
|
+
import "./Icons/GoToLastIcon.js";
|
|
31
|
+
import "./Icons/HarmonicCursorsIcon.js";
|
|
32
|
+
import "./Icons/InfoIcon.js";
|
|
33
|
+
import "./Icons/KeyboardIcon.js";
|
|
34
|
+
import "./Icons/LabelIcon.js";
|
|
35
|
+
import "./Icons/LassoIcon.js";
|
|
36
|
+
import "./Icons/LineToolIcon.js";
|
|
37
|
+
import "./Icons/LiveViewIcon.js";
|
|
38
|
+
import { LoaderIcon as B } from "./Icons/LoaderIcon.js";
|
|
39
|
+
import "./Icons/LocationIcon.js";
|
|
40
|
+
import "./Icons/LogoutIcon.js";
|
|
41
|
+
import "./Icons/MeasureIcon.js";
|
|
42
|
+
import "./Icons/MessagesIcon.js";
|
|
43
|
+
import "./Icons/MetadataIcon.js";
|
|
44
|
+
import "./Icons/MinusIcon.js";
|
|
45
|
+
import "./Icons/OntologyIcon.js";
|
|
46
|
+
import "./Icons/PanelIconClose.js";
|
|
47
|
+
import "./Icons/PanelIconOpen.js";
|
|
48
|
+
import "./Icons/PlayIcon.js";
|
|
49
|
+
import "./Icons/PlusIcon.js";
|
|
50
|
+
import "./Icons/PolygonIcon.js";
|
|
51
|
+
import "./Icons/ResetIcon.js";
|
|
52
|
+
import "./Icons/ReviewedIcon.js";
|
|
53
|
+
import "./Icons/ScissorsIcon.js";
|
|
54
|
+
import "./Icons/SearchIcon.js";
|
|
55
|
+
import "./Icons/SettingsIcon.js";
|
|
56
|
+
import "./Icons/SortAscendingIcon.js";
|
|
57
|
+
import "./Icons/SortAtoZIcon.js";
|
|
58
|
+
import "./Icons/SortDescendingIcon.js";
|
|
59
|
+
import "./Icons/SortZtoAIcon.js";
|
|
60
|
+
import "./Icons/StackIcon.js";
|
|
61
|
+
import "./Icons/StarIcon.js";
|
|
62
|
+
import "./Icons/TrashIcon.js";
|
|
63
|
+
import "./Icons/UndoIcon.js";
|
|
64
|
+
import "./Icons/User2Icon.js";
|
|
65
|
+
import "./Icons/UserIcon.js";
|
|
66
|
+
import "./Icons/WarningIcon.js";
|
|
67
|
+
import "./Icons/ZoomAllIcon.js";
|
|
68
|
+
import "./Icons/ZoomXIcon.js";
|
|
69
|
+
import "./Icons/ZoomYIcon.js";
|
|
70
|
+
import { Slot as E } from "./primitives/slot.js";
|
|
71
|
+
import { ErrorMessage as V } from "./utils/formFieldUtils.js";
|
|
72
|
+
import { cn as i } from "./utils/twUtils.js";
|
|
73
|
+
import { c as _ } from "./index-D29mdTf5.js";
|
|
74
|
+
import { isValidElement as D, Children as S } from "react";
|
|
75
|
+
const q = _(
|
|
11
76
|
`
|
|
12
77
|
font-sans! flex relative items-center justify-center gap-2 whitespace-nowrap transition-colors cursor-pointer rounded-lg border font-semibold focus:outline-none focus:outline-none
|
|
13
78
|
focus-visible:outline-1 focus-visible:outline-offset-2 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 disabled:pointer-events-none
|
|
@@ -41,25 +106,25 @@ const S = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], q = L
|
|
|
41
106
|
size: "default"
|
|
42
107
|
}
|
|
43
108
|
}
|
|
44
|
-
),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
className:
|
|
48
|
-
dataTestId:
|
|
109
|
+
), A = ({
|
|
110
|
+
asChild: c = !1,
|
|
111
|
+
children: a,
|
|
112
|
+
className: x,
|
|
113
|
+
dataTestId: v,
|
|
49
114
|
disabled: r,
|
|
50
115
|
endIcon: b,
|
|
51
|
-
errorMessage:
|
|
52
|
-
label:
|
|
53
|
-
onClick:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
116
|
+
errorMessage: d,
|
|
117
|
+
label: h,
|
|
118
|
+
onClick: y,
|
|
119
|
+
ref: f,
|
|
120
|
+
size: s,
|
|
121
|
+
startIcon: p,
|
|
122
|
+
state: o,
|
|
57
123
|
type: w = "button",
|
|
58
|
-
variant:
|
|
59
|
-
children: i,
|
|
124
|
+
variant: e = "primary",
|
|
60
125
|
...C
|
|
61
126
|
}) => {
|
|
62
|
-
const
|
|
127
|
+
const u = {
|
|
63
128
|
error: {
|
|
64
129
|
primary: "bg-button-danger border-button-danger text-text-primary hover:bg-button-danger--hover hover:text-text-primary",
|
|
65
130
|
secondary: "bg-button-danger border-button-danger text-text-primary hover:bg-button-danger--hover hover:text-text-primary",
|
|
@@ -74,44 +139,41 @@ const S = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], q = L
|
|
|
74
139
|
ghost: "bg-transparent text-button-ghost-text--disabled pointer-events-none",
|
|
75
140
|
unstyled: "bg-transparent opacity-50 pointer-events-none"
|
|
76
141
|
}
|
|
77
|
-
}, N =
|
|
78
|
-
if (!t && !
|
|
142
|
+
}, N = i(q({ variant: e, state: o, size: s }), o === "error" && u.error[e], o === "loading" && u.loading[e], x), t = c && D(a) && S.count(a) === 1, l = t ? void 0 : a ?? h;
|
|
143
|
+
if (!t && !l)
|
|
79
144
|
throw new Error("Button requires either `label` or `children`");
|
|
80
|
-
const j = (
|
|
81
|
-
r && (
|
|
82
|
-
},
|
|
83
|
-
return /* @__PURE__ */ g("div", { className:
|
|
145
|
+
const j = (m) => {
|
|
146
|
+
r && (m.preventDefault(), m.stopPropagation());
|
|
147
|
+
}, k = t ? E : "button";
|
|
148
|
+
return /* @__PURE__ */ g("div", { className: i("flex flex-col justify-items-center", s), children: [
|
|
84
149
|
/* @__PURE__ */ n(
|
|
85
|
-
|
|
150
|
+
k,
|
|
86
151
|
{
|
|
87
152
|
"aria-disabled": r,
|
|
88
|
-
className:
|
|
89
|
-
"data-spectral": "button",
|
|
90
|
-
"data-spectral-variant": o,
|
|
91
|
-
"data-spectral-size": d ?? "default",
|
|
92
|
-
"data-spectral-state": e ?? "default",
|
|
153
|
+
className: i(N, t && "no-underline! before:content-none after:content-none", t && r && "pointer-events-none opacity-50"),
|
|
93
154
|
"data-as-child": t ? "true" : void 0,
|
|
94
|
-
"data-state":
|
|
95
|
-
"data-testid":
|
|
155
|
+
"data-state": o,
|
|
156
|
+
"data-testid": v ?? `spectral-button-${e}`,
|
|
157
|
+
"data-variant": e,
|
|
96
158
|
disabled: t ? void 0 : r,
|
|
159
|
+
onClick: y,
|
|
97
160
|
onClickCapture: t ? j : void 0,
|
|
98
|
-
|
|
99
|
-
ref: x,
|
|
161
|
+
ref: f,
|
|
100
162
|
tabIndex: t && r ? -1 : void 0,
|
|
101
163
|
type: t ? void 0 : w,
|
|
102
164
|
...C,
|
|
103
|
-
children: t ?
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
b &&
|
|
165
|
+
children: t ? a : /* @__PURE__ */ g(z, { children: [
|
|
166
|
+
p && /* @__PURE__ */ n("span", { className: i("flex", e !== "unstyled" && "pr-1"), "aria-hidden": !0, "data-testid": "spectral-button-start-icon", children: p }),
|
|
167
|
+
o === "loading" && /* @__PURE__ */ n(B, { className: "ml-2 motion-safe:animate-spin", size: 16 }),
|
|
168
|
+
l,
|
|
169
|
+
b && o !== "loading" && /* @__PURE__ */ n("span", { className: i("flex", e !== "unstyled" && "pl-2"), "aria-hidden": !0, "data-testid": "spectral-button-end-icon", children: b })
|
|
108
170
|
] })
|
|
109
171
|
}
|
|
110
172
|
),
|
|
111
|
-
|
|
173
|
+
o === "error" && d && /* @__PURE__ */ n(V, { message: d, dataTestId: "spectral-button-error-message", id: "button-error" })
|
|
112
174
|
] });
|
|
113
175
|
};
|
|
114
|
-
|
|
176
|
+
A.displayName = "Button";
|
|
115
177
|
export {
|
|
116
|
-
|
|
178
|
+
A as Button
|
|
117
179
|
};
|
|
@@ -5,7 +5,7 @@ export declare const buttonVariants: (props?: ({
|
|
|
5
5
|
size?: "sm" | "md" | "lg" | "icon-md" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export declare const ButtonGroupButton: {
|
|
8
|
-
({
|
|
8
|
+
({ asChild, className, size, variant, ...props }: ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
displayName: string;
|
|
@@ -29,12 +29,12 @@ const c = l(
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
), u = ({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
size:
|
|
35
|
-
|
|
32
|
+
asChild: i = !1,
|
|
33
|
+
className: o,
|
|
34
|
+
size: t,
|
|
35
|
+
variant: e,
|
|
36
36
|
...s
|
|
37
|
-
}) => /* @__PURE__ */ n(
|
|
37
|
+
}) => /* @__PURE__ */ n(i ? a : "button", { className: r(c({ variant: e, size: t, className: o })), "data-size": t, "data-slot": "button-group-item", "data-variant": e, ...s });
|
|
38
38
|
u.displayName = "ButtonGroupButton";
|
|
39
39
|
export {
|
|
40
40
|
u as ButtonGroupButton,
|
package/dist/ButtonGroup.d.ts
CHANGED
|
@@ -6,21 +6,21 @@ export declare const buttonGroupVariants: (props?: ({
|
|
|
6
6
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
export declare const ButtonGroup: {
|
|
9
|
-
({ className, orientation,
|
|
10
|
-
variant?: "default" | "outline";
|
|
9
|
+
({ children, className, orientation, size, variant, ...props }: ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants> & {
|
|
11
10
|
size?: "md" | "sm" | "lg" | "icon-md" | "icon-sm" | "icon-lg";
|
|
11
|
+
variant?: "default" | "outline";
|
|
12
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
export declare const ButtonGroupItem: {
|
|
16
|
-
({ children, className, size, variant,
|
|
16
|
+
({ asChild, children, className, size, variant, ...props }: ComponentProps<"button"> & {
|
|
17
|
+
asChild?: boolean;
|
|
17
18
|
size?: "sm" | "md" | "lg" | "icon-sm" | "icon-md" | "icon-lg";
|
|
18
19
|
variant?: "default" | "outline";
|
|
19
|
-
asChild?: boolean;
|
|
20
20
|
}): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
23
|
-
export declare const ButtonGroupText: ({
|
|
23
|
+
export declare const ButtonGroupText: ({ asChild, className, ...props }: ComponentProps<"div"> & {
|
|
24
24
|
asChild?: boolean;
|
|
25
25
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export declare const ButtonGroupSeparator: {
|