@spear-ai/spectral 1.13.0 → 1.13.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 (49) hide show
  1. package/dist/.js +41 -40
  2. package/dist/Button.d.ts +1 -1
  3. package/dist/Button.js +46 -45
  4. package/dist/Checkbox.js +6 -5
  5. package/dist/{Combobox-DCCcIDgq.js → Combobox-DRQqx0os.js} +9 -8
  6. package/dist/Combobox.js +1 -1
  7. package/dist/ControlGroup/ControlGroupSelect.d.ts +5 -1
  8. package/dist/ControlGroup/ControlGroupSelect.js +73 -67
  9. package/dist/ControlGroup.js +29 -24
  10. package/dist/DateTimePicker/TimePeriodSelect.js +1 -1
  11. package/dist/DateTimePicker.js +8 -7
  12. package/dist/{DropdownMenu-B8I8IRcu.js → DropdownMenu-BO_RPCVU.js} +204 -202
  13. package/dist/DropdownMenu.d.ts +3 -2
  14. package/dist/DropdownMenu.js +1 -1
  15. package/dist/FormFieldMessage.d.ts +11 -0
  16. package/dist/FormFieldMessage.js +55 -0
  17. package/dist/Input.d.ts +1 -0
  18. package/dist/Input.js +68 -67
  19. package/dist/InputNumeric.js +3 -14
  20. package/dist/{InputOTP-DyhesOLs.js → InputOTP-DLn7ja7J.js} +5 -4
  21. package/dist/InputOTP.js +1 -1
  22. package/dist/MultiSelect/MultiSelectBase.js +105 -104
  23. package/dist/{RadioGroup-BsBK247l.js → RadioGroup-D-XjCU4Q.js} +33 -28
  24. package/dist/RadioGroup.js +1 -1
  25. package/dist/Select.js +21 -20
  26. package/dist/{Switch-Vep4hsq4.js → Switch-CSmXtkia.js} +26 -25
  27. package/dist/Switch.js +1 -1
  28. package/dist/Textarea/TextareaUtils.js +4 -8
  29. package/dist/Textarea.js +23 -22
  30. package/dist/Toggle.d.ts +1 -1
  31. package/dist/Toggle.js +10 -10
  32. package/dist/ToggleGroup/ToggleGroupBase.d.ts +1 -1
  33. package/dist/ToggleGroup/ToggleGroupBase.js +19 -19
  34. package/dist/ToggleGroup/ToggleGroupItem.js +2 -2
  35. package/dist/ToggleGroup/ToggleGroupSplitMenuItem.d.ts +5 -2
  36. package/dist/ToggleGroup/ToggleGroupSplitMenuItem.js +91 -52
  37. package/dist/ToggleGroup.js +1 -1
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/primitives/select.d.ts +1 -1
  41. package/dist/primitives/select.d.ts.map +1 -1
  42. package/dist/primitives/select.js +1 -1
  43. package/dist/primitives/textarea.js +1 -1
  44. package/dist/{select-oAOoVl5g.js → select-DFE8xm1L.js} +230 -259
  45. package/dist/styles/spectral.css +1 -1
  46. package/dist/utils/formFieldUtils.d.ts +1 -13
  47. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  48. package/dist/utils/formFieldUtils.js +48 -69
  49. package/package.json +1 -1
@@ -2,7 +2,8 @@
2
2
  import './styles/main.css'
3
3
  import { t as e } from "./twUtils-BpqlKSeB.js";
4
4
  import { Slot as t } from "./primitives/slot.js";
5
- import { ErrorMessage as n, WarningMessage as r, getErrorMessageId as i, useFormFieldId as a, useFormFieldState as o } from "./utils/formFieldUtils.js";
5
+ import { ErrorMessage as n, WarningMessage as r } from "./FormFieldMessage.js";
6
+ import { getErrorMessageId as i, useFormFieldId as a, useFormFieldState as o } from "./utils/formFieldUtils.js";
6
7
  import { createContext as s, useContext as c } from "react";
7
8
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
9
  //#region src/components/ControlGroup/ControlGroup.tsx
@@ -12,7 +13,7 @@ var d = s(null), f = () => {
12
13
  return e;
13
14
  }, p = ({ className: t, disabled: s, errorMessage: c, id: f, name: p, orientation: m = "horizontal", state: h = "default", warningMessage: g, ..._ }) => {
14
15
  let v = a(f, p), y = i(v), b = `${v}-warning`, { isDisabled: x, isLoading: S, isInvalid: C } = o(s, h), w = h === "error" && c ? y : h === "warning" && g ? b : void 0;
15
- return /* @__PURE__ */ u(d.Provider, {
16
+ return /* @__PURE__ */ l(d.Provider, {
16
17
  value: {
17
18
  messageId: w,
18
19
  isDisabled: x,
@@ -21,28 +22,32 @@ var d = s(null), f = () => {
21
22
  orientation: m,
22
23
  state: h
23
24
  },
24
- children: [
25
- /* @__PURE__ */ l("div", {
26
- "data-slot": "control-group",
27
- "data-orientation": m,
28
- "data-state": h,
29
- id: v,
30
- role: "group",
31
- "aria-describedby": w,
32
- className: e("group flex", m === "vertical" && "flex-col", x && "pointer-events-none opacity-50", t),
33
- ..._
34
- }),
35
- C && c && /* @__PURE__ */ l(n, {
36
- dataTestId: "spectral-control-group-error-message",
37
- id: y,
38
- message: c
39
- }),
40
- h === "warning" && g && /* @__PURE__ */ l(r, {
41
- dataTestId: "spectral-control-group-warning-message",
42
- id: b,
43
- message: g
44
- })
45
- ]
25
+ children: /* @__PURE__ */ u("div", {
26
+ "data-slot": "control-group-field",
27
+ className: "space-y-1.5 w-full",
28
+ children: [
29
+ /* @__PURE__ */ l("div", {
30
+ "data-slot": "control-group",
31
+ "data-orientation": m,
32
+ "data-state": h,
33
+ id: v,
34
+ role: "group",
35
+ "aria-describedby": w,
36
+ className: e("group flex w-full", m === "vertical" && "flex-col", x && "pointer-events-none opacity-50", t),
37
+ ..._
38
+ }),
39
+ /* @__PURE__ */ l(n, {
40
+ dataTestId: "spectral-control-group-error-message",
41
+ id: y,
42
+ message: C ? c : null
43
+ }),
44
+ /* @__PURE__ */ l(r, {
45
+ dataTestId: "spectral-control-group-warning-message",
46
+ id: b,
47
+ message: h === "warning" ? g : null
48
+ })
49
+ ]
50
+ })
46
51
  });
47
52
  }, m = ({ className: n, ...r }) => {
48
53
  let { orientation: i } = f();
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import '../styles/main.css'
3
3
  import { t as e } from "../twUtils-BpqlKSeB.js";
4
- import { i as t, l as n, n as r, t as i, u as a } from "../select-oAOoVl5g.js";
4
+ import { i as t, l as n, n as r, t as i, u as a } from "../select-DFE8xm1L.js";
5
5
  import { forwardRef as o } from "react";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  //#region src/components/DateTimePicker/TimePeriodSelect.tsx
@@ -2,9 +2,10 @@
2
2
  import './styles/main.css'
3
3
  import { CalendarIcon as e } from "./Icons/CalendarIcon.js";
4
4
  import { t } from "./twUtils-BpqlKSeB.js";
5
- import { ErrorMessage as n, getErrorMessageId as r, useFormFieldId as i } from "./utils/formFieldUtils.js";
5
+ import { ErrorMessage as n } from "./FormFieldMessage.js";
6
+ import { getErrorMessageId as r, useFormFieldId as i } from "./utils/formFieldUtils.js";
6
7
  import { useUncontrolledState as a } from "./hooks/useUncontrolledState.js";
7
- import { Popover as o, PopoverContent as s, PopoverTrigger as ee } from "./Popover.js";
8
+ import { Popover as ee, PopoverContent as o, PopoverTrigger as s } from "./Popover.js";
8
9
  import { t as c } from "./Calendar-FXWVuKWS.js";
9
10
  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-BJUAMuot.js";
10
11
  import { DateTimeDisplayInput as G } from "./DateTimePicker/DateTimeDisplayInput.js";
@@ -30,7 +31,7 @@ var $ = ({ calendarProps: l, className: u, defaultValue: d, disabled: f = !1, di
30
31
  }, [j]), I = (e) => {}, L = (e) => {
31
32
  j(e);
32
33
  };
33
- return /* @__PURE__ */ Q(o, { children: [/* @__PURE__ */ Q("div", {
34
+ return /* @__PURE__ */ Q(ee, { children: [/* @__PURE__ */ Q("div", {
34
35
  className: t("w-full", u),
35
36
  "data-slot": "datetime-picker",
36
37
  "data-testid": "spectral-datetime-picker",
@@ -41,7 +42,7 @@ var $ = ({ calendarProps: l, className: u, defaultValue: d, disabled: f = !1, di
41
42
  className: t("gap-4 pr-12 flex w-full justify-start", !A && "text-text-secondary"),
42
43
  "data-testid": "spectral-datetime-picker-input",
43
44
  disabled: f,
44
- endIcon: /* @__PURE__ */ Z(ee, {
45
+ endIcon: /* @__PURE__ */ Z(s, {
45
46
  asChild: !0,
46
47
  disabled: f,
47
48
  children: /* @__PURE__ */ Z(e, {
@@ -58,12 +59,12 @@ var $ = ({ calendarProps: l, className: u, defaultValue: d, disabled: f = !1, di
58
59
  showTime: y,
59
60
  state: x,
60
61
  value: A
61
- }), x === "error" && m && /* @__PURE__ */ Z(n, {
62
+ }), /* @__PURE__ */ Z(n, {
62
63
  dataTestId: "spectral-datetime-picker-error-message",
63
64
  id: O,
64
- message: m
65
+ message: x === "error" ? m : null
65
66
  })]
66
- }), /* @__PURE__ */ Q(s, {
67
+ }), /* @__PURE__ */ Q(o, {
67
68
  align: "start",
68
69
  className: t("rounded-lg py-4 px-6 flex", !y && "w-[330px]", y && N === "24" && "w-[486px]", y && N === "12" && "w-[560px]"),
69
70
  "data-testid": "spectral-datetime-picker-popover",