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