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