@midas-ds/components 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/Breadcrumbs.css +1 -0
  2. package/Button-CCevm2s3.js +183 -0
  3. package/Button.css +1 -0
  4. package/ButtonGroup.css +1 -0
  5. package/CHANGELOG.md +76 -0
  6. package/Card.css +1 -0
  7. package/Checkbox-CllWDBxF.js +405 -0
  8. package/Checkbox.css +1 -0
  9. package/Collection-B3xUVWPF.js +483 -0
  10. package/ComboBox.css +1 -0
  11. package/DatePicker.css +1 -0
  12. package/Dialog-CLTyYwkS.js +1889 -0
  13. package/DragAndDrop-OTN7La7U.js +42 -0
  14. package/Dropdown.css +1 -0
  15. package/FileUpload.css +1 -0
  16. package/Flex.css +1 -0
  17. package/Flex.module-CpoxBzQX.js +37 -0
  18. package/FocusScope-BR0SJ-cZ.js +512 -0
  19. package/Form-DXLoQL91.js +240 -0
  20. package/Grid.css +1 -0
  21. package/Grid.module-Ia0e9Dix.js +36 -0
  22. package/Group-DPMuN3h8.js +44 -0
  23. package/Hidden-BQWDvze4.js +37 -0
  24. package/InfoBanner.css +1 -0
  25. package/Label-C18A_4Z5.js +69 -0
  26. package/Layout.css +1 -0
  27. package/Link-BU1h3K2a.js +77 -0
  28. package/Link.css +1 -0
  29. package/LinkButton.css +1 -0
  30. package/ListBox-D21tdwTs.js +463 -0
  31. package/ListKeyboardDelegate-DxMjfMsI.js +172 -0
  32. package/Logo.css +1 -0
  33. package/Modal.css +1 -0
  34. package/MultiSelect.css +1 -0
  35. package/PressResponder-DP8ZDNGy.js +31 -0
  36. package/README.md +7 -0
  37. package/RSPContexts-EOiWkKOf.js +11 -0
  38. package/Radio.css +1 -0
  39. package/SearchField.css +1 -0
  40. package/Select.css +1 -0
  41. package/SelectionManager-D4WtKtey.js +988 -0
  42. package/Separator-DLUHK9vv.js +48 -0
  43. package/Spinner.css +1 -0
  44. package/Table.css +1 -0
  45. package/Tabs.css +1 -0
  46. package/Tag-CEd6WWSc.js +725 -0
  47. package/Tag.css +1 -0
  48. package/Text-DGLaY3HR.js +17 -0
  49. package/TextArea.css +1 -0
  50. package/TextField-C_hq9WeT.js +226 -0
  51. package/TextField.css +1 -0
  52. package/TextField.module-Cwq1FAm7.js +141 -0
  53. package/Toast.css +1 -0
  54. package/VisuallyHidden-B_XzVvlX.js +39 -0
  55. package/accordion/Accordion.d.ts +13 -0
  56. package/accordion/AccordionContent.d.ts +3 -0
  57. package/accordion/AccordionItem.d.ts +3 -0
  58. package/accordion/AccordionTagContext.d.ts +3 -0
  59. package/accordion/AccordionTrigger.d.ts +3 -0
  60. package/accordion/index.d.ts +5 -0
  61. package/breadcrumbs/Breadcrumbs.d.ts +9 -0
  62. package/breadcrumbs/index.d.ts +1 -0
  63. package/button/Button.d.ts +41 -0
  64. package/button/ButtonGroup.d.ts +12 -0
  65. package/button/index.d.ts +2 -0
  66. package/card/Card.d.ts +34 -0
  67. package/card/index.d.ts +1 -0
  68. package/checkbox/Checkbox.d.ts +2 -0
  69. package/checkbox/CheckboxGroup.d.ts +10 -0
  70. package/checkbox/index.d.ts +2 -0
  71. package/chevron-down-Cd1bkzXT.js +13 -0
  72. package/chevron-right-DBMc9VMi.js +23 -0
  73. package/clsx-OuTLNxxd.js +16 -0
  74. package/combobox/ComboBox.d.ts +12 -0
  75. package/combobox/index.d.ts +1 -0
  76. package/context-ScOIq_Gu.js +80 -0
  77. package/createLucideIcon-DeWljiyi.js +79 -0
  78. package/date-picker/DatePicker.d.ts +14 -0
  79. package/date-picker/index.d.ts +2 -0
  80. package/dropdown/Dropdown.d.ts +8 -0
  81. package/dropdown/index.d.ts +1 -0
  82. package/file-upload/FileUpload.d.ts +11 -0
  83. package/file-upload/index.d.ts +1 -0
  84. package/flex/Flex.d.ts +17 -0
  85. package/flex/FlexItem.d.ts +15 -0
  86. package/flex/index.d.ts +2 -0
  87. package/grid/Grid.d.ts +16 -0
  88. package/grid/GridItem.d.ts +7 -0
  89. package/grid/index.d.ts +2 -0
  90. package/index-CEg5vZQH.js +132 -0
  91. package/index-CgfokhRq.js +674 -0
  92. package/index-CorR1LBD.js +3122 -0
  93. package/index-Dl1Q-tbj.js +26984 -0
  94. package/index.css +1 -0
  95. package/index.d.ts +29 -0
  96. package/index.js +114 -0
  97. package/index10.js +4 -0
  98. package/index11.js +5 -0
  99. package/index12.js +4 -0
  100. package/index13.js +4 -0
  101. package/index14.js +4 -0
  102. package/index15.js +6 -0
  103. package/index16.js +6 -0
  104. package/index17.js +6 -0
  105. package/index18.js +4 -0
  106. package/index19.js +6 -0
  107. package/index2.js +8 -0
  108. package/index20.js +6 -0
  109. package/index21.js +4 -0
  110. package/index22.js +5 -0
  111. package/index23.js +5 -0
  112. package/index24.js +5 -0
  113. package/index25.js +6 -0
  114. package/index26.js +6 -0
  115. package/index27.js +6 -0
  116. package/index28.js +4 -0
  117. package/index29.js +12 -0
  118. package/index3.js +8 -0
  119. package/index30.js +20 -0
  120. package/index31.js +22 -0
  121. package/index32.js +14 -0
  122. package/index33.js +11 -0
  123. package/index34.js +31 -0
  124. package/index35.js +8 -0
  125. package/index36.js +9 -0
  126. package/index37.js +19 -0
  127. package/index38.js +9 -0
  128. package/index39.js +9 -0
  129. package/index4.js +4 -0
  130. package/index40.js +16 -0
  131. package/index41.js +16 -0
  132. package/index42.js +31 -0
  133. package/index43.js +16 -0
  134. package/index44.js +6 -0
  135. package/index45.js +53 -0
  136. package/index46.js +18 -0
  137. package/index47.js +27 -0
  138. package/index48.js +18 -0
  139. package/index49.js +21 -0
  140. package/index5.js +5 -0
  141. package/index50.js +49 -0
  142. package/index51.js +5 -0
  143. package/index52.js +25 -0
  144. package/index53.js +18 -0
  145. package/index54.js +9 -0
  146. package/index55.js +25 -0
  147. package/index56.js +18 -0
  148. package/index57.js +11 -0
  149. package/index58.js +12 -0
  150. package/index59.js +15 -0
  151. package/index6.js +4 -0
  152. package/index60.js +9 -0
  153. package/index61.js +9 -0
  154. package/index62.js +19 -0
  155. package/index63.js +22 -0
  156. package/index64.js +61 -0
  157. package/index65.js +15 -0
  158. package/index66.js +11 -0
  159. package/index67.js +63 -0
  160. package/index68.js +85 -0
  161. package/index69.js +74 -0
  162. package/index7.js +9 -0
  163. package/index70.js +24 -0
  164. package/index71.js +69 -0
  165. package/index72.js +80 -0
  166. package/index73.js +140 -0
  167. package/index74.js +70 -0
  168. package/index75.js +42 -0
  169. package/index76.js +82 -0
  170. package/index77.js +71 -0
  171. package/index78.js +104 -0
  172. package/index79.js +274 -0
  173. package/index8.js +4 -0
  174. package/index80.js +724 -0
  175. package/index81.js +491 -0
  176. package/index82.js +317 -0
  177. package/index83.js +391 -0
  178. package/index84.js +254 -0
  179. package/index85.js +1364 -0
  180. package/index86.js +1009 -0
  181. package/index87.js +388 -0
  182. package/index88.js +2105 -0
  183. package/index89.js +2371 -0
  184. package/index9.js +5 -0
  185. package/index90.js +6834 -0
  186. package/index91.js +17 -0
  187. package/index92.js +14 -0
  188. package/index93.js +6 -0
  189. package/index94.js +9 -0
  190. package/info-banner/InfoBanner.d.ts +21 -0
  191. package/info-banner/index.d.ts +1 -0
  192. package/intlStrings-Cd44R5hT.js +278 -0
  193. package/layout/Layout.d.ts +51 -0
  194. package/layout/index.d.ts +1 -0
  195. package/link/Link.d.ts +13 -0
  196. package/link/index.d.ts +1 -0
  197. package/link-button/LinkButton.d.ts +18 -0
  198. package/link-button/index.d.ts +1 -0
  199. package/logo/Logo.d.ts +16 -0
  200. package/logo/index.d.ts +1 -0
  201. package/modal/Modal.d.ts +13 -0
  202. package/modal/index.d.ts +1 -0
  203. package/multi-select/MultiSelect.d.ts +28 -0
  204. package/multi-select/index.d.ts +1 -0
  205. package/package.json +29 -0
  206. package/radio/Radio.d.ts +20 -0
  207. package/radio/index.d.ts +1 -0
  208. package/react.esm-D8HpDGKP.js +11060 -0
  209. package/search-field/SearchField.d.ts +13 -0
  210. package/search-field/index.d.ts +1 -0
  211. package/select/Select.d.ts +11 -0
  212. package/select/index.d.ts +1 -0
  213. package/spinner/Spinner.d.ts +11 -0
  214. package/spinner/index.d.ts +1 -0
  215. package/table/Table.d.ts +12 -0
  216. package/table/index.d.ts +1 -0
  217. package/tabs/Tabs.d.ts +12 -0
  218. package/tabs/index.d.ts +1 -0
  219. package/tag/Tag.d.ts +11 -0
  220. package/tag/index.d.ts +1 -0
  221. package/textarea/TextArea.d.ts +20 -0
  222. package/textarea/index.d.ts +1 -0
  223. package/textfield/TextField.d.ts +16 -0
  224. package/textfield/index.d.ts +3 -0
  225. package/theme/index.d.ts +138 -0
  226. package/theme/tokens.d.ts +135 -0
  227. package/toast/Toast.d.ts +25 -0
  228. package/toast/index.d.ts +1 -0
  229. package/tokens-CjXmpXTi.js +160 -0
  230. package/triangle-alert-1OYl9KWz.js +56 -0
  231. package/useControlledState-S_TYcV_c.js +45 -0
  232. package/useDescription-D4_zk_sA.js +32 -0
  233. package/useFilter-BnJDBCkt.js +35 -0
  234. package/useFocusRing-D97-G3fT.js +1324 -0
  235. package/useFocusable-C-N9wcwm.js +56 -0
  236. package/useGridSelectionCheckbox-i1rsjlC-.js +22 -0
  237. package/useHasTabbableChild-DeuCnGGv.js +34 -0
  238. package/useHighlightSelectionDescription-JVx2MW_e.js +552 -0
  239. package/useListState-DSOTbsL3.js +119 -0
  240. package/useLocalizedStringFormatter-DVCAZqcL.js +96 -0
  241. package/useSingleSelectListState-CmX9_L5H.js +34 -0
  242. package/useUpdateEffect-Dtz-i14F.js +12 -0
  243. package/x-JK7i-TQC.js +14 -0
@@ -0,0 +1,674 @@
1
+ import * as s from "react";
2
+ import _ from "react";
3
+ import { jsx as f, Fragment as ge } from "react/jsx-runtime";
4
+ import "react-dom";
5
+ import './index.css';const he = '"../theme/tokens.css"', Ae = '"Inter", sans-serif', be = "#bfbfbf", _e = "#e6e6e6", xe = "#000000", Re = "300ms", Ne = "400", Se = "_root_nq4cs_4", ye = "_trigger_nq4cs_8", Ie = "_item_nq4cs_34", Pe = "_content_nq4cs_52", we = "_slideDown_nq4cs_1", Me = "_slideUp_nq4cs_1", Ee = "_header_nq4cs_90", Oe = "_triggerText_nq4cs_94", Ct = {
6
+ tokens: he,
7
+ display: Ae,
8
+ gray50: be,
9
+ gray20: _e,
10
+ black: xe,
11
+ normalTransition: Re,
12
+ regularWeight: Ne,
13
+ root: Se,
14
+ trigger: ye,
15
+ item: Ie,
16
+ content: Pe,
17
+ slideDown: we,
18
+ slideUp: Me,
19
+ header: Ee,
20
+ triggerText: Oe
21
+ };
22
+ function z(e, t = []) {
23
+ let n = [];
24
+ function o(c, i) {
25
+ const a = s.createContext(i), l = n.length;
26
+ n = [...n, i];
27
+ const u = (d) => {
28
+ var b;
29
+ const { scope: m, children: p, ...C } = d, h = ((b = m == null ? void 0 : m[e]) == null ? void 0 : b[l]) || a, A = s.useMemo(() => C, Object.values(C));
30
+ return /* @__PURE__ */ f(h.Provider, { value: A, children: p });
31
+ };
32
+ u.displayName = c + "Provider";
33
+ function g(d, m) {
34
+ var h;
35
+ const p = ((h = m == null ? void 0 : m[e]) == null ? void 0 : h[l]) || a, C = s.useContext(p);
36
+ if (C) return C;
37
+ if (i !== void 0) return i;
38
+ throw new Error(`\`${d}\` must be used within \`${c}\``);
39
+ }
40
+ return [u, g];
41
+ }
42
+ const r = () => {
43
+ const c = n.map((i) => s.createContext(i));
44
+ return function(a) {
45
+ const l = (a == null ? void 0 : a[e]) || c;
46
+ return s.useMemo(
47
+ () => ({ [`__scope${e}`]: { ...a, [e]: l } }),
48
+ [a, l]
49
+ );
50
+ };
51
+ };
52
+ return r.scopeName = e, [o, Te(r, ...t)];
53
+ }
54
+ function Te(...e) {
55
+ const t = e[0];
56
+ if (e.length === 1) return t;
57
+ const n = () => {
58
+ const o = e.map((r) => ({
59
+ useScope: r(),
60
+ scopeName: r.scopeName
61
+ }));
62
+ return function(c) {
63
+ const i = o.reduce((a, { useScope: l, scopeName: u }) => {
64
+ const d = l(c)[`__scope${u}`];
65
+ return { ...a, ...d };
66
+ }, {});
67
+ return s.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
68
+ };
69
+ };
70
+ return n.scopeName = t.scopeName, n;
71
+ }
72
+ function De(e, t = []) {
73
+ let n = [];
74
+ function o(c, i) {
75
+ const a = s.createContext(i), l = n.length;
76
+ n = [...n, i];
77
+ function u(d) {
78
+ const { scope: m, children: p, ...C } = d, h = (m == null ? void 0 : m[e][l]) || a, A = s.useMemo(() => C, Object.values(C));
79
+ return /* @__PURE__ */ f(h.Provider, { value: A, children: p });
80
+ }
81
+ function g(d, m) {
82
+ const p = (m == null ? void 0 : m[e][l]) || a, C = s.useContext(p);
83
+ if (C) return C;
84
+ if (i !== void 0) return i;
85
+ throw new Error(`\`${d}\` must be used within \`${c}\``);
86
+ }
87
+ return u.displayName = c + "Provider", [u, g];
88
+ }
89
+ const r = () => {
90
+ const c = n.map((i) => s.createContext(i));
91
+ return function(a) {
92
+ const l = (a == null ? void 0 : a[e]) || c;
93
+ return s.useMemo(
94
+ () => ({ [`__scope${e}`]: { ...a, [e]: l } }),
95
+ [a, l]
96
+ );
97
+ };
98
+ };
99
+ return r.scopeName = e, [o, ke(r, ...t)];
100
+ }
101
+ function ke(...e) {
102
+ const t = e[0];
103
+ if (e.length === 1) return t;
104
+ const n = () => {
105
+ const o = e.map((r) => ({
106
+ useScope: r(),
107
+ scopeName: r.scopeName
108
+ }));
109
+ return function(c) {
110
+ const i = o.reduce((a, { useScope: l, scopeName: u }) => {
111
+ const d = l(c)[`__scope${u}`];
112
+ return { ...a, ...d };
113
+ }, {});
114
+ return s.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
115
+ };
116
+ };
117
+ return n.scopeName = t.scopeName, n;
118
+ }
119
+ function $e(e, t) {
120
+ typeof e == "function" ? e(t) : e != null && (e.current = t);
121
+ }
122
+ function Y(...e) {
123
+ return (t) => e.forEach((n) => $e(n, t));
124
+ }
125
+ function y(...e) {
126
+ return s.useCallback(Y(...e), e);
127
+ }
128
+ var w = s.forwardRef((e, t) => {
129
+ const { children: n, ...o } = e, r = s.Children.toArray(n), c = r.find(Ue);
130
+ if (c) {
131
+ const i = c.props.children, a = r.map((l) => l === c ? s.Children.count(i) > 1 ? s.Children.only(null) : s.isValidElement(i) ? i.props.children : null : l);
132
+ return /* @__PURE__ */ f($, { ...o, ref: t, children: s.isValidElement(i) ? s.cloneElement(i, void 0, a) : null });
133
+ }
134
+ return /* @__PURE__ */ f($, { ...o, ref: t, children: n });
135
+ });
136
+ w.displayName = "Slot";
137
+ var $ = s.forwardRef((e, t) => {
138
+ const { children: n, ...o } = e;
139
+ if (s.isValidElement(n)) {
140
+ const r = We(n);
141
+ return s.cloneElement(n, {
142
+ ...Ve(o, n.props),
143
+ // @ts-ignore
144
+ ref: t ? Y(t, r) : r
145
+ });
146
+ }
147
+ return s.Children.count(n) > 1 ? s.Children.only(null) : null;
148
+ });
149
+ $.displayName = "SlotClone";
150
+ var Le = ({ children: e }) => /* @__PURE__ */ f(ge, { children: e });
151
+ function Ue(e) {
152
+ return s.isValidElement(e) && e.type === Le;
153
+ }
154
+ function Ve(e, t) {
155
+ const n = { ...t };
156
+ for (const o in t) {
157
+ const r = e[o], c = t[o];
158
+ /^on[A-Z]/.test(o) ? r && c ? n[o] = (...a) => {
159
+ c(...a), r(...a);
160
+ } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...c } : o === "className" && (n[o] = [r, c].filter(Boolean).join(" "));
161
+ }
162
+ return { ...e, ...n };
163
+ }
164
+ function We(e) {
165
+ var o, r;
166
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
167
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
168
+ }
169
+ function qe(e) {
170
+ const t = e + "CollectionProvider", [n, o] = De(t), [r, c] = n(
171
+ t,
172
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
173
+ ), i = (p) => {
174
+ const { scope: C, children: h } = p, A = _.useRef(null), b = _.useRef(/* @__PURE__ */ new Map()).current;
175
+ return /* @__PURE__ */ f(r, { scope: C, itemMap: b, collectionRef: A, children: h });
176
+ };
177
+ i.displayName = t;
178
+ const a = e + "CollectionSlot", l = _.forwardRef(
179
+ (p, C) => {
180
+ const { scope: h, children: A } = p, b = c(a, h), v = y(C, b.collectionRef);
181
+ return /* @__PURE__ */ f(w, { ref: v, children: A });
182
+ }
183
+ );
184
+ l.displayName = a;
185
+ const u = e + "CollectionItemSlot", g = "data-radix-collection-item", d = _.forwardRef(
186
+ (p, C) => {
187
+ const { scope: h, children: A, ...b } = p, v = _.useRef(null), x = y(C, v), N = c(u, h);
188
+ return _.useEffect(() => (N.itemMap.set(v, { ref: v, ...b }), () => void N.itemMap.delete(v))), /* @__PURE__ */ f(w, { [g]: "", ref: x, children: A });
189
+ }
190
+ );
191
+ d.displayName = u;
192
+ function m(p) {
193
+ const C = c(e + "CollectionConsumer", p);
194
+ return _.useCallback(() => {
195
+ const A = C.collectionRef.current;
196
+ if (!A) return [];
197
+ const b = Array.from(A.querySelectorAll(`[${g}]`));
198
+ return Array.from(C.itemMap.values()).sort(
199
+ (N, S) => b.indexOf(N.ref.current) - b.indexOf(S.ref.current)
200
+ );
201
+ }, [C.collectionRef, C.itemMap]);
202
+ }
203
+ return [
204
+ { Provider: i, Slot: l, ItemSlot: d },
205
+ m,
206
+ o
207
+ ];
208
+ }
209
+ function Z(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
210
+ return function(r) {
211
+ if (e == null || e(r), n === !1 || !r.defaultPrevented)
212
+ return t == null ? void 0 : t(r);
213
+ };
214
+ }
215
+ function J(e) {
216
+ const t = s.useRef(e);
217
+ return s.useEffect(() => {
218
+ t.current = e;
219
+ }), s.useMemo(() => (...n) => {
220
+ var o;
221
+ return (o = t.current) == null ? void 0 : o.call(t, ...n);
222
+ }, []);
223
+ }
224
+ function U({
225
+ prop: e,
226
+ defaultProp: t,
227
+ onChange: n = () => {
228
+ }
229
+ }) {
230
+ const [o, r] = Fe({ defaultProp: t, onChange: n }), c = e !== void 0, i = c ? e : o, a = J(n), l = s.useCallback(
231
+ (u) => {
232
+ if (c) {
233
+ const d = typeof u == "function" ? u(e) : u;
234
+ d !== e && a(d);
235
+ } else
236
+ r(u);
237
+ },
238
+ [c, e, r, a]
239
+ );
240
+ return [i, l];
241
+ }
242
+ function Fe({
243
+ defaultProp: e,
244
+ onChange: t
245
+ }) {
246
+ const n = s.useState(e), [o] = n, r = s.useRef(o), c = J(t);
247
+ return s.useEffect(() => {
248
+ r.current !== o && (c(o), r.current = o);
249
+ }, [o, r, c]), n;
250
+ }
251
+ var je = [
252
+ "a",
253
+ "button",
254
+ "div",
255
+ "form",
256
+ "h2",
257
+ "h3",
258
+ "img",
259
+ "input",
260
+ "label",
261
+ "li",
262
+ "nav",
263
+ "ol",
264
+ "p",
265
+ "span",
266
+ "svg",
267
+ "ul"
268
+ ], I = je.reduce((e, t) => {
269
+ const n = s.forwardRef((o, r) => {
270
+ const { asChild: c, ...i } = o, a = c ? w : t;
271
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(a, { ...i, ref: r });
272
+ });
273
+ return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
274
+ }, {}), M = globalThis != null && globalThis.document ? s.useLayoutEffect : () => {
275
+ };
276
+ function Be(e, t) {
277
+ return s.useReducer((n, o) => t[n][o] ?? n, e);
278
+ }
279
+ var Q = (e) => {
280
+ const { present: t, children: n } = e, o = Ge(t), r = typeof n == "function" ? n({ present: o.isPresent }) : s.Children.only(n), c = y(o.ref, He(r));
281
+ return typeof n == "function" || o.isPresent ? s.cloneElement(r, { ref: c }) : null;
282
+ };
283
+ Q.displayName = "Presence";
284
+ function Ge(e) {
285
+ const [t, n] = s.useState(), o = s.useRef({}), r = s.useRef(e), c = s.useRef("none"), i = e ? "mounted" : "unmounted", [a, l] = Be(i, {
286
+ mounted: {
287
+ UNMOUNT: "unmounted",
288
+ ANIMATION_OUT: "unmountSuspended"
289
+ },
290
+ unmountSuspended: {
291
+ MOUNT: "mounted",
292
+ ANIMATION_END: "unmounted"
293
+ },
294
+ unmounted: {
295
+ MOUNT: "mounted"
296
+ }
297
+ });
298
+ return s.useEffect(() => {
299
+ const u = P(o.current);
300
+ c.current = a === "mounted" ? u : "none";
301
+ }, [a]), M(() => {
302
+ const u = o.current, g = r.current;
303
+ if (g !== e) {
304
+ const m = c.current, p = P(u);
305
+ e ? l("MOUNT") : p === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(g && m !== p ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
306
+ }
307
+ }, [e, l]), M(() => {
308
+ if (t) {
309
+ let u;
310
+ const g = t.ownerDocument.defaultView ?? window, d = (p) => {
311
+ const h = P(o.current).includes(p.animationName);
312
+ if (p.target === t && h && (l("ANIMATION_END"), !r.current)) {
313
+ const A = t.style.animationFillMode;
314
+ t.style.animationFillMode = "forwards", u = g.setTimeout(() => {
315
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = A);
316
+ });
317
+ }
318
+ }, m = (p) => {
319
+ p.target === t && (c.current = P(o.current));
320
+ };
321
+ return t.addEventListener("animationstart", m), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
322
+ g.clearTimeout(u), t.removeEventListener("animationstart", m), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
323
+ };
324
+ } else
325
+ l("ANIMATION_END");
326
+ }, [t, l]), {
327
+ isPresent: ["mounted", "unmountSuspended"].includes(a),
328
+ ref: s.useCallback((u) => {
329
+ u && (o.current = getComputedStyle(u)), n(u);
330
+ }, [])
331
+ };
332
+ }
333
+ function P(e) {
334
+ return (e == null ? void 0 : e.animationName) || "none";
335
+ }
336
+ function He(e) {
337
+ var o, r;
338
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
339
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
340
+ }
341
+ var Ke = s.useId || (() => {
342
+ }), ze = 0;
343
+ function X(e) {
344
+ const [t, n] = s.useState(Ke());
345
+ return M(() => {
346
+ n((o) => o ?? String(ze++));
347
+ }, [e]), t ? `radix-${t}` : "";
348
+ }
349
+ var V = "Collapsible", [Ye, ee] = z(V), [Ze, W] = Ye(V), te = s.forwardRef(
350
+ (e, t) => {
351
+ const {
352
+ __scopeCollapsible: n,
353
+ open: o,
354
+ defaultOpen: r,
355
+ disabled: c,
356
+ onOpenChange: i,
357
+ ...a
358
+ } = e, [l = !1, u] = U({
359
+ prop: o,
360
+ defaultProp: r,
361
+ onChange: i
362
+ });
363
+ return /* @__PURE__ */ f(
364
+ Ze,
365
+ {
366
+ scope: n,
367
+ disabled: c,
368
+ contentId: X(),
369
+ open: l,
370
+ onOpenToggle: s.useCallback(() => u((g) => !g), [u]),
371
+ children: /* @__PURE__ */ f(
372
+ I.div,
373
+ {
374
+ "data-state": F(l),
375
+ "data-disabled": c ? "" : void 0,
376
+ ...a,
377
+ ref: t
378
+ }
379
+ )
380
+ }
381
+ );
382
+ }
383
+ );
384
+ te.displayName = V;
385
+ var ne = "CollapsibleTrigger", oe = s.forwardRef(
386
+ (e, t) => {
387
+ const { __scopeCollapsible: n, ...o } = e, r = W(ne, n);
388
+ return /* @__PURE__ */ f(
389
+ I.button,
390
+ {
391
+ type: "button",
392
+ "aria-controls": r.contentId,
393
+ "aria-expanded": r.open || !1,
394
+ "data-state": F(r.open),
395
+ "data-disabled": r.disabled ? "" : void 0,
396
+ disabled: r.disabled,
397
+ ...o,
398
+ ref: t,
399
+ onClick: Z(e.onClick, r.onOpenToggle)
400
+ }
401
+ );
402
+ }
403
+ );
404
+ oe.displayName = ne;
405
+ var q = "CollapsibleContent", re = s.forwardRef(
406
+ (e, t) => {
407
+ const { forceMount: n, ...o } = e, r = W(q, e.__scopeCollapsible);
408
+ return /* @__PURE__ */ f(Q, { present: n || r.open, children: ({ present: c }) => /* @__PURE__ */ f(Je, { ...o, ref: t, present: c }) });
409
+ }
410
+ );
411
+ re.displayName = q;
412
+ var Je = s.forwardRef((e, t) => {
413
+ const { __scopeCollapsible: n, present: o, children: r, ...c } = e, i = W(q, n), [a, l] = s.useState(o), u = s.useRef(null), g = y(t, u), d = s.useRef(0), m = d.current, p = s.useRef(0), C = p.current, h = i.open || a, A = s.useRef(h), b = s.useRef();
414
+ return s.useEffect(() => {
415
+ const v = requestAnimationFrame(() => A.current = !1);
416
+ return () => cancelAnimationFrame(v);
417
+ }, []), M(() => {
418
+ const v = u.current;
419
+ if (v) {
420
+ b.current = b.current || {
421
+ transitionDuration: v.style.transitionDuration,
422
+ animationName: v.style.animationName
423
+ }, v.style.transitionDuration = "0s", v.style.animationName = "none";
424
+ const x = v.getBoundingClientRect();
425
+ d.current = x.height, p.current = x.width, A.current || (v.style.transitionDuration = b.current.transitionDuration, v.style.animationName = b.current.animationName), l(o);
426
+ }
427
+ }, [i.open, o]), /* @__PURE__ */ f(
428
+ I.div,
429
+ {
430
+ "data-state": F(i.open),
431
+ "data-disabled": i.disabled ? "" : void 0,
432
+ id: i.contentId,
433
+ hidden: !h,
434
+ ...c,
435
+ ref: g,
436
+ style: {
437
+ "--radix-collapsible-content-height": m ? `${m}px` : void 0,
438
+ "--radix-collapsible-content-width": C ? `${C}px` : void 0,
439
+ ...e.style
440
+ },
441
+ children: h && r
442
+ }
443
+ );
444
+ });
445
+ function F(e) {
446
+ return e ? "open" : "closed";
447
+ }
448
+ var Qe = te, Xe = oe, et = re, tt = s.createContext(void 0);
449
+ function nt(e) {
450
+ const t = s.useContext(tt);
451
+ return e || t || "ltr";
452
+ }
453
+ var R = "Accordion", ot = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [j, rt, ct] = qe(R), [O, vt] = z(R, [
454
+ ct,
455
+ ee
456
+ ]), B = ee(), ce = _.forwardRef(
457
+ (e, t) => {
458
+ const { type: n, ...o } = e, r = o, c = o;
459
+ return /* @__PURE__ */ f(j.Provider, { scope: e.__scopeAccordion, children: n === "multiple" ? /* @__PURE__ */ f(lt, { ...c, ref: t }) : /* @__PURE__ */ f(at, { ...r, ref: t }) });
460
+ }
461
+ );
462
+ ce.displayName = R;
463
+ var [ie, it] = O(R), [se, st] = O(
464
+ R,
465
+ { collapsible: !1 }
466
+ ), at = _.forwardRef(
467
+ (e, t) => {
468
+ const {
469
+ value: n,
470
+ defaultValue: o,
471
+ onValueChange: r = () => {
472
+ },
473
+ collapsible: c = !1,
474
+ ...i
475
+ } = e, [a, l] = U({
476
+ prop: n,
477
+ defaultProp: o,
478
+ onChange: r
479
+ });
480
+ return /* @__PURE__ */ f(
481
+ ie,
482
+ {
483
+ scope: e.__scopeAccordion,
484
+ value: a ? [a] : [],
485
+ onItemOpen: l,
486
+ onItemClose: _.useCallback(() => c && l(""), [c, l]),
487
+ children: /* @__PURE__ */ f(se, { scope: e.__scopeAccordion, collapsible: c, children: /* @__PURE__ */ f(ae, { ...i, ref: t }) })
488
+ }
489
+ );
490
+ }
491
+ ), lt = _.forwardRef((e, t) => {
492
+ const {
493
+ value: n,
494
+ defaultValue: o,
495
+ onValueChange: r = () => {
496
+ },
497
+ ...c
498
+ } = e, [i = [], a] = U({
499
+ prop: n,
500
+ defaultProp: o,
501
+ onChange: r
502
+ }), l = _.useCallback(
503
+ (g) => a((d = []) => [...d, g]),
504
+ [a]
505
+ ), u = _.useCallback(
506
+ (g) => a((d = []) => d.filter((m) => m !== g)),
507
+ [a]
508
+ );
509
+ return /* @__PURE__ */ f(
510
+ ie,
511
+ {
512
+ scope: e.__scopeAccordion,
513
+ value: i,
514
+ onItemOpen: l,
515
+ onItemClose: u,
516
+ children: /* @__PURE__ */ f(se, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ f(ae, { ...c, ref: t }) })
517
+ }
518
+ );
519
+ }), [ut, T] = O(R), ae = _.forwardRef(
520
+ (e, t) => {
521
+ const { __scopeAccordion: n, disabled: o, dir: r, orientation: c = "vertical", ...i } = e, a = _.useRef(null), l = y(a, t), u = rt(n), d = nt(r) === "ltr", m = Z(e.onKeyDown, (p) => {
522
+ var H;
523
+ if (!ot.includes(p.key)) return;
524
+ const C = p.target, h = u().filter((k) => {
525
+ var K;
526
+ return !((K = k.ref.current) != null && K.disabled);
527
+ }), A = h.findIndex((k) => k.ref.current === C), b = h.length;
528
+ if (A === -1) return;
529
+ p.preventDefault();
530
+ let v = A;
531
+ const x = 0, N = b - 1, S = () => {
532
+ v = A + 1, v > N && (v = x);
533
+ }, D = () => {
534
+ v = A - 1, v < x && (v = N);
535
+ };
536
+ switch (p.key) {
537
+ case "Home":
538
+ v = x;
539
+ break;
540
+ case "End":
541
+ v = N;
542
+ break;
543
+ case "ArrowRight":
544
+ c === "horizontal" && (d ? S() : D());
545
+ break;
546
+ case "ArrowDown":
547
+ c === "vertical" && S();
548
+ break;
549
+ case "ArrowLeft":
550
+ c === "horizontal" && (d ? D() : S());
551
+ break;
552
+ case "ArrowUp":
553
+ c === "vertical" && D();
554
+ break;
555
+ }
556
+ const ve = v % b;
557
+ (H = h[ve].ref.current) == null || H.focus();
558
+ });
559
+ return /* @__PURE__ */ f(
560
+ ut,
561
+ {
562
+ scope: n,
563
+ disabled: o,
564
+ direction: r,
565
+ orientation: c,
566
+ children: /* @__PURE__ */ f(j.Slot, { scope: n, children: /* @__PURE__ */ f(
567
+ I.div,
568
+ {
569
+ ...i,
570
+ "data-orientation": c,
571
+ ref: l,
572
+ onKeyDown: o ? void 0 : m
573
+ }
574
+ ) })
575
+ }
576
+ );
577
+ }
578
+ ), E = "AccordionItem", [dt, G] = O(E), le = _.forwardRef(
579
+ (e, t) => {
580
+ const { __scopeAccordion: n, value: o, ...r } = e, c = T(E, n), i = it(E, n), a = B(n), l = X(), u = o && i.value.includes(o) || !1, g = c.disabled || e.disabled;
581
+ return /* @__PURE__ */ f(
582
+ dt,
583
+ {
584
+ scope: n,
585
+ open: u,
586
+ disabled: g,
587
+ triggerId: l,
588
+ children: /* @__PURE__ */ f(
589
+ Qe,
590
+ {
591
+ "data-orientation": c.orientation,
592
+ "data-state": Ce(u),
593
+ ...a,
594
+ ...r,
595
+ ref: t,
596
+ disabled: g,
597
+ open: u,
598
+ onOpenChange: (d) => {
599
+ d ? i.onItemOpen(o) : i.onItemClose(o);
600
+ }
601
+ }
602
+ )
603
+ }
604
+ );
605
+ }
606
+ );
607
+ le.displayName = E;
608
+ var ue = "AccordionHeader", de = _.forwardRef(
609
+ (e, t) => {
610
+ const { __scopeAccordion: n, ...o } = e, r = T(R, n), c = G(ue, n);
611
+ return /* @__PURE__ */ f(
612
+ I.h3,
613
+ {
614
+ "data-orientation": r.orientation,
615
+ "data-state": Ce(c.open),
616
+ "data-disabled": c.disabled ? "" : void 0,
617
+ ...o,
618
+ ref: t
619
+ }
620
+ );
621
+ }
622
+ );
623
+ de.displayName = ue;
624
+ var L = "AccordionTrigger", fe = _.forwardRef(
625
+ (e, t) => {
626
+ const { __scopeAccordion: n, ...o } = e, r = T(R, n), c = G(L, n), i = st(L, n), a = B(n);
627
+ return /* @__PURE__ */ f(j.ItemSlot, { scope: n, children: /* @__PURE__ */ f(
628
+ Xe,
629
+ {
630
+ "aria-disabled": c.open && !i.collapsible || void 0,
631
+ "data-orientation": r.orientation,
632
+ id: c.triggerId,
633
+ ...a,
634
+ ...o,
635
+ ref: t
636
+ }
637
+ ) });
638
+ }
639
+ );
640
+ fe.displayName = L;
641
+ var pe = "AccordionContent", me = _.forwardRef(
642
+ (e, t) => {
643
+ const { __scopeAccordion: n, ...o } = e, r = T(R, n), c = G(pe, n), i = B(n);
644
+ return /* @__PURE__ */ f(
645
+ et,
646
+ {
647
+ role: "region",
648
+ "aria-labelledby": c.triggerId,
649
+ "data-orientation": r.orientation,
650
+ ...i,
651
+ ...o,
652
+ ref: t,
653
+ style: {
654
+ "--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
655
+ "--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
656
+ ...e.style
657
+ }
658
+ }
659
+ );
660
+ }
661
+ );
662
+ me.displayName = pe;
663
+ function Ce(e) {
664
+ return e ? "open" : "closed";
665
+ }
666
+ var gt = ce, ht = le, At = de, bt = fe, _t = me;
667
+ export {
668
+ _t as C,
669
+ At as H,
670
+ ht as I,
671
+ gt as R,
672
+ bt as T,
673
+ Ct as s
674
+ };