@spear-ai/spectral 1.4.26 → 1.4.27

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