@spear-ai/spectral 1.11.3 → 1.12.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 (123) hide show
  1. package/README.md +4 -0
  2. package/dist/.js +124 -121
  3. package/dist/{Accordion-CDXdSAST.js → Accordion-Cyrb2byI.js} +1 -1
  4. package/dist/Accordion.js +1 -1
  5. package/dist/Alert/AlertBase.js +1 -1
  6. package/dist/Alert.js +3 -3
  7. package/dist/{AnimatePresence-D-9jXfgI.js → AnimatePresence-D9FLxIGV.js} +1 -1
  8. package/dist/Avatar.js +46 -48
  9. package/dist/Badge.js +1 -1
  10. package/dist/Button.js +1 -1
  11. package/dist/ButtonGroup/ButtonGroupButton.js +1 -1
  12. package/dist/ButtonGroup.js +1 -1
  13. package/dist/ButtonIcon.js +1 -1
  14. package/dist/{Calendar-s4lyijkn.js → Calendar-2UVWeLYp.js} +4 -4
  15. package/dist/Checkbox/CheckboxBase.js +1 -1
  16. package/dist/Checkbox.d.ts +10 -3
  17. package/dist/Checkbox.js +55 -35
  18. package/dist/{es2015-YHaMV-St.js → Combination-9q50p_Vu.js} +251 -254
  19. package/dist/Combobox/ComboboxBase.js +492 -3
  20. package/dist/Combobox-Ch5Rxk5v.js +6360 -0
  21. package/dist/Combobox.d.ts +5 -3
  22. package/dist/Combobox.js +3 -143
  23. package/dist/ControlGroup/ControlGroupSelect.d.ts +5 -2
  24. package/dist/ControlGroup/ControlGroupSelect.js +32 -29
  25. package/dist/ControlGroup.d.ts +3 -2
  26. package/dist/ControlGroup.js +41 -33
  27. package/dist/DataCard/Card.js +1 -1
  28. package/dist/DataCard.js +1 -1
  29. package/dist/DateTimePicker/Calendar.js +1 -1
  30. package/dist/DateTimePicker/DateTimeDisplayInput.js +84 -83
  31. package/dist/DateTimePicker/DateTimeInput.js +2 -2
  32. package/dist/DateTimePicker/DateTimeUtils.js +1 -1
  33. package/dist/DateTimePicker/TimePeriodSelect.js +32 -35
  34. package/dist/DateTimePicker/TimePicker.js +2 -2
  35. package/dist/DateTimePicker.d.ts +1 -1
  36. package/dist/DateTimePicker.js +55 -52
  37. package/dist/{DateTimeUtils-DVvG6H-p.js → DateTimeUtils-DrR2JWoU.js} +1 -1
  38. package/dist/Dialog.js +3 -3
  39. package/dist/Drawer.js +1 -1
  40. package/dist/DropdownMenu.d.ts +61 -0
  41. package/dist/DropdownMenu.js +869 -0
  42. package/dist/{HoverCard-CYDsIiVK.js → HoverCard-BGpW6LnA.js} +3 -3
  43. package/dist/HoverCard.js +1 -1
  44. package/dist/Icons/AdjustmentsIcon.d.ts +5 -0
  45. package/dist/Icons/AdjustmentsIcon.js +78 -0
  46. package/dist/Icons/MenuDotsIcon.d.ts +5 -0
  47. package/dist/Icons/MenuDotsIcon.js +36 -0
  48. package/dist/Icons/MenuIcon.d.ts +5 -0
  49. package/dist/Icons/MenuIcon.js +36 -0
  50. package/dist/Icons/index.d.ts +3 -0
  51. package/dist/Icons.js +81 -78
  52. package/dist/IconsAnimated/PanelLeftCloseIcon.js +3 -3
  53. package/dist/IconsAnimated/PanelLeftOpenIcon.js +3 -3
  54. package/dist/Input.js +1 -1
  55. package/dist/InputNumeric.js +1 -1
  56. package/dist/{InputOTP-cVn5Bzyp.js → InputOTP-BkSw_KIB.js} +12 -10
  57. package/dist/InputOTP.js +1 -1
  58. package/dist/Kbd.js +1 -1
  59. package/dist/Label.js +1 -1
  60. package/dist/MultiSelect/MultiSelectBase.d.ts +6 -4
  61. package/dist/MultiSelect/MultiSelectBase.js +222 -201
  62. package/dist/MultiSelect.d.ts +2 -1
  63. package/dist/MultiSelect.js +14 -12
  64. package/dist/Popover.js +2 -2
  65. package/dist/RadioButton.js +1 -1
  66. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -1
  67. package/dist/RadioButtonGroup.js +1 -1
  68. package/dist/RadioGroup-CfjhpW5o.js +328 -0
  69. package/dist/RadioGroup.d.ts +7 -0
  70. package/dist/RadioGroup.js +1 -1
  71. package/dist/Select.d.ts +5 -2
  72. package/dist/Select.js +97 -85
  73. package/dist/Separator.js +1 -1
  74. package/dist/Skeleton.js +1 -1
  75. package/dist/{Slider-BzzZT3Zm.js → Slider-mODhqkCs.js} +4 -4
  76. package/dist/Slider.js +1 -1
  77. package/dist/Switch-Wj_zov--.js +144 -0
  78. package/dist/Switch.d.ts +12 -3
  79. package/dist/Switch.js +1 -1
  80. package/dist/Tabs/TabsBase.js +4 -4
  81. package/dist/Tabs.js +1 -1
  82. package/dist/Textarea.d.ts +3 -2
  83. package/dist/Textarea.js +50 -45
  84. package/dist/{Toast-9zqXxKKO.js → Toast-CJvzLlMD.js} +1 -1
  85. package/dist/Toast.js +1 -1
  86. package/dist/Toggle.js +1 -1
  87. package/dist/ToggleGroup.js +1 -1
  88. package/dist/{Tooltip-D1K8kY1y.js → Tooltip-DH_BzFye.js} +5 -5
  89. package/dist/Tooltip.js +1 -1
  90. package/dist/Tray.js +5 -5
  91. package/dist/{chunk-h9knIhTc.js → chunk-C4rFPcKS.js} +1 -1
  92. package/dist/dist-BMu6Dgh_.js +149 -0
  93. package/dist/{dist-fW81qjVl.js → dist-C9fJjxxB.js} +41 -41
  94. package/dist/{dist-C0Hifjgh.js → dist-Cv8I-d2q.js} +2 -2
  95. package/dist/{dist-B9tup-4O.js → dist-D6QANKSj.js} +5 -5
  96. package/dist/{dist-3Af8168y.js → dist-Tbzy5UFA.js} +1 -1
  97. package/dist/{dist-B2k1iWFp.js → dist-jQ7HawWM.js} +1 -1
  98. package/dist/{dist-BtdmHAzK.js → dist-nYKAWiy4.js} +6 -6
  99. package/dist/main.js +1 -1
  100. package/dist/primitives/button.js +1 -1
  101. package/dist/primitives/input-group.js +1 -1
  102. package/dist/primitives/input.js +1 -1
  103. package/dist/primitives/popover.js +2 -2
  104. package/dist/primitives/select.js +40 -40
  105. package/dist/primitives/textarea.js +1 -1
  106. package/dist/{proxy-Dn10Pl_g.js → proxy-CCB7C4Pu.js} +10 -10
  107. package/dist/styles/spectral.css +1 -1
  108. package/dist/{twUtils-VNWgstKL.js → twUtils-D_qzdiwM.js} +1 -1
  109. package/dist/{use-animation-CBUDycyW.js → use-animation-C-qL83hj.js} +1 -1
  110. package/dist/utils/formFieldUtils.d.ts +15 -1
  111. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  112. package/dist/utils/formFieldUtils.js +35 -19
  113. package/dist/utils/twUtils.js +1 -1
  114. package/package.json +27 -22
  115. package/dist/ComboboxBase-qX-mQhT6.js +0 -491
  116. package/dist/RadioGroup-w_q6RGEK.js +0 -447
  117. package/dist/Switch-CVzRJ-0n.js +0 -126
  118. /package/dist/{dist-Bfjk-jx9.js → dist-ChNh3U3S.js} +0 -0
  119. /package/dist/{dist-B4FgboI8.js → dist-Cujfuel1.js} +0 -0
  120. /package/dist/{dist-D8Wb_MX9.js → dist-DDjUcieO.js} +0 -0
  121. /package/dist/{dist-s1uWaZYZ.js → dist-DFT13f_s.js} +0 -0
  122. /package/dist/{dist-ClmepHp4.js → dist-DIt8FP2G.js} +0 -0
  123. /package/dist/{dist-BK1K0g9W.js → dist-K0_i37VL.js} +0 -0
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
- import { t as e } from "../twUtils-VNWgstKL.js";
3
+ import { t as e } from "../twUtils-D_qzdiwM.js";
4
4
  import { getInputClasses as t } from "../utils/formFieldUtils.js";
5
5
  import { useUncontrolledState as n } from "../hooks/useUncontrolledState.js";
6
6
  import { Label as r } from "../Label.js";
7
- import { S as i, b as a, f as o } from "../DateTimeUtils-DVvG6H-p.js";
8
- import { forwardRef as s, useCallback as c, useEffect as l, useMemo as u, useRef as d } from "react";
9
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
+ import { S as i, b as a, f as o } from "../DateTimeUtils-DrR2JWoU.js";
8
+ import { forwardRef as s, useCallback as c, useEffect as l, useId as u, useMemo as d, useRef as f } from "react";
9
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
10
  //#region src/components/DateTimePicker/DateTimeDisplayInput.tsx
11
- var m = {
11
+ var h = {
12
12
  month: {
13
13
  type: "month",
14
14
  min: 1,
@@ -51,13 +51,13 @@ var m = {
51
51
  max: 1,
52
52
  length: 2
53
53
  }
54
- }, h = (e, t) => e === 2 ? t % 4 == 0 && t % 100 != 0 || t % 400 == 0 ? 29 : 28 : [
54
+ }, g = (e, t) => e === 2 ? t % 4 == 0 && t % 100 != 0 || t % 400 == 0 ? 29 : 28 : [
55
55
  4,
56
56
  6,
57
57
  9,
58
58
  11
59
- ].includes(e) ? 30 : 31, g = ({ ariaLabel: t, config: n, disabled: r, onLeftFocus: i, onRightFocus: a, onValueChange: o, periodLabels: s, value: p }) => {
60
- let m = d(null), h = d(""), g = d(!1), _ = u(() => {
59
+ ].includes(e) ? 30 : 31, _ = ({ ariaLabel: t, config: n, disabled: r, onLeftFocus: i, onRightFocus: a, onValueChange: o, periodLabels: s, value: u }) => {
60
+ let m = f(null), h = f(""), g = f(!1), _ = d(() => {
61
61
  switch (n.type) {
62
62
  case "month": return "MM";
63
63
  case "day": return "dd";
@@ -71,8 +71,8 @@ var m = {
71
71
  n.type,
72
72
  n.max,
73
73
  s
74
- ]), v = u(() => p === void 0 ? _ : n.type === "period" ? (p === 0 ? s?.am ?? "am" : s?.pm ?? "pm").toLowerCase() : p.toString().padStart(n.length, "0"), [
75
- p,
74
+ ]), v = d(() => u === void 0 ? _ : n.type === "period" ? (u === 0 ? s?.am ?? "am" : s?.pm ?? "pm").toLowerCase() : u.toString().padStart(n.length, "0"), [
75
+ u,
76
76
  n,
77
77
  s,
78
78
  _
@@ -107,15 +107,15 @@ var m = {
107
107
  return;
108
108
  }
109
109
  if (n.type === "period") {
110
- e.preventDefault(), e.key === "ArrowUp" || e.key === "ArrowDown" ? o(p === 0 ? 1 : 0) : e.key.toLowerCase() === "a" ? o(0) : e.key.toLowerCase() === "p" && o(1);
110
+ e.preventDefault(), e.key === "ArrowUp" || e.key === "ArrowDown" ? o(+(u === 0)) : e.key.toLowerCase() === "a" ? o(0) : e.key.toLowerCase() === "p" && o(1);
111
111
  return;
112
112
  }
113
113
  if (e.key === "ArrowUp") {
114
- e.preventDefault(), h.current = "", g.current = !1, o(p === void 0 || p >= n.max ? n.min : p + 1);
114
+ e.preventDefault(), h.current = "", g.current = !1, o(u === void 0 || u >= n.max ? n.min : u + 1);
115
115
  return;
116
116
  }
117
117
  if (e.key === "ArrowDown") {
118
- e.preventDefault(), h.current = "", g.current = !1, o(p === void 0 || p <= n.min ? n.max : p - 1);
118
+ e.preventDefault(), h.current = "", g.current = !1, o(u === void 0 || u <= n.min ? n.max : u - 1);
119
119
  return;
120
120
  }
121
121
  if (e.key === "Home") {
@@ -145,12 +145,12 @@ var m = {
145
145
  if (e.key === "Backspace") if (e.preventDefault(), h.current) {
146
146
  let e = h.current.slice(0, -1);
147
147
  h.current = e, g.current = e.length > 0, m.current && (m.current.value = e || v);
148
- } else p !== void 0 && (h.current = "", g.current = !0, o(n.min), m.current && (m.current.value = _));
148
+ } else u !== void 0 && (h.current = "", g.current = !0, o(n.min), m.current && (m.current.value = _));
149
149
  }
150
150
  }, [
151
151
  r,
152
152
  n,
153
- p,
153
+ u,
154
154
  v,
155
155
  _,
156
156
  o,
@@ -200,12 +200,12 @@ var m = {
200
200
  paddingLeft: 0
201
201
  };
202
202
  }
203
- }, [n.type]), T = u(() => w(), [w]), E = u(() => p === void 0, [p]);
204
- return /* @__PURE__ */ f("input", {
203
+ }, [n.type]), T = d(() => w(), [w]), E = d(() => u === void 0, [u]);
204
+ return /* @__PURE__ */ p("input", {
205
205
  "aria-label": t,
206
206
  "aria-valuemax": n.max,
207
207
  "aria-valuemin": n.min,
208
- "aria-valuenow": p,
208
+ "aria-valuenow": u,
209
209
  className: e("rounded inline-flex items-center justify-center text-center tabular-nums", "border-none bg-transparent outline-none", "focus:bg-bg-tertiary focus:text-text-primary focus:ring-1 focus:ring-accent", "hover:bg-bg-secondary", r && "cursor-not-allowed opacity-50", E && "text-text-placeholder text-sm"),
210
210
  "data-segment": n.type,
211
211
  defaultValue: v,
@@ -220,13 +220,13 @@ var m = {
220
220
  style: T,
221
221
  tabIndex: r ? -1 : 0
222
222
  });
223
- }, _ = s(({ className: s, defaultValue: l, disabled: _, endIcon: v, hourFormat: y = "12", id: b, label: x, locale: S, onChange: C, showTime: w = !0, state: T = "default", value: E, date: D, onDateChange: O, ...k }, A) => {
224
- let j = d(null), [M, N] = n({
223
+ }, v = s(({ className: s, defaultValue: l, disabled: v, endIcon: y, hourFormat: b = "12", id: x, label: S, locale: C, onChange: w, showTime: T = !0, state: E = "default", value: D, "aria-labelledby": O, date: k, onDateChange: A, ...j }, M) => {
224
+ let N = u(), P = x ?? `datetime-display-input-${N}`, F = `${P}-label`, I = f(null), L = [S ? F : void 0, O].filter(Boolean).join(" ") || void 0, [R, z] = n({
225
225
  defaultValue: l,
226
- onChange: C ?? O,
227
- value: E ?? D
228
- }), P = u(() => i(S), [S]), F = u(() => a(P), [P]), I = u(() => {
229
- if (!M) return {
226
+ onChange: w ?? A,
227
+ value: D ?? k
228
+ }), B = d(() => i(C), [C]), V = d(() => a(B), [B]), H = d(() => {
229
+ if (!R) return {
230
230
  month: void 0,
231
231
  day: void 0,
232
232
  year: void 0,
@@ -234,104 +234,105 @@ var m = {
234
234
  minute: void 0,
235
235
  period: void 0
236
236
  };
237
- let e = M.getHours(), t, n;
238
- return y === "24" ? (t = e, n = 0) : (n = e >= 12 ? 1 : 0, t = e % 12, t === 0 && (t = 12)), {
239
- month: M.getMonth() + 1,
240
- day: M.getDate(),
241
- year: M.getFullYear(),
237
+ let e = R.getHours(), t, n;
238
+ return b === "24" ? (t = e, n = 0) : (n = +(e >= 12), t = e % 12, t === 0 && (t = 12)), {
239
+ month: R.getMonth() + 1,
240
+ day: R.getDate(),
241
+ year: R.getFullYear(),
242
242
  hour: t,
243
- minute: M.getMinutes(),
243
+ minute: R.getMinutes(),
244
244
  period: n
245
245
  };
246
- }, [M, y]), L = I.month !== void 0 && I.day !== void 0 && I.year !== void 0, R = c((e) => {
246
+ }, [R, b]), U = H.month !== void 0 && H.day !== void 0 && H.year !== void 0, W = c((e) => {
247
247
  let t = {
248
- ...I,
248
+ ...H,
249
249
  ...e
250
250
  };
251
251
  if (t.month === void 0 && t.day === void 0 && t.year === void 0) {
252
- N(void 0);
252
+ z(void 0);
253
253
  return;
254
254
  }
255
- let n = /* @__PURE__ */ new Date(), r = (t.month ?? n.getMonth() + 1) - 1, i = t.day ?? n.getDate(), a = t.year ?? n.getFullYear(), o = h(r + 1, a), s = Math.min(i, o), c = I.month !== void 0 && I.day !== void 0 && I.year !== void 0, l = t.month !== void 0 && t.day !== void 0 && t.year !== void 0, u = !c && l, d;
256
- if (y === "24") d = u ? 0 : t.hour ?? 0;
255
+ let n = /* @__PURE__ */ new Date(), r = (t.month ?? n.getMonth() + 1) - 1, i = t.day ?? n.getDate(), a = t.year ?? n.getFullYear(), o = g(r + 1, a), s = Math.min(i, o), c = H.month !== void 0 && H.day !== void 0 && H.year !== void 0, l = t.month !== void 0 && t.day !== void 0 && t.year !== void 0, u = !c && l, d;
256
+ if (b === "24") d = u ? 0 : t.hour ?? 0;
257
257
  else {
258
258
  let e = u ? 12 : t.hour ?? 12, n = u ? 1 : t.period ?? 0, r = e, i = n;
259
259
  d = r === 12 ? i === 0 ? 0 : 12 : i === 0 ? r : r + 12;
260
260
  }
261
261
  let f = u ? 0 : t.minute ?? 0;
262
- N(new Date(a, r, s, d, f, 0, 0));
262
+ z(new Date(a, r, s, d, f, 0, 0));
263
263
  }, [
264
- I,
265
- y,
266
- N
267
- ]), z = u(() => {
264
+ H,
265
+ b,
266
+ z
267
+ ]), G = d(() => {
268
268
  let e = [
269
269
  {
270
270
  key: "month",
271
- config: m.month,
271
+ config: h.month,
272
272
  ariaLabel: "Month"
273
273
  },
274
274
  {
275
275
  key: "day",
276
- config: m.day,
276
+ config: h.day,
277
277
  ariaLabel: "Day"
278
278
  },
279
279
  {
280
280
  key: "year",
281
- config: m.year,
281
+ config: h.year,
282
282
  ariaLabel: "Year"
283
283
  }
284
284
  ];
285
- if (!w) return e;
286
- let t = y === "24" ? [{
285
+ if (!T) return e;
286
+ let t = b === "24" ? [{
287
287
  key: "hour",
288
- config: m.hour24,
288
+ config: h.hour24,
289
289
  ariaLabel: "Hours"
290
290
  }, {
291
291
  key: "minute",
292
- config: m.minute,
292
+ config: h.minute,
293
293
  ariaLabel: "Minutes"
294
294
  }] : [
295
295
  {
296
296
  key: "hour",
297
- config: m.hour12,
297
+ config: h.hour12,
298
298
  ariaLabel: "Hours"
299
299
  },
300
300
  {
301
301
  key: "minute",
302
- config: m.minute,
302
+ config: h.minute,
303
303
  ariaLabel: "Minutes"
304
304
  },
305
305
  {
306
306
  key: "period",
307
- config: m.period,
308
- ariaLabel: o(F, "Select {am} or {pm}")
307
+ config: h.period,
308
+ ariaLabel: o(V, "Select {am} or {pm}")
309
309
  }
310
310
  ];
311
311
  return [...e, ...t];
312
312
  }, [
313
- w,
314
- y,
315
- F
316
- ]), B = c((e) => {
317
- (j.current?.querySelectorAll("[role='spinbutton']")[e])?.focus();
318
- }, []), V = e(t(T, s));
319
- return /* @__PURE__ */ p("div", {
313
+ T,
314
+ b,
315
+ V
316
+ ]), K = c((e) => {
317
+ (I.current?.querySelectorAll("[role='spinbutton']")[e])?.focus();
318
+ }, []), q = t(E);
319
+ return /* @__PURE__ */ m("div", {
320
320
  className: "gap-1.5 flex flex-col",
321
- children: [x && /* @__PURE__ */ f(r, {
321
+ children: [S && /* @__PURE__ */ p(r, {
322
322
  className: "text-sm font-medium text-text-primary",
323
- htmlFor: b,
324
- children: x
325
- }), /* @__PURE__ */ p("div", {
326
- className: e(V, "relative", (_ ?? T === "disabled") && "cursor-not-allowed", s),
323
+ id: F,
324
+ children: S
325
+ }), /* @__PURE__ */ m("div", {
326
+ className: e(q, "relative", (v ?? E === "disabled") && "cursor-not-allowed", s),
327
327
  "data-slot": "datetime-display-input",
328
- id: b ?? "datetime-display-input",
329
- ref: A ?? j,
330
- ...k,
331
- children: [/* @__PURE__ */ f("div", {
328
+ id: P,
329
+ ref: M ?? I,
330
+ "aria-labelledby": L,
331
+ ...j,
332
+ children: [/* @__PURE__ */ p("div", {
332
333
  className: "flex items-center",
333
- ref: j,
334
- children: z.map((e, t) => {
334
+ ref: I,
335
+ children: G.map((e, t) => {
335
336
  let n = [
336
337
  "month",
337
338
  "day",
@@ -340,31 +341,31 @@ var m = {
340
341
  "hour",
341
342
  "minute",
342
343
  "period"
343
- ].includes(e.key), i = e.key === "year", a = e.key === "hour", o = _ ?? (r && !L);
344
- return /* @__PURE__ */ p("span", {
344
+ ].includes(e.key), i = e.key === "year", a = e.key === "hour", o = v ?? (r && !U);
345
+ return /* @__PURE__ */ m("span", {
345
346
  className: "flex items-center",
346
347
  children: [
347
- a && /* @__PURE__ */ f("span", {
348
+ a && /* @__PURE__ */ p("span", {
348
349
  "aria-hidden": "true",
349
350
  className: "text-text-secondary select-none",
350
351
  children: ",\xA0"
351
352
  }),
352
- /* @__PURE__ */ f(g, {
353
+ /* @__PURE__ */ p(_, {
353
354
  ariaLabel: e.ariaLabel,
354
355
  config: e.config,
355
356
  disabled: o,
356
- onLeftFocus: () => t > 0 && B(t - 1),
357
- onRightFocus: () => t < z.length - 1 && B(t + 1),
358
- onValueChange: (t) => R({ [e.key]: t }),
359
- periodLabels: F,
360
- value: I[e.key]
357
+ onLeftFocus: () => t > 0 && K(t - 1),
358
+ onRightFocus: () => t < G.length - 1 && K(t + 1),
359
+ onValueChange: (t) => W({ [e.key]: t }),
360
+ periodLabels: V,
361
+ value: H[e.key]
361
362
  }),
362
- n && !i && /* @__PURE__ */ f("span", {
363
+ n && !i && /* @__PURE__ */ p("span", {
363
364
  "aria-hidden": "true",
364
365
  className: "text-text-secondary select-none",
365
366
  children: "/"
366
367
  }),
367
- a && /* @__PURE__ */ f("span", {
368
+ a && /* @__PURE__ */ p("span", {
368
369
  "aria-hidden": "true",
369
370
  className: "text-inherit select-none",
370
371
  children: ":"
@@ -372,10 +373,10 @@ var m = {
372
373
  ]
373
374
  }, e.key);
374
375
  })
375
- }), v]
376
+ }), y]
376
377
  })]
377
378
  });
378
379
  });
379
- _.displayName = "DateTimeDisplayInput";
380
+ v.displayName = "DateTimeDisplayInput";
380
381
  //#endregion
381
- export { _ as DateTimeDisplayInput };
382
+ export { v as DateTimeDisplayInput };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
- import { t as e } from "../twUtils-VNWgstKL.js";
3
+ import { t as e } from "../twUtils-D_qzdiwM.js";
4
4
  import { Input as t } from "../primitives/input.js";
5
- import { F as n, S as r, _ as i, g as a, h as o, m as s, p as c, t as l, v as u } from "../DateTimeUtils-DVvG6H-p.js";
5
+ import { F as n, S as r, _ as i, g as a, h as o, m as s, p as c, t as l, v as u } from "../DateTimeUtils-DrR2JWoU.js";
6
6
  import { useCallback as d, useEffect as f, useMemo as p, useRef as m } from "react";
7
7
  import { jsx as h } from "react/jsx-runtime";
8
8
  //#region src/components/DateTimePicker/DateTimeInput.tsx
@@ -1,2 +1,2 @@
1
- import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as F, y as I } from "../DateTimeUtils-DVvG6H-p.js";
1
+ import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as F, y as I } from "../DateTimeUtils-DrR2JWoU.js";
2
2
  export { j as DEFAULT_TRANSLATIONS, E as DateTimeConfigSchema, k as HourFormatSchema, x as PICKER_TYPES, m as PeriodSchema, D as TIME_BOUNDS, A as TimePickerTypeSchema, g as TimeValueSchema, w as convert12HourTo24Hour, M as detectHourFormat, _ as display12HourValue, v as formatSelectPeriodLabel, O as formatTimeNumber, T as getAriaLabel, b as getAriaValueMinMax, y as getAriaValueNow, p as getArrowByType, N as getDateByType, I as getLocalizedPeriodLabel, h as getLocalizedPeriodLabels, F as getPeriodFromHours, d as getResolvedLocale, t as getValid12Hour, P as getValidArrow12Hour, f as getValidArrowHour, r as getValidArrowMinute, n as getValidArrowNumber, l as getValidHour, C as getValidMinute, e as getValidNumber, S as isValid12Hour, s as isValidHour, c as isValidMinute, u as set12Hours, i as setDateByType, a as setHours, o as setMinutes };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
- import { t as e } from "../twUtils-VNWgstKL.js";
3
+ import { t as e } from "../twUtils-D_qzdiwM.js";
4
4
  import { Select as t, SelectContent as n, SelectItem as r, SelectTrigger as i, SelectValue as a } from "../primitives/select.js";
5
5
  import { forwardRef as o } from "react";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -8,41 +8,38 @@ import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
8
  var l = {
9
9
  am: "AM",
10
10
  pm: "PM"
11
- }, u = o(({ ariaLabel: o, className: u, disabled: d, labels: f = l, onLeftFocus: p, onPeriodChange: m, onRightFocus: h, period: g, ..._ }, v) => {
12
- let y = o ?? `Select ${f.am} or ${f.pm}`, b = (e) => {
13
- e.key === "ArrowRight" && (e.preventDefault(), h?.()), e.key === "ArrowLeft" && (e.preventDefault(), p?.());
14
- };
15
- return /* @__PURE__ */ c(t, {
16
- defaultValue: g,
17
- disabled: d,
18
- onValueChange: (e) => m(e),
19
- value: g,
20
- children: [/* @__PURE__ */ s(i, {
21
- "aria-label": y,
22
- className: e("w-fit", u),
23
- "data-slot": "time-period-select",
24
- "data-testid": "spectral-time-period-select",
25
- onKeyDown: b,
26
- ref: v,
27
- size: "sm",
28
- ..._,
29
- children: /* @__PURE__ */ s(a, { children: g === "AM" ? f.am : f.pm })
30
- }), /* @__PURE__ */ c(n, {
31
- "data-testid": "spectral-time-period-select-content",
32
- position: "popper",
33
- sideOffset: 4,
34
- children: [/* @__PURE__ */ s(r, {
35
- "data-testid": "spectral-time-period-select-am",
36
- value: "AM",
37
- children: f.am
38
- }), /* @__PURE__ */ s(r, {
39
- "data-testid": "spectral-time-period-select-pm",
40
- value: "PM",
41
- children: f.pm
42
- })]
11
+ }, u = o(({ ariaLabel: o, className: u, disabled: d, labels: f = l, onLeftFocus: p, onPeriodChange: m, onRightFocus: h, period: g, ..._ }, v) => /* @__PURE__ */ c(t, {
12
+ defaultValue: g,
13
+ disabled: d,
14
+ onValueChange: (e) => m(e),
15
+ value: g,
16
+ children: [/* @__PURE__ */ s(i, {
17
+ "aria-label": o ?? `Select ${f.am} or ${f.pm}`,
18
+ className: e("w-fit", u),
19
+ "data-slot": "time-period-select",
20
+ "data-testid": "spectral-time-period-select",
21
+ onKeyDown: (e) => {
22
+ e.key === "ArrowRight" && (e.preventDefault(), h?.()), e.key === "ArrowLeft" && (e.preventDefault(), p?.());
23
+ },
24
+ ref: v,
25
+ size: "sm",
26
+ ..._,
27
+ children: /* @__PURE__ */ s(a, { children: g === "AM" ? f.am : f.pm })
28
+ }), /* @__PURE__ */ c(n, {
29
+ "data-testid": "spectral-time-period-select-content",
30
+ position: "popper",
31
+ sideOffset: 4,
32
+ children: [/* @__PURE__ */ s(r, {
33
+ "data-testid": "spectral-time-period-select-am",
34
+ value: "AM",
35
+ children: f.am
36
+ }), /* @__PURE__ */ s(r, {
37
+ "data-testid": "spectral-time-period-select-pm",
38
+ value: "PM",
39
+ children: f.pm
43
40
  })]
44
- });
45
- });
41
+ })]
42
+ }));
46
43
  u.displayName = "TimePeriodSelect";
47
44
  //#endregion
48
45
  export { u as TimePeriodSelect };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
- import { t as e } from "../twUtils-VNWgstKL.js";
4
- import { S as t, b as n, f as r, t as i, u as a, x as o } from "../DateTimeUtils-DVvG6H-p.js";
3
+ import { t as e } from "../twUtils-D_qzdiwM.js";
4
+ import { S as t, b as n, f as r, t as i, u as a, x as o } from "../DateTimeUtils-DrR2JWoU.js";
5
5
  import { DateTimeInput as s } from "./DateTimeInput.js";
6
6
  import { TimePeriodSelect as c } from "./TimePeriodSelect.js";
7
7
  import { useMemo as l, useRef as u } from "react";
@@ -20,7 +20,7 @@ export interface DateTimePickerProps extends Omit<ComponentProps<'div'>, 'onChan
20
20
  value?: Date;
21
21
  }
22
22
  export declare const DateTimePicker: {
23
- ({ calendarProps, className, defaultValue, disabled, disablePastDates, errorMessage, hourFormat, label, locale, onChange, showTimePicker, state, timeLocale, timeTranslations, value, ...props }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
23
+ ({ calendarProps, className, defaultValue, disabled, disablePastDates, errorMessage, hourFormat, label, locale, onChange, showTimePicker, state, timeLocale, timeTranslations, value, id, ...props }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
24
24
  displayName: string;
25
25
  };
26
26
  export { Calendar } from './Calendar';
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
3
  import { CalendarIcon as e } from "./Icons/CalendarIcon.js";
4
- import { t } from "./twUtils-VNWgstKL.js";
5
- import { ErrorMessage as n } from "./utils/formFieldUtils.js";
6
- import { useUncontrolledState as r } from "./hooks/useUncontrolledState.js";
7
- import { Popover as i, PopoverContent as a, PopoverTrigger as o } from "./Popover.js";
8
- import { t as s } from "./Calendar-s4lyijkn.js";
9
- import { A as c, C as l, D as u, E as d, F as f, I as p, L as m, M as h, N as g, O as _, P as v, S as y, T as b, _ as x, a as S, b as C, c as w, d as T, f as E, g as D, h as O, i as k, j as A, k as j, l as M, m as N, n as P, o as F, p as I, r as L, s as R, t as z, u as B, v as V, w as H, x as U, y as W } from "./DateTimeUtils-DVvG6H-p.js";
4
+ import { t } from "./twUtils-D_qzdiwM.js";
5
+ import { ErrorMessage as n, getErrorMessageId as r, useFormFieldId as i } from "./utils/formFieldUtils.js";
6
+ import { useUncontrolledState as a } from "./hooks/useUncontrolledState.js";
7
+ import { Popover as o, PopoverContent as s, PopoverTrigger as ee } from "./Popover.js";
8
+ import { t as c } from "./Calendar-2UVWeLYp.js";
9
+ import { A as l, C as u, D as d, E as f, F as p, I as m, L as h, M as g, N as _, O as v, P as y, S as b, T as x, _ as S, a as C, b as w, c as T, d as E, f as D, g as O, h as k, i as A, j, k as M, l as N, m as P, n as F, o as I, p as L, r as te, s as R, t as z, u as B, v as V, w as H, x as U, y as W } from "./DateTimeUtils-DrR2JWoU.js";
10
10
  import { DateTimeDisplayInput as G } from "./DateTimePicker/DateTimeDisplayInput.js";
11
11
  import { DateTimeInput as K } from "./DateTimePicker/DateTimeInput.js";
12
12
  import { TimePeriodSelect as q } from "./DateTimePicker/TimePeriodSelect.js";
@@ -14,77 +14,80 @@ import { TimePicker as J } from "./DateTimePicker/TimePicker.js";
14
14
  import { useCallback as Y, useMemo as X } from "react";
15
15
  import { jsx as Z, jsxs as Q } from "react/jsx-runtime";
16
16
  //#region src/components/DateTimePicker/DateTimePicker.tsx
17
- var $ = ({ calendarProps: c, className: l, defaultValue: u, disabled: d = !1, disablePastDates: f = !0, errorMessage: p, hourFormat: m, label: h, locale: g, onChange: _, showTimePicker: v = !0, state: b = "default", timeLocale: x, timeTranslations: S, value: C, ...w }) => {
18
- let [T, E] = r({
19
- defaultValue: u,
20
- onChange: _,
21
- value: C
22
- }), D = X(() => y(x), [x]), O = X(() => m ?? B(D), [m, D]), k = (e) => {
17
+ var $ = ({ calendarProps: l, className: u, defaultValue: d, disabled: f = !1, disablePastDates: p = !0, errorMessage: m, hourFormat: h, label: g, locale: _, onChange: v, showTimePicker: y = !0, state: x = "default", timeLocale: S, timeTranslations: C, value: w, id: T, ...E }) => {
18
+ let D = i(T), O = r(D), k = x === "error" && m ? O : void 0, [A, j] = a({
19
+ defaultValue: d,
20
+ onChange: v,
21
+ value: w
22
+ }), M = X(() => b(S), [S]), N = X(() => h ?? B(M), [h, M]), P = (e) => {
23
23
  if (!e) {
24
- E(void 0);
24
+ j(void 0);
25
25
  return;
26
26
  }
27
- T && e.setHours(T.getHours(), T.getMinutes(), 0, 0), E(e);
28
- }, A = Y((e) => {
29
- E(e);
30
- }, [E]), j = (e) => {}, M = (e) => {
31
- E(e);
27
+ A && e.setHours(A.getHours(), A.getMinutes(), 0, 0), j(e);
28
+ }, F = Y((e) => {
29
+ j(e);
30
+ }, [j]), I = (e) => {}, L = (e) => {
31
+ j(e);
32
32
  };
33
- return /* @__PURE__ */ Q(i, { children: [/* @__PURE__ */ Q("div", {
34
- className: t("w-full", l),
33
+ return /* @__PURE__ */ Q(o, { children: [/* @__PURE__ */ Q("div", {
34
+ className: t("w-full", u),
35
35
  "data-slot": "datetime-picker",
36
36
  "data-testid": "spectral-datetime-picker",
37
- ...w,
37
+ ...E,
38
38
  children: [/* @__PURE__ */ Z(G, {
39
- className: t("gap-4 pr-12 flex w-full justify-start", !T && "text-text-secondary"),
39
+ "aria-describedby": k,
40
+ "aria-invalid": x === "error",
41
+ className: t("gap-4 pr-12 flex w-full justify-start", !A && "text-text-secondary"),
40
42
  "data-testid": "spectral-datetime-picker-input",
41
- disabled: d,
42
- endIcon: /* @__PURE__ */ Z(o, {
43
+ disabled: f,
44
+ endIcon: /* @__PURE__ */ Z(ee, {
43
45
  asChild: !0,
44
- disabled: d,
46
+ disabled: f,
45
47
  children: /* @__PURE__ */ Z(e, {
46
48
  "aria-label": "Open date picker",
47
- className: t("right-4 text-input-icon hover:text-input-icon--hover absolute top-1/2 -translate-y-1/2 cursor-pointer focus:outline-none", d ? "pointer-events-none cursor-not-allowed opacity-50" : "hover:text-input-icon--hover cursor-pointer"),
49
+ className: t("right-4 text-input-icon hover:text-input-icon--hover absolute top-1/2 -translate-y-1/2 cursor-pointer focus:outline-none", f ? "pointer-events-none cursor-not-allowed opacity-50" : "hover:text-input-icon--hover cursor-pointer"),
48
50
  "data-testid": "spectral-datetime-picker-trigger",
49
- disabled: d
51
+ disabled: f
50
52
  })
51
53
  }),
52
- hourFormat: O,
53
- label: h,
54
- onChange: M,
55
- showTime: v,
56
- state: b,
57
- value: T
58
- }), b === "error" && p && /* @__PURE__ */ Z(n, {
59
- message: p,
54
+ hourFormat: N,
55
+ id: D,
56
+ label: g,
57
+ onChange: L,
58
+ showTime: y,
59
+ state: x,
60
+ value: A
61
+ }), x === "error" && m && /* @__PURE__ */ Z(n, {
60
62
  dataTestId: "spectral-datetime-picker-error-message",
61
- id: "datetime-picker-error"
63
+ id: O,
64
+ message: m
62
65
  })]
63
- }), /* @__PURE__ */ Q(a, {
66
+ }), /* @__PURE__ */ Q(s, {
64
67
  align: "start",
65
- className: t("rounded-lg py-4 px-6 flex", !v && "w-[330px]", v && O === "24" && "w-[486px]", v && O === "12" && "w-[560px]"),
68
+ className: t("rounded-lg py-4 px-6 flex", !y && "w-[330px]", y && N === "24" && "w-[486px]", y && N === "12" && "w-[560px]"),
66
69
  "data-testid": "spectral-datetime-picker-popover",
67
70
  onOpenAutoFocus: (e) => e.preventDefault(),
68
- children: [/* @__PURE__ */ Z(s, {
69
- ...c,
70
- disablePastDates: f,
71
- locale: g,
71
+ children: [/* @__PURE__ */ Z(c, {
72
+ ...l,
73
+ disablePastDates: p,
74
+ locale: _,
72
75
  mode: "single",
73
- onSelect: k,
74
- selected: T
75
- }), v && /* @__PURE__ */ Z("div", {
76
+ onSelect: P,
77
+ selected: A
78
+ }), y && /* @__PURE__ */ Z("div", {
76
79
  className: "pl-6 border-l border-border-secondary",
77
80
  children: /* @__PURE__ */ Z(J, {
78
- date: T,
79
- hourFormat: O,
80
- locale: D,
81
- onChange: A,
82
- onPeriodChange: j,
83
- translations: S
81
+ date: A,
82
+ hourFormat: N,
83
+ locale: M,
84
+ onChange: F,
85
+ onPeriodChange: I,
86
+ translations: C
84
87
  })
85
88
  })]
86
89
  })] });
87
90
  };
88
91
  $.displayName = "DateTimePicker";
89
92
  //#endregion
90
- export { s as Calendar, z as DEFAULT_TRANSLATIONS, P as DateTimeConfigSchema, G as DateTimeDisplayInput, K as DateTimeInput, $ as DateTimePicker, L as HourFormatSchema, k as PICKER_TYPES, S as PeriodSchema, F as TIME_BOUNDS, q as TimePeriodSelect, J as TimePicker, R as TimePickerTypeSchema, w as TimeValueSchema, M as convert12HourTo24Hour, B as detectHourFormat, T as display12HourValue, E as formatSelectPeriodLabel, I as formatTimeNumber, N as getAriaLabel, O as getAriaValueMinMax, D as getAriaValueNow, x as getArrowByType, V as getDateByType, W as getLocalizedPeriodLabel, C as getLocalizedPeriodLabels, U as getPeriodFromHours, y as getResolvedLocale, l as getValid12Hour, H as getValidArrow12Hour, b as getValidArrowHour, d as getValidArrowMinute, u as getValidArrowNumber, _ as getValidHour, j as getValidMinute, c as getValidNumber, A as isValid12Hour, h as isValidHour, g as isValidMinute, v as set12Hours, f as setDateByType, p as setHours, m as setMinutes };
93
+ export { c as Calendar, z as DEFAULT_TRANSLATIONS, F as DateTimeConfigSchema, G as DateTimeDisplayInput, K as DateTimeInput, $ as DateTimePicker, te as HourFormatSchema, A as PICKER_TYPES, C as PeriodSchema, I as TIME_BOUNDS, q as TimePeriodSelect, J as TimePicker, R as TimePickerTypeSchema, T as TimeValueSchema, N as convert12HourTo24Hour, B as detectHourFormat, E as display12HourValue, D as formatSelectPeriodLabel, L as formatTimeNumber, P as getAriaLabel, k as getAriaValueMinMax, O as getAriaValueNow, S as getArrowByType, V as getDateByType, W as getLocalizedPeriodLabel, w as getLocalizedPeriodLabels, U as getPeriodFromHours, b as getResolvedLocale, u as getValid12Hour, H as getValidArrow12Hour, x as getValidArrowHour, f as getValidArrowMinute, d as getValidArrowNumber, v as getValidHour, M as getValidMinute, l as getValidNumber, j as isValid12Hour, g as isValidHour, _ as isValidMinute, y as set12Hours, p as setDateByType, m as setHours, h as setMinutes };
@@ -62,7 +62,7 @@ function c(e) {
62
62
  return e == null;
63
63
  }
64
64
  function l(e) {
65
- let t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
65
+ let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
66
66
  return e.slice(t, n);
67
67
  }
68
68
  function u(e, t) {
package/dist/Dialog.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "./styles/main.css";
2
2
  import { CloseIcon as e } from "./Icons/CloseIcon.js";
3
- import { t } from "./twUtils-VNWgstKL.js";
4
- import { n } from "./es2015-YHaMV-St.js";
5
- import { a as r, c as i, i as a, n as o, o as s, r as c, s as l, t as u } from "./dist-B9tup-4O.js";
3
+ import { t } from "./twUtils-D_qzdiwM.js";
4
+ import { t as n } from "./Combination-9q50p_Vu.js";
5
+ import { a as r, c as i, i as a, n as o, o as s, r as c, s as l, t as u } from "./dist-D6QANKSj.js";
6
6
  import "react";
7
7
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
8
  //#region src/components/Dialog/Dialog.tsx
package/dist/Drawer.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./styles/main.css";
2
2
  import { SpectralProvider as e } from "./SpectralProvider.js";
3
- import { t } from "./dist-3Af8168y.js";
3
+ import { t } from "./dist-Tbzy5UFA.js";
4
4
  import "react";
5
5
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
6
  //#region src/components/Drawer/Drawer.tsx