@spear-ai/spectral 1.9.1 → 1.10.1

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.
Files changed (241) hide show
  1. package/README.md +6 -5
  2. package/dist/.js +113 -239
  3. package/dist/Accordion-CDXdSAST.js +363 -0
  4. package/dist/Accordion.js +3 -498
  5. package/dist/Alert/AlertBase.js +69 -152
  6. package/dist/Alert.js +58 -106
  7. package/dist/AnimatePresence-D-9jXfgI.js +178 -0
  8. package/dist/App.js +6 -6
  9. package/dist/Avatar.js +83 -65
  10. package/dist/Badge.d.ts +1 -3
  11. package/dist/Badge.js +21 -25
  12. package/dist/Button.js +102 -178
  13. package/dist/ButtonGroup/ButtonGroupButton.js +38 -40
  14. package/dist/ButtonGroup.js +55 -59
  15. package/dist/ButtonIcon.js +58 -134
  16. package/dist/Calendar-s4lyijkn.js +3109 -0
  17. package/dist/Checkbox/CheckboxBase.js +94 -126
  18. package/dist/Checkbox.d.ts +1 -1
  19. package/dist/Checkbox.js +40 -105
  20. package/dist/Combobox/ComboboxBase.js +2 -79
  21. package/dist/Combobox.js +106 -172
  22. package/dist/ComboboxBase-D8Nf4xC-.js +491 -0
  23. package/dist/ControlGroup/ControlGroupSelect.d.ts +1 -1
  24. package/dist/ControlGroup/ControlGroupSelect.js +85 -101
  25. package/dist/ControlGroup.js +45 -48
  26. package/dist/DataCard/Card.js +37 -12
  27. package/dist/DataCard.d.ts +1 -1
  28. package/dist/DataCard.js +36 -16
  29. package/dist/DateTimePicker/Calendar.js +2 -2967
  30. package/dist/DateTimePicker/DateTimeDisplayInput.d.ts +1 -1
  31. package/dist/DateTimePicker/DateTimeDisplayInput.js +379 -275
  32. package/dist/DateTimePicker/DateTimeInput.d.ts +1 -1
  33. package/dist/DateTimePicker/DateTimeInput.js +133 -141
  34. package/dist/DateTimePicker/DateTimeUtils.js +2 -2193
  35. package/dist/DateTimePicker/TimePeriodSelect.d.ts +1 -1
  36. package/dist/DateTimePicker/TimePeriodSelect.js +45 -20
  37. package/dist/DateTimePicker/TimePicker.d.ts +1 -1
  38. package/dist/DateTimePicker/TimePicker.js +76 -60
  39. package/dist/DateTimePicker.d.ts +2 -2
  40. package/dist/DateTimePicker.js +87 -205
  41. package/dist/DateTimeUtils-DVvG6H-p.js +2098 -0
  42. package/dist/Dialog.js +74 -74
  43. package/dist/Drawer.js +67 -37
  44. package/dist/HoverCard-CYDsIiVK.js +201 -0
  45. package/dist/HoverCard.d.ts +1 -1
  46. package/dist/HoverCard.js +2 -218
  47. package/dist/Icons/AnalyzeIcon.js +50 -57
  48. package/dist/Icons/AnnotationsIcon.js +20 -15
  49. package/dist/Icons/ApprovedIcon.js +26 -18
  50. package/dist/Icons/ArrowDownIcon.js +20 -6
  51. package/dist/Icons/ArrowUpIcon.js +20 -6
  52. package/dist/Icons/BoxToolIcon.js +17 -12
  53. package/dist/Icons/CalendarIcon.js +43 -20
  54. package/dist/Icons/CheckCircleIcon.js +26 -10
  55. package/dist/Icons/CheckSquareIcon.js +26 -10
  56. package/dist/Icons/CheckmarkIcon.js +22 -9
  57. package/dist/Icons/ChevronDownIcon.js +22 -9
  58. package/dist/Icons/ChevronUpIcon.js +22 -9
  59. package/dist/Icons/ClockIcon.js +26 -18
  60. package/dist/Icons/CloseCircleIcon.js +26 -10
  61. package/dist/Icons/CloseIcon.js +18 -9
  62. package/dist/Icons/DashboardIcon.js +36 -10
  63. package/dist/Icons/DatabaseIcon.js +36 -19
  64. package/dist/Icons/DeleteIcon.js +36 -19
  65. package/dist/Icons/DurationIcon.js +57 -22
  66. package/dist/Icons/EditIcon.js +26 -27
  67. package/dist/Icons/EmailIcon.js +26 -10
  68. package/dist/Icons/EraserIcon.js +41 -25
  69. package/dist/Icons/ErrorIcon.js +27 -11
  70. package/dist/Icons/EyeClosedIcon.js +29 -13
  71. package/dist/Icons/EyeClosedIcon2.js +27 -11
  72. package/dist/Icons/EyeOpenIcon.js +22 -9
  73. package/dist/Icons/FileDownloadIcon.js +43 -20
  74. package/dist/Icons/GoToFirstIcon.js +26 -9
  75. package/dist/Icons/GoToLastIcon.js +26 -9
  76. package/dist/Icons/HarmonicCursorsIcon.js +23 -9
  77. package/dist/Icons/IconBase.d.ts +3 -3
  78. package/dist/Icons/IconBase.js +49 -66
  79. package/dist/Icons/InfoIcon.js +36 -10
  80. package/dist/Icons/KeyboardIcon.js +26 -27
  81. package/dist/Icons/LabelIcon.js +19 -14
  82. package/dist/Icons/LassoIcon.js +36 -28
  83. package/dist/Icons/LineToolIcon.js +48 -39
  84. package/dist/Icons/LiveViewIcon.js +50 -12
  85. package/dist/Icons/LoaderIcon.js +67 -27
  86. package/dist/Icons/LocationIcon.js +26 -27
  87. package/dist/Icons/LogoutIcon.js +20 -15
  88. package/dist/Icons/MeasureIcon.js +78 -25
  89. package/dist/Icons/MessagesIcon.js +33 -18
  90. package/dist/Icons/MetadataIcon.js +20 -15
  91. package/dist/Icons/MinusIcon.d.ts +1 -1
  92. package/dist/Icons/MinusIcon.js +18 -6
  93. package/dist/Icons/OntologyIcon.js +87 -71
  94. package/dist/Icons/PanelIconClose.js +28 -10
  95. package/dist/Icons/PanelIconOpen.js +28 -10
  96. package/dist/Icons/PlayIcon.js +20 -6
  97. package/dist/Icons/PlusIcon.js +20 -14
  98. package/dist/Icons/PolygonIcon.js +50 -39
  99. package/dist/Icons/ProgressCheckIcon.d.ts +5 -0
  100. package/dist/Icons/ProgressCheckIcon.js +58 -0
  101. package/dist/Icons/ResetIcon.js +17 -12
  102. package/dist/Icons/ReviewedIcon.js +36 -19
  103. package/dist/Icons/ScissorsIcon.js +22 -17
  104. package/dist/Icons/SearchIcon.js +26 -9
  105. package/dist/Icons/SettingsIcon.js +26 -27
  106. package/dist/Icons/SortAscendingIcon.js +50 -12
  107. package/dist/Icons/SortAtoZIcon.js +50 -12
  108. package/dist/Icons/SortDescendingIcon.js +50 -12
  109. package/dist/Icons/SortZtoAIcon.js +50 -12
  110. package/dist/Icons/StackIcon.js +26 -9
  111. package/dist/Icons/StarIcon.js +20 -6
  112. package/dist/Icons/TrashIcon.js +17 -12
  113. package/dist/Icons/UndoIcon.js +20 -15
  114. package/dist/Icons/User2Icon.js +26 -10
  115. package/dist/Icons/UserIcon.js +19 -14
  116. package/dist/Icons/WarningIcon.js +19 -14
  117. package/dist/Icons/ZoomAllIcon.js +71 -15
  118. package/dist/Icons/ZoomXIcon.js +36 -10
  119. package/dist/Icons/ZoomYIcon.js +36 -10
  120. package/dist/Icons/index.d.ts +1 -0
  121. package/dist/Icons.js +68 -136
  122. package/dist/IconsAnimated/PanelLeftCloseIcon.js +66 -36
  123. package/dist/IconsAnimated/PanelLeftOpenIcon.js +66 -36
  124. package/dist/IconsAnimated.js +3 -6
  125. package/dist/Input/InputUtils.js +51 -52
  126. package/dist/Input.js +132 -185
  127. package/dist/InputNumeric.d.ts +14 -0
  128. package/dist/InputNumeric.js +137 -0
  129. package/dist/InputOTP-cVn5Bzyp.js +461 -0
  130. package/dist/InputOTP.js +2 -382
  131. package/dist/Kbd.d.ts +1 -1
  132. package/dist/Kbd.js +182 -86
  133. package/dist/Label.js +12 -14
  134. package/dist/MultiSelect/MultiSelectBase.js +331 -403
  135. package/dist/MultiSelect.d.ts +1 -1
  136. package/dist/MultiSelect.js +23 -23
  137. package/dist/Popover.js +28 -32
  138. package/dist/RadioButton.d.ts +17 -0
  139. package/dist/RadioButton.js +33 -0
  140. package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +3 -1
  141. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +49 -46
  142. package/dist/RadioButtonGroup.d.ts +1 -1
  143. package/dist/RadioButtonGroup.js +11 -8
  144. package/dist/RadioGroup-w_q6RGEK.js +447 -0
  145. package/dist/RadioGroup.js +2 -505
  146. package/dist/Select.js +163 -186
  147. package/dist/Separator.js +16 -19
  148. package/dist/Skeleton.js +10 -6
  149. package/dist/Slider-BzzZT3Zm.js +490 -0
  150. package/dist/Slider.js +2 -562
  151. package/dist/SpectralProvider.js +8 -5
  152. package/dist/Switch/SwitchBase.js +91 -95
  153. package/dist/Switch-CVzRJ-0n.js +126 -0
  154. package/dist/Switch.d.ts +1 -1
  155. package/dist/Switch.js +2 -134
  156. package/dist/Tabs/TabsBase.js +242 -250
  157. package/dist/Tabs/tabsUtils.js +65 -73
  158. package/dist/Tabs.d.ts +1 -1
  159. package/dist/Tabs.js +73 -103
  160. package/dist/Textarea/TextareaUtils.js +35 -46
  161. package/dist/Textarea.js +83 -160
  162. package/dist/Toast-9zqXxKKO.js +711 -0
  163. package/dist/Toast.js +2 -885
  164. package/dist/Toggle/ToggleBase.js +46 -56
  165. package/dist/Toggle.d.ts +1 -1
  166. package/dist/Toggle.js +52 -62
  167. package/dist/ToggleGroup/ToggleGroupBase.js +128 -104
  168. package/dist/ToggleGroup.d.ts +1 -1
  169. package/dist/ToggleGroup.js +52 -63
  170. package/dist/Tooltip-D1K8kY1y.js +389 -0
  171. package/dist/Tooltip.js +2 -365
  172. package/dist/Tray.js +174 -217
  173. package/dist/chunk-h9knIhTc.js +20 -0
  174. package/dist/clsx-jM1GlMvB.js +16 -0
  175. package/dist/dist-3Af8168y.js +913 -0
  176. package/dist/dist-7HRQ5IKN.js +249 -0
  177. package/dist/dist-B2k1iWFp.js +129 -0
  178. package/dist/dist-B4FgboI8.js +122 -0
  179. package/dist/dist-B4g6zpUF.js +33 -0
  180. package/dist/dist-B9tup-4O.js +216 -0
  181. package/dist/dist-BK1K0g9W.js +29 -0
  182. package/dist/dist-Bfjk-jx9.js +28 -0
  183. package/dist/dist-Bft31cJh.js +65 -0
  184. package/dist/dist-BtdmHAzK.js +190 -0
  185. package/dist/dist-C0Hifjgh.js +1287 -0
  186. package/dist/dist-CGzgmYB9.js +68 -0
  187. package/dist/dist-ClmepHp4.js +10 -0
  188. package/dist/dist-D8Wb_MX9.js +6 -0
  189. package/dist/dist-Dtvmk11N.js +12 -0
  190. package/dist/dist-fW81qjVl.js +677 -0
  191. package/dist/dist-s1uWaZYZ.js +11 -0
  192. package/dist/es2015-YHaMV-St.js +701 -0
  193. package/dist/hooks/useAccordionAutoScroll.js +66 -67
  194. package/dist/hooks/useControllableState.js +14 -13
  195. package/dist/hooks/useConvertToOklch.d.ts +3 -0
  196. package/dist/hooks/useConvertToOklch.d.ts.map +1 -0
  197. package/dist/hooks/useConvertToOklch.js +51 -0
  198. package/dist/hooks/useTheme.js +21 -17
  199. package/dist/index.d.ts +3 -1
  200. package/dist/index.d.ts.map +1 -1
  201. package/dist/main.js +18954 -27224
  202. package/dist/primitives/button.js +39 -41
  203. package/dist/primitives/input-group.js +57 -73
  204. package/dist/primitives/input.js +11 -20
  205. package/dist/primitives/popover.js +34 -28
  206. package/dist/primitives/select.js +70 -138
  207. package/dist/primitives/slot.js +32 -31
  208. package/dist/primitives/textarea.js +10 -16
  209. package/dist/proxy-Dn10Pl_g.js +4920 -0
  210. package/dist/styles/main.css +2 -1
  211. package/dist/styles/spectral.css +1 -1
  212. package/dist/twUtils-VNWgstKL.js +1673 -0
  213. package/dist/use-animation-CBUDycyW.js +57 -0
  214. package/dist/utils/constants.js +4 -4
  215. package/dist/utils/formFieldUtils.js +136 -148
  216. package/dist/utils/sharedUtils.js +26 -7
  217. package/dist/utils/twUtils.js +2 -2919
  218. package/package.json +24 -28
  219. package/dist/ComboboxBase-CxNxYtdT.js +0 -408
  220. package/dist/clsx-OuTLNxxd.js +0 -16
  221. package/dist/index-0ioNhtNM.js +0 -10
  222. package/dist/index-6oYKCvIn.js +0 -677
  223. package/dist/index-BFOf48AQ.js +0 -69
  224. package/dist/index-BZPx6jYI.js +0 -8
  225. package/dist/index-BlHU_t18.js +0 -142
  226. package/dist/index-Bm1RbF6w.js +0 -1037
  227. package/dist/index-Bv2OIg5P.js +0 -225
  228. package/dist/index-CKEI0pDv.js +0 -56
  229. package/dist/index-CM_hWgfC.js +0 -32
  230. package/dist/index-C_YVr64u.js +0 -1538
  231. package/dist/index-Cl8VeY0o.js +0 -149
  232. package/dist/index-CwSyIPrv.js +0 -13
  233. package/dist/index-D29mdTf5.js +0 -34
  234. package/dist/index-DEYs15GP.js +0 -66
  235. package/dist/index-Dc0No4pV.js +0 -233
  236. package/dist/index-T6XEa11q.js +0 -822
  237. package/dist/index-pBCLb6Gr.js +0 -240
  238. package/dist/index-psiVrsnE.js +0 -27
  239. package/dist/index-rKs9bXHr.js +0 -6
  240. package/dist/proxy-CO_-Vget.js +0 -4975
  241. package/dist/use-animation-DhEPRwZ3.js +0 -62
@@ -1,156 +1,73 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
- import { jsx as i } 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/BoxToolIcon.js";
10
- import "../Icons/CalendarIcon.js";
11
- import "../Icons/CheckCircleIcon.js";
12
- import "../Icons/CheckSquareIcon.js";
13
- import "../Icons/CheckmarkIcon.js";
14
- import "../Icons/ChevronDownIcon.js";
15
- import "../Icons/ChevronUpIcon.js";
16
- import "../Icons/ClockIcon.js";
17
- import "../Icons/CloseCircleIcon.js";
18
- import { CloseIcon as s } from "../Icons/CloseIcon.js";
19
- import "../Icons/DashboardIcon.js";
20
- import "../Icons/DatabaseIcon.js";
21
- import "../Icons/DeleteIcon.js";
22
- import "../Icons/DurationIcon.js";
23
- import "../Icons/EditIcon.js";
24
- import "../Icons/EmailIcon.js";
25
- import "../Icons/EraserIcon.js";
26
- import "../Icons/ErrorIcon.js";
27
- import "../Icons/EyeClosedIcon.js";
28
- import "../Icons/EyeClosedIcon2.js";
29
- import "../Icons/EyeOpenIcon.js";
30
- import "../Icons/FileDownloadIcon.js";
31
- import "../Icons/GoToFirstIcon.js";
32
- import "../Icons/GoToLastIcon.js";
33
- import "../Icons/HarmonicCursorsIcon.js";
34
- import "../Icons/InfoIcon.js";
35
- import "../Icons/KeyboardIcon.js";
36
- import "../Icons/LabelIcon.js";
37
- import "../Icons/LassoIcon.js";
38
- import "../Icons/LineToolIcon.js";
39
- import "../Icons/LiveViewIcon.js";
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
- const x = ({
113
- className: t,
114
- ref: r,
115
- variant: e,
116
- ...o
117
- }) => /* @__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 });
118
- x.displayName = "AlertTitle";
119
- const g = ({
120
- className: t,
121
- ref: r,
122
- variant: e,
123
- ...o
124
- }) => /* @__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 });
125
- g.displayName = "AlertDescription";
126
- const b = ({
127
- className: t,
128
- ref: r,
129
- variant: e,
130
- ...o
131
- }) => /* @__PURE__ */ i(
132
- s,
133
- {
134
- "aria-label": "Close alert",
135
- 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),
136
- "data-slot": "close-icon",
137
- "data-testid": "spectral-alert-close-button",
138
- ref: r,
139
- size: 20,
140
- tabIndex: 0,
141
- ...o
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 { 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
- import "./Icons/AnalyzeIcon.js";
6
- import "./Icons/AnnotationsIcon.js";
7
- import "./Icons/ApprovedIcon.js";
8
- import "./Icons/ArrowDownIcon.js";
9
- import "./Icons/ArrowUpIcon.js";
10
- import "./Icons/BoxToolIcon.js";
11
- import "./Icons/CalendarIcon.js";
12
- import "./Icons/CheckCircleIcon.js";
13
- import { CheckSquareIcon as E } from "./Icons/CheckSquareIcon.js";
14
- import "./Icons/CheckmarkIcon.js";
15
- import "./Icons/ChevronDownIcon.js";
16
- import "./Icons/ChevronUpIcon.js";
17
- import "./Icons/ClockIcon.js";
18
- import { CloseCircleIcon as k } from "./Icons/CloseCircleIcon.js";
19
- import "./Icons/CloseIcon.js";
20
- import "./Icons/DashboardIcon.js";
21
- import "./Icons/DatabaseIcon.js";
22
- import "./Icons/DeleteIcon.js";
23
- import "./Icons/DurationIcon.js";
24
- import "./Icons/EditIcon.js";
25
- import "./Icons/EmailIcon.js";
26
- import "./Icons/EraserIcon.js";
27
- import "./Icons/ErrorIcon.js";
28
- import "./Icons/EyeClosedIcon.js";
29
- import "./Icons/EyeClosedIcon2.js";
30
- import "./Icons/EyeOpenIcon.js";
31
- import "./Icons/FileDownloadIcon.js";
32
- import "./Icons/GoToFirstIcon.js";
33
- import "./Icons/GoToLastIcon.js";
34
- import "./Icons/HarmonicCursorsIcon.js";
35
- import { InfoIcon as C } from "./Icons/InfoIcon.js";
36
- import "./Icons/KeyboardIcon.js";
37
- import "./Icons/LabelIcon.js";
38
- import "./Icons/LassoIcon.js";
39
- import "./Icons/LineToolIcon.js";
40
- import "./Icons/LiveViewIcon.js";
41
- import "./Icons/LoaderIcon.js";
42
- import "./Icons/LocationIcon.js";
43
- import "./Icons/LogoutIcon.js";
44
- import "./Icons/MeasureIcon.js";
45
- import "./Icons/MessagesIcon.js";
46
- import "./Icons/MetadataIcon.js";
47
- import "./Icons/MinusIcon.js";
48
- import "./Icons/OntologyIcon.js";
49
- import "./Icons/PanelIconClose.js";
50
- import "./Icons/PanelIconOpen.js";
51
- import "./Icons/PlayIcon.js";
52
- import "./Icons/PlusIcon.js";
53
- import "./Icons/PolygonIcon.js";
54
- import "./Icons/ResetIcon.js";
55
- import "./Icons/ReviewedIcon.js";
56
- import "./Icons/ScissorsIcon.js";
57
- import "./Icons/SearchIcon.js";
58
- import "./Icons/SettingsIcon.js";
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 r } from "react/jsx-runtime";
3
- function p() {
4
- return /* @__PURE__ */ r("div", { children: "spectral | spear.ai" });
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
- export {
7
- p as default
8
- };
7
+ //#endregion
8
+ export { t as default };