@easypost/easy-ui 1.0.0-alpha.4 → 1.0.0-alpha.6
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/Badge/index.js +32 -26
- package/Badge/index.mjs +32 -26
- package/Banner/index.js +15 -16
- package/Banner/index.mjs +15 -16
- package/Button/Button.d.ts +61 -0
- package/Button/Button.d.ts.map +1 -1
- package/Button/index.js +34 -69
- package/Button/index.mjs +33 -68
- package/CHANGELOG.md +21 -0
- package/Card/index.js +84 -5
- package/Card/index.mjs +84 -5
- package/Checkbox/index.js +84 -72
- package/Checkbox/index.mjs +84 -72
- package/CodeBlock/index.js +43 -49
- package/CodeBlock/index.mjs +43 -49
- package/DropdownButton/DropdownButton.d.ts +48 -0
- package/DropdownButton/DropdownButton.d.ts.map +1 -1
- package/DropdownButton/index.js +29 -101
- package/DropdownButton/index.mjs +29 -85
- package/HorizontalGrid/index.js +11 -31
- package/HorizontalGrid/index.mjs +11 -31
- package/HorizontalStack/index.js +48 -4
- package/HorizontalStack/index.mjs +48 -4
- package/Icon/Icon.d.ts +51 -0
- package/Icon/Icon.d.ts.map +1 -1
- package/Icon/index.js +38 -4
- package/Icon/index.mjs +38 -4
- package/IconButton/IconButton.d.ts +62 -0
- package/IconButton/IconButton.d.ts.map +1 -1
- package/IconButton/index.js +26 -43
- package/IconButton/index.mjs +25 -42
- package/InputField/Label.d.ts +2 -2
- package/InputField/index.js +282 -10
- package/InputField/index.mjs +266 -10
- package/InputField/utilities.d.ts +1 -1
- package/InputField/utilities.d.ts.map +1 -1
- package/Menu/MenuOverlay.d.ts.map +1 -1
- package/Menu/index.js +178 -1958
- package/Menu/index.mjs +168 -1948
- package/Menu/utilities.d.ts +11 -0
- package/Menu/utilities.d.ts.map +1 -0
- package/Notification/index.js +1534 -14
- package/Notification/index.mjs +1518 -14
- package/Provider/index.js +15 -15
- package/Provider/index.mjs +15 -15
- package/RadioGroup/index.js +63 -63
- package/RadioGroup/index.mjs +63 -63
- package/Select/Select.d.ts +88 -0
- package/Select/Select.d.ts.map +1 -0
- package/Select/Select.stories.d.ts +17 -0
- package/Select/Select.stories.d.ts.map +1 -0
- package/Select/Select.test.d.ts +2 -0
- package/Select/Select.test.d.ts.map +1 -0
- package/Select/SelectContext.d.ts +14 -0
- package/Select/SelectContext.d.ts.map +1 -0
- package/Select/SelectField.d.ts +62 -0
- package/Select/SelectField.d.ts.map +1 -0
- package/Select/SelectOption.d.ts +23 -0
- package/Select/SelectOption.d.ts.map +1 -0
- package/Select/SelectOverlay.d.ts +3 -0
- package/Select/SelectOverlay.d.ts.map +1 -0
- package/Select/SelectSection.d.ts +22 -0
- package/Select/SelectSection.d.ts.map +1 -0
- package/Select/SelectTrigger.d.ts +30 -0
- package/Select/SelectTrigger.d.ts.map +1 -0
- package/Select/index.d.ts +2 -0
- package/Select/index.d.ts.map +1 -0
- package/Select/index.js +816 -0
- package/Select/index.mjs +816 -0
- package/SelectorErrorTooltip/index.js +102 -11
- package/SelectorErrorTooltip/index.mjs +86 -11
- package/Text/index.js +85 -4
- package/Text/index.mjs +85 -4
- package/TextField/index.js +19 -38
- package/TextField/index.mjs +19 -38
- package/Textarea/index.js +20 -37
- package/Textarea/index.mjs +20 -37
- package/Theme/index.js +145 -9
- package/Theme/index.mjs +145 -9
- package/Toggle/index.js +51 -50
- package/Toggle/index.mjs +51 -50
- package/Tooltip/index.js +299 -10
- package/Tooltip/index.mjs +299 -10
- package/UnstyledButton/index.js +4 -4
- package/UnstyledButton/index.mjs +3 -3
- package/VerticalStack/index.js +13 -47
- package/VerticalStack/index.mjs +13 -47
- package/__chunks__/ExpandMore400-7c5263a4.mjs +49 -0
- package/__chunks__/ExpandMore400-92646971.js +65 -0
- package/__chunks__/InputIcon-2317befd.mjs +148 -0
- package/__chunks__/InputIcon-d3963cf8.js +147 -0
- package/__chunks__/{import-e7f45c7e.mjs → import-0561e1ba.mjs} +3 -3
- package/__chunks__/{import-b7971a11.mjs → import-19bc38ac.mjs} +72 -34
- package/__chunks__/{import-01299af6.js → import-24a482e1.js} +3 -2
- package/__chunks__/{import-baa3cd0c.mjs → import-29af6941.mjs} +4 -3
- package/__chunks__/{import-0d1b4d93.js → import-2b302763.js} +193 -141
- package/__chunks__/{import-ab878fb6.mjs → import-3d962a94.mjs} +205 -153
- package/__chunks__/{import-86330a7c.mjs → import-6a831ca1.mjs} +16 -15
- package/__chunks__/{import-7545401a.js → import-8b6c0bc7.js} +3 -3
- package/__chunks__/{import-63bf0645.js → import-a1e0f814.js} +47 -9
- package/__chunks__/{import-3ab42f86.js → import-a2023d8f.js} +35 -22
- package/__chunks__/{import-76076ca6.js → import-dea5a24d.js} +15 -14
- package/__chunks__/{import-856e0385.mjs → import-f1f4792a.mjs} +36 -23
- package/__chunks__/{UnstyledButton-883f0c6c.mjs → index-29d7bca9.mjs} +17 -42
- package/__chunks__/{UnstyledButton-96172ec0.js → index-3985350a.js} +17 -42
- package/__chunks__/{overlayscrollbars-react.es-c8369a03.mjs → overlayscrollbars-react.es-7f332a3b.mjs} +4 -4
- package/__chunks__/{overlayscrollbars-react.es-20563393.js → overlayscrollbars-react.es-f2a0bcff.js} +4 -4
- package/__chunks__/{real-module-e4cd2301.mjs → real-module-515df21d.mjs} +1 -1
- package/__chunks__/{real-module-ae2a4342.js → real-module-e36b1436.js} +1 -1
- package/__chunks__/useTriggerWidth-156b038a.js +2030 -0
- package/__chunks__/useTriggerWidth-addcd1d6.mjs +2031 -0
- package/package.json +11 -11
- package/style.css +1423 -1196
- package/utilities/css.js +14 -58
- package/utilities/css.mjs +14 -58
- package/__chunks__/Card-7bbd41e0.mjs +0 -110
- package/__chunks__/Card-dac53c75.js +0 -109
- package/__chunks__/HorizontalStack-a441c63f.mjs +0 -80
- package/__chunks__/HorizontalStack-a862839b.js +0 -79
- package/__chunks__/Icon-3d00481a.js +0 -44
- package/__chunks__/Icon-a75b5201.mjs +0 -45
- package/__chunks__/InputField-4fbaae06.js +0 -487
- package/__chunks__/InputField-a272f602.mjs +0 -472
- package/__chunks__/Notification-b8eafec6.mjs +0 -1456
- package/__chunks__/Notification-c5b34eb3.js +0 -1471
- package/__chunks__/SelectorErrorTooltip-43c5e29e.js +0 -84
- package/__chunks__/SelectorErrorTooltip-b6204987.mjs +0 -69
- package/__chunks__/Text-1ae70c19.js +0 -102
- package/__chunks__/Text-4ae50d5c.mjs +0 -103
- package/__chunks__/Theme-4e498252.mjs +0 -132
- package/__chunks__/Theme-751e5575.js +0 -131
- package/__chunks__/Tooltip-bd55165e.js +0 -317
- package/__chunks__/Tooltip-f7e67b21.mjs +0 -318
package/Notification/index.mjs
CHANGED
|
@@ -1,17 +1,1521 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import React__default, { useState, useCallback, useEffect, useRef, useMemo, createContext, useContext } from "react";
|
|
22
|
+
import { o as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, b as $bdb11010cef70236$export$f680877a34711e37, $ as $bdb11010cef70236$export$b4cc09c592e8fdb8, i as $7215afc6de606d6b$export$de79e2c695e052f3, a as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../__chunks__/import-19bc38ac.mjs";
|
|
23
|
+
import { f as $6179b936705e76d3$export$ae780daf29e6d456, b as $9ab94262bd0047c7$export$420e68273165f4ec, j as $507fabe10e71c6fb$export$630ff653c5ada6a9 } from "../__chunks__/import-3d962a94.mjs";
|
|
24
|
+
import { a as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../__chunks__/real-module-515df21d.mjs";
|
|
25
|
+
import { createPortal } from "react-dom";
|
|
26
|
+
import { Icon } from "../Icon/index.mjs";
|
|
27
|
+
import { Text } from "../Text/index.mjs";
|
|
28
|
+
import { classNames, variationName } from "../utilities/css.mjs";
|
|
29
|
+
import { U as UnstyledButton } from "../__chunks__/index-29d7bca9.mjs";
|
|
11
30
|
import "../__chunks__/omit-f17deb8f.mjs";
|
|
31
|
+
var __defProp$5 = Object.defineProperty;
|
|
32
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
33
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
34
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
35
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value
|
|
40
|
+
}) : obj[key] = value;
|
|
41
|
+
var __spreadValues$5 = (a, b) => {
|
|
42
|
+
for (var prop in b || (b = {}))
|
|
43
|
+
if (__hasOwnProp$5.call(b, prop))
|
|
44
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
45
|
+
if (__getOwnPropSymbols$5)
|
|
46
|
+
for (var prop of __getOwnPropSymbols$5(b)) {
|
|
47
|
+
if (__propIsEnum$5.call(b, prop))
|
|
48
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
49
|
+
}
|
|
50
|
+
return a;
|
|
51
|
+
};
|
|
52
|
+
var __objRest$5 = (source, exclude) => {
|
|
53
|
+
var target = {};
|
|
54
|
+
for (var prop in source)
|
|
55
|
+
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
56
|
+
target[prop] = source[prop];
|
|
57
|
+
if (source != null && __getOwnPropSymbols$5)
|
|
58
|
+
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
59
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
60
|
+
target[prop] = source[prop];
|
|
61
|
+
}
|
|
62
|
+
return target;
|
|
63
|
+
};
|
|
64
|
+
const Close = (_a) => {
|
|
65
|
+
var _b = _a, { title, titleId } = _b, props = __objRest$5(_b, ["title", "titleId"]);
|
|
66
|
+
return React.createElement("svg", __spreadValues$5({
|
|
67
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
68
|
+
viewBox: "0 -960 960 960",
|
|
69
|
+
"aria-labelledby": titleId
|
|
70
|
+
}, props), title ? React.createElement("title", {
|
|
71
|
+
id: titleId
|
|
72
|
+
}, title) : null, React.createElement("path", {
|
|
73
|
+
d: "m250.923-218.924-31.999-31.999L448.001-480 218.924-709.077l31.999-31.999L480-511.999l229.077-229.077 31.999 31.999L511.999-480l229.077 229.077-31.999 31.999L480-448.001 250.923-218.924Z"
|
|
74
|
+
}));
|
|
75
|
+
};
|
|
76
|
+
var __defProp$4 = Object.defineProperty;
|
|
77
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
78
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
79
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
80
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
configurable: true,
|
|
83
|
+
writable: true,
|
|
84
|
+
value
|
|
85
|
+
}) : obj[key] = value;
|
|
86
|
+
var __spreadValues$4 = (a, b) => {
|
|
87
|
+
for (var prop in b || (b = {}))
|
|
88
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
89
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
90
|
+
if (__getOwnPropSymbols$4)
|
|
91
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
92
|
+
if (__propIsEnum$4.call(b, prop))
|
|
93
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
94
|
+
}
|
|
95
|
+
return a;
|
|
96
|
+
};
|
|
97
|
+
var __objRest$4 = (source, exclude) => {
|
|
98
|
+
var target = {};
|
|
99
|
+
for (var prop in source)
|
|
100
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
101
|
+
target[prop] = source[prop];
|
|
102
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
103
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
104
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
105
|
+
target[prop] = source[prop];
|
|
106
|
+
}
|
|
107
|
+
return target;
|
|
108
|
+
};
|
|
109
|
+
const Error2 = (_a) => {
|
|
110
|
+
var _b = _a, { title, titleId } = _b, props = __objRest$4(_b, ["title", "titleId"]);
|
|
111
|
+
return React.createElement("svg", __spreadValues$4({
|
|
112
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
113
|
+
viewBox: "0 -960 960 960",
|
|
114
|
+
"aria-labelledby": titleId
|
|
115
|
+
}, props), title ? React.createElement("title", {
|
|
116
|
+
id: titleId
|
|
117
|
+
}, title) : null, React.createElement("path", {
|
|
118
|
+
d: "M479.982-290.77q11.902 0 19.575-7.655 7.673-7.656 7.673-19.558 0-11.902-7.655-19.575t-19.557-7.673q-11.902 0-19.575 7.656-7.673 7.655-7.673 19.557 0 11.902 7.655 19.575t19.557 7.673Zm-20.443-141.076h45.383v-249.538h-45.383v249.538Zm20.794 331.845q-78.955 0-147.897-29.92t-120.755-81.71q-51.814-51.791-81.747-120.777t-29.933-148.025q0-78.655 29.92-147.864t81.71-120.522q51.791-51.314 120.777-81.247t148.025-29.933q78.655 0 147.864 29.92t120.522 81.21q51.314 51.291 81.247 120.629 29.933 69.337 29.933 147.907 0 78.955-29.92 147.897t-81.21 120.571q-51.291 51.629-120.629 81.746-69.337 30.118-147.907 30.118Zm.167-45.384q139.192 0 236.654-97.769 97.461-97.769 97.461-237.346 0-139.192-97.274-236.654Q620.067-814.615 480-814.615q-139.077 0-236.846 97.274T145.385-480q0 139.077 97.769 236.846T480.5-145.385ZM480-480Z"
|
|
119
|
+
}));
|
|
120
|
+
};
|
|
121
|
+
var __defProp$3 = Object.defineProperty;
|
|
122
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
123
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
124
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
125
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
configurable: true,
|
|
128
|
+
writable: true,
|
|
129
|
+
value
|
|
130
|
+
}) : obj[key] = value;
|
|
131
|
+
var __spreadValues$3 = (a, b) => {
|
|
132
|
+
for (var prop in b || (b = {}))
|
|
133
|
+
if (__hasOwnProp$3.call(b, prop))
|
|
134
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
135
|
+
if (__getOwnPropSymbols$3)
|
|
136
|
+
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
137
|
+
if (__propIsEnum$3.call(b, prop))
|
|
138
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
139
|
+
}
|
|
140
|
+
return a;
|
|
141
|
+
};
|
|
142
|
+
var __objRest$3 = (source, exclude) => {
|
|
143
|
+
var target = {};
|
|
144
|
+
for (var prop in source)
|
|
145
|
+
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
146
|
+
target[prop] = source[prop];
|
|
147
|
+
if (source != null && __getOwnPropSymbols$3)
|
|
148
|
+
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
149
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
150
|
+
target[prop] = source[prop];
|
|
151
|
+
}
|
|
152
|
+
return target;
|
|
153
|
+
};
|
|
154
|
+
const CheckCircle = (_a) => {
|
|
155
|
+
var _b = _a, { title, titleId } = _b, props = __objRest$3(_b, ["title", "titleId"]);
|
|
156
|
+
return React.createElement("svg", __spreadValues$3({
|
|
157
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
158
|
+
viewBox: "0 -960 960 960",
|
|
159
|
+
"aria-labelledby": titleId
|
|
160
|
+
}, props), title ? React.createElement("title", {
|
|
161
|
+
id: titleId
|
|
162
|
+
}, title) : null, React.createElement("path", {
|
|
163
|
+
d: "M421-311.463 690.537-581l-34.845-34.23L421-380.153 302.539-498.615l-33.846 34.23L421-311.463Zm59.067 211.462q-78.221 0-147.397-29.92-69.176-29.92-120.989-81.71-51.814-51.791-81.747-120.936-29.933-69.146-29.933-147.366 0-78.836 29.92-148.204 29.92-69.369 81.71-120.682 51.791-51.314 120.936-81.247 69.146-29.933 147.366-29.933 78.836 0 148.204 29.92 69.369 29.92 120.682 81.21 51.314 51.291 81.247 120.629 29.933 69.337 29.933 148.173 0 78.221-29.92 147.397-29.92 69.176-81.21 120.989-51.291 51.814-120.629 81.747-69.337 29.933-148.173 29.933ZM480-145.385q139.692 0 237.154-97.769Q814.615-340.923 814.615-480q0-139.692-97.461-237.154Q619.692-814.615 480-814.615q-139.077 0-236.846 97.461Q145.385-619.692 145.385-480q0 139.077 97.769 236.846T480-145.385ZM480-480Z"
|
|
164
|
+
}));
|
|
165
|
+
};
|
|
166
|
+
var __defProp$2 = Object.defineProperty;
|
|
167
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
168
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
169
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
170
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
configurable: true,
|
|
173
|
+
writable: true,
|
|
174
|
+
value
|
|
175
|
+
}) : obj[key] = value;
|
|
176
|
+
var __spreadValues$2 = (a, b) => {
|
|
177
|
+
for (var prop in b || (b = {}))
|
|
178
|
+
if (__hasOwnProp$2.call(b, prop))
|
|
179
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
180
|
+
if (__getOwnPropSymbols$2)
|
|
181
|
+
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
182
|
+
if (__propIsEnum$2.call(b, prop))
|
|
183
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
184
|
+
}
|
|
185
|
+
return a;
|
|
186
|
+
};
|
|
187
|
+
var __objRest$2 = (source, exclude) => {
|
|
188
|
+
var target = {};
|
|
189
|
+
for (var prop in source)
|
|
190
|
+
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
191
|
+
target[prop] = source[prop];
|
|
192
|
+
if (source != null && __getOwnPropSymbols$2)
|
|
193
|
+
for (var prop of __getOwnPropSymbols$2(source)) {
|
|
194
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
195
|
+
target[prop] = source[prop];
|
|
196
|
+
}
|
|
197
|
+
return target;
|
|
198
|
+
};
|
|
199
|
+
const Warning = (_a) => {
|
|
200
|
+
var _b = _a, { title, titleId } = _b, props = __objRest$2(_b, ["title", "titleId"]);
|
|
201
|
+
return React.createElement("svg", __spreadValues$2({
|
|
202
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
203
|
+
viewBox: "0 -960 960 960",
|
|
204
|
+
"aria-labelledby": titleId
|
|
205
|
+
}, props), title ? React.createElement("title", {
|
|
206
|
+
id: titleId
|
|
207
|
+
}, title) : null, React.createElement("path", {
|
|
208
|
+
d: "M74.618-140.001 480-839.997l405.382 699.996H74.618Zm78.613-45.384h653.538L480-749.23 153.231-185.385Zm329.797-60.077q10.703 0 17.76-7.24 7.058-7.24 7.058-17.942t-7.24-17.76q-7.24-7.057-17.942-7.057t-17.76 7.239q-7.058 7.24-7.058 17.942 0 10.703 7.24 17.76 7.24 7.058 17.942 7.058Zm-22.874-97.922h45.384V-561.23h-45.384v217.846ZM480-467.307Z"
|
|
209
|
+
}));
|
|
210
|
+
};
|
|
211
|
+
var __defProp$1 = Object.defineProperty;
|
|
212
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
213
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
214
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
215
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
configurable: true,
|
|
218
|
+
writable: true,
|
|
219
|
+
value
|
|
220
|
+
}) : obj[key] = value;
|
|
221
|
+
var __spreadValues$1 = (a, b) => {
|
|
222
|
+
for (var prop in b || (b = {}))
|
|
223
|
+
if (__hasOwnProp$1.call(b, prop))
|
|
224
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
225
|
+
if (__getOwnPropSymbols$1)
|
|
226
|
+
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
227
|
+
if (__propIsEnum$1.call(b, prop))
|
|
228
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
229
|
+
}
|
|
230
|
+
return a;
|
|
231
|
+
};
|
|
232
|
+
var __objRest$1 = (source, exclude) => {
|
|
233
|
+
var target = {};
|
|
234
|
+
for (var prop in source)
|
|
235
|
+
if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
236
|
+
target[prop] = source[prop];
|
|
237
|
+
if (source != null && __getOwnPropSymbols$1)
|
|
238
|
+
for (var prop of __getOwnPropSymbols$1(source)) {
|
|
239
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
|
|
240
|
+
target[prop] = source[prop];
|
|
241
|
+
}
|
|
242
|
+
return target;
|
|
243
|
+
};
|
|
244
|
+
const DocumentScanner = (_a) => {
|
|
245
|
+
var _b = _a, { title, titleId } = _b, props = __objRest$1(_b, ["title", "titleId"]);
|
|
246
|
+
return React.createElement("svg", __spreadValues$1({
|
|
247
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
248
|
+
viewBox: "0 -960 960 960",
|
|
249
|
+
"aria-labelledby": titleId
|
|
250
|
+
}, props), title ? React.createElement("title", {
|
|
251
|
+
id: titleId
|
|
252
|
+
}, title) : null, React.createElement("path", {
|
|
253
|
+
d: "M90-748.462v-161.537h161.923v45.383H135.384v116.154H90.001Zm734.616 0v-116.154H708.462v-45.383h161.537v161.537h-45.383ZM90.001-50.001v-161.922h45.383v116.539h116.539v45.383H90.001Zm618.461 0v-45.383h116.154v-116.539h45.383v161.922H708.462ZM255.384-227.693q0 4.616 3.847 8.462 3.846 3.847 8.462 3.847h424.614q4.616 0 8.462-3.847 3.847-3.846 3.847-8.462v-504.614q0-4.616-3.847-8.462-3.846-3.847-8.462-3.847H267.693q-4.616 0-8.462 3.847-3.847 3.846-3.847 8.462v504.614Zm12.309 57.692q-23.529 0-40.611-17.081-17.081-17.082-17.081-40.611v-504.614q0-23.529 17.081-40.611 17.082-17.081 40.611-17.081h424.614q23.529 0 40.611 17.081 17.081 17.082 17.081 40.611v504.614q0 23.529-17.081 40.611-17.082 17.081-40.611 17.081H267.693Zm109.615-407.307h205.384v-45.384H377.308v45.384Zm0 120h205.384v-45.384H377.308v45.384Zm0 120h205.384v-45.384H377.308v45.384ZM255.384-227.693v-516.923 529.232-12.309Z"
|
|
254
|
+
}));
|
|
255
|
+
};
|
|
256
|
+
var __defProp2 = Object.defineProperty;
|
|
257
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
258
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
259
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
260
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, {
|
|
261
|
+
enumerable: true,
|
|
262
|
+
configurable: true,
|
|
263
|
+
writable: true,
|
|
264
|
+
value
|
|
265
|
+
}) : obj[key] = value;
|
|
266
|
+
var __spreadValues2 = (a, b) => {
|
|
267
|
+
for (var prop in b || (b = {}))
|
|
268
|
+
if (__hasOwnProp2.call(b, prop))
|
|
269
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
270
|
+
if (__getOwnPropSymbols2)
|
|
271
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
272
|
+
if (__propIsEnum2.call(b, prop))
|
|
273
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
274
|
+
}
|
|
275
|
+
return a;
|
|
276
|
+
};
|
|
277
|
+
var __objRest = (source, exclude) => {
|
|
278
|
+
var target = {};
|
|
279
|
+
for (var prop in source)
|
|
280
|
+
if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
281
|
+
target[prop] = source[prop];
|
|
282
|
+
if (source != null && __getOwnPropSymbols2)
|
|
283
|
+
for (var prop of __getOwnPropSymbols2(source)) {
|
|
284
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum2.call(source, prop))
|
|
285
|
+
target[prop] = source[prop];
|
|
286
|
+
}
|
|
287
|
+
return target;
|
|
288
|
+
};
|
|
289
|
+
const CurrencyExchange = (_a) => {
|
|
290
|
+
var _b = _a, { title, titleId } = _b, props = __objRest(_b, ["title", "titleId"]);
|
|
291
|
+
return React.createElement("svg", __spreadValues2({
|
|
292
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
293
|
+
viewBox: "0 -960 960 960",
|
|
294
|
+
"aria-labelledby": titleId
|
|
295
|
+
}, props), title ? React.createElement("title", {
|
|
296
|
+
id: titleId
|
|
297
|
+
}, title) : null, React.createElement("path", {
|
|
298
|
+
d: "M480-60.002q-117 0-219.654-68.884-102.654-68.885-156.884-166.194v141.231H58.078v-219.998h219.999v45.383H136.846q45.615 91.232 142.038 157.156Q375.307-105.385 480-105.385q75.692 0 142.884-28.269t117.731-77.461q50.538-49.192 80.923-116 30.384-66.807 32.692-142.884h45.384q-1.923 85.23-35.654 159.845T773.499-179.77q-56.731 55.769-132.307 87.769-75.577 32-161.192 32Zm-23.23-142.614v-52.077q-42.308-10.846-72.231-34.846-29.923-24-50.538-66.922l39.845-14.308q14.308 37.231 44.616 58.462 30.307 21.23 68.153 21.23 39.616 0 68.808-19.884 29.193-19.885 29.193-56.885 0-34.154-23.654-55.885-23.654-21.731-90.269-48.962-62.693-25-91.731-52.461-29.038-27.461-29.038-74.153 0-40.923 28.846-71.154 28.846-30.231 80-37.231v-49.077h43.845v49.077q34.923 3.231 62.154 21.692 27.23 18.462 44.23 50.385L571.385-618Q556-643.693 534-657.308q-22-13.615-52-13.615-40.154 0-64.385 19.923t-24.231 51.693q0 32.769 22.923 51.384 22.923 18.616 84.769 43 69.77 28.231 98.193 58.308 28.423 30.076 28.423 78.769 0 26.153-9.962 46.769-9.961 20.615-26.846 35.038-16.885 14.423-40.115 22.962-23.231 8.538-50.154 10.384v50.077H456.77ZM60.386-490.001q2.693-87.153 36.808-161.961 34.115-74.807 91.23-130.191 57.116-55.384 132.115-86.615 75-31.231 159.461-31.231 115.846 0 219.654 69.078 103.808 69.077 156.884 167.539v-142.769h45.384v219.998H681.923v-45.383h141.231q-44.461-89.309-140.576-156.194Q586.462-854.615 480-854.615q-74.154 0-141.346 27.884-67.192 27.885-117.923 76.692-50.73 48.808-81.692 115.615-30.961 66.808-33.269 144.423H60.386Z"
|
|
299
|
+
}));
|
|
300
|
+
};
|
|
301
|
+
var shim = { exports: {} };
|
|
302
|
+
var useSyncExternalStoreShim_production_min = {};
|
|
303
|
+
/**
|
|
304
|
+
* @license React
|
|
305
|
+
* use-sync-external-store-shim.production.min.js
|
|
306
|
+
*
|
|
307
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the MIT license found in the
|
|
310
|
+
* LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/
|
|
312
|
+
var hasRequiredUseSyncExternalStoreShim_production_min;
|
|
313
|
+
function requireUseSyncExternalStoreShim_production_min() {
|
|
314
|
+
if (hasRequiredUseSyncExternalStoreShim_production_min)
|
|
315
|
+
return useSyncExternalStoreShim_production_min;
|
|
316
|
+
hasRequiredUseSyncExternalStoreShim_production_min = 1;
|
|
317
|
+
var e = React__default;
|
|
318
|
+
function h(a, b) {
|
|
319
|
+
return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
|
|
320
|
+
}
|
|
321
|
+
var k = "function" === typeof Object.is ? Object.is : h, l = e.useState, m = e.useEffect, n = e.useLayoutEffect, p = e.useDebugValue;
|
|
322
|
+
function q(a, b) {
|
|
323
|
+
var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
|
|
324
|
+
n(function() {
|
|
325
|
+
c.value = d;
|
|
326
|
+
c.getSnapshot = b;
|
|
327
|
+
r(c) && g({ inst: c });
|
|
328
|
+
}, [a, d, b]);
|
|
329
|
+
m(function() {
|
|
330
|
+
r(c) && g({ inst: c });
|
|
331
|
+
return a(function() {
|
|
332
|
+
r(c) && g({ inst: c });
|
|
333
|
+
});
|
|
334
|
+
}, [a]);
|
|
335
|
+
p(d);
|
|
336
|
+
return d;
|
|
337
|
+
}
|
|
338
|
+
function r(a) {
|
|
339
|
+
var b = a.getSnapshot;
|
|
340
|
+
a = a.value;
|
|
341
|
+
try {
|
|
342
|
+
var d = b();
|
|
343
|
+
return !k(a, d);
|
|
344
|
+
} catch (f) {
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function t(a, b) {
|
|
349
|
+
return b();
|
|
350
|
+
}
|
|
351
|
+
var u = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t : q;
|
|
352
|
+
useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u;
|
|
353
|
+
return useSyncExternalStoreShim_production_min;
|
|
354
|
+
}
|
|
355
|
+
var useSyncExternalStoreShim_development = {};
|
|
356
|
+
/**
|
|
357
|
+
* @license React
|
|
358
|
+
* use-sync-external-store-shim.development.js
|
|
359
|
+
*
|
|
360
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
361
|
+
*
|
|
362
|
+
* This source code is licensed under the MIT license found in the
|
|
363
|
+
* LICENSE file in the root directory of this source tree.
|
|
364
|
+
*/
|
|
365
|
+
var hasRequiredUseSyncExternalStoreShim_development;
|
|
366
|
+
function requireUseSyncExternalStoreShim_development() {
|
|
367
|
+
if (hasRequiredUseSyncExternalStoreShim_development)
|
|
368
|
+
return useSyncExternalStoreShim_development;
|
|
369
|
+
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
370
|
+
if (process.env.NODE_ENV !== "production") {
|
|
371
|
+
(function() {
|
|
372
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
373
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
374
|
+
}
|
|
375
|
+
var React2 = React__default;
|
|
376
|
+
var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
377
|
+
function error(format) {
|
|
378
|
+
{
|
|
379
|
+
{
|
|
380
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
381
|
+
args[_key2 - 1] = arguments[_key2];
|
|
382
|
+
}
|
|
383
|
+
printWarning("error", format, args);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function printWarning(level, format, args) {
|
|
388
|
+
{
|
|
389
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
390
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
391
|
+
if (stack !== "") {
|
|
392
|
+
format += "%s";
|
|
393
|
+
args = args.concat([stack]);
|
|
394
|
+
}
|
|
395
|
+
var argsWithFormat = args.map(function(item) {
|
|
396
|
+
return String(item);
|
|
397
|
+
});
|
|
398
|
+
argsWithFormat.unshift("Warning: " + format);
|
|
399
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
function is(x, y) {
|
|
403
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
404
|
+
}
|
|
405
|
+
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
406
|
+
var useState2 = React2.useState, useEffect2 = React2.useEffect, useLayoutEffect = React2.useLayoutEffect, useDebugValue = React2.useDebugValue;
|
|
407
|
+
var didWarnOld18Alpha = false;
|
|
408
|
+
var didWarnUncachedGetSnapshot = false;
|
|
409
|
+
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
410
|
+
{
|
|
411
|
+
if (!didWarnOld18Alpha) {
|
|
412
|
+
if (React2.startTransition !== void 0) {
|
|
413
|
+
didWarnOld18Alpha = true;
|
|
414
|
+
error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
var value = getSnapshot();
|
|
419
|
+
{
|
|
420
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
421
|
+
var cachedValue = getSnapshot();
|
|
422
|
+
if (!objectIs(value, cachedValue)) {
|
|
423
|
+
error("The result of getSnapshot should be cached to avoid an infinite loop");
|
|
424
|
+
didWarnUncachedGetSnapshot = true;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
var _useState = useState2({
|
|
429
|
+
inst: {
|
|
430
|
+
value,
|
|
431
|
+
getSnapshot
|
|
432
|
+
}
|
|
433
|
+
}), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
434
|
+
useLayoutEffect(function() {
|
|
435
|
+
inst.value = value;
|
|
436
|
+
inst.getSnapshot = getSnapshot;
|
|
437
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
438
|
+
forceUpdate({
|
|
439
|
+
inst
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
}, [subscribe, value, getSnapshot]);
|
|
443
|
+
useEffect2(function() {
|
|
444
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
445
|
+
forceUpdate({
|
|
446
|
+
inst
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
var handleStoreChange = function() {
|
|
450
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
451
|
+
forceUpdate({
|
|
452
|
+
inst
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
return subscribe(handleStoreChange);
|
|
457
|
+
}, [subscribe]);
|
|
458
|
+
useDebugValue(value);
|
|
459
|
+
return value;
|
|
460
|
+
}
|
|
461
|
+
function checkIfSnapshotChanged(inst) {
|
|
462
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
463
|
+
var prevValue = inst.value;
|
|
464
|
+
try {
|
|
465
|
+
var nextValue = latestGetSnapshot();
|
|
466
|
+
return !objectIs(prevValue, nextValue);
|
|
467
|
+
} catch (error2) {
|
|
468
|
+
return true;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
472
|
+
return getSnapshot();
|
|
473
|
+
}
|
|
474
|
+
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
475
|
+
var isServerEnvironment = !canUseDOM;
|
|
476
|
+
var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
477
|
+
var useSyncExternalStore$2 = React2.useSyncExternalStore !== void 0 ? React2.useSyncExternalStore : shim2;
|
|
478
|
+
useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
|
|
479
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
480
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
481
|
+
}
|
|
482
|
+
})();
|
|
483
|
+
}
|
|
484
|
+
return useSyncExternalStoreShim_development;
|
|
485
|
+
}
|
|
486
|
+
if (process.env.NODE_ENV === "production") {
|
|
487
|
+
shim.exports = requireUseSyncExternalStoreShim_production_min();
|
|
488
|
+
} else {
|
|
489
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
490
|
+
}
|
|
491
|
+
var shimExports = shim.exports;
|
|
492
|
+
const $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION = 1;
|
|
493
|
+
const $a86207c5d7f7e1fb$var$landmarkSymbol = Symbol.for("react-aria-landmark-manager");
|
|
494
|
+
function $a86207c5d7f7e1fb$var$subscribe(fn) {
|
|
495
|
+
document.addEventListener("react-aria-landmark-manager-change", fn);
|
|
496
|
+
return () => document.removeEventListener("react-aria-landmark-manager-change", fn);
|
|
497
|
+
}
|
|
498
|
+
function $a86207c5d7f7e1fb$var$getLandmarkManager() {
|
|
499
|
+
if (typeof document === "undefined")
|
|
500
|
+
return null;
|
|
501
|
+
let instance = document[$a86207c5d7f7e1fb$var$landmarkSymbol];
|
|
502
|
+
if (instance && instance.version >= $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION)
|
|
503
|
+
return instance;
|
|
504
|
+
document[$a86207c5d7f7e1fb$var$landmarkSymbol] = new $a86207c5d7f7e1fb$var$LandmarkManager();
|
|
505
|
+
document.dispatchEvent(new CustomEvent("react-aria-landmark-manager-change"));
|
|
506
|
+
return document[$a86207c5d7f7e1fb$var$landmarkSymbol];
|
|
507
|
+
}
|
|
508
|
+
function $a86207c5d7f7e1fb$var$useLandmarkManager() {
|
|
509
|
+
return shimExports.useSyncExternalStore($a86207c5d7f7e1fb$var$subscribe, $a86207c5d7f7e1fb$var$getLandmarkManager, $a86207c5d7f7e1fb$var$getLandmarkManager);
|
|
510
|
+
}
|
|
511
|
+
class $a86207c5d7f7e1fb$var$LandmarkManager {
|
|
512
|
+
setupIfNeeded() {
|
|
513
|
+
if (this.isListening)
|
|
514
|
+
return;
|
|
515
|
+
document.addEventListener("keydown", this.f6Handler, {
|
|
516
|
+
capture: true
|
|
517
|
+
});
|
|
518
|
+
document.addEventListener("focusin", this.focusinHandler, {
|
|
519
|
+
capture: true
|
|
520
|
+
});
|
|
521
|
+
document.addEventListener("focusout", this.focusoutHandler, {
|
|
522
|
+
capture: true
|
|
523
|
+
});
|
|
524
|
+
this.isListening = true;
|
|
525
|
+
}
|
|
526
|
+
teardownIfNeeded() {
|
|
527
|
+
if (!this.isListening || this.landmarks.length > 0 || this.refCount > 0)
|
|
528
|
+
return;
|
|
529
|
+
document.removeEventListener("keydown", this.f6Handler, {
|
|
530
|
+
capture: true
|
|
531
|
+
});
|
|
532
|
+
document.removeEventListener("focusin", this.focusinHandler, {
|
|
533
|
+
capture: true
|
|
534
|
+
});
|
|
535
|
+
document.removeEventListener("focusout", this.focusoutHandler, {
|
|
536
|
+
capture: true
|
|
537
|
+
});
|
|
538
|
+
this.isListening = false;
|
|
539
|
+
}
|
|
540
|
+
focusLandmark(landmark, direction) {
|
|
541
|
+
var _this_landmarks_find, _this_landmarks_find_focus;
|
|
542
|
+
(_this_landmarks_find = this.landmarks.find((l) => l.ref.current === landmark)) === null || _this_landmarks_find === void 0 ? void 0 : (_this_landmarks_find_focus = _this_landmarks_find.focus) === null || _this_landmarks_find_focus === void 0 ? void 0 : _this_landmarks_find_focus.call(_this_landmarks_find, direction);
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Return set of landmarks with a specific role.
|
|
546
|
+
*/
|
|
547
|
+
getLandmarksByRole(role) {
|
|
548
|
+
return new Set(this.landmarks.filter((l) => l.role === role));
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Return first landmark with a specific role.
|
|
552
|
+
*/
|
|
553
|
+
getLandmarkByRole(role) {
|
|
554
|
+
return this.landmarks.find((l) => l.role === role);
|
|
555
|
+
}
|
|
556
|
+
addLandmark(newLandmark) {
|
|
557
|
+
this.setupIfNeeded();
|
|
558
|
+
if (this.landmarks.find((landmark) => landmark.ref === newLandmark.ref) || !newLandmark.ref.current)
|
|
559
|
+
return;
|
|
560
|
+
if (this.landmarks.filter((landmark) => landmark.role === "main").length > 1)
|
|
561
|
+
console.error('Page can contain no more than one landmark with the role "main".');
|
|
562
|
+
if (this.landmarks.length === 0) {
|
|
563
|
+
this.landmarks = [
|
|
564
|
+
newLandmark
|
|
565
|
+
];
|
|
566
|
+
this.checkLabels(newLandmark.role);
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
let start = 0;
|
|
570
|
+
let end = this.landmarks.length - 1;
|
|
571
|
+
while (start <= end) {
|
|
572
|
+
let mid = Math.floor((start + end) / 2);
|
|
573
|
+
let comparedPosition = newLandmark.ref.current.compareDocumentPosition(this.landmarks[mid].ref.current);
|
|
574
|
+
let isNewAfterExisting = Boolean(comparedPosition & Node.DOCUMENT_POSITION_PRECEDING || comparedPosition & Node.DOCUMENT_POSITION_CONTAINS);
|
|
575
|
+
if (isNewAfterExisting)
|
|
576
|
+
start = mid + 1;
|
|
577
|
+
else
|
|
578
|
+
end = mid - 1;
|
|
579
|
+
}
|
|
580
|
+
this.landmarks.splice(start, 0, newLandmark);
|
|
581
|
+
this.checkLabels(newLandmark.role);
|
|
582
|
+
}
|
|
583
|
+
updateLandmark(landmark) {
|
|
584
|
+
let index = this.landmarks.findIndex((l) => l.ref === landmark.ref);
|
|
585
|
+
if (index >= 0) {
|
|
586
|
+
this.landmarks[index] = __spreadValues(__spreadValues({}, this.landmarks[index]), landmark);
|
|
587
|
+
this.checkLabels(this.landmarks[index].role);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
removeLandmark(ref) {
|
|
591
|
+
this.landmarks = this.landmarks.filter((landmark) => landmark.ref !== ref);
|
|
592
|
+
this.teardownIfNeeded();
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Warn if there are 2+ landmarks with the same role but no label.
|
|
596
|
+
* Labels for landmarks with the same role must also be unique.
|
|
597
|
+
*
|
|
598
|
+
* See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.
|
|
599
|
+
*/
|
|
600
|
+
checkLabels(role) {
|
|
601
|
+
let landmarksWithRole = this.getLandmarksByRole(role);
|
|
602
|
+
if (landmarksWithRole.size > 1) {
|
|
603
|
+
let duplicatesWithoutLabel = [
|
|
604
|
+
...landmarksWithRole
|
|
605
|
+
].filter((landmark) => !landmark.label);
|
|
606
|
+
if (duplicatesWithoutLabel.length > 0)
|
|
607
|
+
console.warn(`Page contains more than one landmark with the '${role}' 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: `, duplicatesWithoutLabel.map((landmark) => landmark.ref.current));
|
|
608
|
+
else {
|
|
609
|
+
let labels = [
|
|
610
|
+
...landmarksWithRole
|
|
611
|
+
].map((landmark) => landmark.label);
|
|
612
|
+
let duplicateLabels = labels.filter((item, index) => labels.indexOf(item) !== index);
|
|
613
|
+
duplicateLabels.forEach((label) => {
|
|
614
|
+
console.warn(`Page contains more than one landmark with the '${role}' role and '${label}' label. If two or more landmarks on a page share the same role, they must have unique labels: `, [
|
|
615
|
+
...landmarksWithRole
|
|
616
|
+
].filter((landmark) => landmark.label === label).map((landmark) => landmark.ref.current));
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Get the landmark that is the closest parent in the DOM.
|
|
623
|
+
* Returns undefined if no parent is a landmark.
|
|
624
|
+
*/
|
|
625
|
+
closestLandmark(element) {
|
|
626
|
+
let landmarkMap = new Map(this.landmarks.map((l) => [
|
|
627
|
+
l.ref.current,
|
|
628
|
+
l
|
|
629
|
+
]));
|
|
630
|
+
let currentElement = element;
|
|
631
|
+
while (currentElement && !landmarkMap.has(currentElement) && currentElement !== document.body && currentElement.parentElement)
|
|
632
|
+
currentElement = currentElement.parentElement;
|
|
633
|
+
return landmarkMap.get(currentElement);
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Gets the next landmark, in DOM focus order, or previous if backwards is specified.
|
|
637
|
+
* If last landmark, next should be the first landmark.
|
|
638
|
+
* If not inside a landmark, will return first landmark.
|
|
639
|
+
* Returns undefined if there are no landmarks.
|
|
640
|
+
*/
|
|
641
|
+
getNextLandmark(element, { backward }) {
|
|
642
|
+
var _this_landmarks_nextLandmarkIndex_ref_current;
|
|
643
|
+
let currentLandmark = this.closestLandmark(element);
|
|
644
|
+
let nextLandmarkIndex = backward ? this.landmarks.length - 1 : 0;
|
|
645
|
+
if (currentLandmark)
|
|
646
|
+
nextLandmarkIndex = this.landmarks.indexOf(currentLandmark) + (backward ? -1 : 1);
|
|
647
|
+
let wrapIfNeeded = () => {
|
|
648
|
+
if (nextLandmarkIndex < 0) {
|
|
649
|
+
if (!element.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
|
|
650
|
+
detail: {
|
|
651
|
+
direction: "backward"
|
|
652
|
+
},
|
|
653
|
+
bubbles: true,
|
|
654
|
+
cancelable: true
|
|
655
|
+
})))
|
|
656
|
+
return true;
|
|
657
|
+
nextLandmarkIndex = this.landmarks.length - 1;
|
|
658
|
+
} else if (nextLandmarkIndex >= this.landmarks.length) {
|
|
659
|
+
if (!element.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
|
|
660
|
+
detail: {
|
|
661
|
+
direction: "forward"
|
|
662
|
+
},
|
|
663
|
+
bubbles: true,
|
|
664
|
+
cancelable: true
|
|
665
|
+
})))
|
|
666
|
+
return true;
|
|
667
|
+
nextLandmarkIndex = 0;
|
|
668
|
+
}
|
|
669
|
+
if (nextLandmarkIndex < 0 || nextLandmarkIndex >= this.landmarks.length)
|
|
670
|
+
return true;
|
|
671
|
+
return false;
|
|
672
|
+
};
|
|
673
|
+
if (wrapIfNeeded())
|
|
674
|
+
return void 0;
|
|
675
|
+
let i = nextLandmarkIndex;
|
|
676
|
+
while ((_this_landmarks_nextLandmarkIndex_ref_current = this.landmarks[nextLandmarkIndex].ref.current) === null || _this_landmarks_nextLandmarkIndex_ref_current === void 0 ? void 0 : _this_landmarks_nextLandmarkIndex_ref_current.closest("[aria-hidden=true]")) {
|
|
677
|
+
nextLandmarkIndex += backward ? -1 : 1;
|
|
678
|
+
if (wrapIfNeeded())
|
|
679
|
+
return void 0;
|
|
680
|
+
if (nextLandmarkIndex === i)
|
|
681
|
+
break;
|
|
682
|
+
}
|
|
683
|
+
return this.landmarks[nextLandmarkIndex];
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Look at next landmark. If an element was previously focused inside, restore focus there.
|
|
687
|
+
* If not, focus the landmark itself.
|
|
688
|
+
* If no landmarks at all, or none with focusable elements, don't move focus.
|
|
689
|
+
*/
|
|
690
|
+
f6Handler(e) {
|
|
691
|
+
if (e.key === "F6") {
|
|
692
|
+
let handled = e.altKey ? this.focusMain() : this.navigate(e.target, e.shiftKey);
|
|
693
|
+
if (handled) {
|
|
694
|
+
e.preventDefault();
|
|
695
|
+
e.stopPropagation();
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
focusMain() {
|
|
700
|
+
let main = this.getLandmarkByRole("main");
|
|
701
|
+
if (main && main.ref.current && document.contains(main.ref.current)) {
|
|
702
|
+
this.focusLandmark(main.ref.current, "forward");
|
|
703
|
+
return true;
|
|
704
|
+
}
|
|
705
|
+
return false;
|
|
706
|
+
}
|
|
707
|
+
navigate(from, backward) {
|
|
708
|
+
let nextLandmark = this.getNextLandmark(from, {
|
|
709
|
+
backward
|
|
710
|
+
});
|
|
711
|
+
if (!nextLandmark)
|
|
712
|
+
return false;
|
|
713
|
+
if (nextLandmark.lastFocused) {
|
|
714
|
+
let lastFocused = nextLandmark.lastFocused;
|
|
715
|
+
if (document.body.contains(lastFocused)) {
|
|
716
|
+
lastFocused.focus();
|
|
717
|
+
return true;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
if (nextLandmark.ref.current && document.contains(nextLandmark.ref.current)) {
|
|
721
|
+
this.focusLandmark(nextLandmark.ref.current, backward ? "backward" : "forward");
|
|
722
|
+
return true;
|
|
723
|
+
}
|
|
724
|
+
return false;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Sets lastFocused for a landmark, if focus is moved within that landmark.
|
|
728
|
+
* Lets the last focused landmark know it was blurred if something else is focused.
|
|
729
|
+
*/
|
|
730
|
+
focusinHandler(e) {
|
|
731
|
+
let currentLandmark = this.closestLandmark(e.target);
|
|
732
|
+
if (currentLandmark && currentLandmark.ref.current !== e.target)
|
|
733
|
+
this.updateLandmark({
|
|
734
|
+
ref: currentLandmark.ref,
|
|
735
|
+
lastFocused: e.target
|
|
736
|
+
});
|
|
737
|
+
let previousFocusedElement = e.relatedTarget;
|
|
738
|
+
if (previousFocusedElement) {
|
|
739
|
+
let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);
|
|
740
|
+
if (closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement)
|
|
741
|
+
closestPreviousLandmark.blur();
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had focus.
|
|
746
|
+
*/
|
|
747
|
+
focusoutHandler(e) {
|
|
748
|
+
let previousFocusedElement = e.target;
|
|
749
|
+
let nextFocusedElement = e.relatedTarget;
|
|
750
|
+
if (!nextFocusedElement || nextFocusedElement === document) {
|
|
751
|
+
let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);
|
|
752
|
+
if (closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement)
|
|
753
|
+
closestPreviousLandmark.blur();
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
createLandmarkController() {
|
|
757
|
+
let instance = this;
|
|
758
|
+
instance.refCount++;
|
|
759
|
+
instance.setupIfNeeded();
|
|
760
|
+
return {
|
|
761
|
+
navigate(direction, opts) {
|
|
762
|
+
let element = (opts === null || opts === void 0 ? void 0 : opts.from) || document.activeElement;
|
|
763
|
+
return instance.navigate(element, direction === "backward");
|
|
764
|
+
},
|
|
765
|
+
focusNext(opts) {
|
|
766
|
+
let element = (opts === null || opts === void 0 ? void 0 : opts.from) || document.activeElement;
|
|
767
|
+
return instance.navigate(element, false);
|
|
768
|
+
},
|
|
769
|
+
focusPrevious(opts) {
|
|
770
|
+
let element = (opts === null || opts === void 0 ? void 0 : opts.from) || document.activeElement;
|
|
771
|
+
return instance.navigate(element, true);
|
|
772
|
+
},
|
|
773
|
+
focusMain() {
|
|
774
|
+
return instance.focusMain();
|
|
775
|
+
},
|
|
776
|
+
dispose() {
|
|
777
|
+
if (instance) {
|
|
778
|
+
instance.refCount--;
|
|
779
|
+
instance.teardownIfNeeded();
|
|
780
|
+
instance = null;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
registerLandmark(landmark) {
|
|
786
|
+
if (this.landmarks.find((l) => l.ref === landmark.ref))
|
|
787
|
+
this.updateLandmark(landmark);
|
|
788
|
+
else
|
|
789
|
+
this.addLandmark(landmark);
|
|
790
|
+
return () => this.removeLandmark(landmark.ref);
|
|
791
|
+
}
|
|
792
|
+
constructor() {
|
|
793
|
+
this.landmarks = [];
|
|
794
|
+
this.isListening = false;
|
|
795
|
+
this.refCount = 0;
|
|
796
|
+
this.version = $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION;
|
|
797
|
+
this.f6Handler = this.f6Handler.bind(this);
|
|
798
|
+
this.focusinHandler = this.focusinHandler.bind(this);
|
|
799
|
+
this.focusoutHandler = this.focusoutHandler.bind(this);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
function $a86207c5d7f7e1fb$export$4cc632584fd87fae(props, ref) {
|
|
803
|
+
const { role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, focus } = props;
|
|
804
|
+
let manager = $a86207c5d7f7e1fb$var$useLandmarkManager();
|
|
805
|
+
let label = ariaLabel || ariaLabelledby;
|
|
806
|
+
let [isLandmarkFocused, setIsLandmarkFocused] = useState(false);
|
|
807
|
+
let defaultFocus = useCallback(() => {
|
|
808
|
+
setIsLandmarkFocused(true);
|
|
809
|
+
}, [
|
|
810
|
+
setIsLandmarkFocused
|
|
811
|
+
]);
|
|
812
|
+
let blur = useCallback(() => {
|
|
813
|
+
setIsLandmarkFocused(false);
|
|
814
|
+
}, [
|
|
815
|
+
setIsLandmarkFocused
|
|
816
|
+
]);
|
|
817
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
818
|
+
if (manager)
|
|
819
|
+
return manager.registerLandmark({
|
|
820
|
+
ref,
|
|
821
|
+
label,
|
|
822
|
+
role,
|
|
823
|
+
focus: focus || defaultFocus,
|
|
824
|
+
blur
|
|
825
|
+
});
|
|
826
|
+
}, [
|
|
827
|
+
manager,
|
|
828
|
+
label,
|
|
829
|
+
ref,
|
|
830
|
+
role,
|
|
831
|
+
focus,
|
|
832
|
+
defaultFocus,
|
|
833
|
+
blur
|
|
834
|
+
]);
|
|
835
|
+
useEffect(() => {
|
|
836
|
+
var _ref_current;
|
|
837
|
+
if (isLandmarkFocused)
|
|
838
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
|
|
839
|
+
}, [
|
|
840
|
+
isLandmarkFocused,
|
|
841
|
+
ref
|
|
842
|
+
]);
|
|
843
|
+
return {
|
|
844
|
+
landmarkProps: {
|
|
845
|
+
role,
|
|
846
|
+
tabIndex: isLandmarkFocused ? -1 : void 0,
|
|
847
|
+
"aria-label": ariaLabel,
|
|
848
|
+
"aria-labelledby": ariaLabelledby
|
|
849
|
+
}
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
function $parcel$interopDefault(a) {
|
|
853
|
+
return a && a.__esModule ? a.default : a;
|
|
854
|
+
}
|
|
855
|
+
var $7853651519a70071$exports = {};
|
|
856
|
+
var $ff9177efc58547ad$exports = {};
|
|
857
|
+
$ff9177efc58547ad$exports = {
|
|
858
|
+
"close": `إغلاق`,
|
|
859
|
+
"notifications": `إشعارات`
|
|
860
|
+
};
|
|
861
|
+
var $25eb7c0c0c45e544$exports = {};
|
|
862
|
+
$25eb7c0c0c45e544$exports = {
|
|
863
|
+
"close": `Затвори`,
|
|
864
|
+
"notifications": `Известия`
|
|
865
|
+
};
|
|
866
|
+
var $28feffc3d61a8691$exports = {};
|
|
867
|
+
$28feffc3d61a8691$exports = {
|
|
868
|
+
"close": `Zavřít`,
|
|
869
|
+
"notifications": `Upozornění`
|
|
870
|
+
};
|
|
871
|
+
var $390d441203d25ff4$exports = {};
|
|
872
|
+
$390d441203d25ff4$exports = {
|
|
873
|
+
"close": `Luk`,
|
|
874
|
+
"notifications": `Påmindelser`
|
|
875
|
+
};
|
|
876
|
+
var $7063c2d0f14f979a$exports = {};
|
|
877
|
+
$7063c2d0f14f979a$exports = {
|
|
878
|
+
"close": `Schließen`,
|
|
879
|
+
"notifications": `Benachrichtigungen`
|
|
880
|
+
};
|
|
881
|
+
var $2dfc1dbb6590af88$exports = {};
|
|
882
|
+
$2dfc1dbb6590af88$exports = {
|
|
883
|
+
"close": `Κλείσιμο`,
|
|
884
|
+
"notifications": `Ειδοποιήσεις`
|
|
885
|
+
};
|
|
886
|
+
var $9a12ff1caae5a7a5$exports = {};
|
|
887
|
+
$9a12ff1caae5a7a5$exports = {
|
|
888
|
+
"close": `Close`,
|
|
889
|
+
"notifications": `Notifications`
|
|
890
|
+
};
|
|
891
|
+
var $f4095fb5a72adbe6$exports = {};
|
|
892
|
+
$f4095fb5a72adbe6$exports = {
|
|
893
|
+
"close": `Cerrar`,
|
|
894
|
+
"notifications": `Notificaciones`
|
|
895
|
+
};
|
|
896
|
+
var $75bc5191b9d7826a$exports = {};
|
|
897
|
+
$75bc5191b9d7826a$exports = {
|
|
898
|
+
"close": `Sule`,
|
|
899
|
+
"notifications": `Teated`
|
|
900
|
+
};
|
|
901
|
+
var $e4b9aef18b0db8dc$exports = {};
|
|
902
|
+
$e4b9aef18b0db8dc$exports = {
|
|
903
|
+
"close": `Sulje`,
|
|
904
|
+
"notifications": `Ilmoitukset`
|
|
905
|
+
};
|
|
906
|
+
var $888756784d832bd7$exports = {};
|
|
907
|
+
$888756784d832bd7$exports = {
|
|
908
|
+
"close": `Fermer`,
|
|
909
|
+
"notifications": `Notifications`
|
|
910
|
+
};
|
|
911
|
+
var $6835949b68a1fabf$exports = {};
|
|
912
|
+
$6835949b68a1fabf$exports = {
|
|
913
|
+
"close": `סגור`,
|
|
914
|
+
"notifications": `התראות`
|
|
915
|
+
};
|
|
916
|
+
var $87ffcbc0b651e40b$exports = {};
|
|
917
|
+
$87ffcbc0b651e40b$exports = {
|
|
918
|
+
"close": `Zatvori`,
|
|
919
|
+
"notifications": `Obavijesti`
|
|
920
|
+
};
|
|
921
|
+
var $dc6e3b2813600d69$exports = {};
|
|
922
|
+
$dc6e3b2813600d69$exports = {
|
|
923
|
+
"close": `Bezárás`,
|
|
924
|
+
"notifications": `Értesítések`
|
|
925
|
+
};
|
|
926
|
+
var $fe136bcbacfcfa14$exports = {};
|
|
927
|
+
$fe136bcbacfcfa14$exports = {
|
|
928
|
+
"close": `Chiudi`,
|
|
929
|
+
"notifications": `Notifiche`
|
|
930
|
+
};
|
|
931
|
+
var $8fb53a929b46df83$exports = {};
|
|
932
|
+
$8fb53a929b46df83$exports = {
|
|
933
|
+
"close": `閉じる`,
|
|
934
|
+
"notifications": `通知`
|
|
935
|
+
};
|
|
936
|
+
var $2c38dbfaf041a865$exports = {};
|
|
937
|
+
$2c38dbfaf041a865$exports = {
|
|
938
|
+
"close": `닫기`,
|
|
939
|
+
"notifications": `알림`
|
|
940
|
+
};
|
|
941
|
+
var $48f3f33a29908d4c$exports = {};
|
|
942
|
+
$48f3f33a29908d4c$exports = {
|
|
943
|
+
"close": `Uždaryti`,
|
|
944
|
+
"notifications": `Pranešimai`
|
|
945
|
+
};
|
|
946
|
+
var $9867160d996455a0$exports = {};
|
|
947
|
+
$9867160d996455a0$exports = {
|
|
948
|
+
"close": `Aizvērt`,
|
|
949
|
+
"notifications": `Paziņojumi`
|
|
950
|
+
};
|
|
951
|
+
var $196258ea25c96487$exports = {};
|
|
952
|
+
$196258ea25c96487$exports = {
|
|
953
|
+
"close": `Lukk`,
|
|
954
|
+
"notifications": `Varsler`
|
|
955
|
+
};
|
|
956
|
+
var $949061cb954e8000$exports = {};
|
|
957
|
+
$949061cb954e8000$exports = {
|
|
958
|
+
"close": `Sluiten`,
|
|
959
|
+
"notifications": `Meldingen`
|
|
960
|
+
};
|
|
961
|
+
var $8189bed27add1ad3$exports = {};
|
|
962
|
+
$8189bed27add1ad3$exports = {
|
|
963
|
+
"close": `Zamknij`,
|
|
964
|
+
"notifications": `Powiadomienia`
|
|
965
|
+
};
|
|
966
|
+
var $a361756a93b6e28c$exports = {};
|
|
967
|
+
$a361756a93b6e28c$exports = {
|
|
968
|
+
"close": `Fechar`,
|
|
969
|
+
"notifications": `Notificações`
|
|
970
|
+
};
|
|
971
|
+
var $034c7393857c8db0$exports = {};
|
|
972
|
+
$034c7393857c8db0$exports = {
|
|
973
|
+
"close": `Fechar`,
|
|
974
|
+
"notifications": `Notificações`
|
|
975
|
+
};
|
|
976
|
+
var $e33d3b3868478b04$exports = {};
|
|
977
|
+
$e33d3b3868478b04$exports = {
|
|
978
|
+
"close": `Închideţi`,
|
|
979
|
+
"notifications": `Notificări`
|
|
980
|
+
};
|
|
981
|
+
var $9a7dcb914b29cd9f$exports = {};
|
|
982
|
+
$9a7dcb914b29cd9f$exports = {
|
|
983
|
+
"close": `Закрыть`,
|
|
984
|
+
"notifications": `Уведомления`
|
|
985
|
+
};
|
|
986
|
+
var $e43d964a0c7f1266$exports = {};
|
|
987
|
+
$e43d964a0c7f1266$exports = {
|
|
988
|
+
"close": `Zatvoriť`,
|
|
989
|
+
"notifications": `Oznámenia`
|
|
990
|
+
};
|
|
991
|
+
var $0bc56cee3275bcaa$exports = {};
|
|
992
|
+
$0bc56cee3275bcaa$exports = {
|
|
993
|
+
"close": `Zapri`,
|
|
994
|
+
"notifications": `Obvestila`
|
|
995
|
+
};
|
|
996
|
+
var $7dbdd7289c10d2ba$exports = {};
|
|
997
|
+
$7dbdd7289c10d2ba$exports = {
|
|
998
|
+
"close": `Zatvori`,
|
|
999
|
+
"notifications": `Obaveštenja`
|
|
1000
|
+
};
|
|
1001
|
+
var $ccbe6066c10b1e53$exports = {};
|
|
1002
|
+
$ccbe6066c10b1e53$exports = {
|
|
1003
|
+
"close": `Stäng`,
|
|
1004
|
+
"notifications": `Aviseringar`
|
|
1005
|
+
};
|
|
1006
|
+
var $9d503476b9d858b7$exports = {};
|
|
1007
|
+
$9d503476b9d858b7$exports = {
|
|
1008
|
+
"close": `Kapat`,
|
|
1009
|
+
"notifications": `Bildirimler`
|
|
1010
|
+
};
|
|
1011
|
+
var $32ee419c7b9b7a83$exports = {};
|
|
1012
|
+
$32ee419c7b9b7a83$exports = {
|
|
1013
|
+
"close": `Закрити`,
|
|
1014
|
+
"notifications": `Сповіщення`
|
|
1015
|
+
};
|
|
1016
|
+
var $122525af1cb737c7$exports = {};
|
|
1017
|
+
$122525af1cb737c7$exports = {
|
|
1018
|
+
"close": `关闭`,
|
|
1019
|
+
"notifications": `通知`
|
|
1020
|
+
};
|
|
1021
|
+
var $52e8b1b00094e5a3$exports = {};
|
|
1022
|
+
$52e8b1b00094e5a3$exports = {
|
|
1023
|
+
"close": `關閉`,
|
|
1024
|
+
"notifications": `通知`
|
|
1025
|
+
};
|
|
1026
|
+
$7853651519a70071$exports = {
|
|
1027
|
+
"ar-AE": $ff9177efc58547ad$exports,
|
|
1028
|
+
"bg-BG": $25eb7c0c0c45e544$exports,
|
|
1029
|
+
"cs-CZ": $28feffc3d61a8691$exports,
|
|
1030
|
+
"da-DK": $390d441203d25ff4$exports,
|
|
1031
|
+
"de-DE": $7063c2d0f14f979a$exports,
|
|
1032
|
+
"el-GR": $2dfc1dbb6590af88$exports,
|
|
1033
|
+
"en-US": $9a12ff1caae5a7a5$exports,
|
|
1034
|
+
"es-ES": $f4095fb5a72adbe6$exports,
|
|
1035
|
+
"et-EE": $75bc5191b9d7826a$exports,
|
|
1036
|
+
"fi-FI": $e4b9aef18b0db8dc$exports,
|
|
1037
|
+
"fr-FR": $888756784d832bd7$exports,
|
|
1038
|
+
"he-IL": $6835949b68a1fabf$exports,
|
|
1039
|
+
"hr-HR": $87ffcbc0b651e40b$exports,
|
|
1040
|
+
"hu-HU": $dc6e3b2813600d69$exports,
|
|
1041
|
+
"it-IT": $fe136bcbacfcfa14$exports,
|
|
1042
|
+
"ja-JP": $8fb53a929b46df83$exports,
|
|
1043
|
+
"ko-KR": $2c38dbfaf041a865$exports,
|
|
1044
|
+
"lt-LT": $48f3f33a29908d4c$exports,
|
|
1045
|
+
"lv-LV": $9867160d996455a0$exports,
|
|
1046
|
+
"nb-NO": $196258ea25c96487$exports,
|
|
1047
|
+
"nl-NL": $949061cb954e8000$exports,
|
|
1048
|
+
"pl-PL": $8189bed27add1ad3$exports,
|
|
1049
|
+
"pt-BR": $a361756a93b6e28c$exports,
|
|
1050
|
+
"pt-PT": $034c7393857c8db0$exports,
|
|
1051
|
+
"ro-RO": $e33d3b3868478b04$exports,
|
|
1052
|
+
"ru-RU": $9a7dcb914b29cd9f$exports,
|
|
1053
|
+
"sk-SK": $e43d964a0c7f1266$exports,
|
|
1054
|
+
"sl-SI": $0bc56cee3275bcaa$exports,
|
|
1055
|
+
"sr-SP": $7dbdd7289c10d2ba$exports,
|
|
1056
|
+
"sv-SE": $ccbe6066c10b1e53$exports,
|
|
1057
|
+
"tr-TR": $9d503476b9d858b7$exports,
|
|
1058
|
+
"uk-UA": $32ee419c7b9b7a83$exports,
|
|
1059
|
+
"zh-CN": $122525af1cb737c7$exports,
|
|
1060
|
+
"zh-TW": $52e8b1b00094e5a3$exports
|
|
1061
|
+
};
|
|
1062
|
+
function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
1063
|
+
let { key, timer, timeout, animation } = props.toast;
|
|
1064
|
+
useEffect(() => {
|
|
1065
|
+
if (!timer)
|
|
1066
|
+
return;
|
|
1067
|
+
timer.reset(timeout);
|
|
1068
|
+
return () => {
|
|
1069
|
+
timer.pause();
|
|
1070
|
+
};
|
|
1071
|
+
}, [
|
|
1072
|
+
timer,
|
|
1073
|
+
timeout
|
|
1074
|
+
]);
|
|
1075
|
+
let focusOnUnmount = useRef(null);
|
|
1076
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
1077
|
+
let container2 = ref.current.closest("[role=region]");
|
|
1078
|
+
return () => {
|
|
1079
|
+
if (container2 && container2.contains(document.activeElement))
|
|
1080
|
+
focusOnUnmount.current = container2;
|
|
1081
|
+
};
|
|
1082
|
+
}, [
|
|
1083
|
+
ref
|
|
1084
|
+
]);
|
|
1085
|
+
useEffect(() => {
|
|
1086
|
+
return () => {
|
|
1087
|
+
if (focusOnUnmount.current)
|
|
1088
|
+
focusOnUnmount.current.focus();
|
|
1089
|
+
};
|
|
1090
|
+
}, [
|
|
1091
|
+
ref
|
|
1092
|
+
]);
|
|
1093
|
+
let titleId = $bdb11010cef70236$export$f680877a34711e37();
|
|
1094
|
+
let descriptionId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
|
|
1095
|
+
let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1(/* @__PURE__ */ $parcel$interopDefault($7853651519a70071$exports));
|
|
1096
|
+
return {
|
|
1097
|
+
toastProps: {
|
|
1098
|
+
role: "alert",
|
|
1099
|
+
"aria-label": props["aria-label"],
|
|
1100
|
+
"aria-labelledby": props["aria-labelledby"] || titleId,
|
|
1101
|
+
"aria-describedby": props["aria-describedby"] || descriptionId,
|
|
1102
|
+
"aria-details": props["aria-details"],
|
|
1103
|
+
// Hide toasts that are animating out so VoiceOver doesn't announce them.
|
|
1104
|
+
"aria-hidden": animation === "exiting" ? "true" : void 0
|
|
1105
|
+
},
|
|
1106
|
+
titleProps: {
|
|
1107
|
+
id: titleId
|
|
1108
|
+
},
|
|
1109
|
+
descriptionProps: {
|
|
1110
|
+
id: descriptionId
|
|
1111
|
+
},
|
|
1112
|
+
closeButtonProps: {
|
|
1113
|
+
"aria-label": stringFormatter.format("close"),
|
|
1114
|
+
onPress: () => state.close(key)
|
|
1115
|
+
}
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
|
|
1119
|
+
let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1(/* @__PURE__ */ $parcel$interopDefault($7853651519a70071$exports));
|
|
1120
|
+
let { landmarkProps } = $a86207c5d7f7e1fb$export$4cc632584fd87fae({
|
|
1121
|
+
role: "region",
|
|
1122
|
+
"aria-label": props["aria-label"] || stringFormatter.format("notifications")
|
|
1123
|
+
}, ref);
|
|
1124
|
+
let { hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({
|
|
1125
|
+
onHoverStart: state.pauseAll,
|
|
1126
|
+
onHoverEnd: state.resumeAll
|
|
1127
|
+
});
|
|
1128
|
+
let lastFocused = useRef(null);
|
|
1129
|
+
let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
|
|
1130
|
+
onFocusWithin: (e) => {
|
|
1131
|
+
state.pauseAll();
|
|
1132
|
+
lastFocused.current = e.relatedTarget;
|
|
1133
|
+
},
|
|
1134
|
+
onBlurWithin: () => {
|
|
1135
|
+
state.resumeAll();
|
|
1136
|
+
lastFocused.current = null;
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
useEffect(() => {
|
|
1140
|
+
return () => {
|
|
1141
|
+
if (lastFocused.current && document.body.contains(lastFocused.current)) {
|
|
1142
|
+
if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "pointer")
|
|
1143
|
+
$7215afc6de606d6b$export$de79e2c695e052f3(lastFocused.current);
|
|
1144
|
+
else
|
|
1145
|
+
lastFocused.current.focus();
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
}, [
|
|
1149
|
+
ref
|
|
1150
|
+
]);
|
|
1151
|
+
return {
|
|
1152
|
+
regionProps: $3ef42575df84b30b$export$9d1611c77c2fe928(landmarkProps, hoverProps, focusWithinProps, {
|
|
1153
|
+
tabIndex: -1,
|
|
1154
|
+
// Mark the toast region as a "top layer", so that it:
|
|
1155
|
+
// - is not aria-hidden when opening an overlay
|
|
1156
|
+
// - allows focus even outside a containing focus scope
|
|
1157
|
+
// - doesn’t dismiss overlays when clicking on it, even though it is outside
|
|
1158
|
+
// @ts-ignore
|
|
1159
|
+
"data-react-aria-top-layer": true
|
|
1160
|
+
})
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
const statusPromotional = "_statusPromotional_isx2s_5";
|
|
1164
|
+
const statusSuccess = "_statusSuccess_isx2s_10";
|
|
1165
|
+
const statusNeutral = "_statusNeutral_isx2s_15";
|
|
1166
|
+
const statusWarning = "_statusWarning_isx2s_20";
|
|
1167
|
+
const statusError = "_statusError_isx2s_25";
|
|
1168
|
+
const typeToast = "_typeToast_isx2s_30";
|
|
1169
|
+
const typeAlert = "_typeAlert_isx2s_34";
|
|
1170
|
+
const Notification$1 = "_Notification_isx2s_39";
|
|
1171
|
+
const iconText = "_iconText_isx2s_55";
|
|
1172
|
+
const closeButton = "_closeButton_isx2s_61";
|
|
1173
|
+
const region = "_region_isx2s_71";
|
|
1174
|
+
const container = "_container_isx2s_77";
|
|
1175
|
+
const styles = {
|
|
1176
|
+
statusPromotional,
|
|
1177
|
+
statusSuccess,
|
|
1178
|
+
statusNeutral,
|
|
1179
|
+
statusWarning,
|
|
1180
|
+
statusError,
|
|
1181
|
+
typeToast,
|
|
1182
|
+
typeAlert,
|
|
1183
|
+
Notification: Notification$1,
|
|
1184
|
+
iconText,
|
|
1185
|
+
closeButton,
|
|
1186
|
+
region,
|
|
1187
|
+
container
|
|
1188
|
+
};
|
|
1189
|
+
function NotificationRegion(props) {
|
|
1190
|
+
const { state } = props;
|
|
1191
|
+
const ref = React__default.useRef(null);
|
|
1192
|
+
const { regionProps } = $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref);
|
|
1193
|
+
return React__default.createElement("div", __spreadProps(__spreadValues({}, regionProps), {
|
|
1194
|
+
ref,
|
|
1195
|
+
className: styles.region
|
|
1196
|
+
}), state.visibleToasts.map((toast) => React__default.createElement(Notification, {
|
|
1197
|
+
key: toast.key,
|
|
1198
|
+
toast,
|
|
1199
|
+
state
|
|
1200
|
+
})));
|
|
1201
|
+
}
|
|
1202
|
+
function NotificationContainer(props) {
|
|
1203
|
+
const { getContainer = null, position = "fixed", offset, state } = props;
|
|
1204
|
+
const showNotifications = state.visibleToasts.length > 0;
|
|
1205
|
+
let requestFailed = false;
|
|
1206
|
+
let container2 = null;
|
|
1207
|
+
if (showNotifications && getContainer) {
|
|
1208
|
+
container2 = getContainer();
|
|
1209
|
+
requestFailed = container2 === null;
|
|
1210
|
+
}
|
|
1211
|
+
const positionStyleProps = offset && !requestFailed ? {
|
|
1212
|
+
top: offset == null ? void 0 : offset.top,
|
|
1213
|
+
right: offset == null ? void 0 : offset.right,
|
|
1214
|
+
bottom: offset == null ? void 0 : offset.bottom,
|
|
1215
|
+
left: offset == null ? void 0 : offset.left
|
|
1216
|
+
} : {
|
|
1217
|
+
top: 0,
|
|
1218
|
+
left: 0
|
|
1219
|
+
};
|
|
1220
|
+
const positionProps = {
|
|
1221
|
+
position: !requestFailed ? position : "fixed"
|
|
1222
|
+
};
|
|
1223
|
+
const containerStyles = __spreadValues(__spreadValues({}, positionStyleProps), positionProps);
|
|
1224
|
+
return React__default.createElement(React__default.Fragment, null, showNotifications ? createPortal(React__default.createElement("div", {
|
|
1225
|
+
className: styles.container,
|
|
1226
|
+
style: containerStyles
|
|
1227
|
+
}, React__default.createElement(NotificationRegion, {
|
|
1228
|
+
state
|
|
1229
|
+
})), container2 != null ? container2 : document.body) : null);
|
|
1230
|
+
}
|
|
1231
|
+
function $77b352cf12efcf73$export$84726ef35ca2129a(queue) {
|
|
1232
|
+
let subscribe = useCallback((fn) => queue.subscribe(fn), [
|
|
1233
|
+
queue
|
|
1234
|
+
]);
|
|
1235
|
+
let getSnapshot = useCallback(() => queue.visibleToasts, [
|
|
1236
|
+
queue
|
|
1237
|
+
]);
|
|
1238
|
+
let visibleToasts = shimExports.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
1239
|
+
return {
|
|
1240
|
+
visibleToasts,
|
|
1241
|
+
add: (content, options) => queue.add(content, options),
|
|
1242
|
+
close: (key) => queue.close(key),
|
|
1243
|
+
remove: (key) => queue.remove(key),
|
|
1244
|
+
pauseAll: () => queue.pauseAll(),
|
|
1245
|
+
resumeAll: () => queue.resumeAll()
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
class $77b352cf12efcf73$export$f1f8569633bbbec4 {
|
|
1249
|
+
/** Subscribes to updates to the visible toasts. */
|
|
1250
|
+
subscribe(fn) {
|
|
1251
|
+
this.subscriptions.add(fn);
|
|
1252
|
+
return () => this.subscriptions.delete(fn);
|
|
1253
|
+
}
|
|
1254
|
+
/** Adds a new toast to the queue. */
|
|
1255
|
+
add(content, options = {}) {
|
|
1256
|
+
let toastKey = Math.random().toString(36);
|
|
1257
|
+
let toast = __spreadProps(__spreadValues({}, options), {
|
|
1258
|
+
content,
|
|
1259
|
+
key: toastKey,
|
|
1260
|
+
timer: options.timeout ? new $77b352cf12efcf73$var$Timer(() => this.close(toastKey), options.timeout) : null
|
|
1261
|
+
});
|
|
1262
|
+
let low = 0;
|
|
1263
|
+
let high = this.queue.length;
|
|
1264
|
+
while (low < high) {
|
|
1265
|
+
let mid = Math.floor((low + high) / 2);
|
|
1266
|
+
if ((toast.priority || 0) > (this.queue[mid].priority || 0))
|
|
1267
|
+
high = mid;
|
|
1268
|
+
else
|
|
1269
|
+
low = mid + 1;
|
|
1270
|
+
}
|
|
1271
|
+
this.queue.splice(low, 0, toast);
|
|
1272
|
+
toast.animation = low < this.maxVisibleToasts ? "entering" : "queued";
|
|
1273
|
+
let i = this.maxVisibleToasts;
|
|
1274
|
+
while (i < this.queue.length)
|
|
1275
|
+
this.queue[i++].animation = "queued";
|
|
1276
|
+
this.updateVisibleToasts();
|
|
1277
|
+
return toastKey;
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Closes a toast. If `hasExitAnimation` is true, the toast
|
|
1281
|
+
* transitions to an "exiting" state instead of being removed immediately.
|
|
1282
|
+
*/
|
|
1283
|
+
close(key) {
|
|
1284
|
+
let index = this.queue.findIndex((t) => t.key === key);
|
|
1285
|
+
if (index >= 0) {
|
|
1286
|
+
var _this_queue_index, _this_queue_index_onClose;
|
|
1287
|
+
(_this_queue_index_onClose = (_this_queue_index = this.queue[index]).onClose) === null || _this_queue_index_onClose === void 0 ? void 0 : _this_queue_index_onClose.call(_this_queue_index);
|
|
1288
|
+
this.queue.splice(index, 1);
|
|
1289
|
+
}
|
|
1290
|
+
this.updateVisibleToasts();
|
|
1291
|
+
}
|
|
1292
|
+
/** Removes a toast from the visible toasts after an exiting animation. */
|
|
1293
|
+
remove(key) {
|
|
1294
|
+
this.visibleToasts = this.visibleToasts.filter((t) => t.key !== key);
|
|
1295
|
+
this.updateVisibleToasts();
|
|
1296
|
+
}
|
|
1297
|
+
updateVisibleToasts() {
|
|
1298
|
+
let toasts = this.queue.slice(0, this.maxVisibleToasts);
|
|
1299
|
+
if (this.hasExitAnimation) {
|
|
1300
|
+
let prevToasts = this.visibleToasts.filter((t) => !toasts.some((t2) => t.key === t2.key)).map((t) => __spreadProps(__spreadValues({}, t), {
|
|
1301
|
+
animation: "exiting"
|
|
1302
|
+
}));
|
|
1303
|
+
this.visibleToasts = prevToasts.concat(toasts).sort((a, b) => b.priority - a.priority);
|
|
1304
|
+
} else
|
|
1305
|
+
this.visibleToasts = toasts;
|
|
1306
|
+
for (let fn of this.subscriptions)
|
|
1307
|
+
fn();
|
|
1308
|
+
}
|
|
1309
|
+
/** Pauses the timers for all visible toasts. */
|
|
1310
|
+
pauseAll() {
|
|
1311
|
+
for (let toast of this.visibleToasts)
|
|
1312
|
+
if (toast.timer)
|
|
1313
|
+
toast.timer.pause();
|
|
1314
|
+
}
|
|
1315
|
+
/** Resumes the timers for all visible toasts. */
|
|
1316
|
+
resumeAll() {
|
|
1317
|
+
for (let toast of this.visibleToasts)
|
|
1318
|
+
if (toast.timer)
|
|
1319
|
+
toast.timer.resume();
|
|
1320
|
+
}
|
|
1321
|
+
constructor(options) {
|
|
1322
|
+
this.queue = [];
|
|
1323
|
+
this.subscriptions = /* @__PURE__ */ new Set();
|
|
1324
|
+
this.visibleToasts = [];
|
|
1325
|
+
var _options_maxVisibleToasts;
|
|
1326
|
+
this.maxVisibleToasts = (_options_maxVisibleToasts = options === null || options === void 0 ? void 0 : options.maxVisibleToasts) !== null && _options_maxVisibleToasts !== void 0 ? _options_maxVisibleToasts : 1;
|
|
1327
|
+
var _options_hasExitAnimation;
|
|
1328
|
+
this.hasExitAnimation = (_options_hasExitAnimation = options === null || options === void 0 ? void 0 : options.hasExitAnimation) !== null && _options_hasExitAnimation !== void 0 ? _options_hasExitAnimation : false;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
class $77b352cf12efcf73$var$Timer {
|
|
1332
|
+
reset(delay) {
|
|
1333
|
+
this.remaining = delay;
|
|
1334
|
+
this.resume();
|
|
1335
|
+
}
|
|
1336
|
+
pause() {
|
|
1337
|
+
if (this.timerId == null)
|
|
1338
|
+
return;
|
|
1339
|
+
clearTimeout(this.timerId);
|
|
1340
|
+
this.timerId = null;
|
|
1341
|
+
this.remaining -= Date.now() - this.startTime;
|
|
1342
|
+
}
|
|
1343
|
+
resume() {
|
|
1344
|
+
if (this.remaining <= 0)
|
|
1345
|
+
return;
|
|
1346
|
+
this.startTime = Date.now();
|
|
1347
|
+
this.timerId = setTimeout(() => {
|
|
1348
|
+
this.timerId = null;
|
|
1349
|
+
this.remaining = 0;
|
|
1350
|
+
this.callback();
|
|
1351
|
+
}, this.remaining);
|
|
1352
|
+
}
|
|
1353
|
+
constructor(callback, delay) {
|
|
1354
|
+
this.remaining = delay;
|
|
1355
|
+
this.callback = callback;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
const TOAST_TIMEOUT_DURATION = 4e3;
|
|
1359
|
+
class EasyUINotificationQueue extends $77b352cf12efcf73$export$f1f8569633bbbec4 {
|
|
1360
|
+
constructor(options) {
|
|
1361
|
+
super(options);
|
|
1362
|
+
this.activeNotificationKey = "";
|
|
1363
|
+
}
|
|
1364
|
+
closeActiveNotification() {
|
|
1365
|
+
if (this.activeNotificationKey) {
|
|
1366
|
+
super.close(this.activeNotificationKey);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
alert(content) {
|
|
1370
|
+
this.closeActiveNotification();
|
|
1371
|
+
this.activeNotificationKey = super.add(content);
|
|
1372
|
+
}
|
|
1373
|
+
toast(content) {
|
|
1374
|
+
this.closeActiveNotification();
|
|
1375
|
+
this.activeNotificationKey = super.add(content, {
|
|
1376
|
+
timeout: TOAST_TIMEOUT_DURATION
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
function useNotificationState() {
|
|
1381
|
+
const queue = useMemo(() => new EasyUINotificationQueue(), []);
|
|
1382
|
+
const state = $77b352cf12efcf73$export$84726ef35ca2129a(queue);
|
|
1383
|
+
return __spreadProps(__spreadValues({}, state), {
|
|
1384
|
+
showPromotionalAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), {
|
|
1385
|
+
status: "promotional",
|
|
1386
|
+
type: "alert"
|
|
1387
|
+
})),
|
|
1388
|
+
showNeutralAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), {
|
|
1389
|
+
status: "neutral",
|
|
1390
|
+
type: "alert"
|
|
1391
|
+
})),
|
|
1392
|
+
showSuccessAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), {
|
|
1393
|
+
status: "success",
|
|
1394
|
+
type: "alert"
|
|
1395
|
+
})),
|
|
1396
|
+
showWarningAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), {
|
|
1397
|
+
status: "warning",
|
|
1398
|
+
type: "alert"
|
|
1399
|
+
})),
|
|
1400
|
+
showErrorAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), {
|
|
1401
|
+
status: "error",
|
|
1402
|
+
type: "alert"
|
|
1403
|
+
})),
|
|
1404
|
+
showPromotionalToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), {
|
|
1405
|
+
status: "promotional",
|
|
1406
|
+
type: "toast"
|
|
1407
|
+
})),
|
|
1408
|
+
showNeutralToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), {
|
|
1409
|
+
status: "neutral",
|
|
1410
|
+
type: "toast"
|
|
1411
|
+
})),
|
|
1412
|
+
showSuccessToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), {
|
|
1413
|
+
status: "success",
|
|
1414
|
+
type: "toast"
|
|
1415
|
+
})),
|
|
1416
|
+
showWarningToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), {
|
|
1417
|
+
status: "warning",
|
|
1418
|
+
type: "toast"
|
|
1419
|
+
})),
|
|
1420
|
+
showErrorToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), {
|
|
1421
|
+
status: "error",
|
|
1422
|
+
type: "toast"
|
|
1423
|
+
})),
|
|
1424
|
+
closeActiveNotification: () => queue.closeActiveNotification()
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
function Notification(props) {
|
|
1428
|
+
const ref = useRef(null);
|
|
1429
|
+
const { state, toast: notification } = props;
|
|
1430
|
+
const { type = "toast", message, status = "success", hasIcon = true, onDismiss } = notification.content;
|
|
1431
|
+
const { toastProps: notificationProps, titleProps, closeButtonProps } = $d6542812f0669241$export$a407b657d3044108(props, state, ref);
|
|
1432
|
+
const notificationPropsWithAdjustedAriaRole = type === "toast" ? __spreadProps(__spreadValues({}, notificationProps), {
|
|
1433
|
+
role: "status"
|
|
1434
|
+
}) : notificationProps;
|
|
1435
|
+
const handleDismiss = () => {
|
|
1436
|
+
if (onDismiss) {
|
|
1437
|
+
onDismiss();
|
|
1438
|
+
}
|
|
1439
|
+
state.close(notification.key);
|
|
1440
|
+
};
|
|
1441
|
+
const closeButtonPropsWithDismiss = __spreadProps(__spreadValues({}, closeButtonProps), {
|
|
1442
|
+
onPress: handleDismiss
|
|
1443
|
+
});
|
|
1444
|
+
return React__default.createElement("div", __spreadProps(__spreadValues({}, notificationPropsWithAdjustedAriaRole), {
|
|
1445
|
+
ref,
|
|
1446
|
+
className: classNames(styles.Notification, styles[variationName("status", status)], styles[variationName("type", type)])
|
|
1447
|
+
}), React__default.createElement("div", {
|
|
1448
|
+
className: styles.iconText
|
|
1449
|
+
}, hasIcon && React__default.createElement(Icon, {
|
|
1450
|
+
size: "lg",
|
|
1451
|
+
symbol: getStatusIcon(status)
|
|
1452
|
+
}), React__default.createElement("div", __spreadValues({}, titleProps), React__default.createElement(Text, {
|
|
1453
|
+
weight: "semibold"
|
|
1454
|
+
}, message))), type === "alert" && React__default.createElement(UnstyledButton, __spreadProps(__spreadValues({}, closeButtonPropsWithDismiss), {
|
|
1455
|
+
className: classNames(styles.closeButton)
|
|
1456
|
+
}), React__default.createElement(Icon, {
|
|
1457
|
+
size: "md",
|
|
1458
|
+
symbol: Close
|
|
1459
|
+
})));
|
|
1460
|
+
}
|
|
1461
|
+
function getStatusIcon(status) {
|
|
1462
|
+
switch (status) {
|
|
1463
|
+
case "promotional":
|
|
1464
|
+
return CurrencyExchange;
|
|
1465
|
+
case "success":
|
|
1466
|
+
return CheckCircle;
|
|
1467
|
+
case "neutral":
|
|
1468
|
+
return DocumentScanner;
|
|
1469
|
+
case "error":
|
|
1470
|
+
return Error2;
|
|
1471
|
+
case "warning":
|
|
1472
|
+
return Warning;
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
const NotificationContext = createContext(null);
|
|
1476
|
+
function useNotification() {
|
|
1477
|
+
const notification = useContext(NotificationContext);
|
|
1478
|
+
if (!notification) {
|
|
1479
|
+
throw new Error("useNotification() must be used within a NotificationProvider, which is bundled with EasyUIProvider");
|
|
1480
|
+
}
|
|
1481
|
+
return notification;
|
|
1482
|
+
}
|
|
1483
|
+
function NotificationProvider(props) {
|
|
1484
|
+
const { children, notificationPlacement } = props;
|
|
1485
|
+
const combinedState = useNotificationState();
|
|
1486
|
+
const state = {
|
|
1487
|
+
close: combinedState.close,
|
|
1488
|
+
add: combinedState.add,
|
|
1489
|
+
remove: combinedState.remove,
|
|
1490
|
+
pauseAll: combinedState.pauseAll,
|
|
1491
|
+
resumeAll: combinedState.resumeAll,
|
|
1492
|
+
visibleToasts: combinedState.visibleToasts
|
|
1493
|
+
};
|
|
1494
|
+
const notification = {
|
|
1495
|
+
showErrorAlert: combinedState.showErrorAlert,
|
|
1496
|
+
showErrorToast: combinedState.showErrorToast,
|
|
1497
|
+
showPromotionalToast: combinedState.showPromotionalToast,
|
|
1498
|
+
showPromotionalAlert: combinedState.showPromotionalAlert,
|
|
1499
|
+
showNeutralToast: combinedState.showNeutralToast,
|
|
1500
|
+
showNeutralAlert: combinedState.showNeutralAlert,
|
|
1501
|
+
showSuccessToast: combinedState.showSuccessToast,
|
|
1502
|
+
showSuccessAlert: combinedState.showSuccessAlert,
|
|
1503
|
+
showWarningToast: combinedState.showWarningToast,
|
|
1504
|
+
showWarningAlert: combinedState.showWarningAlert,
|
|
1505
|
+
closeActiveNotification: combinedState.closeActiveNotification
|
|
1506
|
+
};
|
|
1507
|
+
return React__default.createElement(NotificationContext.Provider, {
|
|
1508
|
+
value: notification
|
|
1509
|
+
}, React__default.createElement(NotificationContainer, {
|
|
1510
|
+
getContainer: notificationPlacement == null ? void 0 : notificationPlacement.getContainer,
|
|
1511
|
+
offset: notificationPlacement == null ? void 0 : notificationPlacement.offset,
|
|
1512
|
+
position: notificationPlacement == null ? void 0 : notificationPlacement.position,
|
|
1513
|
+
state
|
|
1514
|
+
}), children);
|
|
1515
|
+
}
|
|
12
1516
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1517
|
+
Notification,
|
|
1518
|
+
NotificationContext,
|
|
1519
|
+
NotificationProvider,
|
|
1520
|
+
useNotification
|
|
17
1521
|
};
|