@react-aria/toast 3.0.0-beta.11 → 3.0.0-beta.12
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/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/intlStrings.mjs +1 -1
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useToast.main.js +9 -9
- package/dist/useToast.mjs +10 -10
- package/dist/useToast.module.js +9 -9
- package/dist/useToastRegion.main.js +5 -5
- package/dist/useToastRegion.mjs +6 -6
- package/dist/useToastRegion.module.js +5 -5
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +9 -9
package/dist/ar-AE.mjs
CHANGED
package/dist/bg-BG.mjs
CHANGED
package/dist/cs-CZ.mjs
CHANGED
package/dist/da-DK.mjs
CHANGED
package/dist/de-DE.mjs
CHANGED
package/dist/el-GR.mjs
CHANGED
package/dist/en-US.mjs
CHANGED
package/dist/es-ES.mjs
CHANGED
package/dist/et-EE.mjs
CHANGED
package/dist/fi-FI.mjs
CHANGED
package/dist/fr-FR.mjs
CHANGED
package/dist/he-IL.mjs
CHANGED
package/dist/hr-HR.mjs
CHANGED
package/dist/hu-HU.mjs
CHANGED
package/dist/intlStrings.mjs
CHANGED
package/dist/it-IT.mjs
CHANGED
package/dist/ja-JP.mjs
CHANGED
package/dist/ko-KR.mjs
CHANGED
package/dist/lt-LT.mjs
CHANGED
package/dist/lv-LV.mjs
CHANGED
package/dist/nb-NO.mjs
CHANGED
package/dist/nl-NL.mjs
CHANGED
package/dist/pl-PL.mjs
CHANGED
package/dist/pt-BR.mjs
CHANGED
package/dist/pt-PT.mjs
CHANGED
package/dist/ro-RO.mjs
CHANGED
package/dist/ru-RU.mjs
CHANGED
package/dist/sk-SK.mjs
CHANGED
package/dist/sl-SI.mjs
CHANGED
package/dist/sr-SP.mjs
CHANGED
package/dist/sv-SE.mjs
CHANGED
package/dist/tr-TR.mjs
CHANGED
package/dist/uk-UA.mjs
CHANGED
package/dist/useToast.main.js
CHANGED
|
@@ -45,7 +45,7 @@ function $ec537504faac71d2$export$a407b657d3044108(props, state, ref) {
|
|
|
45
45
|
// focused the toast region.
|
|
46
46
|
let focusOnUnmount = (0, $ijFUR$react.useRef)(null);
|
|
47
47
|
(0, $ijFUR$reactariautils.useLayoutEffect)(()=>{
|
|
48
|
-
let container = ref.current.closest(
|
|
48
|
+
let container = ref.current.closest('[role=region]');
|
|
49
49
|
return ()=>{
|
|
50
50
|
if (container && container.contains(document.activeElement)) // Focus must be delayed for focus ring to appear, but we can't wait
|
|
51
51
|
// until useEffect cleanup to check if focus was inside the container.
|
|
@@ -64,16 +64,16 @@ function $ec537504faac71d2$export$a407b657d3044108(props, state, ref) {
|
|
|
64
64
|
]);
|
|
65
65
|
let titleId = (0, $ijFUR$reactariautils.useId)();
|
|
66
66
|
let descriptionId = (0, $ijFUR$reactariautils.useSlotId)();
|
|
67
|
-
let stringFormatter = (0, $ijFUR$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($f49b2d6c91681304$exports))),
|
|
67
|
+
let stringFormatter = (0, $ijFUR$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($f49b2d6c91681304$exports))), '@react-aria/toast');
|
|
68
68
|
return {
|
|
69
69
|
toastProps: {
|
|
70
|
-
role:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
role: 'alert',
|
|
71
|
+
'aria-label': props['aria-label'],
|
|
72
|
+
'aria-labelledby': props['aria-labelledby'] || titleId,
|
|
73
|
+
'aria-describedby': props['aria-describedby'] || descriptionId,
|
|
74
|
+
'aria-details': props['aria-details'],
|
|
75
75
|
// Hide toasts that are animating out so VoiceOver doesn't announce them.
|
|
76
|
-
|
|
76
|
+
'aria-hidden': animation === 'exiting' ? 'true' : undefined
|
|
77
77
|
},
|
|
78
78
|
titleProps: {
|
|
79
79
|
id: titleId
|
|
@@ -82,7 +82,7 @@ function $ec537504faac71d2$export$a407b657d3044108(props, state, ref) {
|
|
|
82
82
|
id: descriptionId
|
|
83
83
|
},
|
|
84
84
|
closeButtonProps: {
|
|
85
|
-
|
|
85
|
+
'aria-label': stringFormatter.format('close'),
|
|
86
86
|
onPress: ()=>state.close(key)
|
|
87
87
|
}
|
|
88
88
|
};
|
package/dist/useToast.mjs
CHANGED
|
@@ -39,7 +39,7 @@ function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
|
39
39
|
// focused the toast region.
|
|
40
40
|
let focusOnUnmount = (0, $7WpW4$useRef)(null);
|
|
41
41
|
(0, $7WpW4$useLayoutEffect)(()=>{
|
|
42
|
-
let container = ref.current.closest(
|
|
42
|
+
let container = ref.current.closest('[role=region]');
|
|
43
43
|
return ()=>{
|
|
44
44
|
if (container && container.contains(document.activeElement)) // Focus must be delayed for focus ring to appear, but we can't wait
|
|
45
45
|
// until useEffect cleanup to check if focus was inside the container.
|
|
@@ -58,16 +58,16 @@ function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
|
58
58
|
]);
|
|
59
59
|
let titleId = (0, $7WpW4$useId)();
|
|
60
60
|
let descriptionId = (0, $7WpW4$useSlotId)();
|
|
61
|
-
let stringFormatter = (0, $7WpW4$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7WpW4$intlStringsmodulejs))),
|
|
61
|
+
let stringFormatter = (0, $7WpW4$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7WpW4$intlStringsmodulejs))), '@react-aria/toast');
|
|
62
62
|
return {
|
|
63
63
|
toastProps: {
|
|
64
|
-
role:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
role: 'alert',
|
|
65
|
+
'aria-label': props['aria-label'],
|
|
66
|
+
'aria-labelledby': props['aria-labelledby'] || titleId,
|
|
67
|
+
'aria-describedby': props['aria-describedby'] || descriptionId,
|
|
68
|
+
'aria-details': props['aria-details'],
|
|
69
69
|
// Hide toasts that are animating out so VoiceOver doesn't announce them.
|
|
70
|
-
|
|
70
|
+
'aria-hidden': animation === 'exiting' ? 'true' : undefined
|
|
71
71
|
},
|
|
72
72
|
titleProps: {
|
|
73
73
|
id: titleId
|
|
@@ -76,7 +76,7 @@ function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
|
76
76
|
id: descriptionId
|
|
77
77
|
},
|
|
78
78
|
closeButtonProps: {
|
|
79
|
-
|
|
79
|
+
'aria-label': stringFormatter.format('close'),
|
|
80
80
|
onPress: ()=>state.close(key)
|
|
81
81
|
}
|
|
82
82
|
};
|
|
@@ -84,4 +84,4 @@ function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
export {$d6542812f0669241$export$a407b657d3044108 as useToast};
|
|
87
|
-
//# sourceMappingURL=useToast.
|
|
87
|
+
//# sourceMappingURL=useToast.module.js.map
|
package/dist/useToast.module.js
CHANGED
|
@@ -39,7 +39,7 @@ function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
|
39
39
|
// focused the toast region.
|
|
40
40
|
let focusOnUnmount = (0, $7WpW4$useRef)(null);
|
|
41
41
|
(0, $7WpW4$useLayoutEffect)(()=>{
|
|
42
|
-
let container = ref.current.closest(
|
|
42
|
+
let container = ref.current.closest('[role=region]');
|
|
43
43
|
return ()=>{
|
|
44
44
|
if (container && container.contains(document.activeElement)) // Focus must be delayed for focus ring to appear, but we can't wait
|
|
45
45
|
// until useEffect cleanup to check if focus was inside the container.
|
|
@@ -58,16 +58,16 @@ function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
|
58
58
|
]);
|
|
59
59
|
let titleId = (0, $7WpW4$useId)();
|
|
60
60
|
let descriptionId = (0, $7WpW4$useSlotId)();
|
|
61
|
-
let stringFormatter = (0, $7WpW4$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7WpW4$intlStringsmodulejs))),
|
|
61
|
+
let stringFormatter = (0, $7WpW4$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7WpW4$intlStringsmodulejs))), '@react-aria/toast');
|
|
62
62
|
return {
|
|
63
63
|
toastProps: {
|
|
64
|
-
role:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
role: 'alert',
|
|
65
|
+
'aria-label': props['aria-label'],
|
|
66
|
+
'aria-labelledby': props['aria-labelledby'] || titleId,
|
|
67
|
+
'aria-describedby': props['aria-describedby'] || descriptionId,
|
|
68
|
+
'aria-details': props['aria-details'],
|
|
69
69
|
// Hide toasts that are animating out so VoiceOver doesn't announce them.
|
|
70
|
-
|
|
70
|
+
'aria-hidden': animation === 'exiting' ? 'true' : undefined
|
|
71
71
|
},
|
|
72
72
|
titleProps: {
|
|
73
73
|
id: titleId
|
|
@@ -76,7 +76,7 @@ function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
|
|
|
76
76
|
id: descriptionId
|
|
77
77
|
},
|
|
78
78
|
closeButtonProps: {
|
|
79
|
-
|
|
79
|
+
'aria-label': stringFormatter.format('close'),
|
|
80
80
|
onPress: ()=>state.close(key)
|
|
81
81
|
}
|
|
82
82
|
};
|
|
@@ -22,10 +22,10 @@ $parcel$export(module.exports, "useToastRegion", () => $eda7c6204a682dd4$export$
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
function $eda7c6204a682dd4$export$b8cbbb20a51697de(props, state, ref) {
|
|
25
|
-
let stringFormatter = (0, $eO7VF$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($f49b2d6c91681304$exports))),
|
|
25
|
+
let stringFormatter = (0, $eO7VF$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($f49b2d6c91681304$exports))), '@react-aria/toast');
|
|
26
26
|
let { landmarkProps: landmarkProps } = (0, $eO7VF$reactarialandmark.useLandmark)({
|
|
27
|
-
role:
|
|
28
|
-
|
|
27
|
+
role: 'region',
|
|
28
|
+
'aria-label': props['aria-label'] || stringFormatter.format('notifications')
|
|
29
29
|
}, ref);
|
|
30
30
|
let { hoverProps: hoverProps } = (0, $eO7VF$reactariainteractions.useHover)({
|
|
31
31
|
onHoverStart: state.pauseAll,
|
|
@@ -49,7 +49,7 @@ function $eda7c6204a682dd4$export$b8cbbb20a51697de(props, state, ref) {
|
|
|
49
49
|
(0, $eO7VF$react.useEffect)(()=>{
|
|
50
50
|
return ()=>{
|
|
51
51
|
if (lastFocused.current && document.body.contains(lastFocused.current)) {
|
|
52
|
-
if ((0, $eO7VF$reactariainteractions.getInteractionModality)() ===
|
|
52
|
+
if ((0, $eO7VF$reactariainteractions.getInteractionModality)() === 'pointer') (0, $eO7VF$reactariautils.focusWithoutScrolling)(lastFocused.current);
|
|
53
53
|
else lastFocused.current.focus();
|
|
54
54
|
}
|
|
55
55
|
};
|
|
@@ -64,7 +64,7 @@ function $eda7c6204a682dd4$export$b8cbbb20a51697de(props, state, ref) {
|
|
|
64
64
|
// - allows focus even outside a containing focus scope
|
|
65
65
|
// - doesn’t dismiss overlays when clicking on it, even though it is outside
|
|
66
66
|
// @ts-ignore
|
|
67
|
-
|
|
67
|
+
'data-react-aria-top-layer': true
|
|
68
68
|
})
|
|
69
69
|
};
|
|
70
70
|
}
|
package/dist/useToastRegion.mjs
CHANGED
|
@@ -16,10 +16,10 @@ function $parcel$interopDefault(a) {
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
|
|
19
|
-
let stringFormatter = (0, $ckyCP$useLocalizedStringFormatter)((0, ($parcel$interopDefault($ckyCP$intlStringsmodulejs))),
|
|
19
|
+
let stringFormatter = (0, $ckyCP$useLocalizedStringFormatter)((0, ($parcel$interopDefault($ckyCP$intlStringsmodulejs))), '@react-aria/toast');
|
|
20
20
|
let { landmarkProps: landmarkProps } = (0, $ckyCP$useLandmark)({
|
|
21
|
-
role:
|
|
22
|
-
|
|
21
|
+
role: 'region',
|
|
22
|
+
'aria-label': props['aria-label'] || stringFormatter.format('notifications')
|
|
23
23
|
}, ref);
|
|
24
24
|
let { hoverProps: hoverProps } = (0, $ckyCP$useHover)({
|
|
25
25
|
onHoverStart: state.pauseAll,
|
|
@@ -43,7 +43,7 @@ function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
|
|
|
43
43
|
(0, $ckyCP$useEffect)(()=>{
|
|
44
44
|
return ()=>{
|
|
45
45
|
if (lastFocused.current && document.body.contains(lastFocused.current)) {
|
|
46
|
-
if ((0, $ckyCP$getInteractionModality)() ===
|
|
46
|
+
if ((0, $ckyCP$getInteractionModality)() === 'pointer') (0, $ckyCP$focusWithoutScrolling)(lastFocused.current);
|
|
47
47
|
else lastFocused.current.focus();
|
|
48
48
|
}
|
|
49
49
|
};
|
|
@@ -58,11 +58,11 @@ function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
|
|
|
58
58
|
// - allows focus even outside a containing focus scope
|
|
59
59
|
// - doesn’t dismiss overlays when clicking on it, even though it is outside
|
|
60
60
|
// @ts-ignore
|
|
61
|
-
|
|
61
|
+
'data-react-aria-top-layer': true
|
|
62
62
|
})
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
export {$6cc546b19ee7130a$export$b8cbbb20a51697de as useToastRegion};
|
|
68
|
-
//# sourceMappingURL=useToastRegion.
|
|
68
|
+
//# sourceMappingURL=useToastRegion.module.js.map
|
|
@@ -16,10 +16,10 @@ function $parcel$interopDefault(a) {
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
|
|
19
|
-
let stringFormatter = (0, $ckyCP$useLocalizedStringFormatter)((0, ($parcel$interopDefault($ckyCP$intlStringsmodulejs))),
|
|
19
|
+
let stringFormatter = (0, $ckyCP$useLocalizedStringFormatter)((0, ($parcel$interopDefault($ckyCP$intlStringsmodulejs))), '@react-aria/toast');
|
|
20
20
|
let { landmarkProps: landmarkProps } = (0, $ckyCP$useLandmark)({
|
|
21
|
-
role:
|
|
22
|
-
|
|
21
|
+
role: 'region',
|
|
22
|
+
'aria-label': props['aria-label'] || stringFormatter.format('notifications')
|
|
23
23
|
}, ref);
|
|
24
24
|
let { hoverProps: hoverProps } = (0, $ckyCP$useHover)({
|
|
25
25
|
onHoverStart: state.pauseAll,
|
|
@@ -43,7 +43,7 @@ function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
|
|
|
43
43
|
(0, $ckyCP$useEffect)(()=>{
|
|
44
44
|
return ()=>{
|
|
45
45
|
if (lastFocused.current && document.body.contains(lastFocused.current)) {
|
|
46
|
-
if ((0, $ckyCP$getInteractionModality)() ===
|
|
46
|
+
if ((0, $ckyCP$getInteractionModality)() === 'pointer') (0, $ckyCP$focusWithoutScrolling)(lastFocused.current);
|
|
47
47
|
else lastFocused.current.focus();
|
|
48
48
|
}
|
|
49
49
|
};
|
|
@@ -58,7 +58,7 @@ function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
|
|
|
58
58
|
// - allows focus even outside a containing focus scope
|
|
59
59
|
// - doesn’t dismiss overlays when clicking on it, even though it is outside
|
|
60
60
|
// @ts-ignore
|
|
61
|
-
|
|
61
|
+
'data-react-aria-top-layer': true
|
|
62
62
|
})
|
|
63
63
|
};
|
|
64
64
|
}
|
package/dist/zh-CN.mjs
CHANGED
package/dist/zh-TW.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/toast",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.12",
|
|
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.11.
|
|
26
|
-
"@react-aria/interactions": "^3.21.
|
|
27
|
-
"@react-aria/landmark": "3.0.0-beta.
|
|
28
|
-
"@react-aria/utils": "^3.24.
|
|
29
|
-
"@react-stately/toast": "3.0.0-beta.
|
|
30
|
-
"@react-types/button": "^3.9.
|
|
31
|
-
"@react-types/shared": "^3.23.
|
|
25
|
+
"@react-aria/i18n": "^3.11.1",
|
|
26
|
+
"@react-aria/interactions": "^3.21.3",
|
|
27
|
+
"@react-aria/landmark": "3.0.0-beta.12",
|
|
28
|
+
"@react-aria/utils": "^3.24.1",
|
|
29
|
+
"@react-stately/toast": "3.0.0-beta.4",
|
|
30
|
+
"@react-types/button": "^3.9.4",
|
|
31
|
+
"@react-types/shared": "^3.23.1",
|
|
32
32
|
"@swc/helpers": "^0.5.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
41
41
|
}
|