@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,104 +1,88 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
- import { jsx as e, jsxs as x, Fragment as k } from "react/jsx-runtime";
4
- import { ControlGroup as F, useControlGroup as j, ControlGroupItem as I } from "../ControlGroup.js";
5
- import { Label as $ } from "../Label.js";
6
- import { Input as E } from "../primitives/input.js";
7
- import { SelectTrigger as z, SelectValue as M, Select as T, SelectContent as V, SelectItem as q } from "../primitives/select.js";
8
- import { cn as w } from "../utils/twUtils.js";
9
- import { useId as B } from "react";
10
- const D = "placeholder:text-small! [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", y = "flex w-full min-w-0 flex-col gap-1.5", L = ({
11
- amountStep: v,
12
- ariaLabel: o,
13
- captionLayout: C = "inline",
14
- className: h,
15
- dataTestId: i = "spectral-control-group-select",
16
- disabled: l,
17
- errorMessage: a,
18
- inputAriaLabel: p,
19
- inputPlaceholder: r,
20
- maxAmount: N = 1e6,
21
- minAmount: S = 0,
22
- orientation: u = "horizontal",
23
- selectAriaLabel: b,
24
- selectOptions: G,
25
- selectPlaceholder: n,
26
- state: c = "default",
27
- type: t = "number",
28
- ...g
29
- }) => {
30
- const d = B(), f = `${d}-amount`, s = `${d}-select`, m = C === "above";
31
- return /* @__PURE__ */ e(F, { "aria-label": o, className: h, "data-testid": i, disabled: l, errorMessage: a, orientation: u, state: c, children: /* @__PURE__ */ e(
32
- H,
33
- {
34
- amountStep: v,
35
- dataTestId: i,
36
- inputAccessibleName: m ? r ? void 0 : p ?? void 0 : p ?? r ?? void 0,
37
- inputCaption: m ? void 0 : r,
38
- inputId: f,
39
- isDisabled: !!l || c === "disabled",
40
- maxAmount: N,
41
- minAmount: S,
42
- selectCaption: m ? void 0 : n,
43
- selectOptions: G,
44
- selectProps: g,
45
- selectTriggerAriaLabel: m ? n ? void 0 : b ?? void 0 : b ?? n ?? void 0,
46
- selectTriggerId: s,
47
- type: t,
48
- useAboveLabels: m,
49
- inputPlaceholder: r,
50
- selectPlaceholder: n
51
- }
52
- ) });
53
- }, H = ({
54
- amountStep: v,
55
- dataTestId: o,
56
- inputAccessibleName: C,
57
- inputCaption: h,
58
- inputId: i,
59
- inputPlaceholder: l,
60
- isDisabled: a,
61
- maxAmount: p,
62
- minAmount: r,
63
- selectCaption: N,
64
- selectOptions: S,
65
- selectPlaceholder: u,
66
- selectProps: b,
67
- selectTriggerAriaLabel: G,
68
- selectTriggerId: n,
69
- type: c,
70
- useAboveLabels: t
71
- }) => {
72
- const { errorMessageId: g } = j(), d = /* @__PURE__ */ e(
73
- E,
74
- {
75
- "aria-describedby": g,
76
- "aria-label": C,
77
- className: w(c === "number" && D, t && "rounded-none rounded-s-md"),
78
- "data-testid": `${o}-input`,
79
- disabled: a,
80
- id: t ? i : void 0,
81
- type: c === "number" ? "number" : "text",
82
- placeholder: h,
83
- min: r ?? 0,
84
- max: p ?? 1e6,
85
- step: v ?? 1
86
- }
87
- ), f = /* @__PURE__ */ e(z, { "aria-describedby": g, "aria-label": G, className: w(t && "rounded-none rounded-e-md"), "data-testid": `${o}-select-trigger`, disabled: a, id: t ? n : void 0, children: /* @__PURE__ */ e(M, { placeholder: N }) });
88
- return /* @__PURE__ */ x(k, { children: [
89
- /* @__PURE__ */ e(I, { children: t ? /* @__PURE__ */ x("div", { className: y, children: [
90
- l ? /* @__PURE__ */ e($, { className: "text-text-primary", htmlFor: i, children: l }) : null,
91
- d
92
- ] }) : d }),
93
- /* @__PURE__ */ x(T, { "data-testid": `${o}-select-root`, disabled: a, ...b, children: [
94
- /* @__PURE__ */ e(I, { children: t ? /* @__PURE__ */ x("div", { className: y, children: [
95
- u ? /* @__PURE__ */ e($, { className: "text-text-primary", htmlFor: n, children: u }) : null,
96
- f
97
- ] }) : f }),
98
- /* @__PURE__ */ e(V, { children: S.map((s) => /* @__PURE__ */ e(q, { value: s.value, children: s.label }, s.value)) })
99
- ] })
100
- ] });
101
- };
102
- export {
103
- L as ControlGroupSelect
3
+ import { t as e } from "../twUtils-VNWgstKL.js";
4
+ import { Label as t } from "../Label.js";
5
+ import { Input as n } from "../primitives/input.js";
6
+ import { Select as r, SelectContent as i, SelectItem as a, SelectTrigger as o, SelectValue as s } from "../primitives/select.js";
7
+ import { ControlGroup as c, ControlGroupItem as l, useControlGroup as u } from "../ControlGroup.js";
8
+ import { useId as d } from "react";
9
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
10
+ //#region src/components/ControlGroup/ControlGroupSelect.tsx
11
+ var h = "placeholder:text-small! [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", g = "flex w-full min-w-0 flex-col gap-1.5", _ = ({ amountStep: e, ariaLabel: t, captionLayout: n = "inline", className: r, dataTestId: i = "spectral-control-group-select", disabled: a, errorMessage: o, inputAriaLabel: s, inputPlaceholder: l, maxAmount: u = 1e6, minAmount: f = 0, orientation: m = "horizontal", selectAriaLabel: h, selectOptions: g, selectPlaceholder: _, state: y = "default", type: b = "number", ...x }) => {
12
+ let S = d(), C = `${S}-amount`, w = `${S}-select`, T = n === "above", E = T ? void 0 : l, D = T ? void 0 : _, O = T ? l ? void 0 : s ?? void 0 : s ?? l ?? void 0, k = T ? _ ? void 0 : h ?? void 0 : h ?? _ ?? void 0, A = !!a || y === "disabled";
13
+ return /* @__PURE__ */ p(c, {
14
+ "aria-label": t,
15
+ className: r,
16
+ "data-testid": i,
17
+ disabled: a,
18
+ errorMessage: o,
19
+ orientation: m,
20
+ state: y,
21
+ children: /* @__PURE__ */ p(v, {
22
+ amountStep: e,
23
+ dataTestId: i,
24
+ inputAccessibleName: O,
25
+ inputCaption: E,
26
+ inputId: C,
27
+ isDisabled: A,
28
+ maxAmount: u,
29
+ minAmount: f,
30
+ selectCaption: D,
31
+ selectOptions: g,
32
+ selectProps: x,
33
+ selectTriggerAriaLabel: k,
34
+ selectTriggerId: w,
35
+ type: b,
36
+ useAboveLabels: T,
37
+ inputPlaceholder: l,
38
+ selectPlaceholder: _
39
+ })
40
+ });
41
+ }, v = ({ amountStep: c, dataTestId: d, inputAccessibleName: _, inputCaption: v, inputId: y, inputPlaceholder: b, isDisabled: x, maxAmount: S, minAmount: C, selectCaption: w, selectOptions: T, selectPlaceholder: E, selectProps: D, selectTriggerAriaLabel: O, selectTriggerId: k, type: A, useAboveLabels: j }) => {
42
+ let { errorMessageId: M } = u(), N = /* @__PURE__ */ p(n, {
43
+ "aria-describedby": M,
44
+ "aria-label": _,
45
+ className: e(A === "number" && h, A === "number" && "tabular-nums", j && "rounded-s-md rounded-none"),
46
+ "data-testid": `${d}-input`,
47
+ disabled: x,
48
+ id: j ? y : void 0,
49
+ type: A === "number" ? "number" : "text",
50
+ placeholder: v,
51
+ min: C ?? 0,
52
+ max: S ?? 1e6,
53
+ step: c ?? 1
54
+ }), P = /* @__PURE__ */ p(o, {
55
+ "aria-describedby": M,
56
+ "aria-label": O,
57
+ className: e(j && "rounded-e-md rounded-none"),
58
+ "data-testid": `${d}-select-trigger`,
59
+ disabled: x,
60
+ id: j ? k : void 0,
61
+ children: /* @__PURE__ */ p(s, { placeholder: w })
62
+ });
63
+ return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(l, { children: j ? /* @__PURE__ */ m("div", {
64
+ className: g,
65
+ children: [b ? /* @__PURE__ */ p(t, {
66
+ className: "text-text-primary",
67
+ htmlFor: y,
68
+ children: b
69
+ }) : null, N]
70
+ }) : N }), /* @__PURE__ */ m(r, {
71
+ "data-testid": `${d}-select-root`,
72
+ disabled: x,
73
+ ...D,
74
+ children: [/* @__PURE__ */ p(l, { children: j ? /* @__PURE__ */ m("div", {
75
+ className: g,
76
+ children: [E ? /* @__PURE__ */ p(t, {
77
+ className: "text-text-primary",
78
+ htmlFor: k,
79
+ children: E
80
+ }) : null, P]
81
+ }) : P }), /* @__PURE__ */ p(i, { children: T.map((e) => /* @__PURE__ */ p(a, {
82
+ value: e.value,
83
+ children: e.label
84
+ }, e.value)) })]
85
+ })] });
104
86
  };
87
+ //#endregion
88
+ export { _ as ControlGroupSelect };
@@ -1,51 +1,48 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
- import { jsxs as x, jsx as a } from "react/jsx-runtime";
4
- import { Slot as C } from "./primitives/slot.js";
5
- import { useFormFieldId as v, useFormFieldState as b, getStateClasses as I, ErrorMessage as h, getErrorMessageId as G } from "./utils/formFieldUtils.js";
6
- import { cn as u } from "./utils/twUtils.js";
7
- import { createContext as w, useContext as F } from "react";
8
- const m = w(null), z = () => {
9
- const r = F(m);
10
- if (r === null)
11
- throw new Error("useControlGroup must be used within a ControlGroup");
12
- return r;
13
- }, D = ({ className: r, disabled: s, errorMessage: o, id: c, name: p, orientation: n = "horizontal", state: t = "default", ...f }) => {
14
- const l = v(c, p), d = G(l), { isDisabled: i, isLoading: g, isInvalid: e } = b(s, t);
15
- return /* @__PURE__ */ x(m.Provider, { value: { errorMessageId: e && o ? d : void 0, isDisabled: i, isInvalid: e, isLoading: g, orientation: n, state: t }, children: [
16
- /* @__PURE__ */ a(
17
- "div",
18
- {
19
- "data-slot": "control-group",
20
- "data-orientation": n,
21
- "data-state": t,
22
- id: l,
23
- role: "group",
24
- "aria-describedby": e && o ? d : void 0,
25
- className: u("group flex rounded-lg border-2 border-transparent", n === "vertical" && "flex-col", I(t), i && "pointer-events-none opacity-50", r),
26
- ...f
27
- }
28
- ),
29
- e && o && /* @__PURE__ */ a(h, { dataTestId: "spectral-control-group-error-message", id: d, message: o })
30
- ] });
31
- }, L = ({ className: r, ...s }) => {
32
- const { orientation: o } = z();
33
- return /* @__PURE__ */ a(
34
- C,
35
- {
36
- "data-slot": "control-group-item",
37
- className: u(
38
- "rounded-none focus-within:z-10",
39
- o === "horizontal" && "-me-px h-auto first:rounded-s-md last:me-0 last:rounded-e-md",
40
- o === "vertical" && "-mbe-px w-auto first:rounded-ss-md first:rounded-se-md last:mbe-0 last:rounded-ee-md last:rounded-es-md",
41
- r
42
- ),
43
- ...s
44
- }
45
- );
46
- };
47
- export {
48
- D as ControlGroup,
49
- L as ControlGroupItem,
50
- z as useControlGroup
3
+ import { t as e } from "./twUtils-VNWgstKL.js";
4
+ import { Slot as t } from "./primitives/slot.js";
5
+ import { ErrorMessage as n, getErrorMessageId as r, getStateClasses as i, useFormFieldId as a, useFormFieldState as o } from "./utils/formFieldUtils.js";
6
+ import { createContext as s, useContext as c } from "react";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ //#region src/components/ControlGroup/ControlGroup.tsx
9
+ var d = s(null), f = () => {
10
+ let e = c(d);
11
+ if (e === null) throw Error("useControlGroup must be used within a ControlGroup");
12
+ return e;
13
+ }, p = ({ className: t, disabled: s, errorMessage: c, id: f, name: p, orientation: m = "horizontal", state: h = "default", ...g }) => {
14
+ let _ = a(f, p), v = r(_), { isDisabled: y, isLoading: b, isInvalid: x } = o(s, h);
15
+ return /* @__PURE__ */ u(d.Provider, {
16
+ value: {
17
+ errorMessageId: x && c ? v : void 0,
18
+ isDisabled: y,
19
+ isInvalid: x,
20
+ isLoading: b,
21
+ orientation: m,
22
+ state: h
23
+ },
24
+ children: [/* @__PURE__ */ l("div", {
25
+ "data-slot": "control-group",
26
+ "data-orientation": m,
27
+ "data-state": h,
28
+ id: _,
29
+ role: "group",
30
+ "aria-describedby": x && c ? v : void 0,
31
+ className: e("group rounded-lg flex border-2 border-transparent", m === "vertical" && "flex-col", i(h), y && "pointer-events-none opacity-50", t),
32
+ ...g
33
+ }), x && c && /* @__PURE__ */ l(n, {
34
+ dataTestId: "spectral-control-group-error-message",
35
+ id: v,
36
+ message: c
37
+ })]
38
+ });
39
+ }, m = ({ className: n, ...r }) => {
40
+ let { orientation: i } = f();
41
+ return /* @__PURE__ */ l(t, {
42
+ "data-slot": "control-group-item",
43
+ className: e("rounded-none focus-within:z-10", i === "horizontal" && "first:rounded-s-md last:me-0 last:rounded-e-md -me-px h-auto", i === "vertical" && "first:rounded-ss-md first:rounded-se-md last:rounded-ee-md last:rounded-es-md last:mbe-0 -mbe-px w-auto", n),
44
+ ...r
45
+ });
51
46
  };
47
+ //#endregion
48
+ export { p as ControlGroup, m as ControlGroupItem, f as useControlGroup };
@@ -1,14 +1,39 @@
1
1
  import "../styles/main.css";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import { Slot as c } from "../primitives/slot.js";
4
- import { cn as d } from "../utils/twUtils.js";
2
+ import { t as e } from "../twUtils-VNWgstKL.js";
3
+ import { Slot as t } from "../primitives/slot.js";
5
4
  import "react";
6
- const o = "text-text-primary flex flex-col w-full card-effects p-3 gap-6 rounded-xl", f = ({ ...t }) => /* @__PURE__ */ e("div", { "data-slot": "card", "data-testid": "spectral-card", ...t }), C = ({ className: t, ...a }) => /* @__PURE__ */ e("div", { className: d("@container/card-header flex items-center justify-between pb-4", t), "data-slot": "card-header", "data-testid": "spectral-card-header", ...a }), u = ({ className: t, asChild: a = !1, ...r }) => /* @__PURE__ */ e(a ? c : "div", { className: d("text-xl font-semibold", t), "data-slot": "card-title", "data-testid": "spectral-card-title", ...r }), x = ({ className: t, asChild: a = !1, ...r }) => /* @__PURE__ */ e(a ? c : "div", { className: d("justify-self-end", t), "data-slot": "card-action", "data-testid": "spectral-card-action", ...r }), v = ({ className: t, ...a }) => /* @__PURE__ */ e("div", { className: t, "data-slot": "card-content", "data-testid": "spectral-card-content", ...a }), N = ({ asChild: t = !1, children: a, className: r, ...s }) => /* @__PURE__ */ e(t ? c : "div", { className: d(o, r), "data-slot": "card", "data-testid": "spectral-card", ...s, children: a });
7
- export {
8
- N as Card,
9
- f as CardBase,
10
- v as CardContent,
11
- C as CardHeader,
12
- x as CardHeaderEndSlot,
13
- u as CardTitle
14
- };
5
+ import { jsx as n } from "react/jsx-runtime";
6
+ //#region src/components/DataCard/Card.tsx
7
+ var r = "text-text-primary flex flex-col w-full card-effects p-3 gap-6 rounded-xl", i = ({ ...e }) => /* @__PURE__ */ n("div", {
8
+ "data-slot": "card",
9
+ "data-testid": "spectral-card",
10
+ ...e
11
+ }), a = ({ className: t, ...r }) => /* @__PURE__ */ n("div", {
12
+ className: e("pb-4 @container/card-header flex items-center justify-between", t),
13
+ "data-slot": "card-header",
14
+ "data-testid": "spectral-card-header",
15
+ ...r
16
+ }), o = ({ className: r, asChild: i = !1, ...a }) => /* @__PURE__ */ n(i ? t : "div", {
17
+ className: e("font-semibold text-xl", r),
18
+ "data-slot": "card-title",
19
+ "data-testid": "spectral-card-title",
20
+ ...a
21
+ }), s = ({ className: r, asChild: i = !1, ...a }) => /* @__PURE__ */ n(i ? t : "div", {
22
+ className: e("justify-self-end", r),
23
+ "data-slot": "card-action",
24
+ "data-testid": "spectral-card-action",
25
+ ...a
26
+ }), c = ({ className: e, ...t }) => /* @__PURE__ */ n("div", {
27
+ className: e,
28
+ "data-slot": "card-content",
29
+ "data-testid": "spectral-card-content",
30
+ ...t
31
+ }), l = ({ asChild: i = !1, children: a, className: o, ...s }) => /* @__PURE__ */ n(i ? t : "div", {
32
+ className: e(r, o),
33
+ "data-slot": "card",
34
+ "data-testid": "spectral-card",
35
+ ...s,
36
+ children: a
37
+ });
38
+ //#endregion
39
+ export { l as Card, i as CardBase, c as CardContent, a as CardHeader, s as CardHeaderEndSlot, o as CardTitle };
@@ -1,5 +1,5 @@
1
- import { CardProps } from './Card';
2
1
  import { ReactNode } from 'react';
2
+ import { CardProps } from './Card';
3
3
  export type DataCardProps = CardProps & {
4
4
  accentColor: string;
5
5
  cardHeaderEndSlot: ReactNode;
package/dist/DataCard.js CHANGED
@@ -1,18 +1,38 @@
1
1
  import "./styles/main.css";
2
- import { jsxs as t, jsx as a } from "react/jsx-runtime";
3
- import { Card as o, CardHeader as p, CardTitle as n, CardContent as m } from "./DataCard/Card.js";
4
- import { cn as x } from "./utils/twUtils.js";
2
+ import { t as e } from "./twUtils-VNWgstKL.js";
3
+ import { Card as t, CardContent as n, CardHeader as r, CardTitle as i } from "./DataCard/Card.js";
5
4
  import "react";
6
- const C = ({ accentColor: d, cardHeaderEndSlot: e, className: r, dataDescription: s, dataValue: c, title: l, ...i }) => /* @__PURE__ */ t(o, { className: x("card-effects gap-4", r), ...i, "data-testid": "spectral-datacard", children: [
7
- /* @__PURE__ */ t(p, { className: "pb-0", "data-testid": "spectral-datacard-header", children: [
8
- /* @__PURE__ */ a(n, { className: "text-sm font-bold uppercase", "data-testid": "spectral-datacard-title", children: l }),
9
- /* @__PURE__ */ a("div", { style: { color: d }, "data-testid": "spectral-datacard-end-slot", children: e })
10
- ] }),
11
- /* @__PURE__ */ a(m, { children: /* @__PURE__ */ t("div", { className: "flex flex-col gap-4", children: [
12
- /* @__PURE__ */ a("div", { className: "text-4xl font-bold", "data-testid": "spectral-datacard-data-value", style: { color: d }, children: c }),
13
- /* @__PURE__ */ a("div", { className: "text-data-card-description text-xs", "data-testid": "spectral-datacard-data-description", children: s })
14
- ] }) })
15
- ] });
16
- export {
17
- C as DataCard
18
- };
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region src/components/DataCard/DataCard.tsx
7
+ var s = ({ accentColor: s, cardHeaderEndSlot: c, className: l, dataDescription: u, dataValue: d, title: f, ...p }) => /* @__PURE__ */ o(t, {
8
+ className: e("gap-4 card-effects", l),
9
+ ...p,
10
+ "data-testid": "spectral-datacard",
11
+ children: [/* @__PURE__ */ o(r, {
12
+ className: "pb-0",
13
+ "data-testid": "spectral-datacard-header",
14
+ children: [/* @__PURE__ */ a(i, {
15
+ className: "text-sm font-bold uppercase",
16
+ "data-testid": "spectral-datacard-title",
17
+ children: f
18
+ }), /* @__PURE__ */ a("div", {
19
+ style: { color: s },
20
+ "data-testid": "spectral-datacard-end-slot",
21
+ children: c
22
+ })]
23
+ }), /* @__PURE__ */ a(n, { children: /* @__PURE__ */ o("div", {
24
+ className: "gap-4 flex flex-col",
25
+ children: [/* @__PURE__ */ a("div", {
26
+ className: "text-4xl font-bold tabular-nums",
27
+ "data-testid": "spectral-datacard-data-value",
28
+ style: { color: s },
29
+ children: d
30
+ }), /* @__PURE__ */ a("div", {
31
+ className: "text-xs text-data-card-description",
32
+ "data-testid": "spectral-datacard-data-description",
33
+ children: u
34
+ })]
35
+ }) })]
36
+ });
37
+ //#endregion
38
+ export { s as DataCard };