@spear-ai/spectral 1.12.0 → 1.12.2

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 (45) hide show
  1. package/dist/.js +8 -8
  2. package/dist/{es2015-YHaMV-St.js → Combination-9q50p_Vu.js} +251 -254
  3. package/dist/Combobox/ComboboxBase.js +492 -3
  4. package/dist/Combobox-Ch5Rxk5v.js +6360 -0
  5. package/dist/Combobox.js +3 -137
  6. package/dist/DateTimePicker/Calendar.js +1 -1
  7. package/dist/DateTimePicker/DateTimeDisplayInput.js +1 -1
  8. package/dist/DateTimePicker/DateTimeInput.js +1 -1
  9. package/dist/DateTimePicker/DateTimeUtils.js +1 -1
  10. package/dist/DateTimePicker/TimePicker.js +1 -1
  11. package/dist/DateTimePicker.js +2 -2
  12. package/dist/Dialog.js +2 -2
  13. package/dist/Drawer.js +1 -1
  14. package/dist/DropdownMenu.js +241 -241
  15. package/dist/{HoverCard-DERasp0v.js → HoverCard-BGpW6LnA.js} +2 -2
  16. package/dist/HoverCard.js +1 -1
  17. package/dist/MultiSelect/MultiSelectBase.js +1 -1
  18. package/dist/Popover.js +1 -1
  19. package/dist/{RadioGroup-DqKggFnI.js → RadioGroup-CfjhpW5o.js} +3 -3
  20. package/dist/RadioGroup.js +1 -1
  21. package/dist/Select.js +55 -55
  22. package/dist/{Slider-CfUFkWU4.js → Slider-mODhqkCs.js} +3 -3
  23. package/dist/Slider.js +1 -1
  24. package/dist/{Tooltip-BR0tdif4.js → Tooltip-DH_BzFye.js} +3 -3
  25. package/dist/Tooltip.js +1 -1
  26. package/dist/Tray.js +1 -1
  27. package/dist/{dist-DcUGLq_y.js → dist-BMu6Dgh_.js} +1 -1
  28. package/dist/{dist-fW81qjVl.js → dist-C9fJjxxB.js} +41 -41
  29. package/dist/{dist-C0Hifjgh.js → dist-Cv8I-d2q.js} +2 -2
  30. package/dist/{dist-B9tup-4O.js → dist-D6QANKSj.js} +5 -5
  31. package/dist/{dist-3Af8168y.js → dist-Tbzy5UFA.js} +1 -1
  32. package/dist/{dist-B2k1iWFp.js → dist-jQ7HawWM.js} +1 -1
  33. package/dist/{dist-BtdmHAzK.js → dist-nYKAWiy4.js} +6 -6
  34. package/dist/primitives/popover.js +1 -1
  35. package/dist/primitives/select.js +32 -32
  36. package/dist/styles/spectral.css +1 -1
  37. package/package.json +4 -2
  38. package/dist/ComboboxBase-BzDGK36x.js +0 -491
  39. /package/dist/{Calendar-Cnh_PTbQ.js → Calendar-2UVWeLYp.js} +0 -0
  40. /package/dist/{DateTimeUtils-BJUAMuot.js → DateTimeUtils-DrR2JWoU.js} +0 -0
  41. /package/dist/{dist-Bfjk-jx9.js → dist-ChNh3U3S.js} +0 -0
  42. /package/dist/{dist-D8Wb_MX9.js → dist-DDjUcieO.js} +0 -0
  43. /package/dist/{dist-s1uWaZYZ.js → dist-DFT13f_s.js} +0 -0
  44. /package/dist/{dist-ClmepHp4.js → dist-DIt8FP2G.js} +0 -0
  45. /package/dist/{dist-BK1K0g9W.js → dist-K0_i37VL.js} +0 -0
package/dist/Combobox.js CHANGED
@@ -1,137 +1,3 @@
1
- "use client";
2
- import "./styles/main.css";
3
- import { ChevronDownIcon as e } from "./Icons/ChevronDownIcon.js";
4
- import { LoaderIcon as t } from "./Icons/LoaderIcon.js";
5
- import { t as n } from "./twUtils-D_qzdiwM.js";
6
- import { EmptyState as ee, ErrorMessage as r, LoadingState as i, WarningMessage as a, getAriaProps as o, getDropdownSurfaceClasses as s, getDropdownWidthStyles as c, getErrorMessageId as l, getFormFieldCSSProperties as u, getOptionClasses as d, getTriggerClasses as f, useFormFieldId as te } from "./utils/formFieldUtils.js";
7
- import { useUncontrolledState as ne } from "./hooks/useUncontrolledState.js";
8
- import { Label as re } from "./Label.js";
9
- import { InputGroup as ie, InputGroupAddon as ae } from "./primitives/input-group.js";
10
- import { useAutoDropdownHorizontalShift as oe } from "./utils/dropdownPositioning.js";
11
- import { a as se, i as p, n as ce, o as m } from "./ComboboxBase-BzDGK36x.js";
12
- import { useCallback as le, useRef as h, useState as g } from "react";
13
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
14
- //#region src/components/Combobox/Combobox.tsx
15
- var y = ({ className: y, disabled: ue, defaultValue: de = "", dropdownWidth: b = "trigger", emptyMessage: x = "No options found.", errorMessage: S, id: C, label: w, labelClassName: T, loadingMessage: E = "Loading…", name: D, onChange: O, onValueChange: k, options: A = [], placeholder: j = "Search…", ref: M, required: N, state: P = "default", value: F, warningMessage: I, "aria-describedby": L, "aria-label": R }) => {
16
- process.env.NODE_ENV !== "production" && !w && !R && console.warn("Combobox: provide either `label` or `aria-label` for an accessible name.");
17
- let z = h(null), B = h(null), V = te(C, D), H = `${V}-listbox`, U = l(V), W = `${V}-warning`, fe = P === "error" ? U : P === "warning" && I ? W : void 0, G = !!ue, K = P === "loading", pe = P === "error", me = o(P, L, N, fe), [q, J] = g(!1), { dropdownShiftStyle: he, setDropdownElement: ge } = oe(q), [Y, X] = g(""), [Z, _e] = ne({
18
- value: F,
19
- defaultValue: de,
20
- onChange: (e) => {
21
- O ? O(e) : k?.(e);
22
- }
23
- }), Q = A.find((e) => e.value === Z), ve = !!(Q && Y.length === 0), { dropdownWidthMode: $, dropdownWidthStyle: ye } = c({
24
- dropdownWidth: b,
25
- triggerWidth: "var(--radix-popover-trigger-width)"
26
- }), be = (e) => {
27
- _e(e === Z ? "" : e), X(""), J(!1);
28
- }, xe = (e) => {
29
- e.key === "Escape" && J(!1);
30
- }, Se = le(() => {
31
- requestAnimationFrame(() => {
32
- B.current?.contains(document.activeElement) || (J(!1), X(""));
33
- });
34
- }, []), Ce = () => {
35
- G || K || (z.current?.focus(), J(!0));
36
- }, we = () => K ? /* @__PURE__ */ _("div", {
37
- id: H,
38
- role: "listbox",
39
- children: /* @__PURE__ */ _(i, { message: E })
40
- }) : A.length === 0 ? /* @__PURE__ */ _("div", {
41
- id: H,
42
- role: "listbox",
43
- children: /* @__PURE__ */ _(ee, { message: x })
44
- }) : /* @__PURE__ */ v(se, {
45
- id: H,
46
- children: [/* @__PURE__ */ _(ce, { children: x }), A.map((e) => /* @__PURE__ */ _(p, {
47
- className: n(d(!!e.disabled, !1, Z === e.value), "group/command-item relative flex w-full items-center data-[selected=true]:bg-input-bg--hover"),
48
- "data-checked": Z === e.value || void 0,
49
- disabled: e.disabled,
50
- onMouseDown: (e) => e.preventDefault(),
51
- onSelect: () => be(e.value),
52
- value: e.label,
53
- children: /* @__PURE__ */ _("span", {
54
- className: "min-w-0 flex-1 truncate whitespace-nowrap",
55
- children: e.label
56
- })
57
- }, e.value))]
58
- });
59
- return /* @__PURE__ */ v("div", {
60
- className: "w-full",
61
- ref: M,
62
- children: [
63
- D && /* @__PURE__ */ _("input", {
64
- type: "hidden",
65
- name: D,
66
- value: Z,
67
- disabled: G
68
- }),
69
- w && /* @__PURE__ */ _(re, {
70
- className: n("mb-2 block text-text-primary", T, G && "text-text-secondary"),
71
- "data-testid": "spectral-combobox-label",
72
- htmlFor: V,
73
- children: w
74
- }),
75
- /* @__PURE__ */ v(m, {
76
- ref: B,
77
- label: R ?? w,
78
- onKeyDown: xe,
79
- className: "relative w-full",
80
- children: [/* @__PURE__ */ v(ie, {
81
- "data-slot": "combobox-content",
82
- "data-state": P,
83
- "data-testid": "spectral-combobox-trigger",
84
- className: n(f(q, P), "ring-0!", G && "pointer-events-none cursor-not-allowed", y),
85
- onClick: Ce,
86
- style: u(),
87
- children: [/* @__PURE__ */ _(m.Input, {
88
- ref: z,
89
- autoComplete: "off",
90
- "data-slot": "input-group-control",
91
- "aria-controls": H,
92
- "aria-expanded": q,
93
- "aria-label": R ?? w,
94
- className: n("min-w-0 px-3 py-1 text-base flex-1 truncate overflow-hidden border-0 bg-transparent whitespace-nowrap text-input-text outline-hidden placeholder:opacity-100 focus-visible:ring-0 focus-visible:outline-none", ve ? "placeholder:text-input-text!" : "placeholder:text-input-text-placeholder!"),
95
- disabled: G,
96
- id: V,
97
- onBlur: Se,
98
- onFocus: () => !G && !K && J(!0),
99
- onValueChange: X,
100
- placeholder: Q?.label ?? j,
101
- role: "combobox",
102
- value: Y,
103
- ...me
104
- }), /* @__PURE__ */ _(ae, {
105
- align: "inline-end",
106
- className: "cursor-pointer",
107
- children: K ? /* @__PURE__ */ _(t, { className: "size-5 motion-safe:animate-spin" }) : /* @__PURE__ */ _(e, { className: n("size-5 shrink-0 transition-transform duration-200", q && "rotate-180") })
108
- })]
109
- }), /* @__PURE__ */ _("div", {
110
- className: n("left-0 mt-1 p-1 absolute top-full z-50 w-full", s(), "motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-top-2 motion-safe:zoom-in-95", !q && "hidden"),
111
- "data-dropdown-width-mode": $,
112
- "data-dropdown-width-value": $ === "custom" ? b : void 0,
113
- "data-testid": "spectral-combobox-content",
114
- ref: ge,
115
- style: {
116
- ...ye,
117
- ...he
118
- },
119
- children: we()
120
- })]
121
- }),
122
- pe && S && /* @__PURE__ */ _(r, {
123
- dataTestId: "spectral-combobox-error-message",
124
- id: U,
125
- message: S
126
- }),
127
- P === "warning" && I && /* @__PURE__ */ _(a, {
128
- dataTestId: "spectral-combobox-warning-message",
129
- id: W,
130
- message: I
131
- })
132
- ]
133
- });
134
- };
135
- y.displayName = "Combobox";
136
- //#endregion
137
- export { y as Combobox };
1
+ import { t as e } from "./Combobox-Ch5Rxk5v.js";
2
+ import "./primitives/input-group.js";
3
+ export { e as Combobox };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../Calendar-Cnh_PTbQ.js";
1
+ import { t as e } from "../Calendar-2UVWeLYp.js";
2
2
  export { e as Calendar };
@@ -4,7 +4,7 @@ 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-BJUAMuot.js";
7
+ import { S as i, b as a, f as o } from "../DateTimeUtils-DrR2JWoU.js";
8
8
  import { forwardRef as s, useCallback as c, useEffect as l, useId as u, useMemo as d, useRef as f } from "react";
9
9
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
10
  //#region src/components/DateTimePicker/DateTimeDisplayInput.tsx
@@ -2,7 +2,7 @@
2
2
  import "../styles/main.css";
3
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-BJUAMuot.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-BJUAMuot.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,7 +1,7 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
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-BJUAMuot.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";
@@ -5,8 +5,8 @@ import { t } from "./twUtils-D_qzdiwM.js";
5
5
  import { ErrorMessage as n, getErrorMessageId as r, useFormFieldId as i } from "./utils/formFieldUtils.js";
6
6
  import { useUncontrolledState as a } from "./hooks/useUncontrolledState.js";
7
7
  import { Popover as o, PopoverContent as s, PopoverTrigger as ee } from "./Popover.js";
8
- import { t as c } from "./Calendar-Cnh_PTbQ.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-BJUAMuot.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";
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
3
  import { t } from "./twUtils-D_qzdiwM.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";
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