@react-aria/toast 3.0.0-beta.10 → 3.0.0-beta.11

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 (55) hide show
  1. package/dist/ar-AE.mjs +1 -1
  2. package/dist/bg-BG.mjs +1 -1
  3. package/dist/cs-CZ.mjs +1 -1
  4. package/dist/da-DK.mjs +1 -1
  5. package/dist/de-DE.mjs +1 -1
  6. package/dist/el-GR.mjs +1 -1
  7. package/dist/en-US.mjs +1 -1
  8. package/dist/es-ES.mjs +1 -1
  9. package/dist/et-EE.mjs +1 -1
  10. package/dist/fi-FI.mjs +1 -1
  11. package/dist/fr-FR.mjs +1 -1
  12. package/dist/he-IL.mjs +1 -1
  13. package/dist/hr-HR.mjs +1 -1
  14. package/dist/hu-HU.mjs +1 -1
  15. package/dist/import.mjs +3 -245
  16. package/dist/intlStrings.main.js +108 -0
  17. package/dist/intlStrings.main.js.map +1 -0
  18. package/dist/intlStrings.mjs +110 -0
  19. package/dist/intlStrings.module.js +110 -0
  20. package/dist/intlStrings.module.js.map +1 -0
  21. package/dist/it-IT.mjs +1 -1
  22. package/dist/ja-JP.mjs +1 -1
  23. package/dist/ko-KR.mjs +1 -1
  24. package/dist/lt-LT.mjs +1 -1
  25. package/dist/lv-LV.mjs +1 -1
  26. package/dist/main.js +5 -247
  27. package/dist/main.js.map +1 -1
  28. package/dist/module.js +3 -245
  29. package/dist/module.js.map +1 -1
  30. package/dist/nb-NO.mjs +1 -1
  31. package/dist/nl-NL.mjs +1 -1
  32. package/dist/pl-PL.mjs +1 -1
  33. package/dist/pt-BR.mjs +1 -1
  34. package/dist/pt-PT.mjs +1 -1
  35. package/dist/ro-RO.mjs +1 -1
  36. package/dist/ru-RU.mjs +1 -1
  37. package/dist/sk-SK.mjs +1 -1
  38. package/dist/sl-SI.mjs +1 -1
  39. package/dist/sr-SP.mjs +1 -1
  40. package/dist/sv-SE.mjs +1 -1
  41. package/dist/tr-TR.mjs +1 -1
  42. package/dist/uk-UA.mjs +1 -1
  43. package/dist/useToast.main.js +92 -0
  44. package/dist/useToast.main.js.map +1 -0
  45. package/dist/useToast.mjs +87 -0
  46. package/dist/useToast.module.js +87 -0
  47. package/dist/useToast.module.js.map +1 -0
  48. package/dist/useToastRegion.main.js +73 -0
  49. package/dist/useToastRegion.main.js.map +1 -0
  50. package/dist/useToastRegion.mjs +68 -0
  51. package/dist/useToastRegion.module.js +68 -0
  52. package/dist/useToastRegion.module.js.map +1 -0
  53. package/dist/zh-CN.mjs +1 -1
  54. package/dist/zh-TW.mjs +1 -1
  55. package/package.json +9 -9
@@ -0,0 +1,110 @@
1
+ import $aTebn$arAEmodulejs from "./ar-AE.module.js";
2
+ import $aTebn$bgBGmodulejs from "./bg-BG.module.js";
3
+ import $aTebn$csCZmodulejs from "./cs-CZ.module.js";
4
+ import $aTebn$daDKmodulejs from "./da-DK.module.js";
5
+ import $aTebn$deDEmodulejs from "./de-DE.module.js";
6
+ import $aTebn$elGRmodulejs from "./el-GR.module.js";
7
+ import $aTebn$enUSmodulejs from "./en-US.module.js";
8
+ import $aTebn$esESmodulejs from "./es-ES.module.js";
9
+ import $aTebn$etEEmodulejs from "./et-EE.module.js";
10
+ import $aTebn$fiFImodulejs from "./fi-FI.module.js";
11
+ import $aTebn$frFRmodulejs from "./fr-FR.module.js";
12
+ import $aTebn$heILmodulejs from "./he-IL.module.js";
13
+ import $aTebn$hrHRmodulejs from "./hr-HR.module.js";
14
+ import $aTebn$huHUmodulejs from "./hu-HU.module.js";
15
+ import $aTebn$itITmodulejs from "./it-IT.module.js";
16
+ import $aTebn$jaJPmodulejs from "./ja-JP.module.js";
17
+ import $aTebn$koKRmodulejs from "./ko-KR.module.js";
18
+ import $aTebn$ltLTmodulejs from "./lt-LT.module.js";
19
+ import $aTebn$lvLVmodulejs from "./lv-LV.module.js";
20
+ import $aTebn$nbNOmodulejs from "./nb-NO.module.js";
21
+ import $aTebn$nlNLmodulejs from "./nl-NL.module.js";
22
+ import $aTebn$plPLmodulejs from "./pl-PL.module.js";
23
+ import $aTebn$ptBRmodulejs from "./pt-BR.module.js";
24
+ import $aTebn$ptPTmodulejs from "./pt-PT.module.js";
25
+ import $aTebn$roROmodulejs from "./ro-RO.module.js";
26
+ import $aTebn$ruRUmodulejs from "./ru-RU.module.js";
27
+ import $aTebn$skSKmodulejs from "./sk-SK.module.js";
28
+ import $aTebn$slSImodulejs from "./sl-SI.module.js";
29
+ import $aTebn$srSPmodulejs from "./sr-SP.module.js";
30
+ import $aTebn$svSEmodulejs from "./sv-SE.module.js";
31
+ import $aTebn$trTRmodulejs from "./tr-TR.module.js";
32
+ import $aTebn$ukUAmodulejs from "./uk-UA.module.js";
33
+ import $aTebn$zhCNmodulejs from "./zh-CN.module.js";
34
+ import $aTebn$zhTWmodulejs from "./zh-TW.module.js";
35
+
36
+ var $7853651519a70071$exports = {};
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+ $7853651519a70071$exports = {
72
+ "ar-AE": $aTebn$arAEmodulejs,
73
+ "bg-BG": $aTebn$bgBGmodulejs,
74
+ "cs-CZ": $aTebn$csCZmodulejs,
75
+ "da-DK": $aTebn$daDKmodulejs,
76
+ "de-DE": $aTebn$deDEmodulejs,
77
+ "el-GR": $aTebn$elGRmodulejs,
78
+ "en-US": $aTebn$enUSmodulejs,
79
+ "es-ES": $aTebn$esESmodulejs,
80
+ "et-EE": $aTebn$etEEmodulejs,
81
+ "fi-FI": $aTebn$fiFImodulejs,
82
+ "fr-FR": $aTebn$frFRmodulejs,
83
+ "he-IL": $aTebn$heILmodulejs,
84
+ "hr-HR": $aTebn$hrHRmodulejs,
85
+ "hu-HU": $aTebn$huHUmodulejs,
86
+ "it-IT": $aTebn$itITmodulejs,
87
+ "ja-JP": $aTebn$jaJPmodulejs,
88
+ "ko-KR": $aTebn$koKRmodulejs,
89
+ "lt-LT": $aTebn$ltLTmodulejs,
90
+ "lv-LV": $aTebn$lvLVmodulejs,
91
+ "nb-NO": $aTebn$nbNOmodulejs,
92
+ "nl-NL": $aTebn$nlNLmodulejs,
93
+ "pl-PL": $aTebn$plPLmodulejs,
94
+ "pt-BR": $aTebn$ptBRmodulejs,
95
+ "pt-PT": $aTebn$ptPTmodulejs,
96
+ "ro-RO": $aTebn$roROmodulejs,
97
+ "ru-RU": $aTebn$ruRUmodulejs,
98
+ "sk-SK": $aTebn$skSKmodulejs,
99
+ "sl-SI": $aTebn$slSImodulejs,
100
+ "sr-SP": $aTebn$srSPmodulejs,
101
+ "sv-SE": $aTebn$svSEmodulejs,
102
+ "tr-TR": $aTebn$trTRmodulejs,
103
+ "uk-UA": $aTebn$ukUAmodulejs,
104
+ "zh-CN": $aTebn$zhCNmodulejs,
105
+ "zh-TW": $aTebn$zhTWmodulejs
106
+ };
107
+
108
+
109
+ export {$7853651519a70071$exports as default};
110
+ //# sourceMappingURL=intlStrings.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,4BAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX","sources":["packages/@react-aria/toast/src/*.js"],"sourcesContent":["const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}"],"names":[],"version":3,"file":"intlStrings.module.js.map"}
package/dist/it-IT.mjs CHANGED
@@ -6,4 +6,4 @@ $fe136bcbacfcfa14$exports = {
6
6
 
7
7
 
8
8
  export {$fe136bcbacfcfa14$exports as default};
9
- //# sourceMappingURL=it-IT.module.js.map
9
+ //# sourceMappingURL=it-IT.mjs.map
package/dist/ja-JP.mjs CHANGED
@@ -6,4 +6,4 @@ $8fb53a929b46df83$exports = {
6
6
 
7
7
 
8
8
  export {$8fb53a929b46df83$exports as default};
9
- //# sourceMappingURL=ja-JP.module.js.map
9
+ //# sourceMappingURL=ja-JP.mjs.map
package/dist/ko-KR.mjs CHANGED
@@ -6,4 +6,4 @@ $2c38dbfaf041a865$exports = {
6
6
 
7
7
 
8
8
  export {$2c38dbfaf041a865$exports as default};
9
- //# sourceMappingURL=ko-KR.module.js.map
9
+ //# sourceMappingURL=ko-KR.mjs.map
package/dist/lt-LT.mjs CHANGED
@@ -6,4 +6,4 @@ $48f3f33a29908d4c$exports = {
6
6
 
7
7
 
8
8
  export {$48f3f33a29908d4c$exports as default};
9
- //# sourceMappingURL=lt-LT.module.js.map
9
+ //# sourceMappingURL=lt-LT.mjs.map
package/dist/lv-LV.mjs CHANGED
@@ -6,4 +6,4 @@ $9867160d996455a0$exports = {
6
6
 
7
7
 
8
8
  export {$9867160d996455a0$exports as default};
9
- //# sourceMappingURL=lv-LV.module.js.map
9
+ //# sourceMappingURL=lv-LV.mjs.map
package/dist/main.js CHANGED
@@ -1,54 +1,13 @@
1
- var $3ba38fcbd805da3c$exports = require("./ar-AE.main.js");
2
- var $06073da8a2e837af$exports = require("./bg-BG.main.js");
3
- var $f53ed7e9d51b5d55$exports = require("./cs-CZ.main.js");
4
- var $a6b6afdb5a98f76c$exports = require("./da-DK.main.js");
5
- var $52ad23060875775f$exports = require("./de-DE.main.js");
6
- var $08dcc76c0e5f63e1$exports = require("./el-GR.main.js");
7
- var $ac3044aff017d368$exports = require("./en-US.main.js");
8
- var $0299c089dcae9213$exports = require("./es-ES.main.js");
9
- var $6e794080ab3e230e$exports = require("./et-EE.main.js");
10
- var $0e8addbb92e8793c$exports = require("./fi-FI.main.js");
11
- var $ccffda58861e52b2$exports = require("./fr-FR.main.js");
12
- var $653260ae334153b4$exports = require("./he-IL.main.js");
13
- var $290423d4fc0aea87$exports = require("./hr-HR.main.js");
14
- var $da81172046d02c49$exports = require("./hu-HU.main.js");
15
- var $e473b08597cfe1ba$exports = require("./it-IT.main.js");
16
- var $a922e1b461f17a4b$exports = require("./ja-JP.main.js");
17
- var $be1e07b486982d9f$exports = require("./ko-KR.main.js");
18
- var $8ce068abcf4f94c2$exports = require("./lt-LT.main.js");
19
- var $0f0bc08f611d7d33$exports = require("./lv-LV.main.js");
20
- var $5166d11eab257c28$exports = require("./nb-NO.main.js");
21
- var $cb220a55cf7a5fab$exports = require("./nl-NL.main.js");
22
- var $917614d5adb28d77$exports = require("./pl-PL.main.js");
23
- var $23cdda07bb218e23$exports = require("./pt-BR.main.js");
24
- var $bb1b7d8bd48e0fee$exports = require("./pt-PT.main.js");
25
- var $969ad461d232c044$exports = require("./ro-RO.main.js");
26
- var $fca911223f29355e$exports = require("./ru-RU.main.js");
27
- var $19e9a28d44f83203$exports = require("./sk-SK.main.js");
28
- var $778cdcc7dbced5c1$exports = require("./sl-SI.main.js");
29
- var $9359f9b7eac75ac1$exports = require("./sr-SP.main.js");
30
- var $ac7ed8cd33134ccc$exports = require("./sv-SE.main.js");
31
- var $b55461bb5ab189cd$exports = require("./tr-TR.main.js");
32
- var $e6a0bdd8a70a947a$exports = require("./uk-UA.main.js");
33
- var $c2f8abea7819ef8e$exports = require("./zh-CN.main.js");
34
- var $765deb5c0d35c4bc$exports = require("./zh-TW.main.js");
35
- var $35jN2$react = require("react");
36
- var $35jN2$reactariautils = require("@react-aria/utils");
37
- var $35jN2$reactariai18n = require("@react-aria/i18n");
38
- var $35jN2$reactariainteractions = require("@react-aria/interactions");
39
- var $35jN2$reactarialandmark = require("@react-aria/landmark");
1
+ var $ec537504faac71d2$exports = require("./useToast.main.js");
2
+ var $eda7c6204a682dd4$exports = require("./useToastRegion.main.js");
40
3
 
41
4
 
42
5
  function $parcel$export(e, n, v, s) {
43
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
44
7
  }
45
8
 
46
- function $parcel$interopDefault(a) {
47
- return a && a.__esModule ? a.default : a;
48
- }
49
-
50
- $parcel$export(module.exports, "useToast", () => $ec537504faac71d2$export$a407b657d3044108);
51
- $parcel$export(module.exports, "useToastRegion", () => $eda7c6204a682dd4$export$b8cbbb20a51697de);
9
+ $parcel$export(module.exports, "useToast", () => $ec537504faac71d2$exports.useToast);
10
+ $parcel$export(module.exports, "useToastRegion", () => $eda7c6204a682dd4$exports.useToastRegion);
52
11
  /*
53
12
  * Copyright 2020 Adobe. All rights reserved.
54
13
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -59,208 +18,7 @@ $parcel$export(module.exports, "useToastRegion", () => $eda7c6204a682dd4$export$
59
18
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
60
19
  * OF ANY KIND, either express or implied. See the License for the specific language
61
20
  * governing permissions and limitations under the License.
62
- */ /*
63
- * Copyright 2020 Adobe. All rights reserved.
64
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
65
- * you may not use this file except in compliance with the License. You may obtain a copy
66
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
67
- *
68
- * Unless required by applicable law or agreed to in writing, software distributed under
69
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
70
- * OF ANY KIND, either express or implied. See the License for the specific language
71
- * governing permissions and limitations under the License.
72
- */ var $f49b2d6c91681304$exports = {};
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
- $f49b2d6c91681304$exports = {
108
- "ar-AE": $3ba38fcbd805da3c$exports,
109
- "bg-BG": $06073da8a2e837af$exports,
110
- "cs-CZ": $f53ed7e9d51b5d55$exports,
111
- "da-DK": $a6b6afdb5a98f76c$exports,
112
- "de-DE": $52ad23060875775f$exports,
113
- "el-GR": $08dcc76c0e5f63e1$exports,
114
- "en-US": $ac3044aff017d368$exports,
115
- "es-ES": $0299c089dcae9213$exports,
116
- "et-EE": $6e794080ab3e230e$exports,
117
- "fi-FI": $0e8addbb92e8793c$exports,
118
- "fr-FR": $ccffda58861e52b2$exports,
119
- "he-IL": $653260ae334153b4$exports,
120
- "hr-HR": $290423d4fc0aea87$exports,
121
- "hu-HU": $da81172046d02c49$exports,
122
- "it-IT": $e473b08597cfe1ba$exports,
123
- "ja-JP": $a922e1b461f17a4b$exports,
124
- "ko-KR": $be1e07b486982d9f$exports,
125
- "lt-LT": $8ce068abcf4f94c2$exports,
126
- "lv-LV": $0f0bc08f611d7d33$exports,
127
- "nb-NO": $5166d11eab257c28$exports,
128
- "nl-NL": $cb220a55cf7a5fab$exports,
129
- "pl-PL": $917614d5adb28d77$exports,
130
- "pt-BR": $23cdda07bb218e23$exports,
131
- "pt-PT": $bb1b7d8bd48e0fee$exports,
132
- "ro-RO": $969ad461d232c044$exports,
133
- "ru-RU": $fca911223f29355e$exports,
134
- "sk-SK": $19e9a28d44f83203$exports,
135
- "sl-SI": $778cdcc7dbced5c1$exports,
136
- "sr-SP": $9359f9b7eac75ac1$exports,
137
- "sv-SE": $ac7ed8cd33134ccc$exports,
138
- "tr-TR": $b55461bb5ab189cd$exports,
139
- "uk-UA": $e6a0bdd8a70a947a$exports,
140
- "zh-CN": $c2f8abea7819ef8e$exports,
141
- "zh-TW": $765deb5c0d35c4bc$exports
142
- };
143
-
144
-
145
-
146
-
147
-
148
- function $ec537504faac71d2$export$a407b657d3044108(props, state, ref) {
149
- let { key: key, timer: timer, timeout: timeout, animation: animation } = props.toast;
150
- (0, $35jN2$react.useEffect)(()=>{
151
- if (!timer) return;
152
- timer.reset(timeout);
153
- return ()=>{
154
- timer.pause();
155
- };
156
- }, [
157
- timer,
158
- timeout
159
- ]);
160
- // Restore focus to the toast container on unmount.
161
- // If there are no more toasts, the container will be unmounted
162
- // and will restore focus to wherever focus was before the user
163
- // focused the toast region.
164
- let focusOnUnmount = (0, $35jN2$react.useRef)(null);
165
- (0, $35jN2$reactariautils.useLayoutEffect)(()=>{
166
- let container = ref.current.closest("[role=region]");
167
- return ()=>{
168
- if (container && container.contains(document.activeElement)) // Focus must be delayed for focus ring to appear, but we can't wait
169
- // until useEffect cleanup to check if focus was inside the container.
170
- focusOnUnmount.current = container;
171
- };
172
- }, [
173
- ref
174
- ]);
175
- // eslint-disable-next-line
176
- (0, $35jN2$react.useEffect)(()=>{
177
- return ()=>{
178
- if (focusOnUnmount.current) focusOnUnmount.current.focus();
179
- };
180
- }, [
181
- ref
182
- ]);
183
- let titleId = (0, $35jN2$reactariautils.useId)();
184
- let descriptionId = (0, $35jN2$reactariautils.useSlotId)();
185
- let stringFormatter = (0, $35jN2$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f49b2d6c91681304$exports))), "@react-aria/toast");
186
- return {
187
- toastProps: {
188
- role: "alert",
189
- "aria-label": props["aria-label"],
190
- "aria-labelledby": props["aria-labelledby"] || titleId,
191
- "aria-describedby": props["aria-describedby"] || descriptionId,
192
- "aria-details": props["aria-details"],
193
- // Hide toasts that are animating out so VoiceOver doesn't announce them.
194
- "aria-hidden": animation === "exiting" ? "true" : undefined
195
- },
196
- titleProps: {
197
- id: titleId
198
- },
199
- descriptionProps: {
200
- id: descriptionId
201
- },
202
- closeButtonProps: {
203
- "aria-label": stringFormatter.format("close"),
204
- onPress: ()=>state.close(key)
205
- }
206
- };
207
- }
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
- function $eda7c6204a682dd4$export$b8cbbb20a51697de(props, state, ref) {
217
- let stringFormatter = (0, $35jN2$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f49b2d6c91681304$exports))), "@react-aria/toast");
218
- let { landmarkProps: landmarkProps } = (0, $35jN2$reactarialandmark.useLandmark)({
219
- role: "region",
220
- "aria-label": props["aria-label"] || stringFormatter.format("notifications")
221
- }, ref);
222
- let { hoverProps: hoverProps } = (0, $35jN2$reactariainteractions.useHover)({
223
- onHoverStart: state.pauseAll,
224
- onHoverEnd: state.resumeAll
225
- });
226
- let lastFocused = (0, $35jN2$react.useRef)(null);
227
- let { focusWithinProps: focusWithinProps } = (0, $35jN2$reactariainteractions.useFocusWithin)({
228
- onFocusWithin: (e)=>{
229
- state.pauseAll();
230
- lastFocused.current = e.relatedTarget;
231
- },
232
- onBlurWithin: ()=>{
233
- state.resumeAll();
234
- lastFocused.current = null;
235
- }
236
- });
237
- // When the region unmounts, restore focus to the last element that had focus
238
- // before the user moved focus into the region.
239
- // TODO: handle when the element has unmounted like FocusScope does?
240
- // eslint-disable-next-line arrow-body-style
241
- (0, $35jN2$react.useEffect)(()=>{
242
- return ()=>{
243
- if (lastFocused.current && document.body.contains(lastFocused.current)) {
244
- if ((0, $35jN2$reactariainteractions.getInteractionModality)() === "pointer") (0, $35jN2$reactariautils.focusWithoutScrolling)(lastFocused.current);
245
- else lastFocused.current.focus();
246
- }
247
- };
248
- }, [
249
- ref
250
- ]);
251
- return {
252
- regionProps: (0, $35jN2$reactariautils.mergeProps)(landmarkProps, hoverProps, focusWithinProps, {
253
- tabIndex: -1,
254
- // Mark the toast region as a "top layer", so that it:
255
- // - is not aria-hidden when opening an overlay
256
- // - allows focus even outside a containing focus scope
257
- // - doesn’t dismiss overlays when clicking on it, even though it is outside
258
- // @ts-ignore
259
- "data-react-aria-top-layer": true
260
- })
261
- };
262
- }
263
-
21
+ */
264
22
 
265
23
 
266
24
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkCA,4BAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX;;CD3DC;;;;AA+BM,SAAS,0CAAY,KAAwB,EAAE,KAAoB,EAAE,GAAgC;IAC1G,IAAI,OACF,GAAG,SACH,KAAK,WACL,OAAO,aACP,SAAS,EACV,GAAG,MAAM,KAAK;IAEf,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,CAAC,OACH;QAGF,MAAM,KAAK,CAAC;QACZ,OAAO;YACL,MAAM,KAAK;QACb;IACF,GAAG;QAAC;QAAO;KAAQ;IAEnB,mDAAmD;IACnD,+DAA+D;IAC/D,+DAA+D;IAC/D,4BAA4B;IAC5B,IAAI,iBAAiB,CAAA,GAAA,mBAAK,EAAE;IAC5B,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;QACpC,OAAO;YACL,IAAI,aAAa,UAAU,QAAQ,CAAC,SAAS,aAAa,GACxD,oEAAoE;YACpE,sEAAsE;YACtE,eAAe,OAAO,GAAG;QAE7B;IACF,GAAG;QAAC;KAAI;IAER,2BAA2B;IAC3B,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO;YACL,IAAI,eAAe,OAAO,EACxB,eAAe,OAAO,CAAC,KAAK;QAEhC;IACF,GAAG;QAAC;KAAI;IAER,IAAI,UAAU,CAAA,GAAA,2BAAI;IAClB,IAAI,gBAAgB,CAAA,GAAA,+BAAQ;IAC5B,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,gEAAW,GAAG;IAEhE,OAAO;QACL,YAAY;YACV,MAAM;YACN,cAAc,KAAK,CAAC,aAAa;YACjC,mBAAmB,KAAK,CAAC,kBAAkB,IAAI;YAC/C,oBAAoB,KAAK,CAAC,mBAAmB,IAAI;YACjD,gBAAgB,KAAK,CAAC,eAAe;YACrC,yEAAyE;YACzE,eAAe,cAAc,YAAY,SAAS;QACpD;QACA,YAAY;YACV,IAAI;QACN;QACA,kBAAkB;YAChB,IAAI;QACN;QACA,kBAAkB;YAChB,cAAc,gBAAgB,MAAM,CAAC;YACrC,SAAS,IAAM,MAAM,KAAK,CAAC;QAC7B;IACF;AACF;;CDpGC;;;;;;;AGiBM,SAAS,0CAAkB,KAA2B,EAAE,KAAoB,EAAE,GAA2B;IAC9G,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,gEAAW,GAAG;IAChE,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,oCAAU,EAAE;QAChC,MAAM;QACN,cAAc,KAAK,CAAC,aAAa,IAAI,gBAAgB,MAAM,CAAC;IAC9D,GAAG;IAEH,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;QAC1B,cAAc,MAAM,QAAQ;QAC5B,YAAY,MAAM,SAAS;IAC7B;IAEA,IAAI,cAAc,CAAA,GAAA,mBAAK,EAAE;IACzB,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,2CAAa,EAAE;QACtC,eAAe,CAAC;YACd,MAAM,QAAQ;YACd,YAAY,OAAO,GAAG,EAAE,aAAa;QACvC;QACA,cAAc;YACZ,MAAM,SAAS;YACf,YAAY,OAAO,GAAG;QACxB;IACF;IAEA,6EAA6E;IAC7E,+CAA+C;IAC/C,oEAAoE;IACpE,4CAA4C;IAC5C,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO;YACL,IAAI,YAAY,OAAO,IAAI,SAAS,IAAI,CAAC,QAAQ,CAAC,YAAY,OAAO;gBACnE,IAAI,CAAA,GAAA,mDAAqB,QAAQ,WAC/B,CAAA,GAAA,2CAAoB,EAAE,YAAY,OAAO;qBAEzC,YAAY,OAAO,CAAC,KAAK;;QAG/B;IACF,GAAG;QAAC;KAAI;IAER,OAAO;QACL,aAAa,CAAA,GAAA,gCAAS,EAAE,eAAe,YAAY,kBAAkB;YACnE,UAAU;YACV,sDAAsD;YACtD,iDAAiD;YACjD,yDAAyD;YACzD,8EAA8E;YAC9E,aAAa;YACb,6BAA6B;QAC/B;IACF;AACF;","sources":["packages/@react-aria/toast/src/index.ts","packages/@react-aria/toast/src/useToast.ts","packages/@react-aria/toast/src/*.js","packages/@react-aria/toast/src/useToastRegion.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useToast} from './useToast';\nexport {useToastRegion} from './useToastRegion';\n\nexport type {AriaToastRegionProps, ToastRegionAria} from './useToastRegion';\nexport type {AriaToastProps, ToastAria} from './useToast';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaLabelingProps, DOMAttributes, FocusableElement} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {QueuedToast, ToastState} from '@react-stately/toast';\nimport {RefObject, useEffect, useRef} from 'react';\nimport {useId, useLayoutEffect, useSlotId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaToastProps<T> extends AriaLabelingProps {\n /** The toast object. */\n toast: QueuedToast<T>\n}\n\nexport interface ToastAria {\n /** Props for the toast container element. */\n toastProps: DOMAttributes,\n /** Props for the toast title element. */\n titleProps: DOMAttributes,\n /** Props for the toast description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the toast close button. */\n closeButtonProps: AriaButtonProps\n}\n\n/**\n * Provides the behavior and accessibility implementation for a toast component.\n * Toasts display brief, temporary notifications of actions, errors, or other events in an application.\n */\nexport function useToast<T>(props: AriaToastProps<T>, state: ToastState<T>, ref: RefObject<FocusableElement>): ToastAria {\n let {\n key,\n timer,\n timeout,\n animation\n } = props.toast;\n\n useEffect(() => {\n if (!timer) {\n return;\n }\n\n timer.reset(timeout);\n return () => {\n timer.pause();\n };\n }, [timer, timeout]);\n\n // Restore focus to the toast container on unmount.\n // If there are no more toasts, the container will be unmounted\n // and will restore focus to wherever focus was before the user\n // focused the toast region.\n let focusOnUnmount = useRef(null);\n useLayoutEffect(() => {\n let container = ref.current.closest('[role=region]') as HTMLElement;\n return () => {\n if (container && container.contains(document.activeElement)) {\n // Focus must be delayed for focus ring to appear, but we can't wait\n // until useEffect cleanup to check if focus was inside the container.\n focusOnUnmount.current = container;\n }\n };\n }, [ref]);\n\n // eslint-disable-next-line\n useEffect(() => {\n return () => {\n if (focusOnUnmount.current) {\n focusOnUnmount.current.focus();\n }\n };\n }, [ref]);\n\n let titleId = useId();\n let descriptionId = useSlotId();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/toast');\n\n return {\n toastProps: {\n role: 'alert',\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'] || titleId,\n 'aria-describedby': props['aria-describedby'] || descriptionId,\n 'aria-details': props['aria-details'],\n // Hide toasts that are animating out so VoiceOver doesn't announce them.\n 'aria-hidden': animation === 'exiting' ? 'true' : undefined\n },\n titleProps: {\n id: titleId\n },\n descriptionProps: {\n id: descriptionId\n },\n closeButtonProps: {\n 'aria-label': stringFormatter.format('close'),\n onPress: () => state.close(key)\n }\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","import {AriaLabelingProps, DOMAttributes} from '@react-types/shared';\nimport {focusWithoutScrolling, mergeProps} from '@react-aria/utils';\nimport {getInteractionModality, useFocusWithin, useHover} from '@react-aria/interactions';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {RefObject, useEffect, useRef} from 'react';\nimport {ToastState} from '@react-stately/toast';\nimport {useLandmark} from '@react-aria/landmark';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaToastRegionProps extends AriaLabelingProps {\n /**\n * An accessibility label for the toast region.\n * @default \"Notifications\"\n */\n 'aria-label'?: string\n}\n\nexport interface ToastRegionAria {\n /** Props for the landmark region element. */\n regionProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a toast region containing one or more toasts.\n * Toasts display brief, temporary notifications of actions, errors, or other events in an application.\n */\nexport function useToastRegion<T>(props: AriaToastRegionProps, state: ToastState<T>, ref: RefObject<HTMLElement>): ToastRegionAria {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/toast');\n let {landmarkProps} = useLandmark({\n role: 'region',\n 'aria-label': props['aria-label'] || stringFormatter.format('notifications')\n }, ref);\n\n let {hoverProps} = useHover({\n onHoverStart: state.pauseAll,\n onHoverEnd: state.resumeAll\n });\n\n let lastFocused = useRef(null);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithin: (e) => {\n state.pauseAll();\n lastFocused.current = e.relatedTarget;\n },\n onBlurWithin: () => {\n state.resumeAll();\n lastFocused.current = null;\n }\n });\n\n // When the region unmounts, restore focus to the last element that had focus\n // before the user moved focus into the region.\n // TODO: handle when the element has unmounted like FocusScope does?\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n if (lastFocused.current && document.body.contains(lastFocused.current)) {\n if (getInteractionModality() === 'pointer') {\n focusWithoutScrolling(lastFocused.current);\n } else {\n lastFocused.current.focus();\n }\n }\n };\n }, [ref]);\n\n return {\n regionProps: mergeProps(landmarkProps, hoverProps, focusWithinProps, {\n tabIndex: -1,\n // Mark the toast region as a \"top layer\", so that it:\n // - is not aria-hidden when opening an overlay\n // - allows focus even outside a containing focus scope\n // - doesn’t dismiss overlays when clicking on it, even though it is outside\n // @ts-ignore\n 'data-react-aria-top-layer': true\n })\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/toast/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useToast} from './useToast';\nexport {useToastRegion} from './useToastRegion';\n\nexport type {AriaToastRegionProps, ToastRegionAria} from './useToastRegion';\nexport type {AriaToastProps, ToastAria} from './useToast';\n"],"names":[],"version":3,"file":"main.js.map"}