@midas-ds/components 1.0.3 → 1.1.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 (145) hide show
  1. package/{Button-B4vMZbC6.js → Button-DL6nqUco.js} +22 -22
  2. package/CHANGELOG.md +6 -1
  3. package/{Checkbox-DnKWanep.js → Checkbox-q0dugR2t.js} +8 -8
  4. package/{Collection-COLWgm24.js → Collection-KMFfVuzU.js} +2 -2
  5. package/{Dialog-Cb6toyXO.js → Dialog-D6Bqrpn-.js} +170 -169
  6. package/Disclosure-dAZYXyTH.js +225 -0
  7. package/Disclosure.css +1 -0
  8. package/{FocusScope-C8i7CH6y.js → FocusScope-B7CkxXNC.js} +1 -1
  9. package/{Form-BQQs3jUk.js → Form-BWBjJC6v.js} +42 -42
  10. package/{Group-CdwXhx8Q.js → Group-D7_8007y.js} +10 -10
  11. package/Heading-RCRHv6hd.js +15 -0
  12. package/{Hidden-DngIphiL.js → Hidden-CVlUgUJM.js} +1 -1
  13. package/{Link-iAZLB3RI.js → Link-BnQvB-hH.js} +8 -8
  14. package/{ListBox-BKWkIIm6.js → ListBox-DBBiqvcR.js} +72 -72
  15. package/{ListKeyboardDelegate-BH-K5hyq.js → ListKeyboardDelegate-gCXy-Xnn.js} +2 -2
  16. package/{PressResponder-Cz-TRBHO.js → PressResponder-B4g56kDz.js} +5 -5
  17. package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
  18. package/{SelectionManager-8o40f7mx.js → SelectionManager-BfXUE1qg.js} +113 -129
  19. package/{Separator-BlvmQjwz.js → Separator-BBX9m2O2.js} +2 -2
  20. package/{Tag--W5TgxmK.js → Tag-DWt0koFj.js} +74 -74
  21. package/Text-BCF0xvqL.js +15 -0
  22. package/{TextField-DeK_yiK-.js → TextField-CX4eOQf6.js} +33 -33
  23. package/{TextField.module-0-u4LVPp.js → TextField.module-DdICj682.js} +7 -7
  24. package/{VisuallyHidden-CFx06Bae.js → VisuallyHidden-Dhr5caPC.js} +1 -1
  25. package/accordion/Accordion.d.ts +8 -8
  26. package/accordion/AccordionItem.d.ts +11 -3
  27. package/accordion/index.d.ts +0 -3
  28. package/{context-Bnqknrce.js → context-BpJLnOuu.js} +11 -11
  29. package/global.css +1 -0
  30. package/index.d.ts +1 -0
  31. package/index.js +105 -110
  32. package/index10.js +1 -1
  33. package/index11.js +1 -1
  34. package/index12.js +1 -1
  35. package/index13.js +1 -1
  36. package/index14.js +1 -1
  37. package/index15.js +2 -2
  38. package/index16.js +2 -2
  39. package/index17.js +1 -1
  40. package/index18.js +1 -1
  41. package/index19.js +2 -2
  42. package/index2.js +1 -1
  43. package/index20.js +2 -2
  44. package/index21.js +1 -1
  45. package/index22.js +1 -1
  46. package/index23.js +1 -1
  47. package/index24.js +1 -1
  48. package/index25.js +2 -2
  49. package/index26.js +2 -2
  50. package/index27.js +2 -2
  51. package/index28.js +1 -1
  52. package/index29.js +2 -8
  53. package/index3.js +1 -1
  54. package/index30.js +17 -16
  55. package/index31.js +1 -1
  56. package/index32.js +1 -1
  57. package/index33.js +1 -1
  58. package/index34.js +2 -2
  59. package/index36.js +1 -1
  60. package/index37.js +1 -1
  61. package/index38.js +1 -1
  62. package/index39.js +1 -1
  63. package/index4.js +1 -1
  64. package/index40.js +19 -12
  65. package/index41.js +61 -14
  66. package/index42.js +44 -22
  67. package/index43.js +13 -11
  68. package/index44.js +25 -4
  69. package/index45.js +16 -51
  70. package/index46.js +19 -16
  71. package/index47.js +49 -27
  72. package/index48.js +5 -18
  73. package/index49.js +25 -21
  74. package/index5.js +1 -1
  75. package/index50.js +16 -47
  76. package/index51.js +7 -3
  77. package/index52.js +18 -18
  78. package/index53.js +16 -16
  79. package/index54.js +5 -3
  80. package/index55.js +7 -20
  81. package/index56.js +13 -16
  82. package/index57.js +6 -8
  83. package/index58.js +5 -8
  84. package/index59.js +17 -13
  85. package/index6.js +1 -1
  86. package/index60.js +20 -7
  87. package/index61.js +59 -7
  88. package/index62.js +13 -17
  89. package/index63.js +9 -20
  90. package/index64.js +38 -46
  91. package/index65.js +85 -15
  92. package/index66.js +74 -11
  93. package/index67.js +23 -62
  94. package/index68.js +64 -80
  95. package/index69.js +68 -62
  96. package/index7.js +1 -1
  97. package/index70.js +138 -22
  98. package/index71.js +66 -65
  99. package/index72.js +40 -78
  100. package/index73.js +75 -133
  101. package/index74.js +69 -68
  102. package/index75.js +96 -34
  103. package/index76.js +258 -65
  104. package/index77.js +715 -63
  105. package/index78.js +478 -93
  106. package/index79.js +303 -263
  107. package/index8.js +1 -1
  108. package/index80.js +343 -677
  109. package/index81.js +242 -479
  110. package/index82.js +1332 -282
  111. package/index83.js +966 -346
  112. package/index84.js +344 -210
  113. package/index85.js +2024 -1286
  114. package/index86.js +2314 -955
  115. package/index87.js +6785 -340
  116. package/index88.js +15 -2099
  117. package/index89.js +12 -2367
  118. package/index9.js +1 -1
  119. package/index90.js +4 -6834
  120. package/index91.js +7 -15
  121. package/package.json +1 -1
  122. package/useControlledState-Kv9K2AYu.js +30 -0
  123. package/{useDescription-BPs7eRff.js → useDescription-B7stiK3j.js} +1 -1
  124. package/useEvent-Xk5kn5Ns.js +21 -0
  125. package/{useField-Dz62UHCP.js → useField-DMzJIIN4.js} +5 -5
  126. package/{useFilter-ViwzkzZe.js → useFilter-Bt9dbV1U.js} +1 -1
  127. package/{useFocusRing-BKGhL91C.js → useFocusRing-9PXyKy2A.js} +26 -26
  128. package/{useFocusable-CRSmYEQc.js → useFocusable-CcEBZe40.js} +1 -1
  129. package/{useGridSelectionCheckbox-CVEvUCJL.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
  130. package/{useHasTabbableChild-C8y4fwiY.js → useHasTabbableChild-D6DwR81L.js} +5 -5
  131. package/{useHighlightSelectionDescription-CD74uzLh.js → useHighlightSelectionDescription-WYAbP4No.js} +4 -4
  132. package/useLabels-9zaZ9oa0.js +17 -0
  133. package/{useListState-DKnP5TB5.js → useListState-BfTeKTk5.js} +1 -1
  134. package/{useLocalizedStringFormatter-DsZ-ZWSk.js → useLocalizedStringFormatter-BlCbn-hX.js} +1 -1
  135. package/{useSingleSelectListState-BHTLh8Ob.js → useSingleSelectListState-DPkaL0la.js} +2 -2
  136. package/Text-CQPW6xs7.js +0 -15
  137. package/accordion/AccordionContent.d.ts +0 -3
  138. package/accordion/AccordionTagContext.d.ts +0 -3
  139. package/accordion/AccordionTrigger.d.ts +0 -3
  140. package/index-DK9ZACEc.js +0 -642
  141. package/index.css +0 -1
  142. package/index92.js +0 -14
  143. package/index93.js +0 -6
  144. package/index94.js +0 -9
  145. package/useControlledState-DrAoodI6.js +0 -45
package/index83.js CHANGED
@@ -1,389 +1,1009 @@
1
- import { jsxs as H, jsx as F } from "react/jsx-runtime";
2
- import * as w from "react";
3
- import f, { useMemo as S, useRef as B, useEffect as O, forwardRef as M, useContext as p, createContext as T } from "react";
4
- import { $ as z, a as _, b as N, f as W, c as q, d as j } from "./Collection-COLWgm24.js";
5
- import { n as g, p as U, e as m, l as G, a as J, c as E, d as K, A as R, x as Q, i as C, b as X } from "./useFocusRing-BKGhL91C.js";
6
- import { $ as Y } from "./Hidden-DngIphiL.js";
7
- import { $ as Z } from "./useSingleSelectListState-BHTLh8Ob.js";
8
- import { a as A } from "./useControlledState-DrAoodI6.js";
9
- import { $ as ee } from "./context-Bnqknrce.js";
10
- import { d as te, e as ie } from "./SelectionManager-8o40f7mx.js";
11
- import { $ as ae } from "./useHasTabbableChild-C8y4fwiY.js";
12
- import './Tabs.css';const V = /* @__PURE__ */ new WeakMap();
13
- function P(t, e, i) {
14
- return t ? (typeof e == "string" && (e = e.replace(/\s+/g, "")), `${V.get(t)}-${i}-${e}`) : "";
1
+ import { jsx as h, jsxs as E, Fragment as he } from "react/jsx-runtime";
2
+ import { Button as $e } from "./index66.js";
3
+ import { c as pe } from "./clsx-OuTLNxxd.js";
4
+ import y, { useEffect as v, useState as ve, useCallback as T, useRef as x, useMemo as xe } from "react";
5
+ import { k as ke, C as Ee, l as A, b as Te, N as k, f as ge, x as L, e as ye } from "./useFocusRing-9PXyKy2A.js";
6
+ import { $ as w } from "./useLocalizedStringFormatter-BlCbn-hX.js";
7
+ import { s as I } from "./index-B-jHjTDC.js";
8
+ import { createPortal as _e } from "react-dom";
9
+ import { X as Le } from "./x-JK7i-TQC.js";
10
+ import { C as Be, I as Ae, a as we, T as Ie } from "./triangle-alert-1OYl9KWz.js";
11
+ import './Toast.css';var C = {};
12
+ C = {
13
+ close: "إغلاق",
14
+ notifications: (n, e) => `${e.plural(n.count, {
15
+ one: () => `${e.number(n.count)} إشعار`,
16
+ other: () => `${e.number(n.count)} إشعارات`
17
+ })}.`
18
+ };
19
+ var P = {};
20
+ P = {
21
+ close: "Затвори",
22
+ notifications: (n, e) => `${e.plural(n.count, {
23
+ one: () => `${e.number(n.count)} известие`,
24
+ other: () => `${e.number(n.count)} известия`
25
+ })}.`
26
+ };
27
+ var F = {};
28
+ F = {
29
+ close: "Zavřít",
30
+ notifications: (n, e) => `${e.plural(n.count, {
31
+ one: () => `${e.number(n.count)} oznámení`,
32
+ other: () => `${e.number(n.count)} oznámení`
33
+ })}.`
34
+ };
35
+ var R = {};
36
+ R = {
37
+ close: "Luk",
38
+ notifications: (n, e) => `${e.plural(n.count, {
39
+ one: () => `${e.number(n.count)} besked`,
40
+ other: () => `${e.number(n.count)} beskeder`
41
+ })}.`
42
+ };
43
+ var N = {};
44
+ N = {
45
+ close: "Schließen",
46
+ notifications: (n, e) => `${e.plural(n.count, {
47
+ one: () => `${e.number(n.count)} Benachrichtigung`,
48
+ other: () => `${e.number(n.count)} Benachrichtigungen`
49
+ })}.`
50
+ };
51
+ var S = {};
52
+ S = {
53
+ close: "Κλείσιμο",
54
+ notifications: (n, e) => `${e.plural(n.count, {
55
+ one: () => `${e.number(n.count)} ειδοποίηση`,
56
+ other: () => `${e.number(n.count)} ειδοποιήσεις`
57
+ })}.`
58
+ };
59
+ var D = {};
60
+ D = {
61
+ close: "Close",
62
+ notifications: (n, e) => `${e.plural(n.count, {
63
+ one: () => `${e.number(n.count)} notification`,
64
+ other: () => `${e.number(n.count)} notifications`
65
+ })}.`
66
+ };
67
+ var M = {};
68
+ M = {
69
+ close: "Cerrar",
70
+ notifications: (n, e) => `${e.plural(n.count, {
71
+ one: () => `${e.number(n.count)} notificación`,
72
+ other: () => `${e.number(n.count)} notificaciones`
73
+ })}.`
74
+ };
75
+ var H = {};
76
+ H = {
77
+ close: "Sule",
78
+ notifications: (n, e) => `${e.plural(n.count, {
79
+ one: () => `${e.number(n.count)} teatis`,
80
+ other: () => `${e.number(n.count)} teatist`
81
+ })}.`
82
+ };
83
+ var O = {};
84
+ O = {
85
+ close: "Sulje",
86
+ notifications: (n, e) => `${e.plural(n.count, {
87
+ one: () => `${e.number(n.count)} ilmoitus`,
88
+ other: () => `${e.number(n.count)} ilmoitusta`
89
+ })}.`
90
+ };
91
+ var V = {};
92
+ V = {
93
+ close: "Fermer",
94
+ notifications: (n, e) => `${e.plural(n.count, {
95
+ one: () => `${e.number(n.count)} notification`,
96
+ other: () => `${e.number(n.count)} notifications`
97
+ })}.`
98
+ };
99
+ var z = {};
100
+ z = {
101
+ close: "סגור",
102
+ notifications: (n, e) => `${e.plural(n.count, {
103
+ one: () => `${e.number(n.count)} התראה`,
104
+ other: () => `${e.number(n.count)} התראות`
105
+ })}.`
106
+ };
107
+ var j = {};
108
+ j = {
109
+ close: "Zatvori",
110
+ notifications: (n, e) => `${e.plural(n.count, {
111
+ one: () => `${e.number(n.count)} obavijest`,
112
+ other: () => `${e.number(n.count)} obavijesti`
113
+ })}.`
114
+ };
115
+ var G = {};
116
+ G = {
117
+ close: "Bezárás",
118
+ notifications: (n, e) => `${e.plural(n.count, {
119
+ one: () => `${e.number(n.count)} értesítés`,
120
+ other: () => `${e.number(n.count)} értesítés`
121
+ })}.`
122
+ };
123
+ var K = {};
124
+ K = {
125
+ close: "Chiudi",
126
+ notifications: (n, e) => `${e.plural(n.count, {
127
+ one: () => `${e.number(n.count)} notifica`,
128
+ other: () => `${e.number(n.count)} notifiche`
129
+ })}.`
130
+ };
131
+ var U = {};
132
+ U = {
133
+ close: "閉じる",
134
+ notifications: (n, e) => `${e.plural(n.count, {
135
+ one: () => `${e.number(n.count)} 個の通知`,
136
+ other: () => `${e.number(n.count)} 個の通知`
137
+ })}。`
138
+ };
139
+ var W = {};
140
+ W = {
141
+ close: "닫기",
142
+ notifications: (n, e) => `${e.plural(n.count, {
143
+ one: () => `${e.number(n.count)}개 알림`,
144
+ other: () => `${e.number(n.count)}개 알림`
145
+ })}.`
146
+ };
147
+ var Z = {};
148
+ Z = {
149
+ close: "Uždaryti",
150
+ notifications: (n, e) => `${e.plural(n.count, {
151
+ one: () => `${e.number(n.count)} pranešimas`,
152
+ other: () => `${e.number(n.count)} pranešimai`
153
+ })}.`
154
+ };
155
+ var q = {};
156
+ q = {
157
+ close: "Aizvērt",
158
+ notifications: (n, e) => `${e.plural(n.count, {
159
+ one: () => `${e.number(n.count)} paziņojums`,
160
+ other: () => `${e.number(n.count)} paziņojumi`
161
+ })}.`
162
+ };
163
+ var Y = {};
164
+ Y = {
165
+ close: "Lukk",
166
+ notifications: (n, e) => `${e.plural(n.count, {
167
+ one: () => `${e.number(n.count)} varsling`,
168
+ other: () => `${e.number(n.count)} varsler`
169
+ })}.`
170
+ };
171
+ var J = {};
172
+ J = {
173
+ close: "Sluiten",
174
+ notifications: (n, e) => `${e.plural(n.count, {
175
+ one: () => `${e.number(n.count)} melding`,
176
+ other: () => `${e.number(n.count)} meldingen`
177
+ })}.`
178
+ };
179
+ var Q = {};
180
+ Q = {
181
+ close: "Zamknij",
182
+ notifications: (n, e) => `${e.plural(n.count, {
183
+ one: () => `${e.number(n.count)} powiadomienie`,
184
+ few: () => `${e.number(n.count)} powiadomienia`,
185
+ many: () => `${e.number(n.count)} powiadomień`,
186
+ other: () => `${e.number(n.count)} powiadomienia`
187
+ })}.`
188
+ };
189
+ var X = {};
190
+ X = {
191
+ close: "Fechar",
192
+ notifications: (n, e) => `${e.plural(n.count, {
193
+ one: () => `${e.number(n.count)} notificação`,
194
+ other: () => `${e.number(n.count)} notificações`
195
+ })}.`
196
+ };
197
+ var ee = {};
198
+ ee = {
199
+ close: "Fechar",
200
+ notifications: (n, e) => `${e.plural(n.count, {
201
+ one: () => `${e.number(n.count)} notificação`,
202
+ other: () => `${e.number(n.count)} notificações`
203
+ })}.`
204
+ };
205
+ var ne = {};
206
+ ne = {
207
+ close: "Închideţi",
208
+ notifications: (n, e) => `${e.plural(n.count, {
209
+ one: () => `${e.number(n.count)} notificare`,
210
+ other: () => `${e.number(n.count)} notificări`
211
+ })}.`
212
+ };
213
+ var te = {};
214
+ te = {
215
+ close: "Закрыть",
216
+ notifications: (n, e) => `${e.plural(n.count, {
217
+ one: () => `${e.number(n.count)} уведомление`,
218
+ other: () => `${e.number(n.count)} уведомления`
219
+ })}.`
220
+ };
221
+ var ie = {};
222
+ ie = {
223
+ close: "Zatvoriť",
224
+ notifications: (n, e) => `${e.plural(n.count, {
225
+ one: () => `${e.number(n.count)} oznámenie`,
226
+ few: () => `${e.number(n.count)} oznámenia`,
227
+ other: () => `${e.number(n.count)} oznámení`
228
+ })}.`
229
+ };
230
+ var oe = {};
231
+ oe = {
232
+ close: "Zapri",
233
+ notifications: (n, e) => `${e.plural(n.count, {
234
+ one: () => `${e.number(n.count)} obvestilo`,
235
+ two: () => `${e.number(n.count)} obvestili`,
236
+ few: () => `${e.number(n.count)} obvestila`,
237
+ other: () => `${e.number(n.count)} obvestil`
238
+ })}.`
239
+ };
240
+ var ue = {};
241
+ ue = {
242
+ close: "Zatvori",
243
+ notifications: (n, e) => `${e.plural(n.count, {
244
+ one: () => `${e.number(n.count)} obaveštenje`,
245
+ other: () => `${e.number(n.count)} obaveštenja`
246
+ })}.`
247
+ };
248
+ var ae = {};
249
+ ae = {
250
+ close: "Stäng",
251
+ notifications: (n, e) => `${e.plural(n.count, {
252
+ one: () => `${e.number(n.count)} meddelande`,
253
+ other: () => `${e.number(n.count)} meddelanden`
254
+ })}.`
255
+ };
256
+ var se = {};
257
+ se = {
258
+ close: "Kapat",
259
+ notifications: (n, e) => `${e.plural(n.count, {
260
+ one: () => `${e.number(n.count)} bildirim`,
261
+ other: () => `${e.number(n.count)} bildirim`
262
+ })}.`
263
+ };
264
+ var re = {};
265
+ re = {
266
+ close: "Закрити",
267
+ notifications: (n, e) => `${e.plural(n.count, {
268
+ one: () => `${e.number(n.count)} сповіщення`,
269
+ other: () => `${e.number(n.count)} сповіщення`
270
+ })}.`
271
+ };
272
+ var le = {};
273
+ le = {
274
+ close: "关闭",
275
+ notifications: (n, e) => `${e.plural(n.count, {
276
+ one: () => `${e.number(n.count)} 个通知`,
277
+ other: () => `${e.number(n.count)} 个通知`
278
+ })}。`
279
+ };
280
+ var ce = {};
281
+ ce = {
282
+ close: "關閉",
283
+ notifications: (n, e) => `${e.plural(n.count, {
284
+ one: () => `${e.number(n.count)} 個通知`,
285
+ other: () => `${e.number(n.count)} 個通知`
286
+ })}。`
287
+ };
288
+ var _ = {};
289
+ _ = {
290
+ "ar-AE": C,
291
+ "bg-BG": P,
292
+ "cs-CZ": F,
293
+ "da-DK": R,
294
+ "de-DE": N,
295
+ "el-GR": S,
296
+ "en-US": D,
297
+ "es-ES": M,
298
+ "et-EE": H,
299
+ "fi-FI": O,
300
+ "fr-FR": V,
301
+ "he-IL": z,
302
+ "hr-HR": j,
303
+ "hu-HU": G,
304
+ "it-IT": K,
305
+ "ja-JP": U,
306
+ "ko-KR": W,
307
+ "lt-LT": Z,
308
+ "lv-LV": q,
309
+ "nb-NO": Y,
310
+ "nl-NL": J,
311
+ "pl-PL": Q,
312
+ "pt-BR": X,
313
+ "pt-PT": ee,
314
+ "ro-RO": ne,
315
+ "ru-RU": te,
316
+ "sk-SK": ie,
317
+ "sl-SI": oe,
318
+ "sr-SP": ue,
319
+ "sv-SE": ae,
320
+ "tr-TR": se,
321
+ "uk-UA": re,
322
+ "zh-CN": le,
323
+ "zh-TW": ce
324
+ };
325
+ function Ce(n) {
326
+ return n && n.__esModule ? n.default : n;
15
327
  }
16
- function ne(t, e, i) {
17
- let { key: a, isDisabled: n, shouldSelectOnPressUp: l } = t, { selectionManager: s, selectedKey: r } = e, d = a === r, o = n || e.isDisabled || e.selectionManager.isDisabled(a), { itemProps: c, isPressed: u } = te({
18
- selectionManager: s,
19
- key: a,
20
- ref: i,
21
- isDisabled: o,
22
- shouldSelectOnPressUp: l,
23
- linkBehavior: "selection"
24
- }), $ = P(e, a, "tab"), y = P(e, a, "tabpanel"), { tabIndex: D } = c, b = e.collection.getItem(a), L = g(b == null ? void 0 : b.props, {
25
- labelable: !0
26
- });
27
- delete L.id;
28
- let k = U(b == null ? void 0 : b.props);
328
+ function Pe(n, e, t) {
329
+ let { key: i, timer: o, timeout: u, animation: a } = n.toast;
330
+ v(() => {
331
+ if (!(o == null || u == null))
332
+ return o.reset(u), () => {
333
+ o.pause();
334
+ };
335
+ }, [
336
+ o,
337
+ u
338
+ ]);
339
+ let [s, l] = y.useState(!1);
340
+ v(() => {
341
+ (a === "entering" || a === "queued") && l(!0);
342
+ }, [
343
+ a
344
+ ]);
345
+ let r = ke(), $ = Ee(), d = w(Ce(_), "@react-aria/toast");
29
346
  return {
30
- tabProps: m(L, k, c, {
31
- id: $,
32
- "aria-selected": d,
33
- "aria-disabled": o || void 0,
34
- "aria-controls": d ? y : void 0,
35
- tabIndex: o ? void 0 : D,
36
- role: "tab"
37
- }),
38
- isSelected: d,
39
- isDisabled: o,
40
- isPressed: u
347
+ toastProps: {
348
+ role: "alertdialog",
349
+ "aria-modal": "false",
350
+ "aria-label": n["aria-label"],
351
+ "aria-labelledby": n["aria-labelledby"] || r,
352
+ "aria-describedby": n["aria-describedby"] || $,
353
+ "aria-details": n["aria-details"],
354
+ // Hide toasts that are animating out so VoiceOver doesn't announce them.
355
+ "aria-hidden": a === "exiting" ? "true" : void 0,
356
+ tabIndex: 0
357
+ },
358
+ contentProps: {
359
+ role: "alert",
360
+ "aria-atomic": "true",
361
+ style: {
362
+ visibility: s || a === null ? "visible" : "hidden"
363
+ }
364
+ },
365
+ titleProps: {
366
+ id: r
367
+ },
368
+ descriptionProps: {
369
+ id: $
370
+ },
371
+ closeButtonProps: {
372
+ "aria-label": d.format("close"),
373
+ onPress: () => e.close(i)
374
+ }
41
375
  };
42
376
  }
43
- function se(t, e, i) {
44
- let a = ae(i) ? void 0 : 0;
45
- var n;
46
- const l = P(e, (n = t.id) !== null && n !== void 0 ? n : e == null ? void 0 : e.selectedKey, "tabpanel"), s = A({
47
- ...t,
48
- id: l,
49
- "aria-labelledby": P(e, e == null ? void 0 : e.selectedKey, "tab")
50
- });
51
- return {
52
- tabPanelProps: m(s, {
53
- tabIndex: a,
54
- role: "tabpanel",
55
- "aria-describedby": t["aria-describedby"],
56
- "aria-details": t["aria-details"]
57
- })
58
- };
377
+ const de = 1, g = Symbol.for("react-aria-landmark-manager");
378
+ function Fe(n) {
379
+ return document.addEventListener("react-aria-landmark-manager-change", n), () => document.removeEventListener("react-aria-landmark-manager-change", n);
380
+ }
381
+ function B() {
382
+ if (typeof document > "u") return null;
383
+ let n = document[g];
384
+ return n && n.version >= de ? n : (document[g] = new Ne(), document.dispatchEvent(new CustomEvent("react-aria-landmark-manager-change")), document[g]);
59
385
  }
60
- class de {
61
- getKeyLeftOf(e) {
62
- return this.flipDirection ? this.getNextKey(e) : this.getPreviousKey(e);
386
+ function Re() {
387
+ return I.useSyncExternalStore(Fe, B, B);
388
+ }
389
+ class Ne {
390
+ setupIfNeeded() {
391
+ this.isListening || (document.addEventListener("keydown", this.f6Handler, {
392
+ capture: !0
393
+ }), document.addEventListener("focusin", this.focusinHandler, {
394
+ capture: !0
395
+ }), document.addEventListener("focusout", this.focusoutHandler, {
396
+ capture: !0
397
+ }), this.isListening = !0);
398
+ }
399
+ teardownIfNeeded() {
400
+ !this.isListening || this.landmarks.length > 0 || this.refCount > 0 || (document.removeEventListener("keydown", this.f6Handler, {
401
+ capture: !0
402
+ }), document.removeEventListener("focusin", this.focusinHandler, {
403
+ capture: !0
404
+ }), document.removeEventListener("focusout", this.focusoutHandler, {
405
+ capture: !0
406
+ }), this.isListening = !1);
63
407
  }
64
- getKeyRightOf(e) {
65
- return this.flipDirection ? this.getPreviousKey(e) : this.getNextKey(e);
408
+ focusLandmark(e, t) {
409
+ var i, o;
410
+ (o = this.landmarks.find((u) => u.ref.current === e)) === null || o === void 0 || (i = o.focus) === null || i === void 0 || i.call(o, t);
411
+ }
412
+ /**
413
+ * Return set of landmarks with a specific role.
414
+ */
415
+ getLandmarksByRole(e) {
416
+ return new Set(this.landmarks.filter((t) => t.role === e));
417
+ }
418
+ /**
419
+ * Return first landmark with a specific role.
420
+ */
421
+ getLandmarkByRole(e) {
422
+ return this.landmarks.find((t) => t.role === e);
423
+ }
424
+ addLandmark(e) {
425
+ if (this.setupIfNeeded(), this.landmarks.find((o) => o.ref === e.ref) || !e.ref.current) return;
426
+ if (this.landmarks.filter((o) => o.role === "main").length > 1 && console.error('Page can contain no more than one landmark with the role "main".'), this.landmarks.length === 0) {
427
+ this.landmarks = [
428
+ e
429
+ ], this.checkLabels(e.role);
430
+ return;
431
+ }
432
+ let t = 0, i = this.landmarks.length - 1;
433
+ for (; t <= i; ) {
434
+ let o = Math.floor((t + i) / 2), u = e.ref.current.compareDocumentPosition(this.landmarks[o].ref.current);
435
+ !!(u & Node.DOCUMENT_POSITION_PRECEDING || u & Node.DOCUMENT_POSITION_CONTAINS) ? t = o + 1 : i = o - 1;
436
+ }
437
+ this.landmarks.splice(t, 0, e), this.checkLabels(e.role);
438
+ }
439
+ updateLandmark(e) {
440
+ let t = this.landmarks.findIndex((i) => i.ref === e.ref);
441
+ t >= 0 && (this.landmarks[t] = {
442
+ ...this.landmarks[t],
443
+ ...e
444
+ }, this.checkLabels(this.landmarks[t].role));
445
+ }
446
+ removeLandmark(e) {
447
+ this.landmarks = this.landmarks.filter((t) => t.ref !== e), this.teardownIfNeeded();
448
+ }
449
+ /**
450
+ * Warn if there are 2+ landmarks with the same role but no label.
451
+ * Labels for landmarks with the same role must also be unique.
452
+ *
453
+ * See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.
454
+ */
455
+ checkLabels(e) {
456
+ let t = this.getLandmarksByRole(e);
457
+ if (t.size > 1) {
458
+ let i = [
459
+ ...t
460
+ ].filter((o) => !o.label);
461
+ if (i.length > 0) console.warn(`Page contains more than one landmark with the '${e}' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute: `, i.map((o) => o.ref.current));
462
+ else {
463
+ let o = [
464
+ ...t
465
+ ].map((a) => a.label);
466
+ o.filter((a, s) => o.indexOf(a) !== s).forEach((a) => {
467
+ console.warn(`Page contains more than one landmark with the '${e}' role and '${a}' label. If two or more landmarks on a page share the same role, they must have unique labels: `, [
468
+ ...t
469
+ ].filter((s) => s.label === a).map((s) => s.ref.current));
470
+ });
471
+ }
472
+ }
473
+ }
474
+ /**
475
+ * Get the landmark that is the closest parent in the DOM.
476
+ * Returns undefined if no parent is a landmark.
477
+ */
478
+ closestLandmark(e) {
479
+ let t = new Map(this.landmarks.map((o) => [
480
+ o.ref.current,
481
+ o
482
+ ])), i = e;
483
+ for (; i && !t.has(i) && i !== document.body && i.parentElement; ) i = i.parentElement;
484
+ return t.get(i);
485
+ }
486
+ /**
487
+ * Gets the next landmark, in DOM focus order, or previous if backwards is specified.
488
+ * If last landmark, next should be the first landmark.
489
+ * If not inside a landmark, will return first landmark.
490
+ * Returns undefined if there are no landmarks.
491
+ */
492
+ getNextLandmark(e, { backward: t }) {
493
+ var i;
494
+ let o = this.closestLandmark(e), u = t ? this.landmarks.length - 1 : 0;
495
+ o && (u = this.landmarks.indexOf(o) + (t ? -1 : 1));
496
+ let a = () => {
497
+ if (u < 0) {
498
+ if (!e.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
499
+ detail: {
500
+ direction: "backward"
501
+ },
502
+ bubbles: !0,
503
+ cancelable: !0
504
+ }))) return !0;
505
+ u = this.landmarks.length - 1;
506
+ } else if (u >= this.landmarks.length) {
507
+ if (!e.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
508
+ detail: {
509
+ direction: "forward"
510
+ },
511
+ bubbles: !0,
512
+ cancelable: !0
513
+ }))) return !0;
514
+ u = 0;
515
+ }
516
+ return u < 0 || u >= this.landmarks.length;
517
+ };
518
+ if (a()) return;
519
+ let s = u;
520
+ for (; !((i = this.landmarks[u].ref.current) === null || i === void 0) && i.closest("[aria-hidden=true]"); ) {
521
+ if (u += t ? -1 : 1, a()) return;
522
+ if (u === s) break;
523
+ }
524
+ return this.landmarks[u];
66
525
  }
67
- isDisabled(e) {
68
- var i, a;
69
- return this.disabledKeys.has(e) || !!(!((a = this.collection.getItem(e)) === null || a === void 0 || (i = a.props) === null || i === void 0) && i.isDisabled);
526
+ /**
527
+ * Look at next landmark. If an element was previously focused inside, restore focus there.
528
+ * If not, focus the landmark itself.
529
+ * If no landmarks at all, or none with focusable elements, don't move focus.
530
+ */
531
+ f6Handler(e) {
532
+ e.key === "F6" && (e.altKey ? this.focusMain() : this.navigate(e.target, e.shiftKey)) && (e.preventDefault(), e.stopPropagation());
70
533
  }
71
- getFirstKey() {
72
- let e = this.collection.getFirstKey();
73
- return e != null && this.isDisabled(e) && (e = this.getNextKey(e)), e;
534
+ focusMain() {
535
+ let e = this.getLandmarkByRole("main");
536
+ return e && e.ref.current && document.contains(e.ref.current) ? (this.focusLandmark(e.ref.current, "forward"), !0) : !1;
74
537
  }
75
- getLastKey() {
76
- let e = this.collection.getLastKey();
77
- return e != null && this.isDisabled(e) && (e = this.getPreviousKey(e)), e;
538
+ navigate(e, t) {
539
+ let i = this.getNextLandmark(e, {
540
+ backward: t
541
+ });
542
+ if (!i) return !1;
543
+ if (i.lastFocused) {
544
+ let o = i.lastFocused;
545
+ if (document.body.contains(o))
546
+ return o.focus(), !0;
547
+ }
548
+ return i.ref.current && document.contains(i.ref.current) ? (this.focusLandmark(i.ref.current, t ? "backward" : "forward"), !0) : !1;
78
549
  }
79
- getKeyAbove(e) {
80
- return this.tabDirection ? null : this.getPreviousKey(e);
550
+ /**
551
+ * Sets lastFocused for a landmark, if focus is moved within that landmark.
552
+ * Lets the last focused landmark know it was blurred if something else is focused.
553
+ */
554
+ focusinHandler(e) {
555
+ let t = this.closestLandmark(e.target);
556
+ t && t.ref.current !== e.target && this.updateLandmark({
557
+ ref: t.ref,
558
+ lastFocused: e.target
559
+ });
560
+ let i = e.relatedTarget;
561
+ if (i) {
562
+ let o = this.closestLandmark(i);
563
+ o && o.ref.current === i && o.blur();
564
+ }
81
565
  }
82
- getKeyBelow(e) {
83
- return this.tabDirection ? null : this.getNextKey(e);
566
+ /**
567
+ * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had focus.
568
+ */
569
+ focusoutHandler(e) {
570
+ let t = e.target, i = e.relatedTarget;
571
+ if (!i || i === document) {
572
+ let o = this.closestLandmark(t);
573
+ o && o.ref.current === t && o.blur();
574
+ }
84
575
  }
85
- getNextKey(e) {
86
- do
87
- e = this.collection.getKeyAfter(e), e == null && (e = this.collection.getFirstKey());
88
- while (this.isDisabled(e));
89
- return e;
576
+ createLandmarkController() {
577
+ let e = this;
578
+ return e.refCount++, e.setupIfNeeded(), {
579
+ navigate(t, i) {
580
+ let o = (i == null ? void 0 : i.from) || document.activeElement;
581
+ return e.navigate(o, t === "backward");
582
+ },
583
+ focusNext(t) {
584
+ let i = (t == null ? void 0 : t.from) || document.activeElement;
585
+ return e.navigate(i, !1);
586
+ },
587
+ focusPrevious(t) {
588
+ let i = (t == null ? void 0 : t.from) || document.activeElement;
589
+ return e.navigate(i, !0);
590
+ },
591
+ focusMain() {
592
+ return e.focusMain();
593
+ },
594
+ dispose() {
595
+ e && (e.refCount--, e.teardownIfNeeded(), e = null);
596
+ }
597
+ };
90
598
  }
91
- getPreviousKey(e) {
92
- do
93
- e = this.collection.getKeyBefore(e), e == null && (e = this.collection.getLastKey());
94
- while (this.isDisabled(e));
95
- return e;
599
+ registerLandmark(e) {
600
+ return this.landmarks.find((t) => t.ref === e.ref) ? this.updateLandmark(e) : this.addLandmark(e), () => this.removeLandmark(e.ref);
96
601
  }
97
- constructor(e, i, a, n = /* @__PURE__ */ new Set()) {
98
- this.collection = e, this.flipDirection = i === "rtl" && a === "horizontal", this.disabledKeys = n, this.tabDirection = a === "horizontal";
602
+ constructor() {
603
+ this.landmarks = [], this.isListening = !1, this.refCount = 0, this.version = de, this.f6Handler = this.f6Handler.bind(this), this.focusinHandler = this.focusinHandler.bind(this), this.focusoutHandler = this.focusoutHandler.bind(this);
99
604
  }
100
605
  }
101
- function le(t, e, i) {
102
- let { orientation: a = "horizontal", keyboardActivation: n = "automatic" } = t, { collection: l, selectionManager: s, disabledKeys: r } = e, { direction: d } = ee(), o = S(() => new de(l, d, a, r), [
103
- l,
104
- r,
606
+ function Se(n, e) {
607
+ const { role: t, "aria-label": i, "aria-labelledby": o, focus: u } = n;
608
+ let a = Re(), s = i || o, [l, r] = ve(!1), $ = T(() => {
609
+ r(!0);
610
+ }, [
611
+ r
612
+ ]), d = T(() => {
613
+ r(!1);
614
+ }, [
615
+ r
616
+ ]);
617
+ return A(() => {
618
+ if (a) return a.registerLandmark({
619
+ ref: e,
620
+ label: s,
621
+ role: t,
622
+ focus: u || $,
623
+ blur: d
624
+ });
625
+ }, [
105
626
  a,
627
+ s,
628
+ e,
629
+ t,
630
+ u,
631
+ $,
106
632
  d
107
- ]), { collectionProps: c } = ie({
108
- ref: i,
109
- selectionManager: s,
110
- keyboardDelegate: o,
111
- selectOnFocus: n === "automatic",
112
- disallowEmptySelection: !0,
113
- scrollRef: i,
114
- linkBehavior: "selection"
115
- }), u = G();
116
- V.set(e, u);
117
- let $ = A({
118
- ...t,
119
- id: u
120
- });
121
- return {
122
- tabListProps: {
123
- ...m(c, $),
124
- role: "tablist",
125
- "aria-orientation": a,
126
- tabIndex: void 0
633
+ ]), v(() => {
634
+ var b;
635
+ l && ((b = e.current) === null || b === void 0 || b.focus());
636
+ }, [
637
+ l,
638
+ e
639
+ ]), {
640
+ landmarkProps: {
641
+ role: t,
642
+ tabIndex: l ? -1 : void 0,
643
+ "aria-label": i,
644
+ "aria-labelledby": o
127
645
  }
128
646
  };
129
647
  }
130
- function re(t) {
131
- var e, i;
132
- let a = Z({
133
- ...t,
134
- suppressTextValueWarning: !0,
135
- defaultSelectedKey: (i = (e = t.defaultSelectedKey) !== null && e !== void 0 ? e : I(t.collection, t.disabledKeys ? new Set(t.disabledKeys) : /* @__PURE__ */ new Set())) !== null && i !== void 0 ? i : void 0
136
- }), { selectionManager: n, collection: l, selectedKey: s } = a, r = B(s);
137
- return O(() => {
138
- let d = s;
139
- (n.isEmpty || d == null || !l.getItem(d)) && (d = I(l, a.disabledKeys), d != null && n.setSelectedKeys([
140
- d
141
- ])), (d != null && n.focusedKey == null || !n.isFocused && d !== r.current) && n.setFocusedKey(d), r.current = d;
142
- }), {
143
- ...a,
144
- isDisabled: t.isDisabled || !1
145
- };
648
+ function De(n) {
649
+ return n && n.__esModule ? n.default : n;
146
650
  }
147
- function I(t, e) {
148
- let i = null;
149
- if (t) {
150
- var a, n, l, s;
151
- for (i = t.getFirstKey(); i != null && (e.has(i) || !((n = t.getItem(i)) === null || n === void 0 || (a = n.props) === null || a === void 0) && a.isDisabled) && i !== t.getLastKey(); ) i = t.getKeyAfter(i);
152
- i != null && (e.has(i) || !((s = t.getItem(i)) === null || s === void 0 || (l = s.props) === null || l === void 0) && l.isDisabled) && i === t.getLastKey() && (i = t.getFirstKey());
153
- }
154
- return i;
651
+ function Me(n, e, t) {
652
+ let i = w(De(_), "@react-aria/toast"), { landmarkProps: o } = Se({
653
+ role: "region",
654
+ "aria-label": n["aria-label"] || i.format("notifications", {
655
+ count: e.visibleToasts.length
656
+ })
657
+ }, t), { hoverProps: u } = Te({
658
+ onHoverStart: e.pauseAll,
659
+ onHoverEnd: e.resumeAll
660
+ }), a = x([]), s = x(e.visibleToasts), l = x(null);
661
+ A(() => {
662
+ if (l.current === -1 || e.visibleToasts.length === 0 || !t.current) {
663
+ a.current = [], s.current = e.visibleToasts;
664
+ return;
665
+ }
666
+ if (a.current = [
667
+ ...t.current.querySelectorAll('[role="alertdialog"]')
668
+ ], s.current.length === e.visibleToasts.length && e.visibleToasts.every((c, f) => c.key === s.current[f].key)) {
669
+ s.current = e.visibleToasts;
670
+ return;
671
+ }
672
+ let d = s.current.map((c, f) => ({
673
+ ...c,
674
+ i: f,
675
+ isRemoved: !e.visibleToasts.some((m) => c.key === m.key)
676
+ })), b = d.findIndex((c) => c.i === l.current);
677
+ if (b > -1) {
678
+ let c = 0, f, m;
679
+ for (; c <= b; )
680
+ d[c].isRemoved || (m = Math.max(0, c - 1)), c++;
681
+ for (; c < d.length; ) {
682
+ if (!d[c].isRemoved) {
683
+ f = c - 1;
684
+ break;
685
+ }
686
+ c++;
687
+ }
688
+ m === void 0 && f === void 0 && (m = 0), m >= 0 && m < a.current.length ? k(a.current[m]) : f >= 0 && f < a.current.length && k(a.current[f]);
689
+ }
690
+ s.current = e.visibleToasts;
691
+ }, [
692
+ e.visibleToasts,
693
+ t
694
+ ]);
695
+ let r = x(null), { focusWithinProps: $ } = ge({
696
+ onFocusWithin: (d) => {
697
+ e.pauseAll(), r.current = d.relatedTarget;
698
+ },
699
+ onBlurWithin: () => {
700
+ e.resumeAll(), r.current = null;
701
+ }
702
+ });
703
+ return v(() => {
704
+ e.visibleToasts.length === 0 && r.current && document.body.contains(r.current) && (L() === "pointer" ? k(r.current) : r.current.focus(), r.current = null);
705
+ }, [
706
+ t,
707
+ e.visibleToasts.length
708
+ ]), v(() => () => {
709
+ r.current && document.body.contains(r.current) && (L() === "pointer" ? k(r.current) : r.current.focus(), r.current = null);
710
+ }, [
711
+ t
712
+ ]), {
713
+ regionProps: ye(o, u, $, {
714
+ tabIndex: -1,
715
+ // Mark the toast region as a "top layer", so that it:
716
+ // - is not aria-hidden when opening an overlay
717
+ // - allows focus even outside a containing focus scope
718
+ // - doesn’t dismiss overlays when clicking on it, even though it is outside
719
+ // @ts-ignore
720
+ "data-react-aria-top-layer": !0,
721
+ // listen to focus events separate from focuswithin because that will only fire once
722
+ // and we need to follow all focus changes
723
+ onFocus: (d) => {
724
+ let b = d.target.closest('[role="alertdialog"]');
725
+ l.current = a.current.findIndex((c) => c === b);
726
+ },
727
+ onBlur: () => {
728
+ l.current = -1;
729
+ }
730
+ })
731
+ };
155
732
  }
156
- const v = /* @__PURE__ */ T(null), h = /* @__PURE__ */ T(null), oe = /* @__PURE__ */ M(function(e, i) {
157
- [e, i] = J(e, i, v);
158
- let { children: a, orientation: n = "horizontal" } = e;
159
- return a = S(() => typeof a == "function" ? a({
160
- orientation: n,
161
- defaultChildren: null
162
- }) : a, [
163
- a,
164
- n
165
- ]), /* @__PURE__ */ f.createElement(z, {
166
- content: a
167
- }, (l) => /* @__PURE__ */ f.createElement(ce, {
168
- props: e,
169
- collection: l,
170
- tabsRef: i
171
- }));
172
- });
173
- function ce({ props: t, tabsRef: e, collection: i }) {
174
- let { orientation: a = "horizontal" } = t, n = re({
175
- ...t,
176
- collection: i,
177
- children: void 0
178
- }), { focusProps: l, isFocused: s, isFocusVisible: r } = E({
179
- within: !0
180
- }), d = S(() => ({
181
- orientation: a,
182
- isFocusWithin: s,
183
- isFocusVisible: r
733
+ function He(n = {}) {
734
+ let { maxVisibleToasts: e = 1, hasExitAnimation: t = !1 } = n, i = xe(() => new be({
735
+ maxVisibleToasts: e,
736
+ hasExitAnimation: t
184
737
  }), [
185
- a,
186
- s,
187
- r
188
- ]), o = K({
189
- ...t,
190
- defaultClassName: "react-aria-Tabs",
191
- values: d
192
- });
193
- return /* @__PURE__ */ f.createElement("div", {
194
- ...g(t),
195
- ...l,
196
- ...o,
197
- ref: e,
198
- slot: t.slot || void 0,
199
- "data-focused": s || void 0,
200
- "data-orientation": a,
201
- "data-focus-visible": r || void 0,
202
- "data-disabled": n.isDisabled || void 0
203
- }, /* @__PURE__ */ f.createElement(R, {
204
- values: [
205
- [
206
- v,
207
- t
208
- ],
209
- [
210
- h,
211
- n
212
- ]
213
- ]
214
- }, o.children));
738
+ e,
739
+ t
740
+ ]);
741
+ return fe(i);
215
742
  }
216
- const fe = /* @__PURE__ */ M(function(e, i) {
217
- return p(h) ? /* @__PURE__ */ f.createElement(ue, {
218
- props: e,
219
- forwardedRef: i
220
- }) : /* @__PURE__ */ f.createElement(_, e);
221
- });
222
- function ue({ props: t, forwardedRef: e }) {
223
- let i = p(h), { CollectionRoot: a } = p(N), { orientation: n = "horizontal", keyboardActivation: l = "automatic" } = Q(v), s = C(e), { tabListProps: r } = le({
224
- ...t,
225
- orientation: n,
226
- keyboardActivation: l
227
- }, i, s), d = K({
228
- ...t,
229
- children: null,
230
- defaultClassName: "react-aria-TabList",
231
- values: {
232
- orientation: n,
233
- state: i
234
- }
235
- }), o = g(t);
236
- return delete o.id, /* @__PURE__ */ f.createElement("div", {
237
- ...o,
238
- ...r,
239
- ref: s,
240
- ...d,
241
- "data-orientation": n || void 0
242
- }, /* @__PURE__ */ f.createElement(a, {
243
- collection: i.collection,
244
- persistedKeys: W(i.selectionManager.focusedKey)
245
- }));
743
+ function fe(n) {
744
+ let e = T((o) => n.subscribe(o), [
745
+ n
746
+ ]), t = T(() => n.visibleToasts, [
747
+ n
748
+ ]);
749
+ return {
750
+ visibleToasts: I.useSyncExternalStore(e, t, t),
751
+ add: (o, u) => n.add(o, u),
752
+ close: (o) => n.close(o),
753
+ remove: (o) => n.remove(o),
754
+ pauseAll: () => n.pauseAll(),
755
+ resumeAll: () => n.resumeAll()
756
+ };
246
757
  }
247
- const be = /* @__PURE__ */ q("item", (t, e, i) => {
248
- let a = p(h), n = C(e), { tabProps: l, isSelected: s, isDisabled: r, isPressed: d } = ne({
249
- key: i.key,
250
- ...t
251
- }, a, n), { focusProps: o, isFocused: c, isFocusVisible: u } = E(), { hoverProps: $, isHovered: y } = X({
252
- isDisabled: r,
253
- onHoverStart: t.onHoverStart,
254
- onHoverEnd: t.onHoverEnd,
255
- onHoverChange: t.onHoverChange
256
- }), D = K({
257
- ...t,
258
- id: void 0,
259
- defaultClassName: "react-aria-Tab",
260
- values: {
261
- isSelected: s,
262
- isDisabled: r,
263
- isFocused: c,
264
- isFocusVisible: u,
265
- isPressed: d,
266
- isHovered: y
758
+ class be {
759
+ /** Subscribes to updates to the visible toasts. */
760
+ subscribe(e) {
761
+ return this.subscriptions.add(e), () => this.subscriptions.delete(e);
762
+ }
763
+ /** Adds a new toast to the queue. */
764
+ add(e, t = {}) {
765
+ let i = Math.random().toString(36), o = {
766
+ ...t,
767
+ content: e,
768
+ key: i,
769
+ timer: t.timeout ? new Oe(() => this.close(i), t.timeout) : void 0
770
+ }, u = 0, a = this.queue.length;
771
+ for (; u < a; ) {
772
+ let l = Math.floor((u + a) / 2);
773
+ (o.priority || 0) > (this.queue[l].priority || 0) ? a = l : u = l + 1;
267
774
  }
268
- }), b = i.props.href ? "a" : "div";
269
- return /* @__PURE__ */ f.createElement(b, {
270
- ...m(l, o, $, D),
271
- ref: n,
272
- "data-selected": s || void 0,
273
- "data-disabled": r || void 0,
274
- "data-focused": c || void 0,
275
- "data-focus-visible": u || void 0,
276
- "data-pressed": d || void 0,
277
- "data-hovered": y || void 0
278
- });
279
- }), $e = /* @__PURE__ */ Y(function(e, i) {
280
- const a = p(h);
281
- let n = C(i), { tabPanelProps: l } = se(e, a, n), { focusProps: s, isFocused: r, isFocusVisible: d } = E(), o = a.selectedKey === e.id, c = K({
282
- ...e,
283
- defaultClassName: "react-aria-TabPanel",
284
- values: {
285
- isFocused: r,
286
- isFocusVisible: d,
287
- isInert: !o,
288
- state: a
775
+ this.queue.splice(u, 0, o), o.animation = u < this.maxVisibleToasts ? "entering" : "queued";
776
+ let s = this.maxVisibleToasts;
777
+ for (; s < this.queue.length; ) this.queue[s++].animation = "queued";
778
+ return this.updateVisibleToasts({
779
+ action: "add"
780
+ }), i;
781
+ }
782
+ /**
783
+ * Closes a toast. If `hasExitAnimation` is true, the toast
784
+ * transitions to an "exiting" state instead of being removed immediately.
785
+ */
786
+ close(e) {
787
+ let t = this.queue.findIndex((u) => u.key === e);
788
+ if (t >= 0) {
789
+ var i, o;
790
+ (i = (o = this.queue[t]).onClose) === null || i === void 0 || i.call(o), this.queue.splice(t, 1);
289
791
  }
792
+ this.updateVisibleToasts({
793
+ action: "close",
794
+ key: e
795
+ });
796
+ }
797
+ /** Removes a toast from the visible toasts after an exiting animation. */
798
+ remove(e) {
799
+ this.updateVisibleToasts({
800
+ action: "remove",
801
+ key: e
802
+ });
803
+ }
804
+ updateVisibleToasts(e) {
805
+ let { action: t, key: i } = e, o = this.queue.slice(0, this.maxVisibleToasts);
806
+ if (t === "add" && this.hasExitAnimation) {
807
+ let u = this.visibleToasts.filter((a) => !o.some((s) => a.key === s.key)).map((a) => ({
808
+ ...a,
809
+ animation: "exiting"
810
+ }));
811
+ this.visibleToasts = u.concat(o).sort((a, s) => {
812
+ var l, r;
813
+ return ((l = s.priority) !== null && l !== void 0 ? l : 0) - ((r = a.priority) !== null && r !== void 0 ? r : 0);
814
+ });
815
+ } else t === "close" && this.hasExitAnimation ? this.visibleToasts = this.visibleToasts.map((u) => u.key !== i ? u : {
816
+ ...u,
817
+ animation: "exiting"
818
+ }) : this.visibleToasts = o;
819
+ for (let u of this.subscriptions) u();
820
+ }
821
+ /** Pauses the timers for all visible toasts. */
822
+ pauseAll() {
823
+ for (let e of this.visibleToasts) e.timer && e.timer.pause();
824
+ }
825
+ /** Resumes the timers for all visible toasts. */
826
+ resumeAll() {
827
+ for (let e of this.visibleToasts) e.timer && e.timer.resume();
828
+ }
829
+ constructor(e) {
830
+ this.queue = [], this.subscriptions = /* @__PURE__ */ new Set(), this.visibleToasts = [];
831
+ var t;
832
+ this.maxVisibleToasts = (t = e == null ? void 0 : e.maxVisibleToasts) !== null && t !== void 0 ? t : 1;
833
+ var i;
834
+ this.hasExitAnimation = (i = e == null ? void 0 : e.hasExitAnimation) !== null && i !== void 0 ? i : !1;
835
+ }
836
+ }
837
+ class Oe {
838
+ reset(e) {
839
+ this.remaining = e, this.resume();
840
+ }
841
+ pause() {
842
+ this.timerId != null && (clearTimeout(this.timerId), this.timerId = null, this.remaining -= Date.now() - this.startTime);
843
+ }
844
+ resume() {
845
+ this.remaining <= 0 || (this.startTime = Date.now(), this.timerId = setTimeout(() => {
846
+ this.timerId = null, this.remaining = 0, this.callback();
847
+ }, this.remaining));
848
+ }
849
+ constructor(e, t) {
850
+ this.startTime = null, this.remaining = t, this.callback = e;
851
+ }
852
+ }
853
+ const Ve = '"../theme/tokens.css"', ze = '"Inter", sans-serif', je = "#d5f2d9", Ge = "#008d3c", Ke = "#eaf2f6", Ue = "#0066cc", We = "#fff8e1", Ze = "#f1c21b", qe = "#ffdfdf", Ye = "#e62323", Je = "#1f1f1f", Qe = "0 0 0 2px #ffffff, 0 0 0 4px #000000", Xe = "(min-width: 768px)", en = "_toastRegion_i4o11_52", nn = "_toast_i4o11_52", tn = "_success_i4o11_96", on = "_info_i4o11_104", un = "_important_i4o11_112", an = "_warning_i4o11_120", sn = "_icon_i4o11_128", rn = "_toastContent_i4o11_138", ln = "_toastMessage_i4o11_145", cn = "_slideInTop_i4o11_1", dn = "_slideInEnd_i4o11_1", fn = "_slideOutTop_i4o11_1", bn = "_slideOutEnd_i4o11_1", p = {
854
+ tokens: Ve,
855
+ display: ze,
856
+ signalGreen10: je,
857
+ signalGreen100: Ge,
858
+ signalBlue10: Ke,
859
+ signalBlue100: Ue,
860
+ signalYellow10: We,
861
+ signalYellow100: Ze,
862
+ signalRed10: qe,
863
+ signalRed100: Ye,
864
+ gray150: Je,
865
+ focus: Qe,
866
+ mdBreakpoint: Xe,
867
+ toastRegion: en,
868
+ toast: nn,
869
+ success: tn,
870
+ info: on,
871
+ important: un,
872
+ warning: an,
873
+ icon: sn,
874
+ toastContent: rn,
875
+ toastMessage: ln,
876
+ slideInTop: cn,
877
+ slideInEnd: dn,
878
+ slideOutTop: fn,
879
+ slideOutEnd: bn
880
+ }, mn = {
881
+ success: Be,
882
+ info: Ae,
883
+ important: we,
884
+ warning: Ie
885
+ }, hn = new be({
886
+ maxVisibleToasts: 5,
887
+ hasExitAnimation: !0
888
+ }), Bn = (n) => {
889
+ const e = fe(hn);
890
+ return e.visibleToasts.length > 0 ? _e(
891
+ /* @__PURE__ */ h(
892
+ me,
893
+ {
894
+ ...n,
895
+ state: e
896
+ }
897
+ ),
898
+ document.body
899
+ ) : null;
900
+ }, An = ({ children: n, ...e }) => {
901
+ const t = He({
902
+ maxVisibleToasts: 5,
903
+ hasExitAnimation: !0
290
904
  });
291
- if (!o && !e.shouldForceMount) return null;
292
- let u = g(e);
293
- delete u.id;
294
- let $ = o ? m(u, l, s, c) : c;
295
- return /* @__PURE__ */ f.createElement("div", {
296
- ...$,
297
- ref: n,
298
- "data-focused": r || void 0,
299
- "data-focus-visible": d || void 0,
300
- // @ts-ignore
301
- inert: o ? void 0 : "true",
302
- "data-inert": o ? void 0 : "true"
303
- }, /* @__PURE__ */ f.createElement(R, {
304
- values: [
305
- [
306
- v,
307
- null
308
- ],
309
- [
310
- h,
311
- null
312
- ]
313
- ]
314
- }, /* @__PURE__ */ f.createElement(N.Provider, {
315
- value: j
316
- }, c.children)));
317
- }), he = '"../theme/tokens.css"', pe = '"Inter", sans-serif', me = "#bfbfbf", ye = "600", xe = "#25607f", Pe = "0 0 0 2px #ffffff, 0 0 0 4px #000000", ge = "(max-width: 767px)", Ke = "_container_a0kqi_4", ve = "_list_a0kqi_8", De = "_listItem_a0kqi_14", Fe = "_panel_a0kqi_42", x = {
318
- tokens: he,
319
- display: pe,
320
- gray50: me,
321
- semiBoldWeight: ye,
322
- blue130: xe,
323
- focus: Pe,
324
- smBreakpoint: ge,
325
- container: Ke,
326
- list: ve,
327
- listItem: De,
328
- panel: Fe
329
- }, Ae = ({
330
- tabs: t,
331
- label: e,
332
- defaultSelected: i,
333
- children: a
334
- }) => {
335
- const n = w.Children.toArray(a);
336
- if (n.length !== t.length)
337
- throw new Error(
338
- `The number of children must match the number of tabs. Children: ${n.length} Tabs: ${t.length}`
339
- );
340
- const l = n.reduce(
341
- (s, r, d) => {
342
- var o;
343
- if (w.isValidElement(r)) {
344
- const c = (o = t[d]) == null ? void 0 : o.toLowerCase();
345
- c && (s[c] = w.cloneElement(r, { id: c }));
905
+ return /* @__PURE__ */ E(he, { children: [
906
+ typeof n == "function" ? n(t) : n,
907
+ t.visibleToasts.length > 0 && /* @__PURE__ */ h(
908
+ me,
909
+ {
910
+ ...e,
911
+ state: t
346
912
  }
347
- return s;
348
- },
349
- {}
913
+ )
914
+ ] });
915
+ };
916
+ function me({
917
+ state: n,
918
+ ...e
919
+ }) {
920
+ const t = y.useRef(null), { regionProps: i } = Me(e, n, t);
921
+ return /* @__PURE__ */ h(
922
+ "div",
923
+ {
924
+ ...i,
925
+ ref: t,
926
+ className: p.toastRegion,
927
+ children: n.visibleToasts.map((o) => /* @__PURE__ */ h(
928
+ $n,
929
+ {
930
+ toast: o,
931
+ state: n
932
+ },
933
+ o.key
934
+ ))
935
+ }
350
936
  );
351
- return /* @__PURE__ */ H(
352
- oe,
937
+ }
938
+ function $n({
939
+ state: n,
940
+ ...e
941
+ }) {
942
+ const t = y.useRef(null), { toastProps: i, contentProps: o, titleProps: u, closeButtonProps: a } = Pe(
943
+ e,
944
+ n
945
+ ), s = mn[e.toast.content.type];
946
+ return /* @__PURE__ */ E(
947
+ "div",
353
948
  {
354
- orientation: "vertical",
355
- defaultSelectedKey: i && i.toLowerCase(),
356
- className: x.container,
949
+ ...i,
950
+ ref: t,
951
+ className: pe(p.toast, p[e.toast.content.type]),
952
+ "data-animation": e.toast.animation,
953
+ onAnimationEnd: () => {
954
+ e.toast.animation === "exiting" && n.remove(e.toast.key);
955
+ },
357
956
  children: [
358
- /* @__PURE__ */ F(
359
- fe,
957
+ /* @__PURE__ */ E(
958
+ "div",
360
959
  {
361
- "aria-label": e,
362
- className: x.list,
363
- children: t.map((s) => /* @__PURE__ */ F(
364
- be,
365
- {
366
- id: s.toLowerCase(),
367
- className: x.listItem,
368
- children: s
369
- },
370
- s
371
- ))
960
+ className: p.toastContent,
961
+ ...o,
962
+ children: [
963
+ /* @__PURE__ */ h(
964
+ s,
965
+ {
966
+ className: p.icon,
967
+ size: 20,
968
+ "aria-hidden": !0
969
+ }
970
+ ),
971
+ /* @__PURE__ */ E("div", { children: [
972
+ /* @__PURE__ */ h(
973
+ "p",
974
+ {
975
+ className: p.toastMessage,
976
+ ...u,
977
+ children: e.toast.content.message
978
+ }
979
+ ),
980
+ e.toast.content.children
981
+ ] })
982
+ ]
372
983
  }
373
984
  ),
374
- t.map((s) => /* @__PURE__ */ F(
985
+ /* @__PURE__ */ h(
375
986
  $e,
376
987
  {
377
- id: s.toLowerCase(),
378
- className: x.panel,
379
- children: l[s.toLowerCase()]
380
- },
381
- s
382
- ))
988
+ variant: "icon",
989
+ ...a,
990
+ children: /* @__PURE__ */ h(
991
+ Le,
992
+ {
993
+ size: 20,
994
+ "aria-hidden": !0
995
+ }
996
+ )
997
+ }
998
+ )
383
999
  ]
384
1000
  }
385
1001
  );
386
- };
1002
+ }
387
1003
  export {
388
- Ae as Tabs
1004
+ Bn as GlobalToastRegion,
1005
+ $n as Toast,
1006
+ An as ToastProvider,
1007
+ me as ToastRegion,
1008
+ hn as toastQueue
389
1009
  };