@react-aria/toast 3.0.11 → 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,12 +0,0 @@
1
- var $7dbdd7289c10d2ba$exports = {};
2
- $7dbdd7289c10d2ba$exports = {
3
- "close": `Zatvori`,
4
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
5
- one: ()=>`${formatter.number(args.count)} obave\u{161}tenje`,
6
- other: ()=>`${formatter.number(args.count)} obave\u{161}tenja`
7
- })}.`
8
- };
9
-
10
-
11
- export {$7dbdd7289c10d2ba$exports as default};
12
- //# sourceMappingURL=sr-SP.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,OAAO,CAAC;IACpC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kBAAY,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kBAAY,CAAC;QAAA,GAAG,CAAC,CAAC;AAClM","sources":["packages/@react-aria/toast/intl/sr-SP.json"],"sourcesContent":["{\n \"close\": \"Zatvori\",\n \"notifications\": \"{count, plural, one {# obaveštenje} other {# obaveštenja}}.\"\n}\n"],"names":[],"version":3,"file":"sr-SP.module.js.map"}
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- "close": `St\xe4ng`,
3
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
4
- one: ()=>`${formatter.number(args.count)} meddelande`,
5
- other: ()=>`${formatter.number(args.count)} meddelanden`
6
- })}.`
7
- };
8
-
9
-
10
- //# sourceMappingURL=sv-SE.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,QAAK,CAAC;IAClC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,WAAW,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,YAAY,CAAC;QAAA,GAAG,CAAC,CAAC;AACjM","sources":["packages/@react-aria/toast/intl/sv-SE.json"],"sourcesContent":["{\n \"close\": \"Stäng\",\n \"notifications\": \"{count, plural, one {# meddelande} other {# meddelanden}}.\"\n}\n"],"names":[],"version":3,"file":"sv-SE.main.js.map"}
package/dist/sv-SE.mjs DELETED
@@ -1,12 +0,0 @@
1
- var $ccbe6066c10b1e53$exports = {};
2
- $ccbe6066c10b1e53$exports = {
3
- "close": `St\xe4ng`,
4
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
5
- one: ()=>`${formatter.number(args.count)} meddelande`,
6
- other: ()=>`${formatter.number(args.count)} meddelanden`
7
- })}.`
8
- };
9
-
10
-
11
- export {$ccbe6066c10b1e53$exports as default};
12
- //# sourceMappingURL=sv-SE.module.js.map
@@ -1,12 +0,0 @@
1
- var $ccbe6066c10b1e53$exports = {};
2
- $ccbe6066c10b1e53$exports = {
3
- "close": `St\xe4ng`,
4
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
5
- one: ()=>`${formatter.number(args.count)} meddelande`,
6
- other: ()=>`${formatter.number(args.count)} meddelanden`
7
- })}.`
8
- };
9
-
10
-
11
- export {$ccbe6066c10b1e53$exports as default};
12
- //# sourceMappingURL=sv-SE.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,QAAK,CAAC;IAClC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,WAAW,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,YAAY,CAAC;QAAA,GAAG,CAAC,CAAC;AACjM","sources":["packages/@react-aria/toast/intl/sv-SE.json"],"sourcesContent":["{\n \"close\": \"Stäng\",\n \"notifications\": \"{count, plural, one {# meddelande} other {# meddelanden}}.\"\n}\n"],"names":[],"version":3,"file":"sv-SE.module.js.map"}
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- "close": `Kapat`,
3
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
4
- one: ()=>`${formatter.number(args.count)} bildirim`,
5
- other: ()=>`${formatter.number(args.count)} bildirim`
6
- })}.`
7
- };
8
-
9
-
10
- //# sourceMappingURL=tr-TR.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,KAAK,CAAC;IAClC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,SAAS,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,SAAS,CAAC;QAAA,GAAG,CAAC,CAAC;AAC5L","sources":["packages/@react-aria/toast/intl/tr-TR.json"],"sourcesContent":["{\n \"close\": \"Kapat\",\n \"notifications\": \"{count, plural, one {# bildirim} other {# bildirim}}.\"\n}\n"],"names":[],"version":3,"file":"tr-TR.main.js.map"}
package/dist/tr-TR.mjs DELETED
@@ -1,12 +0,0 @@
1
- var $9d503476b9d858b7$exports = {};
2
- $9d503476b9d858b7$exports = {
3
- "close": `Kapat`,
4
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
5
- one: ()=>`${formatter.number(args.count)} bildirim`,
6
- other: ()=>`${formatter.number(args.count)} bildirim`
7
- })}.`
8
- };
9
-
10
-
11
- export {$9d503476b9d858b7$exports as default};
12
- //# sourceMappingURL=tr-TR.module.js.map
@@ -1,12 +0,0 @@
1
- var $9d503476b9d858b7$exports = {};
2
- $9d503476b9d858b7$exports = {
3
- "close": `Kapat`,
4
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
5
- one: ()=>`${formatter.number(args.count)} bildirim`,
6
- other: ()=>`${formatter.number(args.count)} bildirim`
7
- })}.`
8
- };
9
-
10
-
11
- export {$9d503476b9d858b7$exports as default};
12
- //# sourceMappingURL=tr-TR.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,KAAK,CAAC;IAClC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,SAAS,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,SAAS,CAAC;QAAA,GAAG,CAAC,CAAC;AAC5L","sources":["packages/@react-aria/toast/intl/tr-TR.json"],"sourcesContent":["{\n \"close\": \"Kapat\",\n \"notifications\": \"{count, plural, one {# bildirim} other {# bildirim}}.\"\n}\n"],"names":[],"version":3,"file":"tr-TR.module.js.map"}
package/dist/types.d.ts DELETED
@@ -1,42 +0,0 @@
1
- import { AriaButtonProps } from "@react-types/button";
2
- import { AriaLabelingProps, DOMAttributes, FocusableElement, RefObject } from "@react-types/shared";
3
- import { QueuedToast, ToastState } from "@react-stately/toast";
4
- export interface AriaToastProps<T> extends AriaLabelingProps {
5
- /** The toast object. */
6
- toast: QueuedToast<T>;
7
- }
8
- export interface ToastAria {
9
- /** Props for the toast container, non-modal dialog element. */
10
- toastProps: DOMAttributes;
11
- /** Props for the toast content alert message. */
12
- contentProps: DOMAttributes;
13
- /** Props for the toast title element. */
14
- titleProps: DOMAttributes;
15
- /** Props for the toast description element, if any. */
16
- descriptionProps: DOMAttributes;
17
- /** Props for the toast close button. */
18
- closeButtonProps: AriaButtonProps;
19
- }
20
- /**
21
- * Provides the behavior and accessibility implementation for a toast component.
22
- * Toasts display brief, temporary notifications of actions, errors, or other events in an application.
23
- */
24
- export function useToast<T>(props: AriaToastProps<T>, state: ToastState<T>, ref: RefObject<FocusableElement | null>): ToastAria;
25
- export interface AriaToastRegionProps extends AriaLabelingProps {
26
- /**
27
- * An accessibility label for the toast region.
28
- * @default "Notifications"
29
- */
30
- 'aria-label'?: string;
31
- }
32
- export interface ToastRegionAria {
33
- /** Props for the landmark region element. */
34
- regionProps: DOMAttributes;
35
- }
36
- /**
37
- * Provides the behavior and accessibility implementation for a toast region containing one or more toasts.
38
- * Toasts display brief, temporary notifications of actions, errors, or other events in an application.
39
- */
40
- export function useToastRegion<T>(props: AriaToastRegionProps, state: ToastState<T>, ref: RefObject<HTMLElement | null>): ToastRegionAria;
41
-
42
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"mappings":";;;AAqBA,gCAAgC,CAAC,CAAE,SAAQ,iBAAiB;IAC1D,wBAAwB;IACxB,KAAK,EAAE,YAAY,CAAC,CAAC,CAAA;CACtB;AAED;IACE,+DAA+D;IAC/D,UAAU,EAAE,aAAa,CAAC;IAC1B,iDAAiD;IACjD,YAAY,EAAE,aAAa,CAAC;IAC5B,yCAAyC;IACzC,UAAU,EAAE,aAAa,CAAC;IAC1B,uDAAuD;IACvD,gBAAgB,EAAE,aAAa,CAAC;IAChC,wCAAwC;IACxC,gBAAgB,EAAE,eAAe,CAAA;CAClC;AAED;;;GAGG;AAEH,yBAAyB,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,GAAG,SAAS,CAyD9H;AC/ED,qCAAsC,SAAQ,iBAAiB;IAC7D;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;IACE,6CAA6C;IAC7C,WAAW,EAAE,aAAa,CAAA;CAC3B;AAED;;;GAGG;AACH,+BAA+B,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,GAAG,eAAe,CAiKxI","sources":["packages/@react-aria/toast/src/packages/@react-aria/toast/src/useToast.ts","packages/@react-aria/toast/src/packages/@react-aria/toast/src/useToastRegion.ts","packages/@react-aria/toast/src/packages/@react-aria/toast/src/index.ts","packages/@react-aria/toast/src/index.ts"],"sourcesContent":[null,null,null,"/*\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":"types.d.ts.map"}
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- "close": `\u{417}\u{430}\u{43A}\u{440}\u{438}\u{442}\u{438}`,
3
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
4
- one: ()=>`${formatter.number(args.count)} \u{441}\u{43F}\u{43E}\u{432}\u{456}\u{449}\u{435}\u{43D}\u{43D}\u{44F}`,
5
- other: ()=>`${formatter.number(args.count)} \u{441}\u{43F}\u{43E}\u{432}\u{456}\u{449}\u{435}\u{43D}\u{43D}\u{44F}`
6
- })}.`
7
- };
8
-
9
-
10
- //# sourceMappingURL=uk-UA.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,iDAAO,CAAC;IACpC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,uEAAW,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,uEAAW,CAAC;QAAA,GAAG,CAAC,CAAC;AAChM","sources":["packages/@react-aria/toast/intl/uk-UA.json"],"sourcesContent":["{\n \"close\": \"Закрити\",\n \"notifications\": \"{count, plural, one {# сповіщення} other {# сповіщення}}.\"\n}\n"],"names":[],"version":3,"file":"uk-UA.main.js.map"}
package/dist/uk-UA.mjs DELETED
@@ -1,12 +0,0 @@
1
- var $32ee419c7b9b7a83$exports = {};
2
- $32ee419c7b9b7a83$exports = {
3
- "close": `\u{417}\u{430}\u{43A}\u{440}\u{438}\u{442}\u{438}`,
4
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
5
- one: ()=>`${formatter.number(args.count)} \u{441}\u{43F}\u{43E}\u{432}\u{456}\u{449}\u{435}\u{43D}\u{43D}\u{44F}`,
6
- other: ()=>`${formatter.number(args.count)} \u{441}\u{43F}\u{43E}\u{432}\u{456}\u{449}\u{435}\u{43D}\u{43D}\u{44F}`
7
- })}.`
8
- };
9
-
10
-
11
- export {$32ee419c7b9b7a83$exports as default};
12
- //# sourceMappingURL=uk-UA.module.js.map
@@ -1,12 +0,0 @@
1
- var $32ee419c7b9b7a83$exports = {};
2
- $32ee419c7b9b7a83$exports = {
3
- "close": `\u{417}\u{430}\u{43A}\u{440}\u{438}\u{442}\u{438}`,
4
- "notifications": (args, formatter)=>`${formatter.plural(args.count, {
5
- one: ()=>`${formatter.number(args.count)} \u{441}\u{43F}\u{43E}\u{432}\u{456}\u{449}\u{435}\u{43D}\u{43D}\u{44F}`,
6
- other: ()=>`${formatter.number(args.count)} \u{441}\u{43F}\u{43E}\u{432}\u{456}\u{449}\u{435}\u{43D}\u{43D}\u{44F}`
7
- })}.`
8
- };
9
-
10
-
11
- export {$32ee419c7b9b7a83$exports as default};
12
- //# sourceMappingURL=uk-UA.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,iDAAO,CAAC;IACpC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,uEAAW,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,uEAAW,CAAC;QAAA,GAAG,CAAC,CAAC;AAChM","sources":["packages/@react-aria/toast/intl/uk-UA.json"],"sourcesContent":["{\n \"close\": \"Закрити\",\n \"notifications\": \"{count, plural, one {# сповіщення} other {# сповіщення}}.\"\n}\n"],"names":[],"version":3,"file":"uk-UA.module.js.map"}
@@ -1,83 +0,0 @@
1
- var $f49b2d6c91681304$exports = require("./intlStrings.main.js");
2
- var $ijFUR$reactariautils = require("@react-aria/utils");
3
- var $ijFUR$react = require("react");
4
- var $ijFUR$reactariai18n = require("@react-aria/i18n");
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
-
11
- function $parcel$export(e, n, v, s) {
12
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
- }
14
-
15
- $parcel$export(module.exports, "useToast", () => $ec537504faac71d2$export$a407b657d3044108);
16
- /*
17
- * Copyright 2020 Adobe. All rights reserved.
18
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
- * you may not use this file except in compliance with the License. You may obtain a copy
20
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing, software distributed under
23
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
- * OF ANY KIND, either express or implied. See the License for the specific language
25
- * governing permissions and limitations under the License.
26
- */
27
-
28
-
29
-
30
- function $ec537504faac71d2$export$a407b657d3044108(props, state, ref) {
31
- let { key: key, timer: timer, timeout: timeout } = props.toast;
32
- (0, $ijFUR$react.useEffect)(()=>{
33
- if (timer == null || timeout == null) return;
34
- timer.reset(timeout);
35
- return ()=>{
36
- timer.pause();
37
- };
38
- }, [
39
- timer,
40
- timeout
41
- ]);
42
- let titleId = (0, $ijFUR$reactariautils.useId)();
43
- let descriptionId = (0, $ijFUR$reactariautils.useSlotId)();
44
- let stringFormatter = (0, $ijFUR$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($f49b2d6c91681304$exports))), '@react-aria/toast');
45
- // This is required for NVDA announcements, without it NVDA will NOT announce the toast when it appears.
46
- // Originally was tied to animationStart/End via https://github.com/adobe/react-spectrum/pull/6223/commits/e22e319df64958e822ab7cd9685e96818cae9ba5
47
- // but toasts don't always have animations.
48
- let [isVisible, setIsVisible] = (0, $ijFUR$react.useState)(false);
49
- (0, $ijFUR$reactariautils.useLayoutEffect)(()=>{
50
- setIsVisible(true);
51
- }, []);
52
- let toastProps = (0, $ijFUR$reactariautils.filterDOMProps)(props, {
53
- labelable: true
54
- });
55
- return {
56
- toastProps: {
57
- ...toastProps,
58
- role: 'alertdialog',
59
- 'aria-modal': 'false',
60
- 'aria-labelledby': props['aria-labelledby'] || titleId,
61
- 'aria-describedby': props['aria-describedby'] || descriptionId,
62
- tabIndex: 0
63
- },
64
- contentProps: {
65
- role: 'alert',
66
- 'aria-atomic': 'true',
67
- 'aria-hidden': isVisible ? undefined : 'true'
68
- },
69
- titleProps: {
70
- id: titleId
71
- },
72
- descriptionProps: {
73
- id: descriptionId
74
- },
75
- closeButtonProps: {
76
- 'aria-label': stringFormatter.format('close'),
77
- onPress: ()=>state.close(key)
78
- }
79
- };
80
- }
81
-
82
-
83
- //# sourceMappingURL=useToast.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkCM,SAAS,0CAAY,KAAwB,EAAE,KAAoB,EAAE,GAAuC;IACjH,IAAI,OACF,GAAG,SACH,KAAK,WACL,OAAO,EACR,GAAG,MAAM,KAAK;IAEf,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,SAAS,QAAQ,WAAW,MAC9B;QAGF,MAAM,KAAK,CAAC;QACZ,OAAO;YACL,MAAM,KAAK;QACb;IACF,GAAG;QAAC;QAAO;KAAQ;IAEnB,IAAI,UAAU,CAAA,GAAA,2BAAI;IAClB,IAAI,gBAAgB,CAAA,GAAA,+BAAQ;IAC5B,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,wGAAwG;IACxG,mJAAmJ;IACnJ,2CAA2C;IAC3C,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAE;IACzC,CAAA,GAAA,qCAAc,EAAE;QACd,aAAa;IACf,GAAG,EAAE;IAEL,IAAI,aAAa,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IAEvD,OAAO;QACL,YAAY;YACV,GAAG,UAAU;YACb,MAAM;YACN,cAAc;YACd,mBAAmB,KAAK,CAAC,kBAAkB,IAAI;YAC/C,oBAAoB,KAAK,CAAC,mBAAmB,IAAI;YACjD,UAAU;QACZ;QACA,cAAc;YACZ,MAAM;YACN,eAAe;YACf,eAAe,YAAY,YAAY;QACzC;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","sources":["packages/@react-aria/toast/src/useToast.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 */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaLabelingProps, DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {filterDOMProps, useId, useLayoutEffect, useSlotId} from '@react-aria/utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {QueuedToast, ToastState} from '@react-stately/toast';\nimport {useEffect, useState} from 'react';\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, non-modal dialog element. */\n toastProps: DOMAttributes,\n /** Props for the toast content alert message. */\n contentProps: 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 */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useToast<T>(props: AriaToastProps<T>, state: ToastState<T>, ref: RefObject<FocusableElement | null>): ToastAria {\n let {\n key,\n timer,\n timeout\n } = props.toast;\n\n useEffect(() => {\n if (timer == null || timeout == null) {\n return;\n }\n\n timer.reset(timeout);\n return () => {\n timer.pause();\n };\n }, [timer, timeout]);\n\n let titleId = useId();\n let descriptionId = useSlotId();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/toast');\n\n // This is required for NVDA announcements, without it NVDA will NOT announce the toast when it appears.\n // Originally was tied to animationStart/End via https://github.com/adobe/react-spectrum/pull/6223/commits/e22e319df64958e822ab7cd9685e96818cae9ba5\n // but toasts don't always have animations.\n let [isVisible, setIsVisible] = useState(false);\n useLayoutEffect(() => {\n setIsVisible(true);\n }, []);\n\n let toastProps = filterDOMProps(props, {labelable: true});\n\n return {\n toastProps: {\n ...toastProps,\n role: 'alertdialog',\n 'aria-modal': 'false',\n 'aria-labelledby': props['aria-labelledby'] || titleId,\n 'aria-describedby': props['aria-describedby'] || descriptionId,\n tabIndex: 0\n },\n contentProps: {\n role: 'alert',\n 'aria-atomic': 'true',\n 'aria-hidden': isVisible ? undefined : 'true'\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"],"names":[],"version":3,"file":"useToast.main.js.map"}
package/dist/useToast.mjs DELETED
@@ -1,78 +0,0 @@
1
- import $7WpW4$intlStringsmodulejs from "./intlStrings.mjs";
2
- import {useId as $7WpW4$useId, useSlotId as $7WpW4$useSlotId, useLayoutEffect as $7WpW4$useLayoutEffect, filterDOMProps as $7WpW4$filterDOMProps} from "@react-aria/utils";
3
- import {useEffect as $7WpW4$useEffect, useState as $7WpW4$useState} from "react";
4
- import {useLocalizedStringFormatter as $7WpW4$useLocalizedStringFormatter} from "@react-aria/i18n";
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
- /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
-
23
-
24
- function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
25
- let { key: key, timer: timer, timeout: timeout } = props.toast;
26
- (0, $7WpW4$useEffect)(()=>{
27
- if (timer == null || timeout == null) return;
28
- timer.reset(timeout);
29
- return ()=>{
30
- timer.pause();
31
- };
32
- }, [
33
- timer,
34
- timeout
35
- ]);
36
- let titleId = (0, $7WpW4$useId)();
37
- let descriptionId = (0, $7WpW4$useSlotId)();
38
- let stringFormatter = (0, $7WpW4$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7WpW4$intlStringsmodulejs))), '@react-aria/toast');
39
- // This is required for NVDA announcements, without it NVDA will NOT announce the toast when it appears.
40
- // Originally was tied to animationStart/End via https://github.com/adobe/react-spectrum/pull/6223/commits/e22e319df64958e822ab7cd9685e96818cae9ba5
41
- // but toasts don't always have animations.
42
- let [isVisible, setIsVisible] = (0, $7WpW4$useState)(false);
43
- (0, $7WpW4$useLayoutEffect)(()=>{
44
- setIsVisible(true);
45
- }, []);
46
- let toastProps = (0, $7WpW4$filterDOMProps)(props, {
47
- labelable: true
48
- });
49
- return {
50
- toastProps: {
51
- ...toastProps,
52
- role: 'alertdialog',
53
- 'aria-modal': 'false',
54
- 'aria-labelledby': props['aria-labelledby'] || titleId,
55
- 'aria-describedby': props['aria-describedby'] || descriptionId,
56
- tabIndex: 0
57
- },
58
- contentProps: {
59
- role: 'alert',
60
- 'aria-atomic': 'true',
61
- 'aria-hidden': isVisible ? undefined : 'true'
62
- },
63
- titleProps: {
64
- id: titleId
65
- },
66
- descriptionProps: {
67
- id: descriptionId
68
- },
69
- closeButtonProps: {
70
- 'aria-label': stringFormatter.format('close'),
71
- onPress: ()=>state.close(key)
72
- }
73
- };
74
- }
75
-
76
-
77
- export {$d6542812f0669241$export$a407b657d3044108 as useToast};
78
- //# sourceMappingURL=useToast.module.js.map
@@ -1,78 +0,0 @@
1
- import $7WpW4$intlStringsmodulejs from "./intlStrings.module.js";
2
- import {useId as $7WpW4$useId, useSlotId as $7WpW4$useSlotId, useLayoutEffect as $7WpW4$useLayoutEffect, filterDOMProps as $7WpW4$filterDOMProps} from "@react-aria/utils";
3
- import {useEffect as $7WpW4$useEffect, useState as $7WpW4$useState} from "react";
4
- import {useLocalizedStringFormatter as $7WpW4$useLocalizedStringFormatter} from "@react-aria/i18n";
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
- /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
-
23
-
24
- function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
25
- let { key: key, timer: timer, timeout: timeout } = props.toast;
26
- (0, $7WpW4$useEffect)(()=>{
27
- if (timer == null || timeout == null) return;
28
- timer.reset(timeout);
29
- return ()=>{
30
- timer.pause();
31
- };
32
- }, [
33
- timer,
34
- timeout
35
- ]);
36
- let titleId = (0, $7WpW4$useId)();
37
- let descriptionId = (0, $7WpW4$useSlotId)();
38
- let stringFormatter = (0, $7WpW4$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7WpW4$intlStringsmodulejs))), '@react-aria/toast');
39
- // This is required for NVDA announcements, without it NVDA will NOT announce the toast when it appears.
40
- // Originally was tied to animationStart/End via https://github.com/adobe/react-spectrum/pull/6223/commits/e22e319df64958e822ab7cd9685e96818cae9ba5
41
- // but toasts don't always have animations.
42
- let [isVisible, setIsVisible] = (0, $7WpW4$useState)(false);
43
- (0, $7WpW4$useLayoutEffect)(()=>{
44
- setIsVisible(true);
45
- }, []);
46
- let toastProps = (0, $7WpW4$filterDOMProps)(props, {
47
- labelable: true
48
- });
49
- return {
50
- toastProps: {
51
- ...toastProps,
52
- role: 'alertdialog',
53
- 'aria-modal': 'false',
54
- 'aria-labelledby': props['aria-labelledby'] || titleId,
55
- 'aria-describedby': props['aria-describedby'] || descriptionId,
56
- tabIndex: 0
57
- },
58
- contentProps: {
59
- role: 'alert',
60
- 'aria-atomic': 'true',
61
- 'aria-hidden': isVisible ? undefined : 'true'
62
- },
63
- titleProps: {
64
- id: titleId
65
- },
66
- descriptionProps: {
67
- id: descriptionId
68
- },
69
- closeButtonProps: {
70
- 'aria-label': stringFormatter.format('close'),
71
- onPress: ()=>state.close(key)
72
- }
73
- };
74
- }
75
-
76
-
77
- export {$d6542812f0669241$export$a407b657d3044108 as useToast};
78
- //# sourceMappingURL=useToast.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkCM,SAAS,0CAAY,KAAwB,EAAE,KAAoB,EAAE,GAAuC;IACjH,IAAI,OACF,GAAG,SACH,KAAK,WACL,OAAO,EACR,GAAG,MAAM,KAAK;IAEf,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,SAAS,QAAQ,WAAW,MAC9B;QAGF,MAAM,KAAK,CAAC;QACZ,OAAO;YACL,MAAM,KAAK;QACb;IACF,GAAG;QAAC;QAAO;KAAQ;IAEnB,IAAI,UAAU,CAAA,GAAA,YAAI;IAClB,IAAI,gBAAgB,CAAA,GAAA,gBAAQ;IAC5B,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAEhE,wGAAwG;IACxG,mJAAmJ;IACnJ,2CAA2C;IAC3C,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,eAAO,EAAE;IACzC,CAAA,GAAA,sBAAc,EAAE;QACd,aAAa;IACf,GAAG,EAAE;IAEL,IAAI,aAAa,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IAEvD,OAAO;QACL,YAAY;YACV,GAAG,UAAU;YACb,MAAM;YACN,cAAc;YACd,mBAAmB,KAAK,CAAC,kBAAkB,IAAI;YAC/C,oBAAoB,KAAK,CAAC,mBAAmB,IAAI;YACjD,UAAU;QACZ;QACA,cAAc;YACZ,MAAM;YACN,eAAe;YACf,eAAe,YAAY,YAAY;QACzC;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","sources":["packages/@react-aria/toast/src/useToast.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 */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaLabelingProps, DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {filterDOMProps, useId, useLayoutEffect, useSlotId} from '@react-aria/utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {QueuedToast, ToastState} from '@react-stately/toast';\nimport {useEffect, useState} from 'react';\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, non-modal dialog element. */\n toastProps: DOMAttributes,\n /** Props for the toast content alert message. */\n contentProps: 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 */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useToast<T>(props: AriaToastProps<T>, state: ToastState<T>, ref: RefObject<FocusableElement | null>): ToastAria {\n let {\n key,\n timer,\n timeout\n } = props.toast;\n\n useEffect(() => {\n if (timer == null || timeout == null) {\n return;\n }\n\n timer.reset(timeout);\n return () => {\n timer.pause();\n };\n }, [timer, timeout]);\n\n let titleId = useId();\n let descriptionId = useSlotId();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/toast');\n\n // This is required for NVDA announcements, without it NVDA will NOT announce the toast when it appears.\n // Originally was tied to animationStart/End via https://github.com/adobe/react-spectrum/pull/6223/commits/e22e319df64958e822ab7cd9685e96818cae9ba5\n // but toasts don't always have animations.\n let [isVisible, setIsVisible] = useState(false);\n useLayoutEffect(() => {\n setIsVisible(true);\n }, []);\n\n let toastProps = filterDOMProps(props, {labelable: true});\n\n return {\n toastProps: {\n ...toastProps,\n role: 'alertdialog',\n 'aria-modal': 'false',\n 'aria-labelledby': props['aria-labelledby'] || titleId,\n 'aria-describedby': props['aria-describedby'] || descriptionId,\n tabIndex: 0\n },\n contentProps: {\n role: 'alert',\n 'aria-atomic': 'true',\n 'aria-hidden': isVisible ? undefined : 'true'\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"],"names":[],"version":3,"file":"useToast.module.js.map"}