@spear-ai/spectral 1.9.0 → 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.
Files changed (237) hide show
  1. package/README.md +6 -5
  2. package/dist/.js +112 -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 -274
  32. package/dist/DateTimePicker/DateTimeInput.d.ts +5 -3
  33. package/dist/DateTimePicker/DateTimeInput.js +133 -88
  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 -23
  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/InputOTP-XUWW9xcI.js +461 -0
  128. package/dist/InputOTP.js +2 -382
  129. package/dist/Kbd.d.ts +1 -1
  130. package/dist/Kbd.js +182 -86
  131. package/dist/Label.js +12 -14
  132. package/dist/MultiSelect/MultiSelectBase.js +331 -403
  133. package/dist/MultiSelect.d.ts +1 -1
  134. package/dist/MultiSelect.js +23 -23
  135. package/dist/Popover.js +28 -32
  136. package/dist/RadioButton.d.ts +17 -0
  137. package/dist/RadioButton.js +33 -0
  138. package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +3 -1
  139. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +49 -46
  140. package/dist/RadioButtonGroup.d.ts +1 -1
  141. package/dist/RadioButtonGroup.js +11 -8
  142. package/dist/RadioGroup-w_q6RGEK.js +447 -0
  143. package/dist/RadioGroup.js +2 -505
  144. package/dist/Select.js +163 -186
  145. package/dist/Separator.js +16 -19
  146. package/dist/Skeleton.js +10 -6
  147. package/dist/Slider-BzzZT3Zm.js +490 -0
  148. package/dist/Slider.js +2 -562
  149. package/dist/SpectralProvider.js +8 -5
  150. package/dist/Switch/SwitchBase.js +91 -95
  151. package/dist/Switch-CVzRJ-0n.js +126 -0
  152. package/dist/Switch.d.ts +1 -1
  153. package/dist/Switch.js +2 -134
  154. package/dist/Tabs/TabsBase.js +242 -250
  155. package/dist/Tabs/tabsUtils.js +65 -73
  156. package/dist/Tabs.d.ts +1 -1
  157. package/dist/Tabs.js +73 -103
  158. package/dist/Textarea/TextareaUtils.js +35 -46
  159. package/dist/Textarea.js +83 -160
  160. package/dist/Toast-9zqXxKKO.js +711 -0
  161. package/dist/Toast.js +2 -885
  162. package/dist/Toggle/ToggleBase.js +46 -56
  163. package/dist/Toggle.d.ts +1 -1
  164. package/dist/Toggle.js +52 -62
  165. package/dist/ToggleGroup/ToggleGroupBase.js +128 -104
  166. package/dist/ToggleGroup.d.ts +1 -1
  167. package/dist/ToggleGroup.js +52 -63
  168. package/dist/Tooltip-D1K8kY1y.js +389 -0
  169. package/dist/Tooltip.js +2 -365
  170. package/dist/Tray.js +174 -217
  171. package/dist/chunk-h9knIhTc.js +20 -0
  172. package/dist/clsx-jM1GlMvB.js +16 -0
  173. package/dist/dist-3Af8168y.js +913 -0
  174. package/dist/dist-7HRQ5IKN.js +249 -0
  175. package/dist/dist-B2k1iWFp.js +129 -0
  176. package/dist/dist-B4FgboI8.js +122 -0
  177. package/dist/dist-B4g6zpUF.js +33 -0
  178. package/dist/dist-B9tup-4O.js +216 -0
  179. package/dist/dist-BK1K0g9W.js +29 -0
  180. package/dist/dist-Bfjk-jx9.js +28 -0
  181. package/dist/dist-Bft31cJh.js +65 -0
  182. package/dist/dist-BtdmHAzK.js +190 -0
  183. package/dist/dist-C0Hifjgh.js +1287 -0
  184. package/dist/dist-CGzgmYB9.js +68 -0
  185. package/dist/dist-ClmepHp4.js +10 -0
  186. package/dist/dist-D8Wb_MX9.js +6 -0
  187. package/dist/dist-Dtvmk11N.js +12 -0
  188. package/dist/dist-fW81qjVl.js +677 -0
  189. package/dist/dist-s1uWaZYZ.js +11 -0
  190. package/dist/es2015-YHaMV-St.js +701 -0
  191. package/dist/hooks/useAccordionAutoScroll.js +66 -67
  192. package/dist/hooks/useControllableState.js +14 -13
  193. package/dist/hooks/useTheme.js +21 -17
  194. package/dist/index.d.ts +2 -1
  195. package/dist/index.d.ts.map +1 -1
  196. package/dist/main.js +18954 -27224
  197. package/dist/primitives/button.js +39 -41
  198. package/dist/primitives/input-group.js +57 -73
  199. package/dist/primitives/input.js +11 -20
  200. package/dist/primitives/popover.d.ts.map +1 -1
  201. package/dist/primitives/popover.js +34 -25
  202. package/dist/primitives/select.js +70 -138
  203. package/dist/primitives/slot.js +32 -31
  204. package/dist/primitives/textarea.js +10 -16
  205. package/dist/proxy-Dn10Pl_g.js +4920 -0
  206. package/dist/styles/main.css +2 -1
  207. package/dist/styles/spectral.css +1 -1
  208. package/dist/twUtils-VNWgstKL.js +1673 -0
  209. package/dist/use-animation-CBUDycyW.js +57 -0
  210. package/dist/utils/constants.js +4 -4
  211. package/dist/utils/formFieldUtils.js +136 -148
  212. package/dist/utils/sharedUtils.js +26 -7
  213. package/dist/utils/twUtils.js +2 -2919
  214. package/package.json +24 -28
  215. package/dist/ComboboxBase-CxNxYtdT.js +0 -408
  216. package/dist/clsx-OuTLNxxd.js +0 -16
  217. package/dist/index-0ioNhtNM.js +0 -10
  218. package/dist/index-6oYKCvIn.js +0 -677
  219. package/dist/index-BFOf48AQ.js +0 -69
  220. package/dist/index-BZPx6jYI.js +0 -8
  221. package/dist/index-BlHU_t18.js +0 -142
  222. package/dist/index-Bm1RbF6w.js +0 -1037
  223. package/dist/index-Bv2OIg5P.js +0 -225
  224. package/dist/index-CKEI0pDv.js +0 -56
  225. package/dist/index-CM_hWgfC.js +0 -32
  226. package/dist/index-C_YVr64u.js +0 -1538
  227. package/dist/index-Cl8VeY0o.js +0 -149
  228. package/dist/index-CwSyIPrv.js +0 -13
  229. package/dist/index-D29mdTf5.js +0 -34
  230. package/dist/index-DEYs15GP.js +0 -66
  231. package/dist/index-Dc0No4pV.js +0 -233
  232. package/dist/index-T6XEa11q.js +0 -822
  233. package/dist/index-pBCLb6Gr.js +0 -240
  234. package/dist/index-psiVrsnE.js +0 -27
  235. package/dist/index-rKs9bXHr.js +0 -6
  236. package/dist/proxy-CO_-Vget.js +0 -4975
  237. package/dist/use-animation-DhEPRwZ3.js +0 -62
package/dist/Select.js CHANGED
@@ -1,189 +1,166 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
- import { jsxs as a, jsx as e, Fragment 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 { CheckmarkIcon as _ } from "./Icons/CheckmarkIcon.js";
14
- import { ChevronDownIcon as p } from "./Icons/ChevronDownIcon.js";
15
- import "./Icons/ChevronUpIcon.js";
16
- import "./Icons/ClockIcon.js";
17
- import "./Icons/CloseCircleIcon.js";
18
- import "./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 { LoaderIcon as $ } from "./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 { Label as O } from "./Label.js";
73
- import { R as ee, T as te, V as ae, I as re, P as se, C as oe, S as ie, a as le, b as de, c as z, G as me, d as ne, e as pe, f as ce } from "./index-T6XEa11q.js";
74
- import { useFormFieldId as ue, useFormFieldState as ge, getAriaProps as fe, groupOptions as he, getFormFieldCSSProperties as be, getStateClasses as xe, getTriggerClasses as ye, ErrorMessage as ve, LoadingState as Ne, EmptyState as Ce, getErrorMessageId as Se, getOptionClasses as we } from "./utils/formFieldUtils.js";
75
- import { cn as r } from "./utils/twUtils.js";
76
- import { useState as Ie } from "react";
77
- const Oe = (c) => {
78
- const F = "value" in c, {
79
- align: j = "start",
80
- alignOffset: k = 0,
81
- avoidCollisions: L = !0,
82
- className: M,
83
- collisionBoundary: P,
84
- collisionPadding: V = 10,
85
- defaultValue: B,
86
- emptyMessage: D = "No options found",
87
- errorMessage: u,
88
- id: T,
89
- label: l,
90
- labelClassName: g,
91
- loadingMessage: q = "Loading…",
92
- name: f,
93
- onChange: E,
94
- options: h = [],
95
- placeholder: G = "Select an option",
96
- position: d = "popper",
97
- ref: R,
98
- side: A = "bottom",
99
- sideOffset: U = 4,
100
- state: s = "default",
101
- value: b,
102
- "aria-label": H,
103
- "aria-describedby": J,
104
- ...o
105
- } = c, x = F ? b ?? "" : b, [y, K] = Ie(!1), i = ue(T, f), v = Se(i), { isDisabled: m, isLoading: N, isInvalid: Q } = ge(o.disabled, s), W = fe(s, J, o.required, v), { groups: C, ungrouped: S } = he(h), X = () => {
106
- if (N)
107
- return /* @__PURE__ */ e(Ne, { "data-testid": "spectral-select-loading", message: q });
108
- if (h.length === 0)
109
- return /* @__PURE__ */ e(Ce, { "data-testid": "spectral-select-empty", message: D });
110
- const w = (t) => {
111
- const n = x === t.value;
112
- return /* @__PURE__ */ a(ne, { className: r(we(!!t.disabled, !1, n), "relative flex w-full cursor-pointer items-center"), "data-testid": "spectral-select-item", disabled: t.disabled, value: t.value, children: [
113
- /* @__PURE__ */ e(pe, { "data-testid": "spectral-select-item-text", className: "block truncate", children: t.label }),
114
- /* @__PURE__ */ e(ce, { "data-testid": "spectral-select-item-selected-indicator", asChild: !0, children: /* @__PURE__ */ e("span", { className: "absolute right-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ e(_, { size: 16 }) }) })
115
- ] }, t.value);
116
- };
117
- return /* @__PURE__ */ a(I, { children: [
118
- S.length > 0 && /* @__PURE__ */ a(I, { children: [
119
- S.map(w),
120
- Object.keys(C).length > 0 && /* @__PURE__ */ e(z, { className: "bg-border-secondary -mx-1 my-1 h-px", "data-testid": "spectral-select-separator" })
121
- ] }),
122
- Object.entries(C).map(([t, n], Y) => /* @__PURE__ */ a(me, { "data-testid": "spectral-select-group", children: [
123
- Y > 0 && /* @__PURE__ */ e(z, { className: "bg-border-secondary -mx-1 my-1 h-px", "data-testid": "spectral-select-group-separator" }),
124
- /* @__PURE__ */ e(O, { className: r("text-text-primary px-2 py-1.5 text-base font-semibold", g), "data-testid": "spectral-select-group-label", children: t }),
125
- n.map((Z) => w(Z))
126
- ] }, t))
127
- ] });
128
- };
129
- return /* @__PURE__ */ a("div", { className: "w-full", children: [
130
- l && /* @__PURE__ */ e(O, { className: r("text-text-primary mb-2 block", g, m && "text-text-secondary"), "data-testid": "spectral-select-label", htmlFor: i, children: l }),
131
- /* @__PURE__ */ a(ee, { "data-testid": "spectral-select", defaultValue: B, disabled: m, name: f, onOpenChange: K, onValueChange: E, open: y, required: o.required, value: x, children: [
132
- /* @__PURE__ */ e(
133
- te,
134
- {
135
- "aria-controls": i,
136
- "aria-expanded": y,
137
- "aria-label": H ?? l,
138
- asChild: !0,
139
- className: r(ye(!1, s), xe(s), M),
140
- "data-slot": "select-trigger",
141
- "data-state": s,
142
- "data-testid": "spectral-select-trigger",
143
- id: i,
144
- ref: R,
145
- role: "combobox",
146
- style: be(),
147
- ...W,
148
- ...o,
149
- children: /* @__PURE__ */ a("button", { type: "button", disabled: m, children: [
150
- /* @__PURE__ */ e(ae, { className: "block truncate", "data-testid": "spectral-select-value", placeholder: G }),
151
- /* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex items-center", children: N ? /* @__PURE__ */ e($, { size: 20 }) : /* @__PURE__ */ e(p, { className: "transition-transform duration-200 data-[state=open]:rotate-180", size: 20 }) }) })
152
- ] })
153
- }
154
- ),
155
- /* @__PURE__ */ e(se, { children: /* @__PURE__ */ a(
156
- oe,
157
- {
158
- align: j,
159
- alignOffset: k,
160
- avoidCollisions: L,
161
- className: r(
162
- "border-input-border bg-input-bg motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out relative z-50 rounded-lg border shadow-md",
163
- "motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95",
164
- "motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 max-h-[min(var(--radix-select-content-available-height),300px)]",
165
- "min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto",
166
- d === "popper" && "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1"
167
- ),
168
- collisionBoundary: P,
169
- collisionPadding: V,
170
- "data-slot": "select-content",
171
- "data-testid": "spectral-select-content",
172
- position: d,
173
- side: A,
174
- sideOffset: U,
175
- children: [
176
- /* @__PURE__ */ e(ie, { className: "flex cursor-default items-center justify-center py-1", "data-testid": "spectral-select-scroll-up-button", children: /* @__PURE__ */ e(p, { "aria-hidden": "true", className: "rotate-180", size: 18 }) }),
177
- /* @__PURE__ */ e(le, { asChild: !0, children: /* @__PURE__ */ e("div", { className: r("p-1", d === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"), "data-testid": "spectral-select-items", children: X() }) }),
178
- /* @__PURE__ */ e(de, { className: "flex cursor-default items-center justify-center py-1", "data-testid": "spectral-select-scroll-down-button", children: /* @__PURE__ */ e(p, { "aria-hidden": "true", size: 18 }) })
179
- ]
180
- }
181
- ) })
182
- ] }),
183
- Q && u && /* @__PURE__ */ e(ve, { "data-testid": "spectral-select-error-message", id: v, message: u })
184
- ] });
185
- };
186
- Oe.displayName = "Select";
187
- export {
188
- Oe as Select
3
+ import { CheckmarkIcon as e } from "./Icons/CheckmarkIcon.js";
4
+ import { ChevronDownIcon as t } from "./Icons/ChevronDownIcon.js";
5
+ import { LoaderIcon as n } from "./Icons/LoaderIcon.js";
6
+ import { t as r } from "./twUtils-VNWgstKL.js";
7
+ import { EmptyState as i, ErrorMessage as a, LoadingState as o, getAriaProps as s, getErrorMessageId as c, getFormFieldCSSProperties as l, getOptionClasses as ee, getStateClasses as te, getTriggerClasses as ne, groupOptions as re, useFormFieldId as u, useFormFieldState as d } from "./utils/formFieldUtils.js";
8
+ import { Label as f } from "./Label.js";
9
+ import { a as p, c as m, d as h, f as g, h as _, i as v, l as ie, m as ae, n as oe, o as se, p as ce, r as le, t as ue, u as y } from "./dist-fW81qjVl.js";
10
+ import { useState as b } from "react";
11
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
12
+ //#region src/components/Select/Select.tsx
13
+ var w = (w) => {
14
+ let T = "value" in w, { align: E = "start", alignOffset: D = 0, avoidCollisions: O = !0, className: k, collisionBoundary: A, collisionPadding: j = 10, defaultValue: M, emptyMessage: N = "No options found", errorMessage: P, id: F, label: I, labelClassName: L, loadingMessage: de = "Loading…", name: R, onChange: z, options: B = [], placeholder: V = "Select an option", position: H = "popper", ref: fe, side: pe = "bottom", sideOffset: me = 4, state: U = "default", value: W, "aria-label": he, "aria-describedby": ge, ...G } = w, K = T ? W ?? "" : W, [q, _e] = b(!1), J = u(F, R), Y = c(J), { isDisabled: X, isLoading: Z, isInvalid: ve } = d(G.disabled, U), ye = s(U, ge, G.required, Y), { groups: Q, ungrouped: $ } = re(B), be = () => {
15
+ if (Z) return /* @__PURE__ */ S(o, {
16
+ "data-testid": "spectral-select-loading",
17
+ message: de
18
+ });
19
+ if (B.length === 0) return /* @__PURE__ */ S(i, {
20
+ "data-testid": "spectral-select-empty",
21
+ message: N
22
+ });
23
+ let t = (t) => {
24
+ let n = K === t.value;
25
+ return /* @__PURE__ */ C(v, {
26
+ className: r(ee(!!t.disabled, !1, n), "relative flex w-full cursor-pointer items-center"),
27
+ "data-testid": "spectral-select-item",
28
+ disabled: t.disabled,
29
+ value: t.value,
30
+ children: [/* @__PURE__ */ S(se, {
31
+ "data-testid": "spectral-select-item-text",
32
+ className: "block truncate",
33
+ children: t.label
34
+ }), /* @__PURE__ */ S(p, {
35
+ "data-testid": "spectral-select-item-selected-indicator",
36
+ asChild: !0,
37
+ children: /* @__PURE__ */ S("span", {
38
+ className: "right-2 h-4 w-4 absolute flex items-center justify-center",
39
+ children: /* @__PURE__ */ S(e, { size: 16 })
40
+ })
41
+ })]
42
+ }, t.value);
43
+ };
44
+ return /* @__PURE__ */ C(x, { children: [$.length > 0 && /* @__PURE__ */ C(x, { children: [$.map(t), Object.keys(Q).length > 0 && /* @__PURE__ */ S(g, {
45
+ className: "-mx-1 my-1 h-px bg-border-secondary",
46
+ "data-testid": "spectral-select-separator"
47
+ })] }), Object.entries(Q).map(([e, n], i) => /* @__PURE__ */ C(oe, {
48
+ "data-testid": "spectral-select-group",
49
+ children: [
50
+ i > 0 && /* @__PURE__ */ S(g, {
51
+ className: "-mx-1 my-1 h-px bg-border-secondary",
52
+ "data-testid": "spectral-select-group-separator"
53
+ }),
54
+ /* @__PURE__ */ S(f, {
55
+ className: r("px-2 py-1.5 text-base font-semibold text-text-primary", L),
56
+ "data-testid": "spectral-select-group-label",
57
+ children: e
58
+ }),
59
+ n.map((e) => t(e))
60
+ ]
61
+ }, e))] });
62
+ };
63
+ return /* @__PURE__ */ C("div", {
64
+ className: "w-full",
65
+ children: [
66
+ I && /* @__PURE__ */ S(f, {
67
+ className: r("mb-2 block text-text-primary", L, X && "text-text-secondary"),
68
+ "data-testid": "spectral-select-label",
69
+ htmlFor: J,
70
+ children: I
71
+ }),
72
+ /* @__PURE__ */ C(ie, {
73
+ "data-testid": "spectral-select",
74
+ defaultValue: M,
75
+ disabled: X,
76
+ name: R,
77
+ onOpenChange: _e,
78
+ onValueChange: z,
79
+ open: q,
80
+ required: G.required,
81
+ value: K,
82
+ children: [/* @__PURE__ */ S(ce, {
83
+ "aria-controls": J,
84
+ "aria-expanded": q,
85
+ "aria-label": he ?? I,
86
+ asChild: !0,
87
+ className: r(ne(!1, U), te(U), k),
88
+ "data-slot": "select-trigger",
89
+ "data-state": U,
90
+ "data-testid": "spectral-select-trigger",
91
+ id: J,
92
+ ref: fe,
93
+ role: "combobox",
94
+ style: l(),
95
+ ...ye,
96
+ ...G,
97
+ children: /* @__PURE__ */ C("button", {
98
+ type: "button",
99
+ disabled: X,
100
+ children: [/* @__PURE__ */ S(ae, {
101
+ className: "block truncate",
102
+ "data-testid": "spectral-select-value",
103
+ placeholder: V
104
+ }), /* @__PURE__ */ S(le, {
105
+ asChild: !0,
106
+ children: /* @__PURE__ */ S("div", {
107
+ className: "flex items-center",
108
+ children: Z ? /* @__PURE__ */ S(n, { size: 20 }) : /* @__PURE__ */ S(t, {
109
+ className: "transition-transform duration-200 data-[state=open]:rotate-180",
110
+ size: 20
111
+ })
112
+ })
113
+ })]
114
+ })
115
+ }), /* @__PURE__ */ S(m, { children: /* @__PURE__ */ C(ue, {
116
+ align: E,
117
+ alignOffset: D,
118
+ avoidCollisions: O,
119
+ className: r("rounded-lg shadow-md relative z-50 border border-input-border bg-input-bg motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=open]:animate-in", "motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95", "max-h-[min(var(--radix-select-content-available-height),300px)] motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=top]:slide-in-from-bottom-2", "min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto", H === "popper" && "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1"),
120
+ collisionBoundary: A,
121
+ collisionPadding: j,
122
+ "data-slot": "select-content",
123
+ "data-testid": "spectral-select-content",
124
+ position: H,
125
+ side: pe,
126
+ sideOffset: me,
127
+ children: [
128
+ /* @__PURE__ */ S(h, {
129
+ className: "py-1 flex cursor-default items-center justify-center",
130
+ "data-testid": "spectral-select-scroll-up-button",
131
+ children: /* @__PURE__ */ S(t, {
132
+ "aria-hidden": "true",
133
+ className: "rotate-180",
134
+ size: 18
135
+ })
136
+ }),
137
+ /* @__PURE__ */ S(_, {
138
+ asChild: !0,
139
+ children: /* @__PURE__ */ S("div", {
140
+ className: r("p-1", H === "popper" && "scroll-my-1 h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),
141
+ "data-testid": "spectral-select-items",
142
+ children: be()
143
+ })
144
+ }),
145
+ /* @__PURE__ */ S(y, {
146
+ className: "py-1 flex cursor-default items-center justify-center",
147
+ "data-testid": "spectral-select-scroll-down-button",
148
+ children: /* @__PURE__ */ S(t, {
149
+ "aria-hidden": "true",
150
+ size: 18
151
+ })
152
+ })
153
+ ]
154
+ }) })]
155
+ }),
156
+ ve && P && /* @__PURE__ */ S(a, {
157
+ "data-testid": "spectral-select-error-message",
158
+ id: Y,
159
+ message: P
160
+ })
161
+ ]
162
+ });
189
163
  };
164
+ w.displayName = "Select";
165
+ //#endregion
166
+ export { w as Select };
package/dist/Separator.js CHANGED
@@ -1,21 +1,18 @@
1
1
  import "./styles/main.css";
2
- import { jsx as p } from "react/jsx-runtime";
3
- import { cn as e } from "./utils/twUtils.js";
2
+ import { t as e } from "./twUtils-VNWgstKL.js";
4
3
  import "react";
5
- const l = ({ className: o, decorative: r = !0, orientation: a = "horizontal", ref: t, ...i }) => /* @__PURE__ */ p(
6
- "div",
7
- {
8
- "aria-hidden": r ? "true" : void 0,
9
- "aria-orientation": r ? void 0 : a,
10
- className: e("bg-border shrink-0", a === "horizontal" ? "h-px w-full" : "h-full w-px", o),
11
- "data-orientation": a,
12
- "data-slot": "separator",
13
- role: r ? "none" : "separator",
14
- ref: t,
15
- ...i
16
- }
17
- );
18
- l.displayName = "Separator";
19
- export {
20
- l as Separator
21
- };
4
+ import { jsx as t } from "react/jsx-runtime";
5
+ //#region src/components/Separator/Separator.tsx
6
+ var n = ({ className: n, decorative: r = !0, orientation: i = "horizontal", ref: a, ...o }) => /* @__PURE__ */ t("div", {
7
+ "aria-hidden": r ? "true" : void 0,
8
+ "aria-orientation": r ? void 0 : i,
9
+ className: e("bg-border shrink-0", i === "horizontal" ? "h-px w-full" : "h-full w-px", n),
10
+ "data-orientation": i,
11
+ "data-slot": "separator",
12
+ role: r ? "none" : "separator",
13
+ ref: a,
14
+ ...o
15
+ });
16
+ n.displayName = "Separator";
17
+ //#endregion
18
+ export { n as Separator };
package/dist/Skeleton.js CHANGED
@@ -1,8 +1,12 @@
1
1
  import "./styles/main.css";
2
- import { jsx as t } from "react/jsx-runtime";
3
- import { cn as r } from "./utils/twUtils.js";
2
+ import { t as e } from "./twUtils-VNWgstKL.js";
4
3
  import "react";
5
- const a = ({ className: e, ...o }) => /* @__PURE__ */ t("div", { "data-slot": "skeleton", className: r("bg-level-three rounded-md motion-safe:animate-pulse", e), ...o });
6
- export {
7
- a as Skeleton
8
- };
4
+ import { jsx as t } from "react/jsx-runtime";
5
+ //#region src/components/Skeleton/Skeleton.tsx
6
+ var n = ({ className: n, ...r }) => /* @__PURE__ */ t("div", {
7
+ "data-slot": "skeleton",
8
+ className: e("motion-safe:animate-pulse rounded-md bg-level-three", n),
9
+ ...r
10
+ });
11
+ //#endregion
12
+ export { n as Skeleton };