@spear-ai/spectral 1.6.16 → 1.7.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 (150) hide show
  1. package/dist/.js +196 -191
  2. package/dist/Accordion.d.ts +13 -15
  3. package/dist/Accordion.js +172 -165
  4. package/dist/Alert/AlertBase.d.ts +7 -7
  5. package/dist/Alert/AlertBase.js +23 -21
  6. package/dist/Alert.d.ts +2 -2
  7. package/dist/Alert.js +32 -30
  8. package/dist/Avatar.d.ts +2 -2
  9. package/dist/Avatar.js +30 -22
  10. package/dist/Badge.d.ts +1 -1
  11. package/dist/Badge.js +3 -2
  12. package/dist/Button.d.ts +3 -3
  13. package/dist/Button.js +108 -46
  14. package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
  15. package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
  16. package/dist/ButtonGroup.d.ts +5 -5
  17. package/dist/ButtonGroup.js +21 -21
  18. package/dist/ButtonIcon.d.ts +2 -2
  19. package/dist/ButtonIcon.js +31 -30
  20. package/dist/Checkbox/CheckboxBase.d.ts +2 -2
  21. package/dist/Checkbox/CheckboxBase.js +50 -57
  22. package/dist/Checkbox.js +16 -18
  23. package/dist/DataCard/Card.d.ts +1 -1
  24. package/dist/DataCard/Card.js +1 -1
  25. package/dist/DataCard.js +1 -1
  26. package/dist/DateTimePicker/Calendar.d.ts +4 -4
  27. package/dist/DateTimePicker/Calendar.js +4 -2
  28. package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
  29. package/dist/DateTimePicker/DateTimeInput.js +4 -4
  30. package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
  31. package/dist/DateTimePicker/DateTimeUtils.js +139 -197
  32. package/dist/DateTimePicker/TimePicker.d.ts +4 -4
  33. package/dist/DateTimePicker/TimePicker.js +3 -3
  34. package/dist/DateTimePicker.d.ts +5 -5
  35. package/dist/DateTimePicker.js +96 -74
  36. package/dist/Dialog.d.ts +13 -13
  37. package/dist/Dialog.js +57 -84
  38. package/dist/Drawer.d.ts +2 -2
  39. package/dist/Drawer.js +8 -8
  40. package/dist/HoverCard.d.ts +6 -5
  41. package/dist/HoverCard.js +64 -64
  42. package/dist/Icons/LineToolIcon.js +37 -10
  43. package/dist/Icons/MeasureIcon.d.ts +5 -0
  44. package/dist/Icons/MeasureIcon.js +26 -0
  45. package/dist/Icons/SearchIcon.d.ts +5 -0
  46. package/dist/Icons/SearchIcon.js +10 -0
  47. package/dist/Icons/index.d.ts +2 -0
  48. package/dist/Icons.js +76 -72
  49. package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
  50. package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
  51. package/dist/Input/InputUtils.d.ts +2 -2
  52. package/dist/Input/InputUtils.js +4 -4
  53. package/dist/Input.d.ts +1 -1
  54. package/dist/Input.js +31 -29
  55. package/dist/InputOTP.d.ts +10 -10
  56. package/dist/InputOTP.js +125 -123
  57. package/dist/Kbd.d.ts +8 -5
  58. package/dist/Kbd.js +85 -20
  59. package/dist/Label.d.ts +4 -2
  60. package/dist/Label.js +3 -3
  61. package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
  62. package/dist/MultiSelect/MultiSelectBase.js +278 -200
  63. package/dist/MultiSelect.d.ts +6 -6
  64. package/dist/MultiSelect.js +9 -9
  65. package/dist/Popover.js +22 -237
  66. package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
  67. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
  68. package/dist/RadioButtonGroup.d.ts +1 -1
  69. package/dist/RadioGroup.d.ts +15 -15
  70. package/dist/RadioGroup.js +253 -236
  71. package/dist/Select.d.ts +3 -1
  72. package/dist/Select.js +92 -87
  73. package/dist/Separator.js +4 -4
  74. package/dist/Skeleton.d.ts +1 -2
  75. package/dist/Skeleton.js +2 -4
  76. package/dist/Slider.d.ts +6 -6
  77. package/dist/Slider.js +78 -78
  78. package/dist/Switch/SwitchBase.d.ts +4 -4
  79. package/dist/Switch/SwitchBase.js +68 -68
  80. package/dist/Switch.d.ts +3 -3
  81. package/dist/Switch.js +9 -9
  82. package/dist/Tabs/TabsBase.js +39 -38
  83. package/dist/Tabs/tabsUtils.js +7 -7
  84. package/dist/Tabs.d.ts +0 -4
  85. package/dist/Tabs.js +62 -66
  86. package/dist/Textarea/TextareaUtils.d.ts +7 -7
  87. package/dist/Textarea/TextareaUtils.js +13 -13
  88. package/dist/Textarea.js +34 -22
  89. package/dist/Toast.d.ts +43 -0
  90. package/dist/Toast.js +883 -0
  91. package/dist/Toggle/ToggleBase.d.ts +4 -4
  92. package/dist/Toggle/ToggleBase.js +32 -33
  93. package/dist/Toggle.d.ts +1 -1
  94. package/dist/Toggle.js +7 -12
  95. package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
  96. package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
  97. package/dist/ToggleGroup.d.ts +1 -1
  98. package/dist/ToggleGroup.js +27 -30
  99. package/dist/Tooltip.d.ts +1 -1
  100. package/dist/Tooltip.js +97 -97
  101. package/dist/Tray.d.ts +9 -9
  102. package/dist/Tray.js +77 -74
  103. package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
  104. package/dist/hooks/useAccordionAutoScroll.js +42 -39
  105. package/dist/hooks/useControllableState.d.ts +2 -2
  106. package/dist/hooks/useControllableState.d.ts.map +1 -1
  107. package/dist/hooks/useControllableState.js +2 -2
  108. package/dist/index-C12FUuIW.js +13 -0
  109. package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
  110. package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
  111. package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
  112. package/dist/index-DEYs15GP.js +66 -0
  113. package/dist/index-DdFoGvON.js +146 -0
  114. package/dist/index-Q3N6lgwg.js +225 -0
  115. package/dist/index.d.ts +3 -3
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/primitives/button.d.ts +1 -1
  118. package/dist/primitives/button.js +4 -4
  119. package/dist/primitives/input.d.ts.map +1 -1
  120. package/dist/primitives/input.js +8 -5
  121. package/dist/primitives/select.d.ts +12 -13
  122. package/dist/primitives/select.d.ts.map +1 -1
  123. package/dist/primitives/select.js +68 -95
  124. package/dist/primitives/slot.d.ts +5 -5
  125. package/dist/primitives/slot.d.ts.map +1 -1
  126. package/dist/primitives/slot.js +24 -33
  127. package/dist/primitives/textarea.d.ts.map +1 -1
  128. package/dist/primitives/textarea.js +4 -3
  129. package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
  130. package/dist/styles/base-colors.css +30 -30
  131. package/dist/styles/horizon/base-colors.css +30 -30
  132. package/dist/styles/horizon/colors.css +40 -11
  133. package/dist/styles/horizon/utilities.css +26 -3
  134. package/dist/styles/main.css +1 -1
  135. package/dist/styles/spectral.css +1 -1
  136. package/dist/styles/theme.css +96 -44
  137. package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
  138. package/dist/utils/formFieldUtils.d.ts +2 -2
  139. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  140. package/dist/utils/formFieldUtils.js +14 -11
  141. package/dist/utils/sharedUtils.d.ts +3 -3
  142. package/dist/utils/sharedUtils.d.ts.map +1 -1
  143. package/dist/utils/sharedUtils.js +1 -4
  144. package/dist/utils/twUtils.d.ts +1 -1
  145. package/dist/utils/twUtils.d.ts.map +1 -1
  146. package/dist/utils/twUtils.js +1 -4
  147. package/package.json +5 -1
  148. package/dist/createLucideIcon-D4r5Phnh.js +0 -70
  149. package/dist/index-CeP1E2kK.js +0 -209
  150. package/dist/index-Dy-Hzr7y.js +0 -13
package/dist/Accordion.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
- import { jsx as i, jsxs as j } from "react/jsx-runtime";
3
+ import { jsx as i, jsxs as K } from "react/jsx-runtime";
4
4
  import "./Icons/AnalyzeIcon.js";
5
5
  import "./Icons/AnnotationsIcon.js";
6
6
  import "./Icons/ApprovedIcon.js";
@@ -10,7 +10,7 @@ import "./Icons/CalendarIcon.js";
10
10
  import "./Icons/CheckCircleIcon.js";
11
11
  import "./Icons/CheckSquareIcon.js";
12
12
  import "./Icons/CheckmarkIcon.js";
13
- import { ChevronDownIcon as pe } from "./Icons/ChevronDownIcon.js";
13
+ import { ChevronDownIcon as ve } from "./Icons/ChevronDownIcon.js";
14
14
  import "./Icons/ChevronUpIcon.js";
15
15
  import "./Icons/ClockIcon.js";
16
16
  import "./Icons/CloseCircleIcon.js";
@@ -39,6 +39,7 @@ import "./Icons/LiveViewIcon.js";
39
39
  import "./Icons/LoaderIcon.js";
40
40
  import "./Icons/LocationIcon.js";
41
41
  import "./Icons/LogoutIcon.js";
42
+ import "./Icons/MeasureIcon.js";
42
43
  import "./Icons/MessagesIcon.js";
43
44
  import "./Icons/MetadataIcon.js";
44
45
  import "./Icons/MinusIcon.js";
@@ -50,6 +51,7 @@ import "./Icons/PlusIcon.js";
50
51
  import "./Icons/ResetIcon.js";
51
52
  import "./Icons/ReviewedIcon.js";
52
53
  import "./Icons/ScissorsIcon.js";
54
+ import "./Icons/SearchIcon.js";
53
55
  import "./Icons/SettingsIcon.js";
54
56
  import "./Icons/SortAscendingIcon.js";
55
57
  import "./Icons/SortAtoZIcon.js";
@@ -65,44 +67,44 @@ import "./Icons/WarningIcon.js";
65
67
  import "./Icons/ZoomAllIcon.js";
66
68
  import "./Icons/ZoomXIcon.js";
67
69
  import "./Icons/ZoomYIcon.js";
68
- import { useAccordionAutoScroll as me } from "./hooks/useAccordionAutoScroll.js";
70
+ import { useAccordionAutoScroll as Ce } from "./hooks/useAccordionAutoScroll.js";
69
71
  import * as f from "react";
70
- import u, { createContext as ue, Children as fe, isValidElement as ve, cloneElement as Ce, useContext as ge, useRef as be, useCallback as Ae } from "react";
71
- import { c as F, e as M, P as I, b as z, u as B, f as he } from "./index-OnYbwQjk.js";
72
- import { c as xe, u as ye } from "./index-DSXuB1g3.js";
73
- import { P as Ie } from "./index-D6HcSXrq.js";
74
- import { u as U } from "./index-Dy-Hzr7y.js";
72
+ import u, { createContext as ge, Children as be, isValidElement as Ae, cloneElement as he, useRef as xe, useCallback as Ie, useContext as ye } from "react";
73
+ import { c as F, P as y, b as z, e as M, u as B, f as Re } from "./index-OnYbwQjk.js";
74
+ import { c as Ne, u as we } from "./index-DSXuB1g3.js";
75
+ import { P as _e } from "./index-D6HcSXrq.js";
76
+ import { u as U } from "./index-C12FUuIW.js";
75
77
  import { cn as w } from "./utils/twUtils.js";
76
- var _ = "Collapsible", [Ne, q] = F(_), [Re, V] = Ne(_), J = f.forwardRef(
77
- (e, n) => {
78
+ var _ = "Collapsible", [Pe, q] = F(_), [Ee, V] = Pe(_), J = f.forwardRef(
79
+ (e, a) => {
78
80
  const {
79
81
  __scopeCollapsible: o,
80
82
  open: t,
81
- defaultOpen: a,
83
+ defaultOpen: n,
82
84
  disabled: r,
83
85
  onOpenChange: c,
84
- ...l
85
- } = e, [s, p] = M({
86
+ ...s
87
+ } = e, [l, p] = M({
86
88
  prop: t,
87
- defaultProp: a ?? !1,
89
+ defaultProp: n ?? !1,
88
90
  onChange: c,
89
91
  caller: _
90
92
  });
91
93
  return /* @__PURE__ */ i(
92
- Re,
94
+ Ee,
93
95
  {
94
96
  scope: o,
95
97
  disabled: r,
96
98
  contentId: U(),
97
- open: s,
99
+ open: l,
98
100
  onOpenToggle: f.useCallback(() => p((m) => !m), [p]),
99
101
  children: /* @__PURE__ */ i(
100
- I.div,
102
+ y.div,
101
103
  {
102
- "data-state": H(s),
104
+ "data-state": H(l),
103
105
  "data-disabled": r ? "" : void 0,
104
- ...l,
105
- ref: n
106
+ ...s,
107
+ ref: a
106
108
  }
107
109
  )
108
110
  }
@@ -111,49 +113,49 @@ var _ = "Collapsible", [Ne, q] = F(_), [Re, V] = Ne(_), J = f.forwardRef(
111
113
  );
112
114
  J.displayName = _;
113
115
  var Y = "CollapsibleTrigger", Q = f.forwardRef(
114
- (e, n) => {
115
- const { __scopeCollapsible: o, ...t } = e, a = V(Y, o);
116
+ (e, a) => {
117
+ const { __scopeCollapsible: o, ...t } = e, n = V(Y, o);
116
118
  return /* @__PURE__ */ i(
117
- I.button,
119
+ y.button,
118
120
  {
119
121
  type: "button",
120
- "aria-controls": a.contentId,
121
- "aria-expanded": a.open || !1,
122
- "data-state": H(a.open),
123
- "data-disabled": a.disabled ? "" : void 0,
124
- disabled: a.disabled,
122
+ "aria-controls": n.contentId,
123
+ "aria-expanded": n.open || !1,
124
+ "data-state": H(n.open),
125
+ "data-disabled": n.disabled ? "" : void 0,
126
+ disabled: n.disabled,
125
127
  ...t,
126
- ref: n,
127
- onClick: z(e.onClick, a.onOpenToggle)
128
+ ref: a,
129
+ onClick: z(e.onClick, n.onOpenToggle)
128
130
  }
129
131
  );
130
132
  }
131
133
  );
132
134
  Q.displayName = Y;
133
135
  var $ = "CollapsibleContent", W = f.forwardRef(
134
- (e, n) => {
135
- const { forceMount: o, ...t } = e, a = V($, e.__scopeCollapsible);
136
- return /* @__PURE__ */ i(Ie, { present: o || a.open, children: ({ present: r }) => /* @__PURE__ */ i(we, { ...t, ref: n, present: r }) });
136
+ (e, a) => {
137
+ const { forceMount: o, ...t } = e, n = V($, e.__scopeCollapsible);
138
+ return /* @__PURE__ */ i(_e, { present: o || n.open, children: ({ present: r }) => /* @__PURE__ */ i(Se, { ...t, ref: a, present: r }) });
137
139
  }
138
140
  );
139
141
  W.displayName = $;
140
- var we = f.forwardRef((e, n) => {
141
- const { __scopeCollapsible: o, present: t, children: a, ...r } = e, c = V($, o), [l, s] = f.useState(t), p = f.useRef(null), m = B(n, p), v = f.useRef(0), x = v.current, g = f.useRef(0), N = g.current, b = c.open || l, A = f.useRef(b), h = f.useRef(void 0);
142
+ var Se = f.forwardRef((e, a) => {
143
+ const { __scopeCollapsible: o, present: t, children: n, ...r } = e, c = V($, o), [s, l] = f.useState(t), p = f.useRef(null), m = B(a, p), v = f.useRef(0), x = v.current, g = f.useRef(0), R = g.current, b = c.open || s, A = f.useRef(b), h = f.useRef(void 0);
142
144
  return f.useEffect(() => {
143
145
  const d = requestAnimationFrame(() => A.current = !1);
144
146
  return () => cancelAnimationFrame(d);
145
- }, []), he(() => {
147
+ }, []), Re(() => {
146
148
  const d = p.current;
147
149
  if (d) {
148
150
  h.current = h.current || {
149
151
  transitionDuration: d.style.transitionDuration,
150
152
  animationName: d.style.animationName
151
153
  }, d.style.transitionDuration = "0s", d.style.animationName = "none";
152
- const y = d.getBoundingClientRect();
153
- v.current = y.height, g.current = y.width, A.current || (d.style.transitionDuration = h.current.transitionDuration, d.style.animationName = h.current.animationName), s(t);
154
+ const I = d.getBoundingClientRect();
155
+ v.current = I.height, g.current = I.width, A.current || (d.style.transitionDuration = h.current.transitionDuration, d.style.animationName = h.current.animationName), l(t);
154
156
  }
155
157
  }, [c.open, t]), /* @__PURE__ */ i(
156
- I.div,
158
+ y.div,
157
159
  {
158
160
  "data-state": H(c.open),
159
161
  "data-disabled": c.disabled ? "" : void 0,
@@ -163,100 +165,100 @@ var we = f.forwardRef((e, n) => {
163
165
  ref: m,
164
166
  style: {
165
167
  "--radix-collapsible-content-height": x ? `${x}px` : void 0,
166
- "--radix-collapsible-content-width": N ? `${N}px` : void 0,
168
+ "--radix-collapsible-content-width": R ? `${R}px` : void 0,
167
169
  ...e.style
168
170
  },
169
- children: b && a
171
+ children: b && n
170
172
  }
171
173
  );
172
174
  });
173
175
  function H(e) {
174
176
  return e ? "open" : "closed";
175
177
  }
176
- var _e = J, Pe = Q, Ee = W, C = "Accordion", Se = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [L, Oe, Te] = xe(C), [P] = F(C, [
177
- Te,
178
+ var Oe = J, Te = Q, ke = W, C = "Accordion", De = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [L, Me, Ve] = Ne(C), [P] = F(C, [
179
+ Ve,
178
180
  q
179
- ]), G = q(), X = u.forwardRef(
180
- (e, n) => {
181
- const { type: o, ...t } = e, a = t, r = t;
182
- return /* @__PURE__ */ i(L.Provider, { scope: e.__scopeAccordion, children: o === "multiple" ? /* @__PURE__ */ i(Ve, { ...r, ref: n }) : /* @__PURE__ */ i(Me, { ...a, ref: n }) });
181
+ ]), j = q(), X = u.forwardRef(
182
+ (e, a) => {
183
+ const { type: o, ...t } = e, n = t, r = t;
184
+ return /* @__PURE__ */ i(L.Provider, { scope: e.__scopeAccordion, children: o === "multiple" ? /* @__PURE__ */ i(je, { ...r, ref: a }) : /* @__PURE__ */ i(Le, { ...n, ref: a }) });
183
185
  }
184
186
  );
185
187
  X.displayName = C;
186
- var [Z, ke] = P(C), [ee, De] = P(
188
+ var [Z, $e] = P(C), [ee, He] = P(
187
189
  C,
188
190
  { collapsible: !1 }
189
- ), Me = u.forwardRef(
190
- (e, n) => {
191
+ ), Le = u.forwardRef(
192
+ (e, a) => {
191
193
  const {
192
194
  value: o,
193
195
  defaultValue: t,
194
- onValueChange: a = () => {
196
+ onValueChange: n = () => {
195
197
  },
196
198
  collapsible: r = !1,
197
199
  ...c
198
- } = e, [l, s] = M({
200
+ } = e, [s, l] = M({
199
201
  prop: o,
200
202
  defaultProp: t ?? "",
201
- onChange: a,
203
+ onChange: n,
202
204
  caller: C
203
205
  });
204
206
  return /* @__PURE__ */ i(
205
207
  Z,
206
208
  {
207
209
  scope: e.__scopeAccordion,
208
- value: u.useMemo(() => l ? [l] : [], [l]),
209
- onItemOpen: s,
210
- onItemClose: u.useCallback(() => r && s(""), [r, s]),
211
- children: /* @__PURE__ */ i(ee, { scope: e.__scopeAccordion, collapsible: r, children: /* @__PURE__ */ i(oe, { ...c, ref: n }) })
210
+ value: u.useMemo(() => s ? [s] : [], [s]),
211
+ onItemOpen: l,
212
+ onItemClose: u.useCallback(() => r && l(""), [r, l]),
213
+ children: /* @__PURE__ */ i(ee, { scope: e.__scopeAccordion, collapsible: r, children: /* @__PURE__ */ i(oe, { ...c, ref: a }) })
212
214
  }
213
215
  );
214
216
  }
215
- ), Ve = u.forwardRef((e, n) => {
217
+ ), je = u.forwardRef((e, a) => {
216
218
  const {
217
219
  value: o,
218
220
  defaultValue: t,
219
- onValueChange: a = () => {
221
+ onValueChange: n = () => {
220
222
  },
221
223
  ...r
222
- } = e, [c, l] = M({
224
+ } = e, [c, s] = M({
223
225
  prop: o,
224
226
  defaultProp: t ?? [],
225
- onChange: a,
227
+ onChange: n,
226
228
  caller: C
227
- }), s = u.useCallback(
228
- (m) => l((v = []) => [...v, m]),
229
- [l]
229
+ }), l = u.useCallback(
230
+ (m) => s((v = []) => [...v, m]),
231
+ [s]
230
232
  ), p = u.useCallback(
231
- (m) => l((v = []) => v.filter((x) => x !== m)),
232
- [l]
233
+ (m) => s((v = []) => v.filter((x) => x !== m)),
234
+ [s]
233
235
  );
234
236
  return /* @__PURE__ */ i(
235
237
  Z,
236
238
  {
237
239
  scope: e.__scopeAccordion,
238
240
  value: c,
239
- onItemOpen: s,
241
+ onItemOpen: l,
240
242
  onItemClose: p,
241
- children: /* @__PURE__ */ i(ee, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ i(oe, { ...r, ref: n }) })
243
+ children: /* @__PURE__ */ i(ee, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ i(oe, { ...r, ref: a }) })
242
244
  }
243
245
  );
244
- }), [$e, E] = P(C), oe = u.forwardRef(
245
- (e, n) => {
246
- const { __scopeAccordion: o, disabled: t, dir: a, orientation: r = "vertical", ...c } = e, l = u.useRef(null), s = B(l, n), p = Oe(o), v = ye(a) === "ltr", x = z(e.onKeyDown, (g) => {
247
- if (!Se.includes(g.key)) return;
248
- const N = g.target, b = p().filter((k) => !k.ref.current?.disabled), A = b.findIndex((k) => k.ref.current === N), h = b.length;
246
+ }), [Ge, E] = P(C), oe = u.forwardRef(
247
+ (e, a) => {
248
+ const { __scopeAccordion: o, disabled: t, dir: n, orientation: r = "vertical", ...c } = e, s = u.useRef(null), l = B(s, a), p = Me(o), v = we(n) === "ltr", x = z(e.onKeyDown, (g) => {
249
+ if (!De.includes(g.key)) return;
250
+ const R = g.target, b = p().filter((k) => !k.ref.current?.disabled), A = b.findIndex((k) => k.ref.current === R), h = b.length;
249
251
  if (A === -1) return;
250
252
  g.preventDefault();
251
253
  let d = A;
252
- const y = 0, S = h - 1, O = () => {
253
- d = A + 1, d > S && (d = y);
254
+ const I = 0, S = h - 1, O = () => {
255
+ d = A + 1, d > S && (d = I);
254
256
  }, T = () => {
255
- d = A - 1, d < y && (d = S);
257
+ d = A - 1, d < I && (d = S);
256
258
  };
257
259
  switch (g.key) {
258
260
  case "Home":
259
- d = y;
261
+ d = I;
260
262
  break;
261
263
  case "End":
262
264
  d = S;
@@ -274,46 +276,46 @@ var [Z, ke] = P(C), [ee, De] = P(
274
276
  r === "vertical" && T();
275
277
  break;
276
278
  }
277
- const de = d % h;
278
- b[de].ref.current?.focus();
279
+ const fe = d % h;
280
+ b[fe].ref.current?.focus();
279
281
  });
280
282
  return /* @__PURE__ */ i(
281
- $e,
283
+ Ge,
282
284
  {
283
285
  scope: o,
284
286
  disabled: t,
285
- direction: a,
287
+ direction: n,
286
288
  orientation: r,
287
289
  children: /* @__PURE__ */ i(L.Slot, { scope: o, children: /* @__PURE__ */ i(
288
- I.div,
290
+ y.div,
289
291
  {
290
292
  ...c,
291
293
  "data-orientation": r,
292
- ref: s,
294
+ ref: l,
293
295
  onKeyDown: t ? void 0 : x
294
296
  }
295
297
  ) })
296
298
  }
297
299
  );
298
300
  }
299
- ), R = "AccordionItem", [He, K] = P(R), te = u.forwardRef(
300
- (e, n) => {
301
- const { __scopeAccordion: o, value: t, ...a } = e, r = E(R, o), c = ke(R, o), l = G(o), s = U(), p = t && c.value.includes(t) || !1, m = r.disabled || e.disabled;
301
+ ), N = "AccordionItem", [Ke, G] = P(N), te = u.forwardRef(
302
+ (e, a) => {
303
+ const { __scopeAccordion: o, value: t, ...n } = e, r = E(N, o), c = $e(N, o), s = j(o), l = U(), p = t && c.value.includes(t) || !1, m = r.disabled || e.disabled;
302
304
  return /* @__PURE__ */ i(
303
- He,
305
+ Ke,
304
306
  {
305
307
  scope: o,
306
308
  open: p,
307
309
  disabled: m,
308
- triggerId: s,
310
+ triggerId: l,
309
311
  children: /* @__PURE__ */ i(
310
- _e,
312
+ Oe,
311
313
  {
312
314
  "data-orientation": r.orientation,
313
- "data-state": le(p),
314
- ...l,
315
- ...a,
316
- ref: n,
315
+ "data-state": se(p),
316
+ ...s,
317
+ ...n,
318
+ ref: a,
317
319
  disabled: m,
318
320
  open: p,
319
321
  onOpenChange: (v) => {
@@ -325,52 +327,52 @@ var [Z, ke] = P(C), [ee, De] = P(
325
327
  );
326
328
  }
327
329
  );
328
- te.displayName = R;
330
+ te.displayName = N;
329
331
  var re = "AccordionHeader", ne = u.forwardRef(
330
- (e, n) => {
331
- const { __scopeAccordion: o, ...t } = e, a = E(C, o), r = K(re, o);
332
+ (e, a) => {
333
+ const { __scopeAccordion: o, ...t } = e, n = E(C, o), r = G(re, o);
332
334
  return /* @__PURE__ */ i(
333
- I.h3,
335
+ y.h3,
334
336
  {
335
- "data-orientation": a.orientation,
336
- "data-state": le(r.open),
337
+ "data-orientation": n.orientation,
338
+ "data-state": se(r.open),
337
339
  "data-disabled": r.disabled ? "" : void 0,
338
340
  ...t,
339
- ref: n
341
+ ref: a
340
342
  }
341
343
  );
342
344
  }
343
345
  );
344
346
  ne.displayName = re;
345
- var D = "AccordionTrigger", ae = u.forwardRef(
346
- (e, n) => {
347
- const { __scopeAccordion: o, ...t } = e, a = E(C, o), r = K(D, o), c = De(D, o), l = G(o);
347
+ var D = "AccordionTrigger", ie = u.forwardRef(
348
+ (e, a) => {
349
+ const { __scopeAccordion: o, ...t } = e, n = E(C, o), r = G(D, o), c = He(D, o), s = j(o);
348
350
  return /* @__PURE__ */ i(L.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
349
- Pe,
351
+ Te,
350
352
  {
351
353
  "aria-disabled": r.open && !c.collapsible || void 0,
352
- "data-orientation": a.orientation,
354
+ "data-orientation": n.orientation,
353
355
  id: r.triggerId,
354
- ...l,
356
+ ...s,
355
357
  ...t,
356
- ref: n
358
+ ref: a
357
359
  }
358
360
  ) });
359
361
  }
360
362
  );
361
- ae.displayName = D;
362
- var ie = "AccordionContent", ce = u.forwardRef(
363
- (e, n) => {
364
- const { __scopeAccordion: o, ...t } = e, a = E(C, o), r = K(ie, o), c = G(o);
363
+ ie.displayName = D;
364
+ var ae = "AccordionContent", ce = u.forwardRef(
365
+ (e, a) => {
366
+ const { __scopeAccordion: o, ...t } = e, n = E(C, o), r = G(ae, o), c = j(o);
365
367
  return /* @__PURE__ */ i(
366
- Ee,
368
+ ke,
367
369
  {
368
370
  role: "region",
369
371
  "aria-labelledby": r.triggerId,
370
- "data-orientation": a.orientation,
372
+ "data-orientation": n.orientation,
371
373
  ...c,
372
374
  ...t,
373
- ref: n,
375
+ ref: a,
374
376
  style: {
375
377
  "--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
376
378
  "--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
@@ -380,110 +382,115 @@ var ie = "AccordionContent", ce = u.forwardRef(
380
382
  );
381
383
  }
382
384
  );
383
- ce.displayName = ie;
384
- function le(e) {
385
+ ce.displayName = ae;
386
+ function se(e) {
385
387
  return e ? "open" : "closed";
386
388
  }
387
- var Le = X, Ge = te, Ke = ne, je = ae, Fe = ce;
388
- const ze = {
389
+ var Fe = X, ze = te, Be = ne, Ue = ie, qe = ce;
390
+ const Je = {
389
391
  default: "shadow-none",
390
392
  contained: "rounded-md border border-level-four",
391
393
  separated: "rounded-none space-y-2"
392
- }, Be = {
394
+ }, Ye = {
393
395
  default: "w-full py-4",
394
396
  contained: "not-last:border-b border-level-four p-4",
395
397
  separated: "border border-level-four rounded-md p-4"
396
- }, se = ue({ variant: "default" }), Ue = ({
397
- ref: e,
398
- variant: n = "default",
399
- className: o,
398
+ }, le = ge({ variant: "default" }), de = ({
399
+ className: e,
400
+ ref: a,
401
+ variant: o = "default",
400
402
  ...t
401
403
  }) => {
402
- const { autoScroll: a = "never", scrollPadding: r = -20, children: c, ...l } = t, s = {
403
- autoScroll: a,
404
+ const { autoScroll: n = "never", scrollPadding: r = -20, children: c, ...s } = t, l = {
405
+ autoScroll: n,
404
406
  scrollPadding: r
405
407
  }, p = {
406
- ...l,
407
- ref: e
408
+ ...s,
409
+ ref: a
408
410
  };
409
- return /* @__PURE__ */ i(se.Provider, { value: { variant: n }, children: /* @__PURE__ */ i(
410
- Le,
411
+ return /* @__PURE__ */ i(le.Provider, { value: { variant: o }, children: /* @__PURE__ */ i(
412
+ Fe,
411
413
  {
412
414
  ...p,
415
+ className: w("accordion-wrapper flex flex-col", Je[o], e),
416
+ "data-auto-scroll": n,
417
+ "data-scroll-options": JSON.stringify(l),
418
+ "data-scroll-padding": r,
413
419
  "data-slot": "accordion",
414
420
  "data-testid": "spectral-accordion",
415
- "data-scroll-options": JSON.stringify(s),
416
- "data-auto-scroll": a,
417
- "data-scroll-padding": r,
418
421
  ...t.type === "single" ? { collapsible: !0 } : {},
419
- className: w("accordion-wrapper flex flex-col", ze[n], o),
420
- children: fe.map(c, (m) => ve(m) ? Ce(m, { variant: n }) : m)
422
+ children: be.map(c, (m) => Ae(m) ? he(m, { variant: o }) : m)
421
423
  }
422
424
  ) });
423
425
  };
424
- Ue.displayName = "Accordion";
425
- const qe = ({
426
- ref: e,
427
- className: n,
426
+ de.displayName = "Accordion";
427
+ const pe = ({
428
+ className: e,
429
+ ref: a,
428
430
  ...o
429
431
  }) => {
430
- const { variant: t = "default" } = ge(se);
431
- return /* @__PURE__ */ i(Ge, { ref: e, "data-slot": "accordion-item", "data-testid": "spectral-accordion-item", className: w("w-full", Be[t], n), ...o });
432
+ const { variant: t = "default" } = ye(le);
433
+ return /* @__PURE__ */ i(ze, { className: w("w-full", Ye[t], e), "data-slot": "accordion-item", "data-testid": "spectral-accordion-item", ref: a, ...o });
432
434
  };
433
- qe.displayName = "AccordionItem";
434
- const Je = ({
435
+ pe.displayName = "AccordionItem";
436
+ const me = ({
435
437
  ref: e,
436
- className: n,
438
+ className: a,
437
439
  title: o,
438
440
  subtitle: t,
439
- ...a
441
+ ...n
440
442
  }) => {
441
- const r = be(null), c = me(r), l = Ae(
442
- (s) => {
443
- typeof e == "function" ? e(s) : e && (e.current = s), r.current = s;
443
+ const r = xe(null), c = Ce(r), s = Ie(
444
+ (l) => {
445
+ typeof e == "function" ? e(l) : e && (e.current = l), r.current = l;
444
446
  },
445
447
  [e]
446
448
  );
447
- return /* @__PURE__ */ i(Ke, { className: "m-0 flex", children: /* @__PURE__ */ j(
448
- je,
449
+ return /* @__PURE__ */ i(Be, { className: "m-0 flex", children: /* @__PURE__ */ K(
450
+ Ue,
449
451
  {
450
- ref: l,
452
+ className: w("text-text-primary flex flex-1 items-center justify-between text-sm font-normal transition-all hover:no-underline", "disabled:cursor-not-allowed [&[data-state=open]>svg]:rotate-180", a),
451
453
  "data-slot": "accordion-trigger",
452
454
  "data-testid": "spectral-accordion-trigger",
453
- className: w("text-text-primary flex flex-1 items-center justify-between text-sm font-normal transition-all hover:no-underline", "disabled:cursor-not-allowed [&[data-state=open]>svg]:rotate-180", n),
454
455
  onClick: c,
455
- ...a,
456
+ ref: s,
457
+ ...n,
456
458
  children: [
457
- /* @__PURE__ */ j("div", { className: "flex w-full flex-col space-y-0.5 text-start", children: [
459
+ /* @__PURE__ */ K("div", { className: "flex w-full flex-col space-y-0.5 text-start", children: [
458
460
  /* @__PURE__ */ i("div", { className: "text-text-primary text-base font-medium", children: o }),
459
461
  t && /* @__PURE__ */ i("div", { className: "text-text-secondary text-sm font-normal", children: t })
460
462
  ] }),
461
- /* @__PURE__ */ i(pe, { className: "shrink-0 transition-transform duration-200" })
463
+ /* @__PURE__ */ i(ve, { className: "shrink-0 transition-transform duration-200" })
462
464
  ]
463
465
  }
464
466
  ) });
465
467
  };
466
- Je.displayName = "AccordionTrigger";
467
- const Ye = ({
468
+ me.displayName = "AccordionTrigger";
469
+ const ue = ({
468
470
  ref: e,
469
- className: n,
471
+ className: a,
470
472
  children: o,
471
473
  ...t
472
474
  }) => /* @__PURE__ */ i(
473
- Fe,
475
+ qe,
474
476
  {
475
- ref: e,
477
+ className: w("motion-safe:data-[state=closed]:animate-accordion-up motion-safe:data-[state=open]:animate-accordion-down overflow-hidden pt-4 text-sm", a),
476
478
  "data-slot": "accordion-content",
477
479
  "data-testid": "spectral-accordion-content",
478
- className: w("motion-safe:data-[state=closed]:animate-accordion-up motion-safe:data-[state=open]:animate-accordion-down overflow-hidden pt-4 text-sm", n),
480
+ ref: e,
479
481
  ...t,
480
482
  children: /* @__PURE__ */ i("div", { className: "px-1 pt-0 pb-4", "data-slot": "accordion-content-inner", children: o })
481
483
  }
482
484
  );
483
- Ye.displayName = "AccordionContent";
485
+ ue.displayName = "AccordionContent";
486
+ const gt = Object.assign(de, {
487
+ Content: ue,
488
+ Item: pe,
489
+ Trigger: me
490
+ });
484
491
  export {
485
- Ue as Accordion,
486
- Ye as AccordionContent,
487
- qe as AccordionItem,
488
- Je as AccordionTrigger
492
+ gt as Accordion,
493
+ ue as AccordionContent,
494
+ pe as AccordionItem,
495
+ me as AccordionTrigger
489
496
  };
@@ -11,36 +11,36 @@ export declare const AlertBase: {
11
11
  displayName: string;
12
12
  };
13
13
  export declare const AlertHeader: {
14
- ({ ref, className, ...props }: HTMLAttributes<HTMLDivElement> & {
14
+ ({ className, ref, ...props }: HTMLAttributes<HTMLDivElement> & {
15
15
  ref?: Ref<HTMLDivElement>;
16
16
  }): import("react/jsx-runtime").JSX.Element;
17
17
  displayName: string;
18
18
  };
19
19
  export declare const AlertTitle: {
20
- ({ ref, className, variant, ...props }: HTMLAttributes<HTMLDivElement> & {
20
+ ({ className, ref, variant, ...props }: HTMLAttributes<HTMLDivElement> & {
21
21
  ref?: Ref<HTMLDivElement>;
22
22
  variant: AlertVariant;
23
23
  }): import("react/jsx-runtime").JSX.Element;
24
24
  displayName: string;
25
25
  };
26
26
  export declare const AlertDescription: {
27
- ({ ref, className, variant, ...props }: HTMLAttributes<HTMLDivElement> & {
27
+ ({ className, ref, variant, ...props }: HTMLAttributes<HTMLDivElement> & {
28
28
  ref?: Ref<HTMLDivElement>;
29
29
  variant: AlertVariant;
30
30
  }): import("react/jsx-runtime").JSX.Element;
31
31
  displayName: string;
32
32
  };
33
33
  export declare const AlertCloseButton: {
34
- ({ ref, className, variant, ...props }: HTMLAttributes<SVGSVGElement> & {
34
+ ({ className, ref, variant, ...props }: HTMLAttributes<SVGSVGElement> & {
35
35
  ref?: Ref<SVGSVGElement>;
36
36
  variant: AlertVariant;
37
37
  }): import("react/jsx-runtime").JSX.Element;
38
38
  displayName: string;
39
39
  };
40
- type AlertPortalProps = {
40
+ interface AlertPortalProps {
41
41
  children: ReactNode;
42
42
  container?: Element | DocumentFragment;
43
- };
44
- export declare function AlertPortal({ children, container }: AlertPortalProps): import('react').ReactPortal | null;
43
+ }
44
+ export declare const AlertPortal: ({ children, container }: AlertPortalProps) => import('react').ReactPortal | null;
45
45
  export {};
46
46
  //# sourceMappingURL=AlertBase.d.ts.map