@react-aria/toast 3.0.10 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dist/import.mjs +2 -4
  2. package/dist/main.js +3 -5
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +2 -4
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +2 -0
  7. package/package.json +15 -18
  8. package/src/index.ts +2 -4
  9. package/dist/ar-AE.main.js +0 -10
  10. package/dist/ar-AE.main.js.map +0 -1
  11. package/dist/ar-AE.mjs +0 -12
  12. package/dist/ar-AE.module.js +0 -12
  13. package/dist/ar-AE.module.js.map +0 -1
  14. package/dist/bg-BG.main.js +0 -10
  15. package/dist/bg-BG.main.js.map +0 -1
  16. package/dist/bg-BG.mjs +0 -12
  17. package/dist/bg-BG.module.js +0 -12
  18. package/dist/bg-BG.module.js.map +0 -1
  19. package/dist/cs-CZ.main.js +0 -10
  20. package/dist/cs-CZ.main.js.map +0 -1
  21. package/dist/cs-CZ.mjs +0 -12
  22. package/dist/cs-CZ.module.js +0 -12
  23. package/dist/cs-CZ.module.js.map +0 -1
  24. package/dist/da-DK.main.js +0 -10
  25. package/dist/da-DK.main.js.map +0 -1
  26. package/dist/da-DK.mjs +0 -12
  27. package/dist/da-DK.module.js +0 -12
  28. package/dist/da-DK.module.js.map +0 -1
  29. package/dist/de-DE.main.js +0 -10
  30. package/dist/de-DE.main.js.map +0 -1
  31. package/dist/de-DE.mjs +0 -12
  32. package/dist/de-DE.module.js +0 -12
  33. package/dist/de-DE.module.js.map +0 -1
  34. package/dist/el-GR.main.js +0 -10
  35. package/dist/el-GR.main.js.map +0 -1
  36. package/dist/el-GR.mjs +0 -12
  37. package/dist/el-GR.module.js +0 -12
  38. package/dist/el-GR.module.js.map +0 -1
  39. package/dist/en-US.main.js +0 -10
  40. package/dist/en-US.main.js.map +0 -1
  41. package/dist/en-US.mjs +0 -12
  42. package/dist/en-US.module.js +0 -12
  43. package/dist/en-US.module.js.map +0 -1
  44. package/dist/es-ES.main.js +0 -10
  45. package/dist/es-ES.main.js.map +0 -1
  46. package/dist/es-ES.mjs +0 -12
  47. package/dist/es-ES.module.js +0 -12
  48. package/dist/es-ES.module.js.map +0 -1
  49. package/dist/et-EE.main.js +0 -10
  50. package/dist/et-EE.main.js.map +0 -1
  51. package/dist/et-EE.mjs +0 -12
  52. package/dist/et-EE.module.js +0 -12
  53. package/dist/et-EE.module.js.map +0 -1
  54. package/dist/fi-FI.main.js +0 -10
  55. package/dist/fi-FI.main.js.map +0 -1
  56. package/dist/fi-FI.mjs +0 -12
  57. package/dist/fi-FI.module.js +0 -12
  58. package/dist/fi-FI.module.js.map +0 -1
  59. package/dist/fr-FR.main.js +0 -10
  60. package/dist/fr-FR.main.js.map +0 -1
  61. package/dist/fr-FR.mjs +0 -12
  62. package/dist/fr-FR.module.js +0 -12
  63. package/dist/fr-FR.module.js.map +0 -1
  64. package/dist/he-IL.main.js +0 -10
  65. package/dist/he-IL.main.js.map +0 -1
  66. package/dist/he-IL.mjs +0 -12
  67. package/dist/he-IL.module.js +0 -12
  68. package/dist/he-IL.module.js.map +0 -1
  69. package/dist/hr-HR.main.js +0 -10
  70. package/dist/hr-HR.main.js.map +0 -1
  71. package/dist/hr-HR.mjs +0 -12
  72. package/dist/hr-HR.module.js +0 -12
  73. package/dist/hr-HR.module.js.map +0 -1
  74. package/dist/hu-HU.main.js +0 -10
  75. package/dist/hu-HU.main.js.map +0 -1
  76. package/dist/hu-HU.mjs +0 -12
  77. package/dist/hu-HU.module.js +0 -12
  78. package/dist/hu-HU.module.js.map +0 -1
  79. package/dist/intlStrings.main.js +0 -108
  80. package/dist/intlStrings.main.js.map +0 -1
  81. package/dist/intlStrings.mjs +0 -110
  82. package/dist/intlStrings.module.js +0 -110
  83. package/dist/intlStrings.module.js.map +0 -1
  84. package/dist/it-IT.main.js +0 -10
  85. package/dist/it-IT.main.js.map +0 -1
  86. package/dist/it-IT.mjs +0 -12
  87. package/dist/it-IT.module.js +0 -12
  88. package/dist/it-IT.module.js.map +0 -1
  89. package/dist/ja-JP.main.js +0 -10
  90. package/dist/ja-JP.main.js.map +0 -1
  91. package/dist/ja-JP.mjs +0 -12
  92. package/dist/ja-JP.module.js +0 -12
  93. package/dist/ja-JP.module.js.map +0 -1
  94. package/dist/ko-KR.main.js +0 -10
  95. package/dist/ko-KR.main.js.map +0 -1
  96. package/dist/ko-KR.mjs +0 -12
  97. package/dist/ko-KR.module.js +0 -12
  98. package/dist/ko-KR.module.js.map +0 -1
  99. package/dist/lt-LT.main.js +0 -10
  100. package/dist/lt-LT.main.js.map +0 -1
  101. package/dist/lt-LT.mjs +0 -12
  102. package/dist/lt-LT.module.js +0 -12
  103. package/dist/lt-LT.module.js.map +0 -1
  104. package/dist/lv-LV.main.js +0 -10
  105. package/dist/lv-LV.main.js.map +0 -1
  106. package/dist/lv-LV.mjs +0 -12
  107. package/dist/lv-LV.module.js +0 -12
  108. package/dist/lv-LV.module.js.map +0 -1
  109. package/dist/nb-NO.main.js +0 -10
  110. package/dist/nb-NO.main.js.map +0 -1
  111. package/dist/nb-NO.mjs +0 -12
  112. package/dist/nb-NO.module.js +0 -12
  113. package/dist/nb-NO.module.js.map +0 -1
  114. package/dist/nl-NL.main.js +0 -10
  115. package/dist/nl-NL.main.js.map +0 -1
  116. package/dist/nl-NL.mjs +0 -12
  117. package/dist/nl-NL.module.js +0 -12
  118. package/dist/nl-NL.module.js.map +0 -1
  119. package/dist/pl-PL.main.js +0 -12
  120. package/dist/pl-PL.main.js.map +0 -1
  121. package/dist/pl-PL.mjs +0 -14
  122. package/dist/pl-PL.module.js +0 -14
  123. package/dist/pl-PL.module.js.map +0 -1
  124. package/dist/pt-BR.main.js +0 -10
  125. package/dist/pt-BR.main.js.map +0 -1
  126. package/dist/pt-BR.mjs +0 -12
  127. package/dist/pt-BR.module.js +0 -12
  128. package/dist/pt-BR.module.js.map +0 -1
  129. package/dist/pt-PT.main.js +0 -10
  130. package/dist/pt-PT.main.js.map +0 -1
  131. package/dist/pt-PT.mjs +0 -12
  132. package/dist/pt-PT.module.js +0 -12
  133. package/dist/pt-PT.module.js.map +0 -1
  134. package/dist/ro-RO.main.js +0 -10
  135. package/dist/ro-RO.main.js.map +0 -1
  136. package/dist/ro-RO.mjs +0 -12
  137. package/dist/ro-RO.module.js +0 -12
  138. package/dist/ro-RO.module.js.map +0 -1
  139. package/dist/ru-RU.main.js +0 -10
  140. package/dist/ru-RU.main.js.map +0 -1
  141. package/dist/ru-RU.mjs +0 -12
  142. package/dist/ru-RU.module.js +0 -12
  143. package/dist/ru-RU.module.js.map +0 -1
  144. package/dist/sk-SK.main.js +0 -11
  145. package/dist/sk-SK.main.js.map +0 -1
  146. package/dist/sk-SK.mjs +0 -13
  147. package/dist/sk-SK.module.js +0 -13
  148. package/dist/sk-SK.module.js.map +0 -1
  149. package/dist/sl-SI.main.js +0 -12
  150. package/dist/sl-SI.main.js.map +0 -1
  151. package/dist/sl-SI.mjs +0 -14
  152. package/dist/sl-SI.module.js +0 -14
  153. package/dist/sl-SI.module.js.map +0 -1
  154. package/dist/sr-SP.main.js +0 -10
  155. package/dist/sr-SP.main.js.map +0 -1
  156. package/dist/sr-SP.mjs +0 -12
  157. package/dist/sr-SP.module.js +0 -12
  158. package/dist/sr-SP.module.js.map +0 -1
  159. package/dist/sv-SE.main.js +0 -10
  160. package/dist/sv-SE.main.js.map +0 -1
  161. package/dist/sv-SE.mjs +0 -12
  162. package/dist/sv-SE.module.js +0 -12
  163. package/dist/sv-SE.module.js.map +0 -1
  164. package/dist/tr-TR.main.js +0 -10
  165. package/dist/tr-TR.main.js.map +0 -1
  166. package/dist/tr-TR.mjs +0 -12
  167. package/dist/tr-TR.module.js +0 -12
  168. package/dist/tr-TR.module.js.map +0 -1
  169. package/dist/types.d.ts +0 -42
  170. package/dist/types.d.ts.map +0 -1
  171. package/dist/uk-UA.main.js +0 -10
  172. package/dist/uk-UA.main.js.map +0 -1
  173. package/dist/uk-UA.mjs +0 -12
  174. package/dist/uk-UA.module.js +0 -12
  175. package/dist/uk-UA.module.js.map +0 -1
  176. package/dist/useToast.main.js +0 -83
  177. package/dist/useToast.main.js.map +0 -1
  178. package/dist/useToast.mjs +0 -78
  179. package/dist/useToast.module.js +0 -78
  180. package/dist/useToast.module.js.map +0 -1
  181. package/dist/useToastRegion.main.js +0 -184
  182. package/dist/useToastRegion.main.js.map +0 -1
  183. package/dist/useToastRegion.mjs +0 -179
  184. package/dist/useToastRegion.module.js +0 -179
  185. package/dist/useToastRegion.module.js.map +0 -1
  186. package/dist/zh-CN.main.js +0 -10
  187. package/dist/zh-CN.main.js.map +0 -1
  188. package/dist/zh-CN.mjs +0 -12
  189. package/dist/zh-CN.module.js +0 -12
  190. package/dist/zh-CN.module.js.map +0 -1
  191. package/dist/zh-TW.main.js +0 -10
  192. package/dist/zh-TW.main.js.map +0 -1
  193. package/dist/zh-TW.mjs +0 -12
  194. package/dist/zh-TW.module.js +0 -12
  195. package/dist/zh-TW.module.js.map +0 -1
  196. package/src/useToast.ts +0 -102
  197. package/src/useToastRegion.ts +0 -201
@@ -1,184 +0,0 @@
1
- var $f49b2d6c91681304$exports = require("./intlStrings.main.js");
2
- var $eO7VF$reactariautils = require("@react-aria/utils");
3
- var $eO7VF$reactariainteractions = require("@react-aria/interactions");
4
- var $eO7VF$react = require("react");
5
- var $eO7VF$reactarialandmark = require("@react-aria/landmark");
6
- var $eO7VF$reactariai18n = require("@react-aria/i18n");
7
-
8
-
9
- function $parcel$interopDefault(a) {
10
- return a && a.__esModule ? a.default : a;
11
- }
12
-
13
- function $parcel$export(e, n, v, s) {
14
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
- }
16
-
17
- $parcel$export(module.exports, "useToastRegion", () => $eda7c6204a682dd4$export$b8cbbb20a51697de);
18
- /*
19
- * Copyright 2025 Adobe. All rights reserved.
20
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
- * you may not use this file except in compliance with the License. You may obtain a copy
22
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
- *
24
- * Unless required by applicable law or agreed to in writing, software distributed under
25
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
- * OF ANY KIND, either express or implied. See the License for the specific language
27
- * governing permissions and limitations under the License.
28
- */
29
-
30
-
31
-
32
-
33
-
34
- function $eda7c6204a682dd4$export$b8cbbb20a51697de(props, state, ref) {
35
- let stringFormatter = (0, $eO7VF$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($f49b2d6c91681304$exports))), '@react-aria/toast');
36
- let { landmarkProps: landmarkProps } = (0, $eO7VF$reactarialandmark.useLandmark)({
37
- role: 'region',
38
- 'aria-label': props['aria-label'] || stringFormatter.format('notifications', {
39
- count: state.visibleToasts.length
40
- })
41
- }, ref);
42
- let isHovered = (0, $eO7VF$react.useRef)(false);
43
- let isFocused = (0, $eO7VF$react.useRef)(false);
44
- let updateTimers = (0, $eO7VF$react.useCallback)(()=>{
45
- if (isHovered.current || isFocused.current) state.pauseAll();
46
- else state.resumeAll();
47
- }, [
48
- state
49
- ]);
50
- let { hoverProps: hoverProps } = (0, $eO7VF$reactariainteractions.useHover)({
51
- onHoverStart: ()=>{
52
- isHovered.current = true;
53
- updateTimers();
54
- },
55
- onHoverEnd: ()=>{
56
- isHovered.current = false;
57
- updateTimers();
58
- }
59
- });
60
- // Manage focus within the toast region.
61
- // If a focused containing toast is removed, move focus to the next toast, or the previous toast if there is no next toast.
62
- let toasts = (0, $eO7VF$react.useRef)([]);
63
- let prevVisibleToasts = (0, $eO7VF$react.useRef)(state.visibleToasts);
64
- let focusedToast = (0, $eO7VF$react.useRef)(null);
65
- (0, $eO7VF$reactariautils.useLayoutEffect)(()=>{
66
- // If no toast has focus, then don't do anything.
67
- if (focusedToast.current === -1 || state.visibleToasts.length === 0 || !ref.current) {
68
- toasts.current = [];
69
- prevVisibleToasts.current = state.visibleToasts;
70
- return;
71
- }
72
- toasts.current = [
73
- ...ref.current.querySelectorAll('[role="alertdialog"]')
74
- ];
75
- // If the visible toasts haven't changed, we don't need to do anything.
76
- if (prevVisibleToasts.current.length === state.visibleToasts.length && state.visibleToasts.every((t, i)=>t.key === prevVisibleToasts.current[i].key)) {
77
- prevVisibleToasts.current = state.visibleToasts;
78
- return;
79
- }
80
- // Get a list of all toasts by index and add info if they are removed.
81
- let allToasts = prevVisibleToasts.current.map((t, i)=>({
82
- ...t,
83
- i: i,
84
- isRemoved: !state.visibleToasts.some((t2)=>t.key === t2.key)
85
- }));
86
- let removedFocusedToastIndex = allToasts.findIndex((t)=>t.i === focusedToast.current && t.isRemoved);
87
- // If the focused toast was removed, focus the next or previous toast.
88
- if (removedFocusedToastIndex > -1) {
89
- var _lastFocused_current;
90
- // In pointer modality, move focus out of the toast region.
91
- // Otherwise auto-dismiss timers will appear "stuck".
92
- if ((0, $eO7VF$reactariainteractions.getInteractionModality)() === 'pointer' && ((_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.isConnected)) (0, $eO7VF$reactariautils.focusWithoutScrolling)(lastFocused.current);
93
- else {
94
- let i = 0;
95
- let nextToast;
96
- let prevToast;
97
- while(i <= removedFocusedToastIndex){
98
- if (!allToasts[i].isRemoved) prevToast = Math.max(0, i - 1);
99
- i++;
100
- }
101
- while(i < allToasts.length){
102
- if (!allToasts[i].isRemoved) {
103
- nextToast = i - 1;
104
- break;
105
- }
106
- i++;
107
- }
108
- // in the case where it's one toast at a time, both will be undefined, but we know the index must be 0
109
- if (prevToast === undefined && nextToast === undefined) prevToast = 0;
110
- // prioritize going to newer toasts
111
- if (prevToast >= 0 && prevToast < toasts.current.length) (0, $eO7VF$reactariautils.focusWithoutScrolling)(toasts.current[prevToast]);
112
- else if (nextToast >= 0 && nextToast < toasts.current.length) (0, $eO7VF$reactariautils.focusWithoutScrolling)(toasts.current[nextToast]);
113
- }
114
- }
115
- prevVisibleToasts.current = state.visibleToasts;
116
- }, [
117
- state.visibleToasts,
118
- ref
119
- ]);
120
- let lastFocused = (0, $eO7VF$react.useRef)(null);
121
- let { focusWithinProps: focusWithinProps } = (0, $eO7VF$reactariainteractions.useFocusWithin)({
122
- onFocusWithin: (e)=>{
123
- isFocused.current = true;
124
- lastFocused.current = e.relatedTarget;
125
- updateTimers();
126
- },
127
- onBlurWithin: ()=>{
128
- isFocused.current = false;
129
- lastFocused.current = null;
130
- updateTimers();
131
- }
132
- });
133
- // When the number of visible toasts becomes 0 or the region unmounts,
134
- // restore focus to the last element that had focus before the user moved focus
135
- // into the region. FocusScope restore focus doesn't update whenever the focus
136
- // moves in, it only happens once, so we correct it.
137
- // Because we're in a hook, we can't control if the user unmounts or not.
138
- (0, $eO7VF$react.useEffect)(()=>{
139
- var _lastFocused_current;
140
- if (state.visibleToasts.length === 0 && ((_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.isConnected)) {
141
- if ((0, $eO7VF$reactariainteractions.getInteractionModality)() === 'pointer') (0, $eO7VF$reactariautils.focusWithoutScrolling)(lastFocused.current);
142
- else lastFocused.current.focus();
143
- lastFocused.current = null;
144
- }
145
- }, [
146
- ref,
147
- state.visibleToasts.length
148
- ]);
149
- (0, $eO7VF$react.useEffect)(()=>{
150
- return ()=>{
151
- var _lastFocused_current;
152
- if ((_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.isConnected) {
153
- if ((0, $eO7VF$reactariainteractions.getInteractionModality)() === 'pointer') (0, $eO7VF$reactariautils.focusWithoutScrolling)(lastFocused.current);
154
- else lastFocused.current.focus();
155
- lastFocused.current = null;
156
- }
157
- };
158
- }, [
159
- ref
160
- ]);
161
- return {
162
- regionProps: (0, $eO7VF$reactariautils.mergeProps)(landmarkProps, hoverProps, focusWithinProps, {
163
- tabIndex: -1,
164
- // Mark the toast region as a "top layer", so that it:
165
- // - is not aria-hidden when opening an overlay
166
- // - allows focus even outside a containing focus scope
167
- // - doesn’t dismiss overlays when clicking on it, even though it is outside
168
- // @ts-ignore
169
- 'data-react-aria-top-layer': true,
170
- // listen to focus events separate from focuswithin because that will only fire once
171
- // and we need to follow all focus changes
172
- onFocus: (e)=>{
173
- let target = e.target.closest('[role="alertdialog"]');
174
- focusedToast.current = toasts.current.findIndex((t)=>t === target);
175
- },
176
- onBlur: ()=>{
177
- focusedToast.current = -1;
178
- }
179
- })
180
- };
181
- }
182
-
183
-
184
- //# sourceMappingURL=useToastRegion.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA6BM,SAAS,0CAAkB,KAA2B,EAAE,KAAoB,EAAE,GAAkC;IACrH,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,oCAAU,EAAE;QAChC,MAAM;QACN,cAAc,KAAK,CAAC,aAAa,IAAI,gBAAgB,MAAM,CAAC,iBAAiB;YAAC,OAAO,MAAM,aAAa,CAAC,MAAM;QAAA;IACjH,GAAG;IAEH,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,eAAe,CAAA,GAAA,wBAAU,EAAE;QAC7B,IAAI,UAAU,OAAO,IAAI,UAAU,OAAO,EACxC,MAAM,QAAQ;aAEd,MAAM,SAAS;IAEnB,GAAG;QAAC;KAAM;IAEV,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;QAC1B,cAAc;YACZ,UAAU,OAAO,GAAG;YACpB;QACF;QACA,YAAY;YACV,UAAU,OAAO,GAAG;YACpB;QACF;IACF;IAEA,wCAAwC;IACxC,2HAA2H;IAC3H,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAsB,EAAE;IAC1C,IAAI,oBAAoB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,CAAC,KAAK;YAE3B,YAAY,OAAO,GAAG;QACxB;IACF,GAAG;QAAC;QAAK,MAAM,aAAa,CAAC,MAAM;KAAC;IAEpC,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO;gBACD;YAAJ,KAAI,uBAAA,YAAY,OAAO,cAAnB,2CAAA,qBAAqB,WAAW,EAAE;gBACpC,IAAI,CAAA,GAAA,mDAAqB,QAAQ,WAC/B,CAAA,GAAA,2CAAoB,EAAE,YAAY,OAAO;qBAEzC,YAAY,OAAO,CAAC,KAAK;gBAE3B,YAAY,OAAO,GAAG;YACxB;QACF;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;YAC7B,oFAAoF;YACpF,0CAA0C;YAC1C,SAAS,CAAC;gBACR,IAAI,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC;gBAC9B,aAAa,OAAO,GAAG,OAAO,OAAO,CAAC,SAAS,CAAC,CAAA,IAAK,MAAM;YAC7D;YACA,QAAQ;gBACN,aAAa,OAAO,GAAG;YACzB;QACF;IACF;AACF","sources":["packages/@react-aria/toast/src/useToastRegion.ts"],"sourcesContent":["/*\n * Copyright 2025 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 {AriaLabelingProps, DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {focusWithoutScrolling, mergeProps, useLayoutEffect} from '@react-aria/utils';\nimport {getInteractionModality, useFocusWithin, useHover} from '@react-aria/interactions';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ToastState} from '@react-stately/toast';\nimport {useCallback, useEffect, useRef} from 'react';\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 | null>): 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', {count: state.visibleToasts.length})\n }, ref);\n\n let isHovered = useRef(false);\n let isFocused = useRef(false);\n let updateTimers = useCallback(() => {\n if (isHovered.current || isFocused.current) {\n state.pauseAll();\n } else {\n state.resumeAll();\n }\n }, [state]);\n\n let {hoverProps} = useHover({\n onHoverStart: () => {\n isHovered.current = true;\n updateTimers();\n },\n onHoverEnd: () => {\n isHovered.current = false;\n updateTimers();\n }\n });\n\n // Manage focus within the toast region.\n // If a focused containing toast is removed, move focus to the next toast, or the previous toast if there is no next toast.\n let toasts = useRef<FocusableElement[]>([]);\n let prevVisibleToasts = useRef(state.visibleToasts);\n let focusedToast = useRef<number | null>(null);\n useLayoutEffect(() => {\n // If no toast has focus, then don't do anything.\n if (focusedToast.current === -1 || state.visibleToasts.length === 0 || !ref.current) {\n toasts.current = [];\n prevVisibleToasts.current = state.visibleToasts;\n return;\n }\n toasts.current = [...ref.current.querySelectorAll('[role=\"alertdialog\"]')] as FocusableElement[];\n // If the visible toasts haven't changed, we don't need to do anything.\n if (prevVisibleToasts.current.length === state.visibleToasts.length\n && state.visibleToasts.every((t, i) => t.key === prevVisibleToasts.current[i].key)) {\n prevVisibleToasts.current = state.visibleToasts;\n return;\n }\n // Get a list of all toasts by index and add info if they are removed.\n let allToasts = prevVisibleToasts.current\n .map((t, i) => ({\n ...t,\n i,\n isRemoved: !state.visibleToasts.some(t2 => t.key === t2.key)\n }));\n\n let removedFocusedToastIndex = allToasts.findIndex(t => t.i === focusedToast.current && t.isRemoved);\n\n // If the focused toast was removed, focus the next or previous toast.\n if (removedFocusedToastIndex > -1) {\n // In pointer modality, move focus out of the toast region.\n // Otherwise auto-dismiss timers will appear \"stuck\".\n if (getInteractionModality() === 'pointer' && lastFocused.current?.isConnected) {\n focusWithoutScrolling(lastFocused.current);\n } else {\n let i = 0;\n let nextToast;\n let prevToast;\n while (i <= removedFocusedToastIndex) {\n if (!allToasts[i].isRemoved) {\n prevToast = Math.max(0, i - 1);\n }\n i++;\n }\n while (i < allToasts.length) {\n if (!allToasts[i].isRemoved) {\n nextToast = i - 1;\n break;\n }\n i++;\n }\n\n // in the case where it's one toast at a time, both will be undefined, but we know the index must be 0\n if (prevToast === undefined && nextToast === undefined) {\n prevToast = 0;\n }\n\n // prioritize going to newer toasts\n if (prevToast >= 0 && prevToast < toasts.current.length) {\n focusWithoutScrolling(toasts.current[prevToast]);\n } else if (nextToast >= 0 && nextToast < toasts.current.length) {\n focusWithoutScrolling(toasts.current[nextToast]);\n }\n }\n }\n\n prevVisibleToasts.current = state.visibleToasts;\n }, [state.visibleToasts, ref]);\n\n let lastFocused = useRef<FocusableElement | null>(null);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithin: (e) => {\n isFocused.current = true;\n lastFocused.current = e.relatedTarget as FocusableElement;\n updateTimers();\n },\n onBlurWithin: () => {\n isFocused.current = false;\n lastFocused.current = null;\n updateTimers();\n }\n });\n\n // When the number of visible toasts becomes 0 or the region unmounts,\n // restore focus to the last element that had focus before the user moved focus\n // into the region. FocusScope restore focus doesn't update whenever the focus\n // moves in, it only happens once, so we correct it.\n // Because we're in a hook, we can't control if the user unmounts or not.\n useEffect(() => {\n if (state.visibleToasts.length === 0 && lastFocused.current?.isConnected) {\n if (getInteractionModality() === 'pointer') {\n focusWithoutScrolling(lastFocused.current);\n } else {\n lastFocused.current.focus();\n }\n lastFocused.current = null;\n }\n }, [ref, state.visibleToasts.length]);\n\n useEffect(() => {\n return () => {\n if (lastFocused.current?.isConnected) {\n if (getInteractionModality() === 'pointer') {\n focusWithoutScrolling(lastFocused.current);\n } else {\n lastFocused.current.focus();\n }\n lastFocused.current = null;\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 // listen to focus events separate from focuswithin because that will only fire once\n // and we need to follow all focus changes\n onFocus: (e) => {\n let target = e.target.closest('[role=\"alertdialog\"]');\n focusedToast.current = toasts.current.findIndex(t => t === target);\n },\n onBlur: () => {\n focusedToast.current = -1;\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useToastRegion.main.js.map"}
@@ -1,179 +0,0 @@
1
- import $ckyCP$intlStringsmodulejs from "./intlStrings.mjs";
2
- import {useLayoutEffect as $ckyCP$useLayoutEffect, focusWithoutScrolling as $ckyCP$focusWithoutScrolling, mergeProps as $ckyCP$mergeProps} from "@react-aria/utils";
3
- import {useHover as $ckyCP$useHover, getInteractionModality as $ckyCP$getInteractionModality, useFocusWithin as $ckyCP$useFocusWithin} from "@react-aria/interactions";
4
- import {useRef as $ckyCP$useRef, useCallback as $ckyCP$useCallback, useEffect as $ckyCP$useEffect} from "react";
5
- import {useLandmark as $ckyCP$useLandmark} from "@react-aria/landmark";
6
- import {useLocalizedStringFormatter as $ckyCP$useLocalizedStringFormatter} from "@react-aria/i18n";
7
-
8
-
9
- function $parcel$interopDefault(a) {
10
- return a && a.__esModule ? a.default : a;
11
- }
12
- /*
13
- * Copyright 2025 Adobe. All rights reserved.
14
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
- * you may not use this file except in compliance with the License. You may obtain a copy
16
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software distributed under
19
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
- * OF ANY KIND, either express or implied. See the License for the specific language
21
- * governing permissions and limitations under the License.
22
- */
23
-
24
-
25
-
26
-
27
-
28
- function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
29
- let stringFormatter = (0, $ckyCP$useLocalizedStringFormatter)((0, ($parcel$interopDefault($ckyCP$intlStringsmodulejs))), '@react-aria/toast');
30
- let { landmarkProps: landmarkProps } = (0, $ckyCP$useLandmark)({
31
- role: 'region',
32
- 'aria-label': props['aria-label'] || stringFormatter.format('notifications', {
33
- count: state.visibleToasts.length
34
- })
35
- }, ref);
36
- let isHovered = (0, $ckyCP$useRef)(false);
37
- let isFocused = (0, $ckyCP$useRef)(false);
38
- let updateTimers = (0, $ckyCP$useCallback)(()=>{
39
- if (isHovered.current || isFocused.current) state.pauseAll();
40
- else state.resumeAll();
41
- }, [
42
- state
43
- ]);
44
- let { hoverProps: hoverProps } = (0, $ckyCP$useHover)({
45
- onHoverStart: ()=>{
46
- isHovered.current = true;
47
- updateTimers();
48
- },
49
- onHoverEnd: ()=>{
50
- isHovered.current = false;
51
- updateTimers();
52
- }
53
- });
54
- // Manage focus within the toast region.
55
- // If a focused containing toast is removed, move focus to the next toast, or the previous toast if there is no next toast.
56
- let toasts = (0, $ckyCP$useRef)([]);
57
- let prevVisibleToasts = (0, $ckyCP$useRef)(state.visibleToasts);
58
- let focusedToast = (0, $ckyCP$useRef)(null);
59
- (0, $ckyCP$useLayoutEffect)(()=>{
60
- // If no toast has focus, then don't do anything.
61
- if (focusedToast.current === -1 || state.visibleToasts.length === 0 || !ref.current) {
62
- toasts.current = [];
63
- prevVisibleToasts.current = state.visibleToasts;
64
- return;
65
- }
66
- toasts.current = [
67
- ...ref.current.querySelectorAll('[role="alertdialog"]')
68
- ];
69
- // If the visible toasts haven't changed, we don't need to do anything.
70
- if (prevVisibleToasts.current.length === state.visibleToasts.length && state.visibleToasts.every((t, i)=>t.key === prevVisibleToasts.current[i].key)) {
71
- prevVisibleToasts.current = state.visibleToasts;
72
- return;
73
- }
74
- // Get a list of all toasts by index and add info if they are removed.
75
- let allToasts = prevVisibleToasts.current.map((t, i)=>({
76
- ...t,
77
- i: i,
78
- isRemoved: !state.visibleToasts.some((t2)=>t.key === t2.key)
79
- }));
80
- let removedFocusedToastIndex = allToasts.findIndex((t)=>t.i === focusedToast.current && t.isRemoved);
81
- // If the focused toast was removed, focus the next or previous toast.
82
- if (removedFocusedToastIndex > -1) {
83
- var _lastFocused_current;
84
- // In pointer modality, move focus out of the toast region.
85
- // Otherwise auto-dismiss timers will appear "stuck".
86
- if ((0, $ckyCP$getInteractionModality)() === 'pointer' && ((_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.isConnected)) (0, $ckyCP$focusWithoutScrolling)(lastFocused.current);
87
- else {
88
- let i = 0;
89
- let nextToast;
90
- let prevToast;
91
- while(i <= removedFocusedToastIndex){
92
- if (!allToasts[i].isRemoved) prevToast = Math.max(0, i - 1);
93
- i++;
94
- }
95
- while(i < allToasts.length){
96
- if (!allToasts[i].isRemoved) {
97
- nextToast = i - 1;
98
- break;
99
- }
100
- i++;
101
- }
102
- // in the case where it's one toast at a time, both will be undefined, but we know the index must be 0
103
- if (prevToast === undefined && nextToast === undefined) prevToast = 0;
104
- // prioritize going to newer toasts
105
- if (prevToast >= 0 && prevToast < toasts.current.length) (0, $ckyCP$focusWithoutScrolling)(toasts.current[prevToast]);
106
- else if (nextToast >= 0 && nextToast < toasts.current.length) (0, $ckyCP$focusWithoutScrolling)(toasts.current[nextToast]);
107
- }
108
- }
109
- prevVisibleToasts.current = state.visibleToasts;
110
- }, [
111
- state.visibleToasts,
112
- ref
113
- ]);
114
- let lastFocused = (0, $ckyCP$useRef)(null);
115
- let { focusWithinProps: focusWithinProps } = (0, $ckyCP$useFocusWithin)({
116
- onFocusWithin: (e)=>{
117
- isFocused.current = true;
118
- lastFocused.current = e.relatedTarget;
119
- updateTimers();
120
- },
121
- onBlurWithin: ()=>{
122
- isFocused.current = false;
123
- lastFocused.current = null;
124
- updateTimers();
125
- }
126
- });
127
- // When the number of visible toasts becomes 0 or the region unmounts,
128
- // restore focus to the last element that had focus before the user moved focus
129
- // into the region. FocusScope restore focus doesn't update whenever the focus
130
- // moves in, it only happens once, so we correct it.
131
- // Because we're in a hook, we can't control if the user unmounts or not.
132
- (0, $ckyCP$useEffect)(()=>{
133
- var _lastFocused_current;
134
- if (state.visibleToasts.length === 0 && ((_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.isConnected)) {
135
- if ((0, $ckyCP$getInteractionModality)() === 'pointer') (0, $ckyCP$focusWithoutScrolling)(lastFocused.current);
136
- else lastFocused.current.focus();
137
- lastFocused.current = null;
138
- }
139
- }, [
140
- ref,
141
- state.visibleToasts.length
142
- ]);
143
- (0, $ckyCP$useEffect)(()=>{
144
- return ()=>{
145
- var _lastFocused_current;
146
- if ((_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.isConnected) {
147
- if ((0, $ckyCP$getInteractionModality)() === 'pointer') (0, $ckyCP$focusWithoutScrolling)(lastFocused.current);
148
- else lastFocused.current.focus();
149
- lastFocused.current = null;
150
- }
151
- };
152
- }, [
153
- ref
154
- ]);
155
- return {
156
- regionProps: (0, $ckyCP$mergeProps)(landmarkProps, hoverProps, focusWithinProps, {
157
- tabIndex: -1,
158
- // Mark the toast region as a "top layer", so that it:
159
- // - is not aria-hidden when opening an overlay
160
- // - allows focus even outside a containing focus scope
161
- // - doesn’t dismiss overlays when clicking on it, even though it is outside
162
- // @ts-ignore
163
- 'data-react-aria-top-layer': true,
164
- // listen to focus events separate from focuswithin because that will only fire once
165
- // and we need to follow all focus changes
166
- onFocus: (e)=>{
167
- let target = e.target.closest('[role="alertdialog"]');
168
- focusedToast.current = toasts.current.findIndex((t)=>t === target);
169
- },
170
- onBlur: ()=>{
171
- focusedToast.current = -1;
172
- }
173
- })
174
- };
175
- }
176
-
177
-
178
- export {$6cc546b19ee7130a$export$b8cbbb20a51697de as useToastRegion};
179
- //# sourceMappingURL=useToastRegion.module.js.map
@@ -1,179 +0,0 @@
1
- import $ckyCP$intlStringsmodulejs from "./intlStrings.module.js";
2
- import {useLayoutEffect as $ckyCP$useLayoutEffect, focusWithoutScrolling as $ckyCP$focusWithoutScrolling, mergeProps as $ckyCP$mergeProps} from "@react-aria/utils";
3
- import {useHover as $ckyCP$useHover, getInteractionModality as $ckyCP$getInteractionModality, useFocusWithin as $ckyCP$useFocusWithin} from "@react-aria/interactions";
4
- import {useRef as $ckyCP$useRef, useCallback as $ckyCP$useCallback, useEffect as $ckyCP$useEffect} from "react";
5
- import {useLandmark as $ckyCP$useLandmark} from "@react-aria/landmark";
6
- import {useLocalizedStringFormatter as $ckyCP$useLocalizedStringFormatter} from "@react-aria/i18n";
7
-
8
-
9
- function $parcel$interopDefault(a) {
10
- return a && a.__esModule ? a.default : a;
11
- }
12
- /*
13
- * Copyright 2025 Adobe. All rights reserved.
14
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
- * you may not use this file except in compliance with the License. You may obtain a copy
16
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software distributed under
19
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
- * OF ANY KIND, either express or implied. See the License for the specific language
21
- * governing permissions and limitations under the License.
22
- */
23
-
24
-
25
-
26
-
27
-
28
- function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
29
- let stringFormatter = (0, $ckyCP$useLocalizedStringFormatter)((0, ($parcel$interopDefault($ckyCP$intlStringsmodulejs))), '@react-aria/toast');
30
- let { landmarkProps: landmarkProps } = (0, $ckyCP$useLandmark)({
31
- role: 'region',
32
- 'aria-label': props['aria-label'] || stringFormatter.format('notifications', {
33
- count: state.visibleToasts.length
34
- })
35
- }, ref);
36
- let isHovered = (0, $ckyCP$useRef)(false);
37
- let isFocused = (0, $ckyCP$useRef)(false);
38
- let updateTimers = (0, $ckyCP$useCallback)(()=>{
39
- if (isHovered.current || isFocused.current) state.pauseAll();
40
- else state.resumeAll();
41
- }, [
42
- state
43
- ]);
44
- let { hoverProps: hoverProps } = (0, $ckyCP$useHover)({
45
- onHoverStart: ()=>{
46
- isHovered.current = true;
47
- updateTimers();
48
- },
49
- onHoverEnd: ()=>{
50
- isHovered.current = false;
51
- updateTimers();
52
- }
53
- });
54
- // Manage focus within the toast region.
55
- // If a focused containing toast is removed, move focus to the next toast, or the previous toast if there is no next toast.
56
- let toasts = (0, $ckyCP$useRef)([]);
57
- let prevVisibleToasts = (0, $ckyCP$useRef)(state.visibleToasts);
58
- let focusedToast = (0, $ckyCP$useRef)(null);
59
- (0, $ckyCP$useLayoutEffect)(()=>{
60
- // If no toast has focus, then don't do anything.
61
- if (focusedToast.current === -1 || state.visibleToasts.length === 0 || !ref.current) {
62
- toasts.current = [];
63
- prevVisibleToasts.current = state.visibleToasts;
64
- return;
65
- }
66
- toasts.current = [
67
- ...ref.current.querySelectorAll('[role="alertdialog"]')
68
- ];
69
- // If the visible toasts haven't changed, we don't need to do anything.
70
- if (prevVisibleToasts.current.length === state.visibleToasts.length && state.visibleToasts.every((t, i)=>t.key === prevVisibleToasts.current[i].key)) {
71
- prevVisibleToasts.current = state.visibleToasts;
72
- return;
73
- }
74
- // Get a list of all toasts by index and add info if they are removed.
75
- let allToasts = prevVisibleToasts.current.map((t, i)=>({
76
- ...t,
77
- i: i,
78
- isRemoved: !state.visibleToasts.some((t2)=>t.key === t2.key)
79
- }));
80
- let removedFocusedToastIndex = allToasts.findIndex((t)=>t.i === focusedToast.current && t.isRemoved);
81
- // If the focused toast was removed, focus the next or previous toast.
82
- if (removedFocusedToastIndex > -1) {
83
- var _lastFocused_current;
84
- // In pointer modality, move focus out of the toast region.
85
- // Otherwise auto-dismiss timers will appear "stuck".
86
- if ((0, $ckyCP$getInteractionModality)() === 'pointer' && ((_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.isConnected)) (0, $ckyCP$focusWithoutScrolling)(lastFocused.current);
87
- else {
88
- let i = 0;
89
- let nextToast;
90
- let prevToast;
91
- while(i <= removedFocusedToastIndex){
92
- if (!allToasts[i].isRemoved) prevToast = Math.max(0, i - 1);
93
- i++;
94
- }
95
- while(i < allToasts.length){
96
- if (!allToasts[i].isRemoved) {
97
- nextToast = i - 1;
98
- break;
99
- }
100
- i++;
101
- }
102
- // in the case where it's one toast at a time, both will be undefined, but we know the index must be 0
103
- if (prevToast === undefined && nextToast === undefined) prevToast = 0;
104
- // prioritize going to newer toasts
105
- if (prevToast >= 0 && prevToast < toasts.current.length) (0, $ckyCP$focusWithoutScrolling)(toasts.current[prevToast]);
106
- else if (nextToast >= 0 && nextToast < toasts.current.length) (0, $ckyCP$focusWithoutScrolling)(toasts.current[nextToast]);
107
- }
108
- }
109
- prevVisibleToasts.current = state.visibleToasts;
110
- }, [
111
- state.visibleToasts,
112
- ref
113
- ]);
114
- let lastFocused = (0, $ckyCP$useRef)(null);
115
- let { focusWithinProps: focusWithinProps } = (0, $ckyCP$useFocusWithin)({
116
- onFocusWithin: (e)=>{
117
- isFocused.current = true;
118
- lastFocused.current = e.relatedTarget;
119
- updateTimers();
120
- },
121
- onBlurWithin: ()=>{
122
- isFocused.current = false;
123
- lastFocused.current = null;
124
- updateTimers();
125
- }
126
- });
127
- // When the number of visible toasts becomes 0 or the region unmounts,
128
- // restore focus to the last element that had focus before the user moved focus
129
- // into the region. FocusScope restore focus doesn't update whenever the focus
130
- // moves in, it only happens once, so we correct it.
131
- // Because we're in a hook, we can't control if the user unmounts or not.
132
- (0, $ckyCP$useEffect)(()=>{
133
- var _lastFocused_current;
134
- if (state.visibleToasts.length === 0 && ((_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.isConnected)) {
135
- if ((0, $ckyCP$getInteractionModality)() === 'pointer') (0, $ckyCP$focusWithoutScrolling)(lastFocused.current);
136
- else lastFocused.current.focus();
137
- lastFocused.current = null;
138
- }
139
- }, [
140
- ref,
141
- state.visibleToasts.length
142
- ]);
143
- (0, $ckyCP$useEffect)(()=>{
144
- return ()=>{
145
- var _lastFocused_current;
146
- if ((_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.isConnected) {
147
- if ((0, $ckyCP$getInteractionModality)() === 'pointer') (0, $ckyCP$focusWithoutScrolling)(lastFocused.current);
148
- else lastFocused.current.focus();
149
- lastFocused.current = null;
150
- }
151
- };
152
- }, [
153
- ref
154
- ]);
155
- return {
156
- regionProps: (0, $ckyCP$mergeProps)(landmarkProps, hoverProps, focusWithinProps, {
157
- tabIndex: -1,
158
- // Mark the toast region as a "top layer", so that it:
159
- // - is not aria-hidden when opening an overlay
160
- // - allows focus even outside a containing focus scope
161
- // - doesn’t dismiss overlays when clicking on it, even though it is outside
162
- // @ts-ignore
163
- 'data-react-aria-top-layer': true,
164
- // listen to focus events separate from focuswithin because that will only fire once
165
- // and we need to follow all focus changes
166
- onFocus: (e)=>{
167
- let target = e.target.closest('[role="alertdialog"]');
168
- focusedToast.current = toasts.current.findIndex((t)=>t === target);
169
- },
170
- onBlur: ()=>{
171
- focusedToast.current = -1;
172
- }
173
- })
174
- };
175
- }
176
-
177
-
178
- export {$6cc546b19ee7130a$export$b8cbbb20a51697de as useToastRegion};
179
- //# sourceM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;gBAE3B,YAAY,OAAO,GAAG;YACxB;QACF;IACF,GAAG;QAAC;KAAI;IAER,OAAO;QACL,aAAa,CAAA,GAAA,iBAAS,EAAE,eAAe,YAAY,kBAAkB;YACnE,UAAU;YACV,sDAAsD;YACtD,iDAAiD;YACjD,yDAAyD;YACzD,8EAA8E;YAC9E,aAAa;YACb,6BAA6B;YAC7B,oFAAoF;YACpF,0CAA0C;YAC1C,SAAS,CAAC;gBACR,IAAI,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC;gBAC9B,aAAa,OAAO,GAAG,OAAO,OAAO,CAAC,SAAS,CAAC,CAAA,IAAK,MAAM;YAC7D;YACA,QAAQ;gBACN,aAAa,OAAO,GAAG;YACzB;QACF;IACF;AACF","sources":["packages/@react-aria/toast/src/useToastRegion.ts"],"sourcesContent":["/*\n * Copyright 2025 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 {AriaLabelingProps, DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {focusWithoutScrolling, mergeProps, useLayoutEffect} from '@react-aria/utils';\nimport {getInteractionModality, useFocusWithin, useHover} from '@react-aria/interactions';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ToastState} from '@react-stately/toast';\nimport {useCallback, useEffect, useRef} from 'react';\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 | null>): 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', {count: state.visibleToasts.length})\n }, ref);\n\n let isHovered = useRef(false);\n let isFocused = useRef(false);\n let updateTimers = useCallback(() => {\n if (isHovered.current || isFocused.current) {\n state.pauseAll();\n } else {\n state.resumeAll();\n }\n }, [state]);\n\n let {hoverProps} = useHover({\n onHoverStart: () => {\n isHovered.current = true;\n updateTimers();\n },\n onHoverEnd: () => {\n isHovered.current = false;\n updateTimers();\n }\n });\n\n // Manage focus within the toast region.\n // If a focused containing toast is removed, move focus to the next toast, or the previous toast if there is no next toast.\n let toasts = useRef<FocusableElement[]>([]);\n let prevVisibleToasts = useRef(state.visibleToasts);\n let focusedToast = useRef<number | null>(null);\n useLayoutEffect(() => {\n // If no toast has focus, then don't do anything.\n if (focusedToast.current === -1 || state.visibleToasts.length === 0 || !ref.current) {\n toasts.current = [];\n prevVisibleToasts.current = state.visibleToasts;\n return;\n }\n toasts.current = [...ref.current.querySelectorAll('[role=\"alertdialog\"]')] as FocusableElement[];\n // If the visible toasts haven't changed, we don't need to do anything.\n if (prevVisibleToasts.current.length === state.visibleToasts.length\n && state.visibleToasts.every((t, i) => t.key === prevVisibleToasts.current[i].key)) {\n prevVisibleToasts.current = state.visibleToasts;\n return;\n }\n // Get a list of all toasts by index and add info if they are removed.\n let allToasts = prevVisibleToasts.current\n .map((t, i) => ({\n ...t,\n i,\n isRemoved: !state.visibleToasts.some(t2 => t.key === t2.key)\n }));\n\n let removedFocusedToastIndex = allToasts.findIndex(t => t.i === focusedToast.current && t.isRemoved);\n\n // If the focused toast was removed, focus the next or previous toast.\n if (removedFocusedToastIndex > -1) {\n // In pointer modality, move focus out of the toast region.\n // Otherwise auto-dismiss timers will appear \"stuck\".\n if (getInteractionModality() === 'pointer' && lastFocused.current?.isConnected) {\n focusWithoutScrolling(lastFocused.current);\n } else {\n let i = 0;\n let nextToast;\n let prevToast;\n while (i <= removedFocusedToastIndex) {\n if (!allToasts[i].isRemoved) {\n prevToast = Math.max(0, i - 1);\n }\n i++;\n }\n while (i < allToasts.length) {\n if (!allToasts[i].isRemoved) {\n nextToast = i - 1;\n break;\n }\n i++;\n }\n\n // in the case where it's one toast at a time, both will be undefined, but we know the index must be 0\n if (prevToast === undefined && nextToast === undefined) {\n prevToast = 0;\n }\n\n // prioritize going to newer toasts\n if (prevToast >= 0 && prevToast < toasts.current.length) {\n focusWithoutScrolling(toasts.current[prevToast]);\n } else if (nextToast >= 0 && nextToast < toasts.current.length) {\n focusWithoutScrolling(toasts.current[nextToast]);\n }\n }\n }\n\n prevVisibleToasts.current = state.visibleToasts;\n }, [state.visibleToasts, ref]);\n\n let lastFocused = useRef<FocusableElement | null>(null);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithin: (e) => {\n isFocused.current = true;\n lastFocused.current = e.relatedTarget as FocusableElement;\n updateTimers();\n },\n onBlurWithin: () => {\n isFocused.current = false;\n lastFocused.current = null;\n updateTimers();\n }\n });\n\n // When the number of visible toasts becomes 0 or the region unmounts,\n // restore focus to the last element that had focus before the user moved focus\n // into the region. FocusScope restore focus doesn't update whenever the focus\n // moves in, it only happens once, so we correct it.\n // Because we're in a hook, we can't control if the user unmounts or not.\n useEffect(() => {\n if (state.visibleToasts.length === 0 && lastFocused.current?.isConnected) {\n if (getInteractionModality() === 'pointer') {\n focusWithoutScrolling(lastFocused.current);\n } else {\n lastFocused.current.focus();\n }\n lastFocused.current = null;\n }\n }, [ref, state.visibleToasts.length]);\n\n useEffect(() => {\n return () => {\n if (lastFocused.current?.isConnected) {\n if (getInteractionModality() === 'pointer') {\n focusWithoutScrolling(lastFocused.current);\n } else {\n lastFocused.current.focus();\n }\n lastFocused.current = null;\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 // listen to focus events separate from focuswithin because that will only fire once\n // and we need to follow all focus changes\n onFocus: (e) => {\n let target = e.target.closest('[role=\"alertdialog\"]');\n focusedToast.current = toasts.current.findIndex(t => t === target);\n },\n onBlur: () => {\n focusedToast.current = -1;\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useToastRegion.module.js.map"}
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- "close": `\u{5173}\u{95ED}`,
3
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
4
- one: ()=>`${formatter.number(args.count)} \u{4E2A}\u{901A}\u{77E5}`,
5
- other: ()=>`${formatter.number(args.count)} \u{4E2A}\u{901A}\u{77E5}`
6
- })}\u{3002}`
7
- };
8
-
9
-
10
- //# sourceMappingURL=zh-CN.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,gBAAE,CAAC;IAC/B,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,yBAAI,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,yBAAI,CAAC;QAAA,GAAG,QAAC,CAAC;AAClL","sources":["packages/@react-aria/toast/intl/zh-CN.json"],"sourcesContent":["{\n \"close\": \"关闭\",\n \"notifications\": \"{count, plural, one {# 个通知} other {# 个通知}}。\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
package/dist/zh-CN.mjs DELETED
@@ -1,12 +0,0 @@
1
- var $122525af1cb737c7$exports = {};
2
- $122525af1cb737c7$exports = {
3
- "close": `\u{5173}\u{95ED}`,
4
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
5
- one: ()=>`${formatter.number(args.count)} \u{4E2A}\u{901A}\u{77E5}`,
6
- other: ()=>`${formatter.number(args.count)} \u{4E2A}\u{901A}\u{77E5}`
7
- })}\u{3002}`
8
- };
9
-
10
-
11
- export {$122525af1cb737c7$exports as default};
12
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1,12 +0,0 @@
1
- var $122525af1cb737c7$exports = {};
2
- $122525af1cb737c7$exports = {
3
- "close": `\u{5173}\u{95ED}`,
4
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
5
- one: ()=>`${formatter.number(args.count)} \u{4E2A}\u{901A}\u{77E5}`,
6
- other: ()=>`${formatter.number(args.count)} \u{4E2A}\u{901A}\u{77E5}`
7
- })}\u{3002}`
8
- };
9
-
10
-
11
- export {$122525af1cb737c7$exports as default};
12
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,gBAAE,CAAC;IAC/B,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,yBAAI,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,yBAAI,CAAC;QAAA,GAAG,QAAC,CAAC;AAClL","sources":["packages/@react-aria/toast/intl/zh-CN.json"],"sourcesContent":["{\n \"close\": \"关闭\",\n \"notifications\": \"{count, plural, one {# 个通知} other {# 个通知}}。\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- "close": `\u{95DC}\u{9589}`,
3
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
4
- one: ()=>`${formatter.number(args.count)} \u{500B}\u{901A}\u{77E5}`,
5
- other: ()=>`${formatter.number(args.count)} \u{500B}\u{901A}\u{77E5}`
6
- })}\u{3002}`
7
- };
8
-
9
-
10
- //# sourceMappingURL=zh-TW.main.js.map