@spear-ai/spectral 1.9.1 → 1.10.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/README.md +6 -5
- package/dist/.js +112 -239
- package/dist/Accordion-CDXdSAST.js +363 -0
- package/dist/Accordion.js +3 -498
- package/dist/Alert/AlertBase.js +69 -152
- package/dist/Alert.js +58 -106
- package/dist/AnimatePresence-D-9jXfgI.js +178 -0
- package/dist/App.js +6 -6
- package/dist/Avatar.js +83 -65
- package/dist/Badge.d.ts +1 -3
- package/dist/Badge.js +21 -25
- package/dist/Button.js +102 -178
- package/dist/ButtonGroup/ButtonGroupButton.js +38 -40
- package/dist/ButtonGroup.js +55 -59
- package/dist/ButtonIcon.js +58 -134
- package/dist/Calendar-s4lyijkn.js +3109 -0
- package/dist/Checkbox/CheckboxBase.js +94 -126
- package/dist/Checkbox.d.ts +1 -1
- package/dist/Checkbox.js +40 -105
- package/dist/Combobox/ComboboxBase.js +2 -79
- package/dist/Combobox.js +106 -172
- package/dist/ComboboxBase-D8Nf4xC-.js +491 -0
- package/dist/ControlGroup/ControlGroupSelect.d.ts +1 -1
- package/dist/ControlGroup/ControlGroupSelect.js +85 -101
- package/dist/ControlGroup.js +45 -48
- package/dist/DataCard/Card.js +37 -12
- package/dist/DataCard.d.ts +1 -1
- package/dist/DataCard.js +36 -16
- package/dist/DateTimePicker/Calendar.js +2 -2967
- package/dist/DateTimePicker/DateTimeDisplayInput.d.ts +1 -1
- package/dist/DateTimePicker/DateTimeDisplayInput.js +379 -275
- package/dist/DateTimePicker/DateTimeInput.d.ts +1 -1
- package/dist/DateTimePicker/DateTimeInput.js +133 -141
- package/dist/DateTimePicker/DateTimeUtils.js +2 -2193
- package/dist/DateTimePicker/TimePeriodSelect.d.ts +1 -1
- package/dist/DateTimePicker/TimePeriodSelect.js +45 -20
- package/dist/DateTimePicker/TimePicker.d.ts +1 -1
- package/dist/DateTimePicker/TimePicker.js +76 -60
- package/dist/DateTimePicker.d.ts +2 -2
- package/dist/DateTimePicker.js +87 -205
- package/dist/DateTimeUtils-DVvG6H-p.js +2098 -0
- package/dist/Dialog.js +74 -74
- package/dist/Drawer.js +67 -37
- package/dist/HoverCard-CYDsIiVK.js +201 -0
- package/dist/HoverCard.d.ts +1 -1
- package/dist/HoverCard.js +2 -218
- package/dist/Icons/AnalyzeIcon.js +50 -57
- package/dist/Icons/AnnotationsIcon.js +20 -15
- package/dist/Icons/ApprovedIcon.js +26 -18
- package/dist/Icons/ArrowDownIcon.js +20 -6
- package/dist/Icons/ArrowUpIcon.js +20 -6
- package/dist/Icons/BoxToolIcon.js +17 -12
- package/dist/Icons/CalendarIcon.js +43 -20
- package/dist/Icons/CheckCircleIcon.js +26 -10
- package/dist/Icons/CheckSquareIcon.js +26 -10
- package/dist/Icons/CheckmarkIcon.js +22 -9
- package/dist/Icons/ChevronDownIcon.js +22 -9
- package/dist/Icons/ChevronUpIcon.js +22 -9
- package/dist/Icons/ClockIcon.js +26 -18
- package/dist/Icons/CloseCircleIcon.js +26 -10
- package/dist/Icons/CloseIcon.js +18 -9
- package/dist/Icons/DashboardIcon.js +36 -10
- package/dist/Icons/DatabaseIcon.js +36 -19
- package/dist/Icons/DeleteIcon.js +36 -19
- package/dist/Icons/DurationIcon.js +57 -22
- package/dist/Icons/EditIcon.js +26 -27
- package/dist/Icons/EmailIcon.js +26 -10
- package/dist/Icons/EraserIcon.js +41 -25
- package/dist/Icons/ErrorIcon.js +27 -11
- package/dist/Icons/EyeClosedIcon.js +29 -13
- package/dist/Icons/EyeClosedIcon2.js +27 -11
- package/dist/Icons/EyeOpenIcon.js +22 -9
- package/dist/Icons/FileDownloadIcon.js +43 -20
- package/dist/Icons/GoToFirstIcon.js +26 -9
- package/dist/Icons/GoToLastIcon.js +26 -9
- package/dist/Icons/HarmonicCursorsIcon.js +23 -9
- package/dist/Icons/IconBase.d.ts +3 -3
- package/dist/Icons/IconBase.js +49 -66
- package/dist/Icons/InfoIcon.js +36 -10
- package/dist/Icons/KeyboardIcon.js +26 -27
- package/dist/Icons/LabelIcon.js +19 -14
- package/dist/Icons/LassoIcon.js +36 -28
- package/dist/Icons/LineToolIcon.js +48 -39
- package/dist/Icons/LiveViewIcon.js +50 -12
- package/dist/Icons/LoaderIcon.js +67 -27
- package/dist/Icons/LocationIcon.js +26 -27
- package/dist/Icons/LogoutIcon.js +20 -15
- package/dist/Icons/MeasureIcon.js +78 -25
- package/dist/Icons/MessagesIcon.js +33 -18
- package/dist/Icons/MetadataIcon.js +20 -15
- package/dist/Icons/MinusIcon.d.ts +1 -1
- package/dist/Icons/MinusIcon.js +18 -6
- package/dist/Icons/OntologyIcon.js +87 -71
- package/dist/Icons/PanelIconClose.js +28 -10
- package/dist/Icons/PanelIconOpen.js +28 -10
- package/dist/Icons/PlayIcon.js +20 -6
- package/dist/Icons/PlusIcon.js +20 -14
- package/dist/Icons/PolygonIcon.js +50 -39
- package/dist/Icons/ProgressCheckIcon.d.ts +5 -0
- package/dist/Icons/ProgressCheckIcon.js +58 -0
- package/dist/Icons/ResetIcon.js +17 -12
- package/dist/Icons/ReviewedIcon.js +36 -19
- package/dist/Icons/ScissorsIcon.js +22 -17
- package/dist/Icons/SearchIcon.js +26 -9
- package/dist/Icons/SettingsIcon.js +26 -27
- package/dist/Icons/SortAscendingIcon.js +50 -12
- package/dist/Icons/SortAtoZIcon.js +50 -12
- package/dist/Icons/SortDescendingIcon.js +50 -12
- package/dist/Icons/SortZtoAIcon.js +50 -12
- package/dist/Icons/StackIcon.js +26 -9
- package/dist/Icons/StarIcon.js +20 -6
- package/dist/Icons/TrashIcon.js +17 -12
- package/dist/Icons/UndoIcon.js +20 -15
- package/dist/Icons/User2Icon.js +26 -10
- package/dist/Icons/UserIcon.js +19 -14
- package/dist/Icons/WarningIcon.js +19 -14
- package/dist/Icons/ZoomAllIcon.js +71 -15
- package/dist/Icons/ZoomXIcon.js +36 -10
- package/dist/Icons/ZoomYIcon.js +36 -10
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons.js +68 -136
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +66 -36
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +66 -36
- package/dist/IconsAnimated.js +3 -6
- package/dist/Input/InputUtils.js +51 -52
- package/dist/Input.js +132 -185
- package/dist/InputOTP-XUWW9xcI.js +461 -0
- package/dist/InputOTP.js +2 -382
- package/dist/Kbd.d.ts +1 -1
- package/dist/Kbd.js +182 -86
- package/dist/Label.js +12 -14
- package/dist/MultiSelect/MultiSelectBase.js +331 -403
- package/dist/MultiSelect.d.ts +1 -1
- package/dist/MultiSelect.js +23 -23
- package/dist/Popover.js +28 -32
- package/dist/RadioButton.d.ts +17 -0
- package/dist/RadioButton.js +33 -0
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +3 -1
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +49 -46
- package/dist/RadioButtonGroup.d.ts +1 -1
- package/dist/RadioButtonGroup.js +11 -8
- package/dist/RadioGroup-w_q6RGEK.js +447 -0
- package/dist/RadioGroup.js +2 -505
- package/dist/Select.js +163 -186
- package/dist/Separator.js +16 -19
- package/dist/Skeleton.js +10 -6
- package/dist/Slider-BzzZT3Zm.js +490 -0
- package/dist/Slider.js +2 -562
- package/dist/SpectralProvider.js +8 -5
- package/dist/Switch/SwitchBase.js +91 -95
- package/dist/Switch-CVzRJ-0n.js +126 -0
- package/dist/Switch.d.ts +1 -1
- package/dist/Switch.js +2 -134
- package/dist/Tabs/TabsBase.js +242 -250
- package/dist/Tabs/tabsUtils.js +65 -73
- package/dist/Tabs.d.ts +1 -1
- package/dist/Tabs.js +73 -103
- package/dist/Textarea/TextareaUtils.js +35 -46
- package/dist/Textarea.js +83 -160
- package/dist/Toast-9zqXxKKO.js +711 -0
- package/dist/Toast.js +2 -885
- package/dist/Toggle/ToggleBase.js +46 -56
- package/dist/Toggle.d.ts +1 -1
- package/dist/Toggle.js +52 -62
- package/dist/ToggleGroup/ToggleGroupBase.js +128 -104
- package/dist/ToggleGroup.d.ts +1 -1
- package/dist/ToggleGroup.js +52 -63
- package/dist/Tooltip-D1K8kY1y.js +389 -0
- package/dist/Tooltip.js +2 -365
- package/dist/Tray.js +174 -217
- package/dist/chunk-h9knIhTc.js +20 -0
- package/dist/clsx-jM1GlMvB.js +16 -0
- package/dist/dist-3Af8168y.js +913 -0
- package/dist/dist-7HRQ5IKN.js +249 -0
- package/dist/dist-B2k1iWFp.js +129 -0
- package/dist/dist-B4FgboI8.js +122 -0
- package/dist/dist-B4g6zpUF.js +33 -0
- package/dist/dist-B9tup-4O.js +216 -0
- package/dist/dist-BK1K0g9W.js +29 -0
- package/dist/dist-Bfjk-jx9.js +28 -0
- package/dist/dist-Bft31cJh.js +65 -0
- package/dist/dist-BtdmHAzK.js +190 -0
- package/dist/dist-C0Hifjgh.js +1287 -0
- package/dist/dist-CGzgmYB9.js +68 -0
- package/dist/dist-ClmepHp4.js +10 -0
- package/dist/dist-D8Wb_MX9.js +6 -0
- package/dist/dist-Dtvmk11N.js +12 -0
- package/dist/dist-fW81qjVl.js +677 -0
- package/dist/dist-s1uWaZYZ.js +11 -0
- package/dist/es2015-YHaMV-St.js +701 -0
- package/dist/hooks/useAccordionAutoScroll.js +66 -67
- package/dist/hooks/useControllableState.js +14 -13
- package/dist/hooks/useTheme.js +21 -17
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/main.js +18954 -27224
- package/dist/primitives/button.js +39 -41
- package/dist/primitives/input-group.js +57 -73
- package/dist/primitives/input.js +11 -20
- package/dist/primitives/popover.js +34 -28
- package/dist/primitives/select.js +70 -138
- package/dist/primitives/slot.js +32 -31
- package/dist/primitives/textarea.js +10 -16
- package/dist/proxy-Dn10Pl_g.js +4920 -0
- package/dist/styles/main.css +2 -1
- package/dist/styles/spectral.css +1 -1
- package/dist/twUtils-VNWgstKL.js +1673 -0
- package/dist/use-animation-CBUDycyW.js +57 -0
- package/dist/utils/constants.js +4 -4
- package/dist/utils/formFieldUtils.js +136 -148
- package/dist/utils/sharedUtils.js +26 -7
- package/dist/utils/twUtils.js +2 -2919
- package/package.json +24 -28
- package/dist/ComboboxBase-CxNxYtdT.js +0 -408
- package/dist/clsx-OuTLNxxd.js +0 -16
- package/dist/index-0ioNhtNM.js +0 -10
- package/dist/index-6oYKCvIn.js +0 -677
- package/dist/index-BFOf48AQ.js +0 -69
- package/dist/index-BZPx6jYI.js +0 -8
- package/dist/index-BlHU_t18.js +0 -142
- package/dist/index-Bm1RbF6w.js +0 -1037
- package/dist/index-Bv2OIg5P.js +0 -225
- package/dist/index-CKEI0pDv.js +0 -56
- package/dist/index-CM_hWgfC.js +0 -32
- package/dist/index-C_YVr64u.js +0 -1538
- package/dist/index-Cl8VeY0o.js +0 -149
- package/dist/index-CwSyIPrv.js +0 -13
- package/dist/index-D29mdTf5.js +0 -34
- package/dist/index-DEYs15GP.js +0 -66
- package/dist/index-Dc0No4pV.js +0 -233
- package/dist/index-T6XEa11q.js +0 -822
- package/dist/index-pBCLb6Gr.js +0 -240
- package/dist/index-psiVrsnE.js +0 -27
- package/dist/index-rKs9bXHr.js +0 -6
- package/dist/proxy-CO_-Vget.js +0 -4975
- package/dist/use-animation-DhEPRwZ3.js +0 -62
package/dist/Alert/AlertBase.js
CHANGED
|
@@ -1,156 +1,73 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../styles/main.css";
|
|
3
|
-
import {
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
import "../Icons/LoaderIcon.js";
|
|
41
|
-
import "../Icons/LocationIcon.js";
|
|
42
|
-
import "../Icons/LogoutIcon.js";
|
|
43
|
-
import "../Icons/MeasureIcon.js";
|
|
44
|
-
import "../Icons/MessagesIcon.js";
|
|
45
|
-
import "../Icons/MetadataIcon.js";
|
|
46
|
-
import "../Icons/MinusIcon.js";
|
|
47
|
-
import "../Icons/OntologyIcon.js";
|
|
48
|
-
import "../Icons/PanelIconClose.js";
|
|
49
|
-
import "../Icons/PanelIconOpen.js";
|
|
50
|
-
import "../Icons/PlayIcon.js";
|
|
51
|
-
import "../Icons/PlusIcon.js";
|
|
52
|
-
import "../Icons/PolygonIcon.js";
|
|
53
|
-
import "../Icons/ResetIcon.js";
|
|
54
|
-
import "../Icons/ReviewedIcon.js";
|
|
55
|
-
import "../Icons/ScissorsIcon.js";
|
|
56
|
-
import "../Icons/SearchIcon.js";
|
|
57
|
-
import "../Icons/SettingsIcon.js";
|
|
58
|
-
import "../Icons/SortAscendingIcon.js";
|
|
59
|
-
import "../Icons/SortAtoZIcon.js";
|
|
60
|
-
import "../Icons/SortDescendingIcon.js";
|
|
61
|
-
import "../Icons/SortZtoAIcon.js";
|
|
62
|
-
import "../Icons/StackIcon.js";
|
|
63
|
-
import "../Icons/StarIcon.js";
|
|
64
|
-
import "../Icons/TrashIcon.js";
|
|
65
|
-
import "../Icons/UndoIcon.js";
|
|
66
|
-
import "../Icons/User2Icon.js";
|
|
67
|
-
import "../Icons/UserIcon.js";
|
|
68
|
-
import "../Icons/WarningIcon.js";
|
|
69
|
-
import "../Icons/ZoomAllIcon.js";
|
|
70
|
-
import "../Icons/ZoomXIcon.js";
|
|
71
|
-
import "../Icons/ZoomYIcon.js";
|
|
72
|
-
import { cn as a } from "../utils/twUtils.js";
|
|
73
|
-
import { c as m } from "../index-D29mdTf5.js";
|
|
74
|
-
import { useState as p, useEffect as n } from "react";
|
|
75
|
-
import { createPortal as d } from "react-dom";
|
|
76
|
-
const c = m(
|
|
77
|
-
`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
|
|
78
|
-
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`,
|
|
79
|
-
{
|
|
80
|
-
variants: {
|
|
81
|
-
variant: {
|
|
82
|
-
default: "bg-alert-bg border-alert-border",
|
|
83
|
-
success: "bg-alert-success-bg border-alert-success-border",
|
|
84
|
-
warning: "bg-alert-warning-bg border-alert-warning-border",
|
|
85
|
-
danger: "bg-alert-danger-bg border-alert-danger-border",
|
|
86
|
-
info: "bg-alert-info-bg border-alert-info-border"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
defaultVariants: {
|
|
90
|
-
variant: "default"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
), l = {
|
|
94
|
-
success: "text-alert-success-text [&_p]:text-alert-success-text",
|
|
95
|
-
warning: "text-alert-warning-text [&_p]:text-alert-warning-text",
|
|
96
|
-
danger: "text-alert-danger-text [&_p]:text-alert-danger-text",
|
|
97
|
-
info: "text-alert-info-text [&_p]:text-alert-info-text",
|
|
98
|
-
default: "text-alert-text [&_p]:text-alert-text"
|
|
99
|
-
}, f = ({
|
|
100
|
-
ref: t,
|
|
101
|
-
className: r,
|
|
102
|
-
variant: e,
|
|
103
|
-
...o
|
|
104
|
-
}) => /* @__PURE__ */ i("div", { className: a(c({ variant: e }), r), "data-slot": "alert", "data-testid": "spectral-alert", ref: t, role: "alert", ...o });
|
|
105
|
-
f.displayName = "AlertBase";
|
|
106
|
-
const u = ({
|
|
107
|
-
className: t,
|
|
108
|
-
ref: r,
|
|
109
|
-
...e
|
|
110
|
-
}) => /* @__PURE__ */ i("div", { className: a("flex items-center gap-2 [&>svg]:size-6 [&>svg]:shrink-0", t), "data-slot": "alert-header", ref: r, ...e });
|
|
3
|
+
import { CloseIcon as e } from "../Icons/CloseIcon.js";
|
|
4
|
+
import { t } from "../twUtils-VNWgstKL.js";
|
|
5
|
+
import { t as n } from "../dist-B4g6zpUF.js";
|
|
6
|
+
import { useEffect as r, useState as i } from "react";
|
|
7
|
+
import { createPortal as a } from "react-dom";
|
|
8
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/Alert/AlertBase.tsx
|
|
10
|
+
var s = n("top-2 max-w-md rounded-md px-4 py-3 text-sm gap-y-1 translate-y-0 fixed left-1/2 z-50 flex w-full -translate-x-1/2 scale-100 transform flex-col border opacity-100 transition-all duration-300 ease-in-out motion-safe:duration-300 motion-safe:animate-in motion-safe:fade-in motion-safe:slide-in-from-top-full", {
|
|
11
|
+
variants: { variant: {
|
|
12
|
+
default: "border-alert-border bg-alert-bg",
|
|
13
|
+
success: "border-alert-success-border bg-alert-success-bg",
|
|
14
|
+
warning: "border-alert-warning-border bg-alert-warning-bg",
|
|
15
|
+
danger: "border-alert-danger-border bg-alert-danger-bg",
|
|
16
|
+
info: "border-alert-info-border bg-alert-info-bg"
|
|
17
|
+
} },
|
|
18
|
+
defaultVariants: { variant: "default" }
|
|
19
|
+
}), c = {
|
|
20
|
+
success: "text-alert-success-text [&_p]:text-alert-success-text",
|
|
21
|
+
warning: "text-alert-warning-text [&_p]:text-alert-warning-text",
|
|
22
|
+
danger: "text-alert-danger-text [&_p]:text-alert-danger-text",
|
|
23
|
+
info: "text-alert-info-text [&_p]:text-alert-info-text",
|
|
24
|
+
default: "text-alert-text [&_p]:text-alert-text"
|
|
25
|
+
}, l = ({ ref: e, className: n, variant: r, ...i }) => /* @__PURE__ */ o("div", {
|
|
26
|
+
className: t(s({ variant: r }), n),
|
|
27
|
+
"data-slot": "alert",
|
|
28
|
+
"data-testid": "spectral-alert",
|
|
29
|
+
ref: e,
|
|
30
|
+
role: "alert",
|
|
31
|
+
...i
|
|
32
|
+
});
|
|
33
|
+
l.displayName = "AlertBase";
|
|
34
|
+
var u = ({ className: e, ref: n, ...r }) => /* @__PURE__ */ o("div", {
|
|
35
|
+
className: t("gap-2 [&>svg]:size-6 flex items-center [&>svg]:shrink-0", e),
|
|
36
|
+
"data-slot": "alert-header",
|
|
37
|
+
ref: n,
|
|
38
|
+
...r
|
|
39
|
+
});
|
|
111
40
|
u.displayName = "AlertHeader";
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
);
|
|
144
|
-
b.displayName = "AlertCloseButton";
|
|
145
|
-
const Mt = ({ children: t, container: r }) => {
|
|
146
|
-
const [e, o] = p(!1);
|
|
147
|
-
return n(() => (o(!0), () => o(!1)), []), e ? d(t, r ?? document.body) : null;
|
|
148
|
-
};
|
|
149
|
-
export {
|
|
150
|
-
f as AlertBase,
|
|
151
|
-
b as AlertCloseButton,
|
|
152
|
-
g as AlertDescription,
|
|
153
|
-
u as AlertHeader,
|
|
154
|
-
Mt as AlertPortal,
|
|
155
|
-
x as AlertTitle
|
|
41
|
+
var d = ({ className: e, ref: n, variant: r, ...i }) => /* @__PURE__ */ o("div", {
|
|
42
|
+
className: t(c[r], "font-semibold text-base tracking-tight line-clamp-1 flex-1", e),
|
|
43
|
+
"data-slot": "alert-title",
|
|
44
|
+
"data-testid": "spectral-alert-title",
|
|
45
|
+
ref: n,
|
|
46
|
+
...i
|
|
47
|
+
});
|
|
48
|
+
d.displayName = "AlertTitle";
|
|
49
|
+
var f = ({ className: e, ref: n, variant: r, ...i }) => /* @__PURE__ */ o("div", {
|
|
50
|
+
className: t(c[r], "gap-1 text-sm [&_p]:leading-relaxed grid justify-items-start", e),
|
|
51
|
+
"data-slot": "alert-description",
|
|
52
|
+
"data-testid": "spectral-alert-description",
|
|
53
|
+
ref: n,
|
|
54
|
+
...i
|
|
55
|
+
});
|
|
56
|
+
f.displayName = "AlertDescription";
|
|
57
|
+
var p = ({ className: n, ref: r, variant: i, ...a }) => /* @__PURE__ */ o(e, {
|
|
58
|
+
"aria-label": "Close alert",
|
|
59
|
+
className: t(c[i], "rounded shrink-0 cursor-pointer outline-transparent focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-text-secondary", n),
|
|
60
|
+
"data-slot": "close-icon",
|
|
61
|
+
"data-testid": "spectral-alert-close-button",
|
|
62
|
+
ref: r,
|
|
63
|
+
size: 20,
|
|
64
|
+
tabIndex: 0,
|
|
65
|
+
...a
|
|
66
|
+
});
|
|
67
|
+
p.displayName = "AlertCloseButton";
|
|
68
|
+
var m = ({ children: e, container: t }) => {
|
|
69
|
+
let [n, o] = i(!1);
|
|
70
|
+
return r(() => (o(!0), () => o(!1)), []), n ? a(e, t ?? document.body) : null;
|
|
156
71
|
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { l as AlertBase, p as AlertCloseButton, f as AlertDescription, u as AlertHeader, m as AlertPortal, d as AlertTitle };
|
package/dist/Alert.js
CHANGED
|
@@ -1,109 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./Icons/
|
|
6
|
-
import "./Icons/
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
import "./Icons/SortAscendingIcon.js";
|
|
60
|
-
import "./Icons/SortAtoZIcon.js";
|
|
61
|
-
import "./Icons/SortDescendingIcon.js";
|
|
62
|
-
import "./Icons/SortZtoAIcon.js";
|
|
63
|
-
import "./Icons/StackIcon.js";
|
|
64
|
-
import "./Icons/StarIcon.js";
|
|
65
|
-
import "./Icons/TrashIcon.js";
|
|
66
|
-
import "./Icons/UndoIcon.js";
|
|
67
|
-
import "./Icons/User2Icon.js";
|
|
68
|
-
import "./Icons/UserIcon.js";
|
|
69
|
-
import { WarningIcon as R } from "./Icons/WarningIcon.js";
|
|
70
|
-
import "./Icons/ZoomAllIcon.js";
|
|
71
|
-
import "./Icons/ZoomXIcon.js";
|
|
72
|
-
import "./Icons/ZoomYIcon.js";
|
|
73
|
-
import { cn as T } from "./utils/twUtils.js";
|
|
74
|
-
import { useRef as v, useCallback as s, useEffect as S } from "react";
|
|
75
|
-
const Xt = ({ className: c, description: e, icon: d, id: u, onClose: m, title: f, variant: r = "default" }) => {
|
|
76
|
-
const o = v(null), p = d ?? {
|
|
77
|
-
info: /* @__PURE__ */ t(C, { className: "text-alert-info-text" }),
|
|
78
|
-
success: /* @__PURE__ */ t(E, { className: "text-alert-success-text" }),
|
|
79
|
-
warning: /* @__PURE__ */ t(R, { className: "text-alert-warning-text" }),
|
|
80
|
-
danger: /* @__PURE__ */ t(k, { className: "text-alert-danger-text" }),
|
|
81
|
-
default: null
|
|
82
|
-
}[r], i = s(() => {
|
|
83
|
-
o.current && (o.current.style.opacity = "0", setTimeout(() => {
|
|
84
|
-
o.current && (o.current.style.display = "none"), m?.();
|
|
85
|
-
}, 300));
|
|
86
|
-
}, [m]);
|
|
87
|
-
S(() => {
|
|
88
|
-
const n = (a) => {
|
|
89
|
-
a.key === "Escape" && o.current && (a.preventDefault(), i());
|
|
90
|
-
};
|
|
91
|
-
return document.addEventListener("keydown", n), () => {
|
|
92
|
-
document.removeEventListener("keydown", n);
|
|
93
|
-
};
|
|
94
|
-
}, [i]);
|
|
95
|
-
const A = s(() => {
|
|
96
|
-
i();
|
|
97
|
-
}, [i]), x = (/* @__PURE__ */ new Set(["danger", "warning"])).has(r) ? "assertive" : "polite";
|
|
98
|
-
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: [
|
|
99
|
-
/* @__PURE__ */ l(N, { children: [
|
|
100
|
-
p,
|
|
101
|
-
/* @__PURE__ */ t(h, { variant: r, children: f }),
|
|
102
|
-
/* @__PURE__ */ t(w, { onClick: A, variant: r })
|
|
103
|
-
] }),
|
|
104
|
-
e && /* @__PURE__ */ t(g, { className: p ? "ml-8" : void 0, variant: r, children: e })
|
|
105
|
-
] }) });
|
|
106
|
-
};
|
|
107
|
-
export {
|
|
108
|
-
Xt as Alert
|
|
3
|
+
import { CheckSquareIcon as e } from "./Icons/CheckSquareIcon.js";
|
|
4
|
+
import { CloseCircleIcon as t } from "./Icons/CloseCircleIcon.js";
|
|
5
|
+
import { InfoIcon as n } from "./Icons/InfoIcon.js";
|
|
6
|
+
import { WarningIcon as r } from "./Icons/WarningIcon.js";
|
|
7
|
+
import { t as i } from "./twUtils-VNWgstKL.js";
|
|
8
|
+
import { AlertBase as a, AlertCloseButton as o, AlertDescription as s, AlertHeader as c, AlertPortal as l, AlertTitle as u } from "./Alert/AlertBase.js";
|
|
9
|
+
import { useCallback as d, useEffect as f, useRef as p } from "react";
|
|
10
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/Alert/Alert.tsx
|
|
12
|
+
var g = ({ className: g, description: _, icon: v, id: y, onClose: b, title: x, variant: S = "default" }) => {
|
|
13
|
+
let C = p(null), w = v ?? {
|
|
14
|
+
info: /* @__PURE__ */ m(n, { className: "text-alert-info-text" }),
|
|
15
|
+
success: /* @__PURE__ */ m(e, { className: "text-alert-success-text" }),
|
|
16
|
+
warning: /* @__PURE__ */ m(r, { className: "text-alert-warning-text" }),
|
|
17
|
+
danger: /* @__PURE__ */ m(t, { className: "text-alert-danger-text" }),
|
|
18
|
+
default: null
|
|
19
|
+
}[S], T = d(() => {
|
|
20
|
+
C.current && (C.current.style.opacity = "0", setTimeout(() => {
|
|
21
|
+
C.current && (C.current.style.display = "none"), b?.();
|
|
22
|
+
}, 300));
|
|
23
|
+
}, [b]);
|
|
24
|
+
f(() => {
|
|
25
|
+
let e = (e) => {
|
|
26
|
+
e.key === "Escape" && C.current && (e.preventDefault(), T());
|
|
27
|
+
};
|
|
28
|
+
return document.addEventListener("keydown", e), () => {
|
|
29
|
+
document.removeEventListener("keydown", e);
|
|
30
|
+
};
|
|
31
|
+
}, [T]);
|
|
32
|
+
let E = d(() => {
|
|
33
|
+
T();
|
|
34
|
+
}, [T]), D = new Set(["danger", "warning"]).has(S) ? "assertive" : "polite";
|
|
35
|
+
return /* @__PURE__ */ m(l, { children: /* @__PURE__ */ h(a, {
|
|
36
|
+
"aria-live": D,
|
|
37
|
+
className: i("alert-wrapper transition-opacity duration-300", g),
|
|
38
|
+
"data-slot": "alert",
|
|
39
|
+
"data-variant": S,
|
|
40
|
+
id: y,
|
|
41
|
+
ref: C,
|
|
42
|
+
variant: S,
|
|
43
|
+
children: [/* @__PURE__ */ h(c, { children: [
|
|
44
|
+
w,
|
|
45
|
+
/* @__PURE__ */ m(u, {
|
|
46
|
+
variant: S,
|
|
47
|
+
children: x
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ m(o, {
|
|
50
|
+
onClick: E,
|
|
51
|
+
variant: S
|
|
52
|
+
})
|
|
53
|
+
] }), _ && /* @__PURE__ */ m(s, {
|
|
54
|
+
className: w ? "ml-8" : void 0,
|
|
55
|
+
variant: S,
|
|
56
|
+
children: _
|
|
57
|
+
})]
|
|
58
|
+
}) });
|
|
109
59
|
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { g as Alert };
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import "./styles/main.css";
|
|
2
|
+
import { f as e, h as t, m as n, n as r, p as i, r as a, s as o } from "./proxy-Dn10Pl_g.js";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { Children as c, isValidElement as l, useContext as u, useId as d, useInsertionEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
5
|
+
import { Fragment as g, jsx as _ } from "react/jsx-runtime";
|
|
6
|
+
//#region node_modules/.pnpm/framer-motion@12.38.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs
|
|
7
|
+
function v(e, t) {
|
|
8
|
+
if (typeof e == "function") return e(t);
|
|
9
|
+
e != null && (e.current = t);
|
|
10
|
+
}
|
|
11
|
+
function y(...e) {
|
|
12
|
+
return (t) => {
|
|
13
|
+
let n = !1, r = e.map((e) => {
|
|
14
|
+
let r = v(e, t);
|
|
15
|
+
return !n && typeof r == "function" && (n = !0), r;
|
|
16
|
+
});
|
|
17
|
+
if (n) return () => {
|
|
18
|
+
for (let t = 0; t < r.length; t++) {
|
|
19
|
+
let n = r[t];
|
|
20
|
+
typeof n == "function" ? n() : v(e[t], null);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function b(...e) {
|
|
26
|
+
return s.useCallback(y(...e), e);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region node_modules/.pnpm/framer-motion@12.38.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
|
|
30
|
+
var x = class extends s.Component {
|
|
31
|
+
getSnapshotBeforeUpdate(e) {
|
|
32
|
+
let t = this.props.childRef.current;
|
|
33
|
+
if (o(t) && e.isPresent && !this.props.isPresent && this.props.pop !== !1) {
|
|
34
|
+
let e = t.offsetParent, n = o(e) && e.offsetWidth || 0, r = o(e) && e.offsetHeight || 0, i = getComputedStyle(t), a = this.props.sizeRef.current;
|
|
35
|
+
a.height = parseFloat(i.height), a.width = parseFloat(i.width), a.top = t.offsetTop, a.left = t.offsetLeft, a.right = n - a.width - a.left, a.bottom = r - a.height - a.top;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
componentDidUpdate() {}
|
|
40
|
+
render() {
|
|
41
|
+
return this.props.children;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
function S({ children: e, isPresent: t, anchorX: n, anchorY: r, root: i, pop: o }) {
|
|
45
|
+
let c = d(), l = m(null), p = m({
|
|
46
|
+
width: 0,
|
|
47
|
+
height: 0,
|
|
48
|
+
top: 0,
|
|
49
|
+
left: 0,
|
|
50
|
+
right: 0,
|
|
51
|
+
bottom: 0
|
|
52
|
+
}), { nonce: h } = u(a), g = b(l, e.props?.ref ?? e?.ref);
|
|
53
|
+
return f(() => {
|
|
54
|
+
let { width: e, height: a, top: s, left: u, right: d, bottom: f } = p.current;
|
|
55
|
+
if (t || o === !1 || !l.current || !e || !a) return;
|
|
56
|
+
let m = n === "left" ? `left: ${u}` : `right: ${d}`, g = r === "bottom" ? `bottom: ${f}` : `top: ${s}`;
|
|
57
|
+
l.current.dataset.motionPopId = c;
|
|
58
|
+
let _ = document.createElement("style");
|
|
59
|
+
h && (_.nonce = h);
|
|
60
|
+
let v = i ?? document.head;
|
|
61
|
+
return v.appendChild(_), _.sheet && _.sheet.insertRule(`
|
|
62
|
+
[data-motion-pop-id="${c}"] {
|
|
63
|
+
position: absolute !important;
|
|
64
|
+
width: ${e}px !important;
|
|
65
|
+
height: ${a}px !important;
|
|
66
|
+
${m}px !important;
|
|
67
|
+
${g}px !important;
|
|
68
|
+
}
|
|
69
|
+
`), () => {
|
|
70
|
+
l.current?.removeAttribute("data-motion-pop-id"), v.contains(_) && v.removeChild(_);
|
|
71
|
+
};
|
|
72
|
+
}, [t]), _(x, {
|
|
73
|
+
isPresent: t,
|
|
74
|
+
childRef: l,
|
|
75
|
+
sizeRef: p,
|
|
76
|
+
pop: o,
|
|
77
|
+
children: o === !1 ? e : s.cloneElement(e, { ref: g })
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region node_modules/.pnpm/framer-motion@12.38.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
|
|
82
|
+
var C = ({ children: t, initial: r, isPresent: i, onExitComplete: a, custom: o, presenceAffectsLayout: c, mode: l, anchorX: u, anchorY: f, root: m }) => {
|
|
83
|
+
let h = n(w), g = d(), v = !0, y = p(() => (v = !1, {
|
|
84
|
+
id: g,
|
|
85
|
+
initial: r,
|
|
86
|
+
isPresent: i,
|
|
87
|
+
custom: o,
|
|
88
|
+
onExitComplete: (e) => {
|
|
89
|
+
h.set(e, !0);
|
|
90
|
+
for (let e of h.values()) if (!e) return;
|
|
91
|
+
a && a();
|
|
92
|
+
},
|
|
93
|
+
register: (e) => (h.set(e, !1), () => h.delete(e))
|
|
94
|
+
}), [
|
|
95
|
+
i,
|
|
96
|
+
h,
|
|
97
|
+
a
|
|
98
|
+
]);
|
|
99
|
+
return c && v && (y = { ...y }), p(() => {
|
|
100
|
+
h.forEach((e, t) => h.set(t, !1));
|
|
101
|
+
}, [i]), s.useEffect(() => {
|
|
102
|
+
!i && !h.size && a && a();
|
|
103
|
+
}, [i]), t = _(S, {
|
|
104
|
+
pop: l === "popLayout",
|
|
105
|
+
isPresent: i,
|
|
106
|
+
anchorX: u,
|
|
107
|
+
anchorY: f,
|
|
108
|
+
root: m,
|
|
109
|
+
children: t
|
|
110
|
+
}), _(e.Provider, {
|
|
111
|
+
value: y,
|
|
112
|
+
children: t
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
function w() {
|
|
116
|
+
return /* @__PURE__ */ new Map();
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region node_modules/.pnpm/framer-motion@12.38.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs
|
|
120
|
+
var T = (e) => e.key || "";
|
|
121
|
+
function E(e) {
|
|
122
|
+
let t = [];
|
|
123
|
+
return c.forEach(e, (e) => {
|
|
124
|
+
l(e) && t.push(e);
|
|
125
|
+
}), t;
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region node_modules/.pnpm/framer-motion@12.38.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
|
|
129
|
+
var D = ({ children: e, custom: a, initial: o = !0, onExitComplete: s, presenceAffectsLayout: c = !0, mode: l = "sync", propagate: d = !1, anchorX: f = "left", anchorY: v = "top", root: y }) => {
|
|
130
|
+
let [b, x] = r(d), S = p(() => E(e), [e]), w = d && !b ? [] : S.map(T), D = m(!0), O = m(S), k = n(() => /* @__PURE__ */ new Map()), A = m(/* @__PURE__ */ new Set()), [j, M] = h(S), [N, P] = h(S);
|
|
131
|
+
i(() => {
|
|
132
|
+
D.current = !1, O.current = S;
|
|
133
|
+
for (let e = 0; e < N.length; e++) {
|
|
134
|
+
let t = T(N[e]);
|
|
135
|
+
w.includes(t) ? (k.delete(t), A.current.delete(t)) : k.get(t) !== !0 && k.set(t, !1);
|
|
136
|
+
}
|
|
137
|
+
}, [
|
|
138
|
+
N,
|
|
139
|
+
w.length,
|
|
140
|
+
w.join("-")
|
|
141
|
+
]);
|
|
142
|
+
let F = [];
|
|
143
|
+
if (S !== j) {
|
|
144
|
+
let e = [...S];
|
|
145
|
+
for (let t = 0; t < N.length; t++) {
|
|
146
|
+
let n = N[t], r = T(n);
|
|
147
|
+
w.includes(r) || (e.splice(t, 0, n), F.push(n));
|
|
148
|
+
}
|
|
149
|
+
return l === "wait" && F.length && (e = F), P(E(e)), M(S), null;
|
|
150
|
+
}
|
|
151
|
+
process.env.NODE_ENV !== "production" && l === "wait" && N.length > 1 && console.warn("You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.");
|
|
152
|
+
let { forceRender: I } = u(t);
|
|
153
|
+
return _(g, { children: N.map((e) => {
|
|
154
|
+
let t = T(e), n = d && !b ? !1 : S === N || w.includes(t);
|
|
155
|
+
return _(C, {
|
|
156
|
+
isPresent: n,
|
|
157
|
+
initial: !D.current || o ? void 0 : !1,
|
|
158
|
+
custom: a,
|
|
159
|
+
presenceAffectsLayout: c,
|
|
160
|
+
mode: l,
|
|
161
|
+
root: y,
|
|
162
|
+
onExitComplete: n ? void 0 : () => {
|
|
163
|
+
if (A.current.has(t)) return;
|
|
164
|
+
if (k.has(t)) A.current.add(t), k.set(t, !0);
|
|
165
|
+
else return;
|
|
166
|
+
let e = !0;
|
|
167
|
+
k.forEach((t) => {
|
|
168
|
+
t || (e = !1);
|
|
169
|
+
}), e && (I?.(), P(O.current), d && x?.(), s && s());
|
|
170
|
+
},
|
|
171
|
+
anchorX: f,
|
|
172
|
+
anchorY: v,
|
|
173
|
+
children: e
|
|
174
|
+
}, t);
|
|
175
|
+
}) });
|
|
176
|
+
};
|
|
177
|
+
//#endregion
|
|
178
|
+
export { D as t };
|
package/dist/App.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
|
-
import { jsx as
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/App.tsx
|
|
4
|
+
function t() {
|
|
5
|
+
return /* @__PURE__ */ e("div", { children: "spectral | spear.ai" });
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as default };
|