@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.
- package/Breadcrumbs.css +1 -0
- package/Button-CCevm2s3.js +183 -0
- package/Button.css +1 -0
- package/ButtonGroup.css +1 -0
- package/CHANGELOG.md +76 -0
- package/Card.css +1 -0
- package/Checkbox-CllWDBxF.js +405 -0
- package/Checkbox.css +1 -0
- package/Collection-B3xUVWPF.js +483 -0
- package/ComboBox.css +1 -0
- package/DatePicker.css +1 -0
- package/Dialog-CLTyYwkS.js +1889 -0
- package/DragAndDrop-OTN7La7U.js +42 -0
- package/Dropdown.css +1 -0
- package/FileUpload.css +1 -0
- package/Flex.css +1 -0
- package/Flex.module-CpoxBzQX.js +37 -0
- package/FocusScope-BR0SJ-cZ.js +512 -0
- package/Form-DXLoQL91.js +240 -0
- package/Grid.css +1 -0
- package/Grid.module-Ia0e9Dix.js +36 -0
- package/Group-DPMuN3h8.js +44 -0
- package/Hidden-BQWDvze4.js +37 -0
- package/InfoBanner.css +1 -0
- package/Label-C18A_4Z5.js +69 -0
- package/Layout.css +1 -0
- package/Link-BU1h3K2a.js +77 -0
- package/Link.css +1 -0
- package/LinkButton.css +1 -0
- package/ListBox-D21tdwTs.js +463 -0
- package/ListKeyboardDelegate-DxMjfMsI.js +172 -0
- package/Logo.css +1 -0
- package/Modal.css +1 -0
- package/MultiSelect.css +1 -0
- package/PressResponder-DP8ZDNGy.js +31 -0
- package/README.md +7 -0
- package/RSPContexts-EOiWkKOf.js +11 -0
- package/Radio.css +1 -0
- package/SearchField.css +1 -0
- package/Select.css +1 -0
- package/SelectionManager-D4WtKtey.js +988 -0
- package/Separator-DLUHK9vv.js +48 -0
- package/Spinner.css +1 -0
- package/Table.css +1 -0
- package/Tabs.css +1 -0
- package/Tag-CEd6WWSc.js +725 -0
- package/Tag.css +1 -0
- package/Text-DGLaY3HR.js +17 -0
- package/TextArea.css +1 -0
- package/TextField-C_hq9WeT.js +226 -0
- package/TextField.css +1 -0
- package/TextField.module-Cwq1FAm7.js +141 -0
- package/Toast.css +1 -0
- package/VisuallyHidden-B_XzVvlX.js +39 -0
- package/accordion/Accordion.d.ts +13 -0
- package/accordion/AccordionContent.d.ts +3 -0
- package/accordion/AccordionItem.d.ts +3 -0
- package/accordion/AccordionTagContext.d.ts +3 -0
- package/accordion/AccordionTrigger.d.ts +3 -0
- package/accordion/index.d.ts +5 -0
- package/breadcrumbs/Breadcrumbs.d.ts +9 -0
- package/breadcrumbs/index.d.ts +1 -0
- package/button/Button.d.ts +41 -0
- package/button/ButtonGroup.d.ts +12 -0
- package/button/index.d.ts +2 -0
- package/card/Card.d.ts +34 -0
- package/card/index.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -0
- package/checkbox/CheckboxGroup.d.ts +10 -0
- package/checkbox/index.d.ts +2 -0
- package/chevron-down-Cd1bkzXT.js +13 -0
- package/chevron-right-DBMc9VMi.js +23 -0
- package/clsx-OuTLNxxd.js +16 -0
- package/combobox/ComboBox.d.ts +12 -0
- package/combobox/index.d.ts +1 -0
- package/context-ScOIq_Gu.js +80 -0
- package/createLucideIcon-DeWljiyi.js +79 -0
- package/date-picker/DatePicker.d.ts +14 -0
- package/date-picker/index.d.ts +2 -0
- package/dropdown/Dropdown.d.ts +8 -0
- package/dropdown/index.d.ts +1 -0
- package/file-upload/FileUpload.d.ts +11 -0
- package/file-upload/index.d.ts +1 -0
- package/flex/Flex.d.ts +17 -0
- package/flex/FlexItem.d.ts +15 -0
- package/flex/index.d.ts +2 -0
- package/grid/Grid.d.ts +16 -0
- package/grid/GridItem.d.ts +7 -0
- package/grid/index.d.ts +2 -0
- package/index-CEg5vZQH.js +132 -0
- package/index-CgfokhRq.js +674 -0
- package/index-CorR1LBD.js +3122 -0
- package/index-Dl1Q-tbj.js +26984 -0
- package/index.css +1 -0
- package/index.d.ts +29 -0
- package/index.js +114 -0
- package/index10.js +4 -0
- package/index11.js +5 -0
- package/index12.js +4 -0
- package/index13.js +4 -0
- package/index14.js +4 -0
- package/index15.js +6 -0
- package/index16.js +6 -0
- package/index17.js +6 -0
- package/index18.js +4 -0
- package/index19.js +6 -0
- package/index2.js +8 -0
- package/index20.js +6 -0
- package/index21.js +4 -0
- package/index22.js +5 -0
- package/index23.js +5 -0
- package/index24.js +5 -0
- package/index25.js +6 -0
- package/index26.js +6 -0
- package/index27.js +6 -0
- package/index28.js +4 -0
- package/index29.js +12 -0
- package/index3.js +8 -0
- package/index30.js +20 -0
- package/index31.js +22 -0
- package/index32.js +14 -0
- package/index33.js +11 -0
- package/index34.js +31 -0
- package/index35.js +8 -0
- package/index36.js +9 -0
- package/index37.js +19 -0
- package/index38.js +9 -0
- package/index39.js +9 -0
- package/index4.js +4 -0
- package/index40.js +16 -0
- package/index41.js +16 -0
- package/index42.js +31 -0
- package/index43.js +16 -0
- package/index44.js +6 -0
- package/index45.js +53 -0
- package/index46.js +18 -0
- package/index47.js +27 -0
- package/index48.js +18 -0
- package/index49.js +21 -0
- package/index5.js +5 -0
- package/index50.js +49 -0
- package/index51.js +5 -0
- package/index52.js +25 -0
- package/index53.js +18 -0
- package/index54.js +9 -0
- package/index55.js +25 -0
- package/index56.js +18 -0
- package/index57.js +11 -0
- package/index58.js +12 -0
- package/index59.js +15 -0
- package/index6.js +4 -0
- package/index60.js +9 -0
- package/index61.js +9 -0
- package/index62.js +19 -0
- package/index63.js +22 -0
- package/index64.js +61 -0
- package/index65.js +15 -0
- package/index66.js +11 -0
- package/index67.js +63 -0
- package/index68.js +85 -0
- package/index69.js +74 -0
- package/index7.js +9 -0
- package/index70.js +24 -0
- package/index71.js +69 -0
- package/index72.js +80 -0
- package/index73.js +140 -0
- package/index74.js +70 -0
- package/index75.js +42 -0
- package/index76.js +82 -0
- package/index77.js +71 -0
- package/index78.js +104 -0
- package/index79.js +274 -0
- package/index8.js +4 -0
- package/index80.js +724 -0
- package/index81.js +491 -0
- package/index82.js +317 -0
- package/index83.js +391 -0
- package/index84.js +254 -0
- package/index85.js +1364 -0
- package/index86.js +1009 -0
- package/index87.js +388 -0
- package/index88.js +2105 -0
- package/index89.js +2371 -0
- package/index9.js +5 -0
- package/index90.js +6834 -0
- package/index91.js +17 -0
- package/index92.js +14 -0
- package/index93.js +6 -0
- package/index94.js +9 -0
- package/info-banner/InfoBanner.d.ts +21 -0
- package/info-banner/index.d.ts +1 -0
- package/intlStrings-Cd44R5hT.js +278 -0
- package/layout/Layout.d.ts +51 -0
- package/layout/index.d.ts +1 -0
- package/link/Link.d.ts +13 -0
- package/link/index.d.ts +1 -0
- package/link-button/LinkButton.d.ts +18 -0
- package/link-button/index.d.ts +1 -0
- package/logo/Logo.d.ts +16 -0
- package/logo/index.d.ts +1 -0
- package/modal/Modal.d.ts +13 -0
- package/modal/index.d.ts +1 -0
- package/multi-select/MultiSelect.d.ts +28 -0
- package/multi-select/index.d.ts +1 -0
- package/package.json +29 -0
- package/radio/Radio.d.ts +20 -0
- package/radio/index.d.ts +1 -0
- package/react.esm-D8HpDGKP.js +11060 -0
- package/search-field/SearchField.d.ts +13 -0
- package/search-field/index.d.ts +1 -0
- package/select/Select.d.ts +11 -0
- package/select/index.d.ts +1 -0
- package/spinner/Spinner.d.ts +11 -0
- package/spinner/index.d.ts +1 -0
- package/table/Table.d.ts +12 -0
- package/table/index.d.ts +1 -0
- package/tabs/Tabs.d.ts +12 -0
- package/tabs/index.d.ts +1 -0
- package/tag/Tag.d.ts +11 -0
- package/tag/index.d.ts +1 -0
- package/textarea/TextArea.d.ts +20 -0
- package/textarea/index.d.ts +1 -0
- package/textfield/TextField.d.ts +16 -0
- package/textfield/index.d.ts +3 -0
- package/theme/index.d.ts +138 -0
- package/theme/tokens.d.ts +135 -0
- package/toast/Toast.d.ts +25 -0
- package/toast/index.d.ts +1 -0
- package/tokens-CjXmpXTi.js +160 -0
- package/triangle-alert-1OYl9KWz.js +56 -0
- package/useControlledState-S_TYcV_c.js +45 -0
- package/useDescription-D4_zk_sA.js +32 -0
- package/useFilter-BnJDBCkt.js +35 -0
- package/useFocusRing-D97-G3fT.js +1324 -0
- package/useFocusable-C-N9wcwm.js +56 -0
- package/useGridSelectionCheckbox-i1rsjlC-.js +22 -0
- package/useHasTabbableChild-DeuCnGGv.js +34 -0
- package/useHighlightSelectionDescription-JVx2MW_e.js +552 -0
- package/useListState-DSOTbsL3.js +119 -0
- package/useLocalizedStringFormatter-DVCAZqcL.js +96 -0
- package/useSingleSelectListState-CmX9_L5H.js +34 -0
- package/useUpdateEffect-Dtz-i14F.js +12 -0
- package/x-JK7i-TQC.js +14 -0
package/index86.js
ADDED
|
@@ -0,0 +1,1009 @@
|
|
|
1
|
+
import { jsx as h, jsxs as E, Fragment as he } from "react/jsx-runtime";
|
|
2
|
+
import { Button as $e } from "./index69.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, y as Ee, l as A, b as Te, L as k, f as ge, K as L, e as ye } from "./useFocusRing-D97-G3fT.js";
|
|
6
|
+
import { $ as w } from "./useLocalizedStringFormatter-DVCAZqcL.js";
|
|
7
|
+
import { s as I } from "./index-CEg5vZQH.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: (t, e) => `${e.plural(t.count, {
|
|
15
|
+
one: () => `${e.number(t.count)} إشعار`,
|
|
16
|
+
other: () => `${e.number(t.count)} إشعارات`
|
|
17
|
+
})}.`
|
|
18
|
+
};
|
|
19
|
+
var P = {};
|
|
20
|
+
P = {
|
|
21
|
+
close: "Затвори",
|
|
22
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
23
|
+
one: () => `${e.number(t.count)} известие`,
|
|
24
|
+
other: () => `${e.number(t.count)} известия`
|
|
25
|
+
})}.`
|
|
26
|
+
};
|
|
27
|
+
var F = {};
|
|
28
|
+
F = {
|
|
29
|
+
close: "Zavřít",
|
|
30
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
31
|
+
one: () => `${e.number(t.count)} oznámení`,
|
|
32
|
+
other: () => `${e.number(t.count)} oznámení`
|
|
33
|
+
})}.`
|
|
34
|
+
};
|
|
35
|
+
var R = {};
|
|
36
|
+
R = {
|
|
37
|
+
close: "Luk",
|
|
38
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
39
|
+
one: () => `${e.number(t.count)} besked`,
|
|
40
|
+
other: () => `${e.number(t.count)} beskeder`
|
|
41
|
+
})}.`
|
|
42
|
+
};
|
|
43
|
+
var N = {};
|
|
44
|
+
N = {
|
|
45
|
+
close: "Schließen",
|
|
46
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
47
|
+
one: () => `${e.number(t.count)} Benachrichtigung`,
|
|
48
|
+
other: () => `${e.number(t.count)} Benachrichtigungen`
|
|
49
|
+
})}.`
|
|
50
|
+
};
|
|
51
|
+
var S = {};
|
|
52
|
+
S = {
|
|
53
|
+
close: "Κλείσιμο",
|
|
54
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
55
|
+
one: () => `${e.number(t.count)} ειδοποίηση`,
|
|
56
|
+
other: () => `${e.number(t.count)} ειδοποιήσεις`
|
|
57
|
+
})}.`
|
|
58
|
+
};
|
|
59
|
+
var D = {};
|
|
60
|
+
D = {
|
|
61
|
+
close: "Close",
|
|
62
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
63
|
+
one: () => `${e.number(t.count)} notification`,
|
|
64
|
+
other: () => `${e.number(t.count)} notifications`
|
|
65
|
+
})}.`
|
|
66
|
+
};
|
|
67
|
+
var M = {};
|
|
68
|
+
M = {
|
|
69
|
+
close: "Cerrar",
|
|
70
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
71
|
+
one: () => `${e.number(t.count)} notificación`,
|
|
72
|
+
other: () => `${e.number(t.count)} notificaciones`
|
|
73
|
+
})}.`
|
|
74
|
+
};
|
|
75
|
+
var H = {};
|
|
76
|
+
H = {
|
|
77
|
+
close: "Sule",
|
|
78
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
79
|
+
one: () => `${e.number(t.count)} teatis`,
|
|
80
|
+
other: () => `${e.number(t.count)} teatist`
|
|
81
|
+
})}.`
|
|
82
|
+
};
|
|
83
|
+
var O = {};
|
|
84
|
+
O = {
|
|
85
|
+
close: "Sulje",
|
|
86
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
87
|
+
one: () => `${e.number(t.count)} ilmoitus`,
|
|
88
|
+
other: () => `${e.number(t.count)} ilmoitusta`
|
|
89
|
+
})}.`
|
|
90
|
+
};
|
|
91
|
+
var V = {};
|
|
92
|
+
V = {
|
|
93
|
+
close: "Fermer",
|
|
94
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
95
|
+
one: () => `${e.number(t.count)} notification`,
|
|
96
|
+
other: () => `${e.number(t.count)} notifications`
|
|
97
|
+
})}.`
|
|
98
|
+
};
|
|
99
|
+
var z = {};
|
|
100
|
+
z = {
|
|
101
|
+
close: "סגור",
|
|
102
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
103
|
+
one: () => `${e.number(t.count)} התראה`,
|
|
104
|
+
other: () => `${e.number(t.count)} התראות`
|
|
105
|
+
})}.`
|
|
106
|
+
};
|
|
107
|
+
var j = {};
|
|
108
|
+
j = {
|
|
109
|
+
close: "Zatvori",
|
|
110
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
111
|
+
one: () => `${e.number(t.count)} obavijest`,
|
|
112
|
+
other: () => `${e.number(t.count)} obavijesti`
|
|
113
|
+
})}.`
|
|
114
|
+
};
|
|
115
|
+
var K = {};
|
|
116
|
+
K = {
|
|
117
|
+
close: "Bezárás",
|
|
118
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
119
|
+
one: () => `${e.number(t.count)} értesítés`,
|
|
120
|
+
other: () => `${e.number(t.count)} értesítés`
|
|
121
|
+
})}.`
|
|
122
|
+
};
|
|
123
|
+
var G = {};
|
|
124
|
+
G = {
|
|
125
|
+
close: "Chiudi",
|
|
126
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
127
|
+
one: () => `${e.number(t.count)} notifica`,
|
|
128
|
+
other: () => `${e.number(t.count)} notifiche`
|
|
129
|
+
})}.`
|
|
130
|
+
};
|
|
131
|
+
var U = {};
|
|
132
|
+
U = {
|
|
133
|
+
close: "閉じる",
|
|
134
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
135
|
+
one: () => `${e.number(t.count)} 個の通知`,
|
|
136
|
+
other: () => `${e.number(t.count)} 個の通知`
|
|
137
|
+
})}。`
|
|
138
|
+
};
|
|
139
|
+
var W = {};
|
|
140
|
+
W = {
|
|
141
|
+
close: "닫기",
|
|
142
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
143
|
+
one: () => `${e.number(t.count)}개 알림`,
|
|
144
|
+
other: () => `${e.number(t.count)}개 알림`
|
|
145
|
+
})}.`
|
|
146
|
+
};
|
|
147
|
+
var Z = {};
|
|
148
|
+
Z = {
|
|
149
|
+
close: "Uždaryti",
|
|
150
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
151
|
+
one: () => `${e.number(t.count)} pranešimas`,
|
|
152
|
+
other: () => `${e.number(t.count)} pranešimai`
|
|
153
|
+
})}.`
|
|
154
|
+
};
|
|
155
|
+
var q = {};
|
|
156
|
+
q = {
|
|
157
|
+
close: "Aizvērt",
|
|
158
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
159
|
+
one: () => `${e.number(t.count)} paziņojums`,
|
|
160
|
+
other: () => `${e.number(t.count)} paziņojumi`
|
|
161
|
+
})}.`
|
|
162
|
+
};
|
|
163
|
+
var Y = {};
|
|
164
|
+
Y = {
|
|
165
|
+
close: "Lukk",
|
|
166
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
167
|
+
one: () => `${e.number(t.count)} varsling`,
|
|
168
|
+
other: () => `${e.number(t.count)} varsler`
|
|
169
|
+
})}.`
|
|
170
|
+
};
|
|
171
|
+
var J = {};
|
|
172
|
+
J = {
|
|
173
|
+
close: "Sluiten",
|
|
174
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
175
|
+
one: () => `${e.number(t.count)} melding`,
|
|
176
|
+
other: () => `${e.number(t.count)} meldingen`
|
|
177
|
+
})}.`
|
|
178
|
+
};
|
|
179
|
+
var Q = {};
|
|
180
|
+
Q = {
|
|
181
|
+
close: "Zamknij",
|
|
182
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
183
|
+
one: () => `${e.number(t.count)} powiadomienie`,
|
|
184
|
+
few: () => `${e.number(t.count)} powiadomienia`,
|
|
185
|
+
many: () => `${e.number(t.count)} powiadomień`,
|
|
186
|
+
other: () => `${e.number(t.count)} powiadomienia`
|
|
187
|
+
})}.`
|
|
188
|
+
};
|
|
189
|
+
var X = {};
|
|
190
|
+
X = {
|
|
191
|
+
close: "Fechar",
|
|
192
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
193
|
+
one: () => `${e.number(t.count)} notificação`,
|
|
194
|
+
other: () => `${e.number(t.count)} notificações`
|
|
195
|
+
})}.`
|
|
196
|
+
};
|
|
197
|
+
var ee = {};
|
|
198
|
+
ee = {
|
|
199
|
+
close: "Fechar",
|
|
200
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
201
|
+
one: () => `${e.number(t.count)} notificação`,
|
|
202
|
+
other: () => `${e.number(t.count)} notificações`
|
|
203
|
+
})}.`
|
|
204
|
+
};
|
|
205
|
+
var te = {};
|
|
206
|
+
te = {
|
|
207
|
+
close: "Închideţi",
|
|
208
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
209
|
+
one: () => `${e.number(t.count)} notificare`,
|
|
210
|
+
other: () => `${e.number(t.count)} notificări`
|
|
211
|
+
})}.`
|
|
212
|
+
};
|
|
213
|
+
var ne = {};
|
|
214
|
+
ne = {
|
|
215
|
+
close: "Закрыть",
|
|
216
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
217
|
+
one: () => `${e.number(t.count)} уведомление`,
|
|
218
|
+
other: () => `${e.number(t.count)} уведомления`
|
|
219
|
+
})}.`
|
|
220
|
+
};
|
|
221
|
+
var ie = {};
|
|
222
|
+
ie = {
|
|
223
|
+
close: "Zatvoriť",
|
|
224
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
225
|
+
one: () => `${e.number(t.count)} oznámenie`,
|
|
226
|
+
few: () => `${e.number(t.count)} oznámenia`,
|
|
227
|
+
other: () => `${e.number(t.count)} oznámení`
|
|
228
|
+
})}.`
|
|
229
|
+
};
|
|
230
|
+
var oe = {};
|
|
231
|
+
oe = {
|
|
232
|
+
close: "Zapri",
|
|
233
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
234
|
+
one: () => `${e.number(t.count)} obvestilo`,
|
|
235
|
+
two: () => `${e.number(t.count)} obvestili`,
|
|
236
|
+
few: () => `${e.number(t.count)} obvestila`,
|
|
237
|
+
other: () => `${e.number(t.count)} obvestil`
|
|
238
|
+
})}.`
|
|
239
|
+
};
|
|
240
|
+
var ue = {};
|
|
241
|
+
ue = {
|
|
242
|
+
close: "Zatvori",
|
|
243
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
244
|
+
one: () => `${e.number(t.count)} obaveštenje`,
|
|
245
|
+
other: () => `${e.number(t.count)} obaveštenja`
|
|
246
|
+
})}.`
|
|
247
|
+
};
|
|
248
|
+
var ae = {};
|
|
249
|
+
ae = {
|
|
250
|
+
close: "Stäng",
|
|
251
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
252
|
+
one: () => `${e.number(t.count)} meddelande`,
|
|
253
|
+
other: () => `${e.number(t.count)} meddelanden`
|
|
254
|
+
})}.`
|
|
255
|
+
};
|
|
256
|
+
var se = {};
|
|
257
|
+
se = {
|
|
258
|
+
close: "Kapat",
|
|
259
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
260
|
+
one: () => `${e.number(t.count)} bildirim`,
|
|
261
|
+
other: () => `${e.number(t.count)} bildirim`
|
|
262
|
+
})}.`
|
|
263
|
+
};
|
|
264
|
+
var re = {};
|
|
265
|
+
re = {
|
|
266
|
+
close: "Закрити",
|
|
267
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
268
|
+
one: () => `${e.number(t.count)} сповіщення`,
|
|
269
|
+
other: () => `${e.number(t.count)} сповіщення`
|
|
270
|
+
})}.`
|
|
271
|
+
};
|
|
272
|
+
var le = {};
|
|
273
|
+
le = {
|
|
274
|
+
close: "关闭",
|
|
275
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
276
|
+
one: () => `${e.number(t.count)} 个通知`,
|
|
277
|
+
other: () => `${e.number(t.count)} 个通知`
|
|
278
|
+
})}。`
|
|
279
|
+
};
|
|
280
|
+
var ce = {};
|
|
281
|
+
ce = {
|
|
282
|
+
close: "關閉",
|
|
283
|
+
notifications: (t, e) => `${e.plural(t.count, {
|
|
284
|
+
one: () => `${e.number(t.count)} 個通知`,
|
|
285
|
+
other: () => `${e.number(t.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": K,
|
|
304
|
+
"it-IT": G,
|
|
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": te,
|
|
315
|
+
"ru-RU": ne,
|
|
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(t) {
|
|
326
|
+
return t && t.__esModule ? t.default : t;
|
|
327
|
+
}
|
|
328
|
+
function Pe(t, e, n) {
|
|
329
|
+
let { key: i, timer: o, timeout: u, animation: a } = t.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");
|
|
346
|
+
return {
|
|
347
|
+
toastProps: {
|
|
348
|
+
role: "alertdialog",
|
|
349
|
+
"aria-modal": "false",
|
|
350
|
+
"aria-label": t["aria-label"],
|
|
351
|
+
"aria-labelledby": t["aria-labelledby"] || r,
|
|
352
|
+
"aria-describedby": t["aria-describedby"] || $,
|
|
353
|
+
"aria-details": t["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
|
+
}
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
const de = 1, g = Symbol.for("react-aria-landmark-manager");
|
|
378
|
+
function Fe(t) {
|
|
379
|
+
return document.addEventListener("react-aria-landmark-manager-change", t), () => document.removeEventListener("react-aria-landmark-manager-change", t);
|
|
380
|
+
}
|
|
381
|
+
function B() {
|
|
382
|
+
if (typeof document > "u") return null;
|
|
383
|
+
let t = document[g];
|
|
384
|
+
return t && t.version >= de ? t : (document[g] = new Ne(), document.dispatchEvent(new CustomEvent("react-aria-landmark-manager-change")), document[g]);
|
|
385
|
+
}
|
|
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);
|
|
407
|
+
}
|
|
408
|
+
focusLandmark(e, n) {
|
|
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, n);
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Return set of landmarks with a specific role.
|
|
414
|
+
*/
|
|
415
|
+
getLandmarksByRole(e) {
|
|
416
|
+
return new Set(this.landmarks.filter((n) => n.role === e));
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Return first landmark with a specific role.
|
|
420
|
+
*/
|
|
421
|
+
getLandmarkByRole(e) {
|
|
422
|
+
return this.landmarks.find((n) => n.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 n = 0, i = this.landmarks.length - 1;
|
|
433
|
+
for (; n <= i; ) {
|
|
434
|
+
let o = Math.floor((n + i) / 2), u = e.ref.current.compareDocumentPosition(this.landmarks[o].ref.current);
|
|
435
|
+
!!(u & Node.DOCUMENT_POSITION_PRECEDING || u & Node.DOCUMENT_POSITION_CONTAINS) ? n = o + 1 : i = o - 1;
|
|
436
|
+
}
|
|
437
|
+
this.landmarks.splice(n, 0, e), this.checkLabels(e.role);
|
|
438
|
+
}
|
|
439
|
+
updateLandmark(e) {
|
|
440
|
+
let n = this.landmarks.findIndex((i) => i.ref === e.ref);
|
|
441
|
+
n >= 0 && (this.landmarks[n] = {
|
|
442
|
+
...this.landmarks[n],
|
|
443
|
+
...e
|
|
444
|
+
}, this.checkLabels(this.landmarks[n].role));
|
|
445
|
+
}
|
|
446
|
+
removeLandmark(e) {
|
|
447
|
+
this.landmarks = this.landmarks.filter((n) => n.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 n = this.getLandmarksByRole(e);
|
|
457
|
+
if (n.size > 1) {
|
|
458
|
+
let i = [
|
|
459
|
+
...n
|
|
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
|
+
...n
|
|
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
|
+
...n
|
|
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 n = new Map(this.landmarks.map((o) => [
|
|
480
|
+
o.ref.current,
|
|
481
|
+
o
|
|
482
|
+
])), i = e;
|
|
483
|
+
for (; i && !n.has(i) && i !== document.body && i.parentElement; ) i = i.parentElement;
|
|
484
|
+
return n.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: n }) {
|
|
493
|
+
var i;
|
|
494
|
+
let o = this.closestLandmark(e), u = n ? this.landmarks.length - 1 : 0;
|
|
495
|
+
o && (u = this.landmarks.indexOf(o) + (n ? -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 += n ? -1 : 1, a()) return;
|
|
522
|
+
if (u === s) break;
|
|
523
|
+
}
|
|
524
|
+
return this.landmarks[u];
|
|
525
|
+
}
|
|
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());
|
|
533
|
+
}
|
|
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;
|
|
537
|
+
}
|
|
538
|
+
navigate(e, n) {
|
|
539
|
+
let i = this.getNextLandmark(e, {
|
|
540
|
+
backward: n
|
|
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, n ? "backward" : "forward"), !0) : !1;
|
|
549
|
+
}
|
|
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 n = this.closestLandmark(e.target);
|
|
556
|
+
n && n.ref.current !== e.target && this.updateLandmark({
|
|
557
|
+
ref: n.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
|
+
}
|
|
565
|
+
}
|
|
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 n = e.target, i = e.relatedTarget;
|
|
571
|
+
if (!i || i === document) {
|
|
572
|
+
let o = this.closestLandmark(n);
|
|
573
|
+
o && o.ref.current === n && o.blur();
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
createLandmarkController() {
|
|
577
|
+
let e = this;
|
|
578
|
+
return e.refCount++, e.setupIfNeeded(), {
|
|
579
|
+
navigate(n, i) {
|
|
580
|
+
let o = (i == null ? void 0 : i.from) || document.activeElement;
|
|
581
|
+
return e.navigate(o, n === "backward");
|
|
582
|
+
},
|
|
583
|
+
focusNext(n) {
|
|
584
|
+
let i = (n == null ? void 0 : n.from) || document.activeElement;
|
|
585
|
+
return e.navigate(i, !1);
|
|
586
|
+
},
|
|
587
|
+
focusPrevious(n) {
|
|
588
|
+
let i = (n == null ? void 0 : n.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
|
+
};
|
|
598
|
+
}
|
|
599
|
+
registerLandmark(e) {
|
|
600
|
+
return this.landmarks.find((n) => n.ref === e.ref) ? this.updateLandmark(e) : this.addLandmark(e), () => this.removeLandmark(e.ref);
|
|
601
|
+
}
|
|
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);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
function Se(t, e) {
|
|
607
|
+
const { role: n, "aria-label": i, "aria-labelledby": o, focus: u } = t;
|
|
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: n,
|
|
622
|
+
focus: u || $,
|
|
623
|
+
blur: d
|
|
624
|
+
});
|
|
625
|
+
}, [
|
|
626
|
+
a,
|
|
627
|
+
s,
|
|
628
|
+
e,
|
|
629
|
+
n,
|
|
630
|
+
u,
|
|
631
|
+
$,
|
|
632
|
+
d
|
|
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: n,
|
|
642
|
+
tabIndex: l ? -1 : void 0,
|
|
643
|
+
"aria-label": i,
|
|
644
|
+
"aria-labelledby": o
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
function De(t) {
|
|
649
|
+
return t && t.__esModule ? t.default : t;
|
|
650
|
+
}
|
|
651
|
+
function Me(t, e, n) {
|
|
652
|
+
let i = w(De(_), "@react-aria/toast"), { landmarkProps: o } = Se({
|
|
653
|
+
role: "region",
|
|
654
|
+
"aria-label": t["aria-label"] || i.format("notifications", {
|
|
655
|
+
count: e.visibleToasts.length
|
|
656
|
+
})
|
|
657
|
+
}, n), { 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 || !n.current) {
|
|
663
|
+
a.current = [], s.current = e.visibleToasts;
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
if (a.current = [
|
|
667
|
+
...n.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
|
+
n
|
|
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
|
+
n,
|
|
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
|
+
n
|
|
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
|
+
};
|
|
732
|
+
}
|
|
733
|
+
function He(t = {}) {
|
|
734
|
+
let { maxVisibleToasts: e = 1, hasExitAnimation: n = !1 } = t, i = xe(() => new be({
|
|
735
|
+
maxVisibleToasts: e,
|
|
736
|
+
hasExitAnimation: n
|
|
737
|
+
}), [
|
|
738
|
+
e,
|
|
739
|
+
n
|
|
740
|
+
]);
|
|
741
|
+
return fe(i);
|
|
742
|
+
}
|
|
743
|
+
function fe(t) {
|
|
744
|
+
let e = T((o) => t.subscribe(o), [
|
|
745
|
+
t
|
|
746
|
+
]), n = T(() => t.visibleToasts, [
|
|
747
|
+
t
|
|
748
|
+
]);
|
|
749
|
+
return {
|
|
750
|
+
visibleToasts: I.useSyncExternalStore(e, n, n),
|
|
751
|
+
add: (o, u) => t.add(o, u),
|
|
752
|
+
close: (o) => t.close(o),
|
|
753
|
+
remove: (o) => t.remove(o),
|
|
754
|
+
pauseAll: () => t.pauseAll(),
|
|
755
|
+
resumeAll: () => t.resumeAll()
|
|
756
|
+
};
|
|
757
|
+
}
|
|
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, n = {}) {
|
|
765
|
+
let i = Math.random().toString(36), o = {
|
|
766
|
+
...n,
|
|
767
|
+
content: e,
|
|
768
|
+
key: i,
|
|
769
|
+
timer: n.timeout ? new Oe(() => this.close(i), n.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;
|
|
774
|
+
}
|
|
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 n = this.queue.findIndex((u) => u.key === e);
|
|
788
|
+
if (n >= 0) {
|
|
789
|
+
var i, o;
|
|
790
|
+
(i = (o = this.queue[n]).onClose) === null || i === void 0 || i.call(o), this.queue.splice(n, 1);
|
|
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: n, key: i } = e, o = this.queue.slice(0, this.maxVisibleToasts);
|
|
806
|
+
if (n === "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 n === "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 n;
|
|
832
|
+
this.maxVisibleToasts = (n = e == null ? void 0 : e.maxVisibleToasts) !== null && n !== void 0 ? n : 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, n) {
|
|
850
|
+
this.startTime = null, this.remaining = n, this.callback = e;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
const Ve = '"../theme/tokens.css"', ze = '"Inter", sans-serif', je = "#d5f2d9", Ke = "#008d3c", Ge = "#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)", et = "_toastRegion_i4o11_52", tt = "_toast_i4o11_52", nt = "_success_i4o11_96", it = "_info_i4o11_104", ot = "_important_i4o11_112", ut = "_warning_i4o11_120", at = "_icon_i4o11_128", st = "_toastContent_i4o11_138", rt = "_toastMessage_i4o11_145", lt = "_slideInTop_i4o11_1", ct = "_slideInEnd_i4o11_1", dt = "_slideOutTop_i4o11_1", ft = "_slideOutEnd_i4o11_1", p = {
|
|
854
|
+
tokens: Ve,
|
|
855
|
+
display: ze,
|
|
856
|
+
signalGreen10: je,
|
|
857
|
+
signalGreen100: Ke,
|
|
858
|
+
signalBlue10: Ge,
|
|
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: et,
|
|
868
|
+
toast: tt,
|
|
869
|
+
success: nt,
|
|
870
|
+
info: it,
|
|
871
|
+
important: ot,
|
|
872
|
+
warning: ut,
|
|
873
|
+
icon: at,
|
|
874
|
+
toastContent: st,
|
|
875
|
+
toastMessage: rt,
|
|
876
|
+
slideInTop: lt,
|
|
877
|
+
slideInEnd: ct,
|
|
878
|
+
slideOutTop: dt,
|
|
879
|
+
slideOutEnd: ft
|
|
880
|
+
}, bt = {
|
|
881
|
+
success: Be,
|
|
882
|
+
info: Ae,
|
|
883
|
+
important: we,
|
|
884
|
+
warning: Ie
|
|
885
|
+
}, mt = new be({
|
|
886
|
+
maxVisibleToasts: 5,
|
|
887
|
+
hasExitAnimation: !0
|
|
888
|
+
}), Lt = (t) => {
|
|
889
|
+
const e = fe(mt);
|
|
890
|
+
return e.visibleToasts.length > 0 ? _e(
|
|
891
|
+
/* @__PURE__ */ h(
|
|
892
|
+
me,
|
|
893
|
+
{
|
|
894
|
+
...t,
|
|
895
|
+
state: e
|
|
896
|
+
}
|
|
897
|
+
),
|
|
898
|
+
document.body
|
|
899
|
+
) : null;
|
|
900
|
+
}, Bt = ({ children: t, ...e }) => {
|
|
901
|
+
const n = He({
|
|
902
|
+
maxVisibleToasts: 5,
|
|
903
|
+
hasExitAnimation: !0
|
|
904
|
+
});
|
|
905
|
+
return /* @__PURE__ */ E(he, { children: [
|
|
906
|
+
typeof t == "function" ? t(n) : t,
|
|
907
|
+
n.visibleToasts.length > 0 && /* @__PURE__ */ h(
|
|
908
|
+
me,
|
|
909
|
+
{
|
|
910
|
+
...e,
|
|
911
|
+
state: n
|
|
912
|
+
}
|
|
913
|
+
)
|
|
914
|
+
] });
|
|
915
|
+
};
|
|
916
|
+
function me({
|
|
917
|
+
state: t,
|
|
918
|
+
...e
|
|
919
|
+
}) {
|
|
920
|
+
const n = y.useRef(null), { regionProps: i } = Me(e, t, n);
|
|
921
|
+
return /* @__PURE__ */ h(
|
|
922
|
+
"div",
|
|
923
|
+
{
|
|
924
|
+
...i,
|
|
925
|
+
ref: n,
|
|
926
|
+
className: p.toastRegion,
|
|
927
|
+
children: t.visibleToasts.map((o) => /* @__PURE__ */ h(
|
|
928
|
+
ht,
|
|
929
|
+
{
|
|
930
|
+
toast: o,
|
|
931
|
+
state: t
|
|
932
|
+
},
|
|
933
|
+
o.key
|
|
934
|
+
))
|
|
935
|
+
}
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
function ht({
|
|
939
|
+
state: t,
|
|
940
|
+
...e
|
|
941
|
+
}) {
|
|
942
|
+
const n = y.useRef(null), { toastProps: i, contentProps: o, titleProps: u, closeButtonProps: a } = Pe(
|
|
943
|
+
e,
|
|
944
|
+
t
|
|
945
|
+
), s = bt[e.toast.content.type];
|
|
946
|
+
return /* @__PURE__ */ E(
|
|
947
|
+
"div",
|
|
948
|
+
{
|
|
949
|
+
...i,
|
|
950
|
+
ref: n,
|
|
951
|
+
className: pe(p.toast, p[e.toast.content.type]),
|
|
952
|
+
"data-animation": e.toast.animation,
|
|
953
|
+
onAnimationEnd: () => {
|
|
954
|
+
e.toast.animation === "exiting" && t.remove(e.toast.key);
|
|
955
|
+
},
|
|
956
|
+
children: [
|
|
957
|
+
/* @__PURE__ */ E(
|
|
958
|
+
"div",
|
|
959
|
+
{
|
|
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
|
+
]
|
|
983
|
+
}
|
|
984
|
+
),
|
|
985
|
+
/* @__PURE__ */ h(
|
|
986
|
+
$e,
|
|
987
|
+
{
|
|
988
|
+
variant: "icon",
|
|
989
|
+
...a,
|
|
990
|
+
children: /* @__PURE__ */ h(
|
|
991
|
+
Le,
|
|
992
|
+
{
|
|
993
|
+
size: 20,
|
|
994
|
+
"aria-hidden": !0
|
|
995
|
+
}
|
|
996
|
+
)
|
|
997
|
+
}
|
|
998
|
+
)
|
|
999
|
+
]
|
|
1000
|
+
}
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
export {
|
|
1004
|
+
Lt as GlobalToastRegion,
|
|
1005
|
+
ht as Toast,
|
|
1006
|
+
Bt as ToastProvider,
|
|
1007
|
+
me as ToastRegion,
|
|
1008
|
+
mt as toastQueue
|
|
1009
|
+
};
|