@react-aria/toast 3.0.1 → 3.0.3
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/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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/useToast.main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $f49b2d6c91681304$exports = require("./intlStrings.main.js");
|
|
2
|
-
var $ijFUR$react = require("react");
|
|
3
2
|
var $ijFUR$reactariautils = require("@react-aria/utils");
|
|
3
|
+
var $ijFUR$react = require("react");
|
|
4
4
|
var $ijFUR$reactariai18n = require("@react-aria/i18n");
|
|
5
5
|
|
|
6
6
|
|
|
@@ -49,14 +49,16 @@ function $ec537504faac71d2$export$a407b657d3044108(props, state, ref) {
|
|
|
49
49
|
(0, $ijFUR$react.useEffect)(()=>{
|
|
50
50
|
setIsVisible(true);
|
|
51
51
|
}, []);
|
|
52
|
+
let toastProps = (0, $ijFUR$reactariautils.filterDOMProps)(props, {
|
|
53
|
+
labelable: true
|
|
54
|
+
});
|
|
52
55
|
return {
|
|
53
56
|
toastProps: {
|
|
57
|
+
...toastProps,
|
|
54
58
|
role: 'alertdialog',
|
|
55
59
|
'aria-modal': 'false',
|
|
56
|
-
'aria-label': props['aria-label'],
|
|
57
60
|
'aria-labelledby': props['aria-labelledby'] || titleId,
|
|
58
61
|
'aria-describedby': props['aria-describedby'] || descriptionId,
|
|
59
|
-
'aria-details': props['aria-details'],
|
|
60
62
|
tabIndex: 0
|
|
61
63
|
},
|
|
62
64
|
contentProps: {
|
|
@@ -1 +1 @@
|
|
|
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,sBAAQ,EAAE;QACR,aAAa;IACf,GAAG,EAAE;IAEL,OAAO;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,
|
|
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,sBAAQ,EAAE;QACR,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, 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 useEffect(() => {\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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import $7WpW4$intlStringsmodulejs from "./intlStrings.mjs";
|
|
2
|
+
import {useId as $7WpW4$useId, useSlotId as $7WpW4$useSlotId, filterDOMProps as $7WpW4$filterDOMProps} from "@react-aria/utils";
|
|
2
3
|
import {useEffect as $7WpW4$useEffect, useState as $7WpW4$useState} from "react";
|
|
3
|
-
import {useId as $7WpW4$useId, useSlotId as $7WpW4$useSlotId} from "@react-aria/utils";
|
|
4
4
|
import {useLocalizedStringFormatter as $7WpW4$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
5
5
|
|
|
6
6
|
|
|
@@ -43,14 +43,16 @@ function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
|
43
43
|
(0, $7WpW4$useEffect)(()=>{
|
|
44
44
|
setIsVisible(true);
|
|
45
45
|
}, []);
|
|
46
|
+
let toastProps = (0, $7WpW4$filterDOMProps)(props, {
|
|
47
|
+
labelable: true
|
|
48
|
+
});
|
|
46
49
|
return {
|
|
47
50
|
toastProps: {
|
|
51
|
+
...toastProps,
|
|
48
52
|
role: 'alertdialog',
|
|
49
53
|
'aria-modal': 'false',
|
|
50
|
-
'aria-label': props['aria-label'],
|
|
51
54
|
'aria-labelledby': props['aria-labelledby'] || titleId,
|
|
52
55
|
'aria-describedby': props['aria-describedby'] || descriptionId,
|
|
53
|
-
'aria-details': props['aria-details'],
|
|
54
56
|
tabIndex: 0
|
|
55
57
|
},
|
|
56
58
|
contentProps: {
|
package/dist/useToast.module.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import $7WpW4$intlStringsmodulejs from "./intlStrings.module.js";
|
|
2
|
+
import {useId as $7WpW4$useId, useSlotId as $7WpW4$useSlotId, filterDOMProps as $7WpW4$filterDOMProps} from "@react-aria/utils";
|
|
2
3
|
import {useEffect as $7WpW4$useEffect, useState as $7WpW4$useState} from "react";
|
|
3
|
-
import {useId as $7WpW4$useId, useSlotId as $7WpW4$useSlotId} from "@react-aria/utils";
|
|
4
4
|
import {useLocalizedStringFormatter as $7WpW4$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
5
5
|
|
|
6
6
|
|
|
@@ -43,14 +43,16 @@ function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
|
43
43
|
(0, $7WpW4$useEffect)(()=>{
|
|
44
44
|
setIsVisible(true);
|
|
45
45
|
}, []);
|
|
46
|
+
let toastProps = (0, $7WpW4$filterDOMProps)(props, {
|
|
47
|
+
labelable: true
|
|
48
|
+
});
|
|
46
49
|
return {
|
|
47
50
|
toastProps: {
|
|
51
|
+
...toastProps,
|
|
48
52
|
role: 'alertdialog',
|
|
49
53
|
'aria-modal': 'false',
|
|
50
|
-
'aria-label': props['aria-label'],
|
|
51
54
|
'aria-labelledby': props['aria-labelledby'] || titleId,
|
|
52
55
|
'aria-describedby': props['aria-describedby'] || descriptionId,
|
|
53
|
-
'aria-details': props['aria-details'],
|
|
54
56
|
tabIndex: 0
|
|
55
57
|
},
|
|
56
58
|
contentProps: {
|
|
@@ -1 +1 @@
|
|
|
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,gBAAQ,EAAE;QACR,aAAa;IACf,GAAG,EAAE;IAEL,OAAO;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,
|
|
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,gBAAQ,EAAE;QACR,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, 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 useEffect(() => {\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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/toast",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/i18n": "^3.12.
|
|
26
|
-
"@react-aria/interactions": "^3.
|
|
27
|
-
"@react-aria/landmark": "^3.0.
|
|
28
|
-
"@react-aria/utils": "^3.
|
|
29
|
-
"@react-stately/toast": "^3.
|
|
30
|
-
"@react-types/button": "^3.
|
|
31
|
-
"@react-types/shared": "^3.
|
|
25
|
+
"@react-aria/i18n": "^3.12.9",
|
|
26
|
+
"@react-aria/interactions": "^3.25.1",
|
|
27
|
+
"@react-aria/landmark": "^3.0.3",
|
|
28
|
+
"@react-aria/utils": "^3.29.0",
|
|
29
|
+
"@react-stately/toast": "^3.1.0",
|
|
30
|
+
"@react-types/button": "^3.12.1",
|
|
31
|
+
"@react-types/shared": "^3.29.1",
|
|
32
32
|
"@swc/helpers": "^0.5.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "9c77d4e8267ed39469c65f65da94ece7be509874"
|
|
42
42
|
}
|
package/src/useToast.ts
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
import {AriaButtonProps} from '@react-types/button';
|
|
14
14
|
import {AriaLabelingProps, DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';
|
|
15
|
+
import {filterDOMProps, useId, useSlotId} from '@react-aria/utils';
|
|
15
16
|
// @ts-ignore
|
|
16
17
|
import intlMessages from '../intl/*.json';
|
|
17
18
|
import {QueuedToast, ToastState} from '@react-stately/toast';
|
|
18
19
|
import {useEffect, useState} from 'react';
|
|
19
|
-
import {useId, useSlotId} from '@react-aria/utils';
|
|
20
20
|
import {useLocalizedStringFormatter} from '@react-aria/i18n';
|
|
21
21
|
|
|
22
22
|
export interface AriaToastProps<T> extends AriaLabelingProps {
|
|
@@ -72,14 +72,15 @@ export function useToast<T>(props: AriaToastProps<T>, state: ToastState<T>, ref:
|
|
|
72
72
|
setIsVisible(true);
|
|
73
73
|
}, []);
|
|
74
74
|
|
|
75
|
+
let toastProps = filterDOMProps(props, {labelable: true});
|
|
76
|
+
|
|
75
77
|
return {
|
|
76
78
|
toastProps: {
|
|
79
|
+
...toastProps,
|
|
77
80
|
role: 'alertdialog',
|
|
78
81
|
'aria-modal': 'false',
|
|
79
|
-
'aria-label': props['aria-label'],
|
|
80
82
|
'aria-labelledby': props['aria-labelledby'] || titleId,
|
|
81
83
|
'aria-describedby': props['aria-describedby'] || descriptionId,
|
|
82
|
-
'aria-details': props['aria-details'],
|
|
83
84
|
tabIndex: 0
|
|
84
85
|
},
|
|
85
86
|
contentProps: {
|