@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.
- package/dist/import.mjs +2 -4
- package/dist/main.js +3 -5
- package/dist/main.js.map +1 -1
- package/dist/module.js +2 -4
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/package.json +15 -18
- package/src/index.ts +2 -4
- package/dist/ar-AE.main.js +0 -10
- package/dist/ar-AE.main.js.map +0 -1
- package/dist/ar-AE.mjs +0 -12
- package/dist/ar-AE.module.js +0 -12
- package/dist/ar-AE.module.js.map +0 -1
- package/dist/bg-BG.main.js +0 -10
- package/dist/bg-BG.main.js.map +0 -1
- package/dist/bg-BG.mjs +0 -12
- package/dist/bg-BG.module.js +0 -12
- package/dist/bg-BG.module.js.map +0 -1
- package/dist/cs-CZ.main.js +0 -10
- package/dist/cs-CZ.main.js.map +0 -1
- package/dist/cs-CZ.mjs +0 -12
- package/dist/cs-CZ.module.js +0 -12
- package/dist/cs-CZ.module.js.map +0 -1
- package/dist/da-DK.main.js +0 -10
- package/dist/da-DK.main.js.map +0 -1
- package/dist/da-DK.mjs +0 -12
- package/dist/da-DK.module.js +0 -12
- package/dist/da-DK.module.js.map +0 -1
- package/dist/de-DE.main.js +0 -10
- package/dist/de-DE.main.js.map +0 -1
- package/dist/de-DE.mjs +0 -12
- package/dist/de-DE.module.js +0 -12
- package/dist/de-DE.module.js.map +0 -1
- package/dist/el-GR.main.js +0 -10
- package/dist/el-GR.main.js.map +0 -1
- package/dist/el-GR.mjs +0 -12
- package/dist/el-GR.module.js +0 -12
- package/dist/el-GR.module.js.map +0 -1
- package/dist/en-US.main.js +0 -10
- package/dist/en-US.main.js.map +0 -1
- package/dist/en-US.mjs +0 -12
- package/dist/en-US.module.js +0 -12
- package/dist/en-US.module.js.map +0 -1
- package/dist/es-ES.main.js +0 -10
- package/dist/es-ES.main.js.map +0 -1
- package/dist/es-ES.mjs +0 -12
- package/dist/es-ES.module.js +0 -12
- package/dist/es-ES.module.js.map +0 -1
- package/dist/et-EE.main.js +0 -10
- package/dist/et-EE.main.js.map +0 -1
- package/dist/et-EE.mjs +0 -12
- package/dist/et-EE.module.js +0 -12
- package/dist/et-EE.module.js.map +0 -1
- package/dist/fi-FI.main.js +0 -10
- package/dist/fi-FI.main.js.map +0 -1
- package/dist/fi-FI.mjs +0 -12
- package/dist/fi-FI.module.js +0 -12
- package/dist/fi-FI.module.js.map +0 -1
- package/dist/fr-FR.main.js +0 -10
- package/dist/fr-FR.main.js.map +0 -1
- package/dist/fr-FR.mjs +0 -12
- package/dist/fr-FR.module.js +0 -12
- package/dist/fr-FR.module.js.map +0 -1
- package/dist/he-IL.main.js +0 -10
- package/dist/he-IL.main.js.map +0 -1
- package/dist/he-IL.mjs +0 -12
- package/dist/he-IL.module.js +0 -12
- package/dist/he-IL.module.js.map +0 -1
- package/dist/hr-HR.main.js +0 -10
- package/dist/hr-HR.main.js.map +0 -1
- package/dist/hr-HR.mjs +0 -12
- package/dist/hr-HR.module.js +0 -12
- package/dist/hr-HR.module.js.map +0 -1
- package/dist/hu-HU.main.js +0 -10
- package/dist/hu-HU.main.js.map +0 -1
- package/dist/hu-HU.mjs +0 -12
- package/dist/hu-HU.module.js +0 -12
- package/dist/hu-HU.module.js.map +0 -1
- package/dist/intlStrings.main.js +0 -108
- package/dist/intlStrings.main.js.map +0 -1
- package/dist/intlStrings.mjs +0 -110
- package/dist/intlStrings.module.js +0 -110
- package/dist/intlStrings.module.js.map +0 -1
- package/dist/it-IT.main.js +0 -10
- package/dist/it-IT.main.js.map +0 -1
- package/dist/it-IT.mjs +0 -12
- package/dist/it-IT.module.js +0 -12
- package/dist/it-IT.module.js.map +0 -1
- package/dist/ja-JP.main.js +0 -10
- package/dist/ja-JP.main.js.map +0 -1
- package/dist/ja-JP.mjs +0 -12
- package/dist/ja-JP.module.js +0 -12
- package/dist/ja-JP.module.js.map +0 -1
- package/dist/ko-KR.main.js +0 -10
- package/dist/ko-KR.main.js.map +0 -1
- package/dist/ko-KR.mjs +0 -12
- package/dist/ko-KR.module.js +0 -12
- package/dist/ko-KR.module.js.map +0 -1
- package/dist/lt-LT.main.js +0 -10
- package/dist/lt-LT.main.js.map +0 -1
- package/dist/lt-LT.mjs +0 -12
- package/dist/lt-LT.module.js +0 -12
- package/dist/lt-LT.module.js.map +0 -1
- package/dist/lv-LV.main.js +0 -10
- package/dist/lv-LV.main.js.map +0 -1
- package/dist/lv-LV.mjs +0 -12
- package/dist/lv-LV.module.js +0 -12
- package/dist/lv-LV.module.js.map +0 -1
- package/dist/nb-NO.main.js +0 -10
- package/dist/nb-NO.main.js.map +0 -1
- package/dist/nb-NO.mjs +0 -12
- package/dist/nb-NO.module.js +0 -12
- package/dist/nb-NO.module.js.map +0 -1
- package/dist/nl-NL.main.js +0 -10
- package/dist/nl-NL.main.js.map +0 -1
- package/dist/nl-NL.mjs +0 -12
- package/dist/nl-NL.module.js +0 -12
- package/dist/nl-NL.module.js.map +0 -1
- package/dist/pl-PL.main.js +0 -12
- package/dist/pl-PL.main.js.map +0 -1
- package/dist/pl-PL.mjs +0 -14
- package/dist/pl-PL.module.js +0 -14
- package/dist/pl-PL.module.js.map +0 -1
- package/dist/pt-BR.main.js +0 -10
- package/dist/pt-BR.main.js.map +0 -1
- package/dist/pt-BR.mjs +0 -12
- package/dist/pt-BR.module.js +0 -12
- package/dist/pt-BR.module.js.map +0 -1
- package/dist/pt-PT.main.js +0 -10
- package/dist/pt-PT.main.js.map +0 -1
- package/dist/pt-PT.mjs +0 -12
- package/dist/pt-PT.module.js +0 -12
- package/dist/pt-PT.module.js.map +0 -1
- package/dist/ro-RO.main.js +0 -10
- package/dist/ro-RO.main.js.map +0 -1
- package/dist/ro-RO.mjs +0 -12
- package/dist/ro-RO.module.js +0 -12
- package/dist/ro-RO.module.js.map +0 -1
- package/dist/ru-RU.main.js +0 -10
- package/dist/ru-RU.main.js.map +0 -1
- package/dist/ru-RU.mjs +0 -12
- package/dist/ru-RU.module.js +0 -12
- package/dist/ru-RU.module.js.map +0 -1
- package/dist/sk-SK.main.js +0 -11
- package/dist/sk-SK.main.js.map +0 -1
- package/dist/sk-SK.mjs +0 -13
- package/dist/sk-SK.module.js +0 -13
- package/dist/sk-SK.module.js.map +0 -1
- package/dist/sl-SI.main.js +0 -12
- package/dist/sl-SI.main.js.map +0 -1
- package/dist/sl-SI.mjs +0 -14
- package/dist/sl-SI.module.js +0 -14
- package/dist/sl-SI.module.js.map +0 -1
- package/dist/sr-SP.main.js +0 -10
- package/dist/sr-SP.main.js.map +0 -1
- package/dist/sr-SP.mjs +0 -12
- package/dist/sr-SP.module.js +0 -12
- package/dist/sr-SP.module.js.map +0 -1
- package/dist/sv-SE.main.js +0 -10
- package/dist/sv-SE.main.js.map +0 -1
- package/dist/sv-SE.mjs +0 -12
- package/dist/sv-SE.module.js +0 -12
- package/dist/sv-SE.module.js.map +0 -1
- package/dist/tr-TR.main.js +0 -10
- package/dist/tr-TR.main.js.map +0 -1
- package/dist/tr-TR.mjs +0 -12
- package/dist/tr-TR.module.js +0 -12
- package/dist/tr-TR.module.js.map +0 -1
- package/dist/types.d.ts +0 -42
- package/dist/types.d.ts.map +0 -1
- package/dist/uk-UA.main.js +0 -10
- package/dist/uk-UA.main.js.map +0 -1
- package/dist/uk-UA.mjs +0 -12
- package/dist/uk-UA.module.js +0 -12
- package/dist/uk-UA.module.js.map +0 -1
- package/dist/useToast.main.js +0 -83
- package/dist/useToast.main.js.map +0 -1
- package/dist/useToast.mjs +0 -78
- package/dist/useToast.module.js +0 -78
- package/dist/useToast.module.js.map +0 -1
- package/dist/useToastRegion.main.js +0 -184
- package/dist/useToastRegion.main.js.map +0 -1
- package/dist/useToastRegion.mjs +0 -179
- package/dist/useToastRegion.module.js +0 -179
- package/dist/useToastRegion.module.js.map +0 -1
- package/dist/zh-CN.main.js +0 -10
- package/dist/zh-CN.main.js.map +0 -1
- package/dist/zh-CN.mjs +0 -12
- package/dist/zh-CN.module.js +0 -12
- package/dist/zh-CN.module.js.map +0 -1
- package/dist/zh-TW.main.js +0 -10
- package/dist/zh-TW.main.js.map +0 -1
- package/dist/zh-TW.mjs +0 -12
- package/dist/zh-TW.module.js +0 -12
- package/dist/zh-TW.module.js.map +0 -1
- package/src/useToast.ts +0 -102
- package/src/useToastRegion.ts +0 -201
package/dist/sr-SP.module.js
DELETED
|
@@ -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
|
package/dist/sr-SP.module.js.map
DELETED
|
@@ -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"}
|
package/dist/sv-SE.main.js
DELETED
|
@@ -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
|
package/dist/sv-SE.main.js.map
DELETED
|
@@ -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
|
package/dist/sv-SE.module.js
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
|
package/dist/sv-SE.module.js.map
DELETED
|
@@ -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"}
|
package/dist/tr-TR.main.js
DELETED
|
@@ -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
|
package/dist/tr-TR.main.js.map
DELETED
|
@@ -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
|
package/dist/tr-TR.module.js
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
|
package/dist/tr-TR.module.js.map
DELETED
|
@@ -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
|
package/dist/types.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/uk-UA.main.js
DELETED
|
@@ -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
|
package/dist/uk-UA.main.js.map
DELETED
|
@@ -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
|
package/dist/uk-UA.module.js
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
|
package/dist/uk-UA.module.js.map
DELETED
|
@@ -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"}
|
package/dist/useToast.main.js
DELETED
|
@@ -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
|
package/dist/useToast.module.js
DELETED
|
@@ -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"}
|