@react-spectrum/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/Toast.main.js +12 -12
- package/dist/Toast.mjs +13 -13
- package/dist/Toast.module.js +12 -12
- package/dist/ToastContainer.main.js +6 -6
- package/dist/ToastContainer.mjs +7 -7
- package/dist/ToastContainer.module.js +6 -6
- package/dist/Toaster.main.js +2 -2
- package/dist/Toaster.mjs +3 -3
- package/dist/Toaster.module.js +2 -2
- 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/toastContainer_css.mjs +1 -1
- package/dist/toast_vars_css.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +12 -12
package/dist/Toast.main.js
CHANGED
|
@@ -60,8 +60,8 @@ function $6c5bd1047ecc310e$var$Toast(props, ref) {
|
|
|
60
60
|
let domRef = (0, $8Jify$reactspectrumutils.useDOMRef)(ref);
|
|
61
61
|
let { closeButtonProps: closeButtonProps, titleProps: titleProps, toastProps: toastProps } = (0, $8Jify$reactariatoast.useToast)(props, state, domRef);
|
|
62
62
|
let { styleProps: styleProps } = (0, $8Jify$reactspectrumutils.useStyleProps)(otherProps);
|
|
63
|
-
let stringFormatter = (0, $8Jify$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1e709ec471c88b75$exports))),
|
|
64
|
-
let iconLabel = variant && variant !==
|
|
63
|
+
let stringFormatter = (0, $8Jify$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1e709ec471c88b75$exports))), '@react-spectrum/toast');
|
|
64
|
+
let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;
|
|
65
65
|
let Icon = $6c5bd1047ecc310e$export$fde44257752a9f60[variant];
|
|
66
66
|
let isFocusVisible = (0, $8Jify$react.useContext)((0, $5b9f2c86c1b1395c$exports.ToasterContext));
|
|
67
67
|
const handleAction = ()=>{
|
|
@@ -73,10 +73,10 @@ function $6c5bd1047ecc310e$var$Toast(props, ref) {
|
|
|
73
73
|
...toastProps,
|
|
74
74
|
...(0, $8Jify$reactariautils.filterDOMProps)(props.toast.content),
|
|
75
75
|
ref: domRef,
|
|
76
|
-
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))),
|
|
77
|
-
[
|
|
78
|
-
}, styleProps.className, (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($e20782d0579ed886$exports))),
|
|
79
|
-
|
|
76
|
+
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast', {
|
|
77
|
+
['spectrum-Toast--' + variant]: variant
|
|
78
|
+
}, styleProps.className, (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($e20782d0579ed886$exports))), 'spectrum-Toast', {
|
|
79
|
+
'focus-ring': props.toast.key === ((_state_visibleToasts_ = state.visibleToasts[0]) === null || _state_visibleToasts_ === void 0 ? void 0 : _state_visibleToasts_.key) && isFocusVisible
|
|
80
80
|
})),
|
|
81
81
|
style: {
|
|
82
82
|
...styleProps.style,
|
|
@@ -84,23 +84,23 @@ function $6c5bd1047ecc310e$var$Toast(props, ref) {
|
|
|
84
84
|
},
|
|
85
85
|
"data-animation": animation,
|
|
86
86
|
onAnimationEnd: ()=>{
|
|
87
|
-
if (animation ===
|
|
87
|
+
if (animation === 'exiting') state.remove(key);
|
|
88
88
|
}
|
|
89
89
|
}, Icon && /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement(Icon, {
|
|
90
90
|
"aria-label": iconLabel,
|
|
91
|
-
UNSAFE_className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))),
|
|
91
|
+
UNSAFE_className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast-typeIcon')
|
|
92
92
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement("div", {
|
|
93
|
-
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))),
|
|
93
|
+
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast-body')
|
|
94
94
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement("div", {
|
|
95
|
-
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))),
|
|
95
|
+
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast-content'),
|
|
96
96
|
...titleProps
|
|
97
97
|
}, children), actionLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement((0, $8Jify$reactspectrumbutton.Button), {
|
|
98
98
|
onPress: handleAction,
|
|
99
|
-
UNSAFE_className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))),
|
|
99
|
+
UNSAFE_className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Button'),
|
|
100
100
|
variant: "secondary",
|
|
101
101
|
staticColor: "white"
|
|
102
102
|
}, actionLabel)), /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement("div", {
|
|
103
|
-
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))),
|
|
103
|
+
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast-buttons')
|
|
104
104
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement((0, $8Jify$reactspectrumbutton.ClearButton), {
|
|
105
105
|
...closeButtonProps,
|
|
106
106
|
variant: "overBackground"
|
package/dist/Toast.mjs
CHANGED
|
@@ -54,8 +54,8 @@ function $7e7a2952509f3a56$var$Toast(props, ref) {
|
|
|
54
54
|
let domRef = (0, $iu2Jc$useDOMRef)(ref);
|
|
55
55
|
let { closeButtonProps: closeButtonProps, titleProps: titleProps, toastProps: toastProps } = (0, $iu2Jc$useToast)(props, state, domRef);
|
|
56
56
|
let { styleProps: styleProps } = (0, $iu2Jc$useStyleProps)(otherProps);
|
|
57
|
-
let stringFormatter = (0, $iu2Jc$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iu2Jc$intlStringsmodulejs))),
|
|
58
|
-
let iconLabel = variant && variant !==
|
|
57
|
+
let stringFormatter = (0, $iu2Jc$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iu2Jc$intlStringsmodulejs))), '@react-spectrum/toast');
|
|
58
|
+
let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;
|
|
59
59
|
let Icon = $7e7a2952509f3a56$export$fde44257752a9f60[variant];
|
|
60
60
|
let isFocusVisible = (0, $iu2Jc$useContext)((0, $e46feef4e4c28a4b$export$9194c0aa0cd7a9ff));
|
|
61
61
|
const handleAction = ()=>{
|
|
@@ -67,10 +67,10 @@ function $7e7a2952509f3a56$var$Toast(props, ref) {
|
|
|
67
67
|
...toastProps,
|
|
68
68
|
...(0, $iu2Jc$filterDOMProps)(props.toast.content),
|
|
69
69
|
ref: domRef,
|
|
70
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
71
|
-
[
|
|
72
|
-
}, styleProps.className, (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toastContainer_cssmodulejs))),
|
|
73
|
-
|
|
70
|
+
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast', {
|
|
71
|
+
['spectrum-Toast--' + variant]: variant
|
|
72
|
+
}, styleProps.className, (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toastContainer_cssmodulejs))), 'spectrum-Toast', {
|
|
73
|
+
'focus-ring': props.toast.key === ((_state_visibleToasts_ = state.visibleToasts[0]) === null || _state_visibleToasts_ === void 0 ? void 0 : _state_visibleToasts_.key) && isFocusVisible
|
|
74
74
|
})),
|
|
75
75
|
style: {
|
|
76
76
|
...styleProps.style,
|
|
@@ -78,23 +78,23 @@ function $7e7a2952509f3a56$var$Toast(props, ref) {
|
|
|
78
78
|
},
|
|
79
79
|
"data-animation": animation,
|
|
80
80
|
onAnimationEnd: ()=>{
|
|
81
|
-
if (animation ===
|
|
81
|
+
if (animation === 'exiting') state.remove(key);
|
|
82
82
|
}
|
|
83
83
|
}, Icon && /*#__PURE__*/ (0, $iu2Jc$react).createElement(Icon, {
|
|
84
84
|
"aria-label": iconLabel,
|
|
85
|
-
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
85
|
+
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-typeIcon')
|
|
86
86
|
}), /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
87
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
87
|
+
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-body')
|
|
88
88
|
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
89
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
89
|
+
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-content'),
|
|
90
90
|
...titleProps
|
|
91
91
|
}, children), actionLabel && /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$Button), {
|
|
92
92
|
onPress: handleAction,
|
|
93
|
-
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
93
|
+
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Button'),
|
|
94
94
|
variant: "secondary",
|
|
95
95
|
staticColor: "white"
|
|
96
96
|
}, actionLabel)), /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
97
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
97
|
+
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-buttons')
|
|
98
98
|
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$ClearButton), {
|
|
99
99
|
...closeButtonProps,
|
|
100
100
|
variant: "overBackground"
|
|
@@ -104,4 +104,4 @@ let $7e7a2952509f3a56$export$8d8dc7d5f743331b = /*#__PURE__*/ (0, $iu2Jc$react).
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
export {$7e7a2952509f3a56$export$fde44257752a9f60 as ICONS, $7e7a2952509f3a56$export$8d8dc7d5f743331b as Toast};
|
|
107
|
-
//# sourceMappingURL=Toast.
|
|
107
|
+
//# sourceMappingURL=Toast.module.js.map
|
package/dist/Toast.module.js
CHANGED
|
@@ -54,8 +54,8 @@ function $7e7a2952509f3a56$var$Toast(props, ref) {
|
|
|
54
54
|
let domRef = (0, $iu2Jc$useDOMRef)(ref);
|
|
55
55
|
let { closeButtonProps: closeButtonProps, titleProps: titleProps, toastProps: toastProps } = (0, $iu2Jc$useToast)(props, state, domRef);
|
|
56
56
|
let { styleProps: styleProps } = (0, $iu2Jc$useStyleProps)(otherProps);
|
|
57
|
-
let stringFormatter = (0, $iu2Jc$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iu2Jc$intlStringsmodulejs))),
|
|
58
|
-
let iconLabel = variant && variant !==
|
|
57
|
+
let stringFormatter = (0, $iu2Jc$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iu2Jc$intlStringsmodulejs))), '@react-spectrum/toast');
|
|
58
|
+
let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;
|
|
59
59
|
let Icon = $7e7a2952509f3a56$export$fde44257752a9f60[variant];
|
|
60
60
|
let isFocusVisible = (0, $iu2Jc$useContext)((0, $e46feef4e4c28a4b$export$9194c0aa0cd7a9ff));
|
|
61
61
|
const handleAction = ()=>{
|
|
@@ -67,10 +67,10 @@ function $7e7a2952509f3a56$var$Toast(props, ref) {
|
|
|
67
67
|
...toastProps,
|
|
68
68
|
...(0, $iu2Jc$filterDOMProps)(props.toast.content),
|
|
69
69
|
ref: domRef,
|
|
70
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
71
|
-
[
|
|
72
|
-
}, styleProps.className, (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toastContainer_cssmodulejs))),
|
|
73
|
-
|
|
70
|
+
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast', {
|
|
71
|
+
['spectrum-Toast--' + variant]: variant
|
|
72
|
+
}, styleProps.className, (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toastContainer_cssmodulejs))), 'spectrum-Toast', {
|
|
73
|
+
'focus-ring': props.toast.key === ((_state_visibleToasts_ = state.visibleToasts[0]) === null || _state_visibleToasts_ === void 0 ? void 0 : _state_visibleToasts_.key) && isFocusVisible
|
|
74
74
|
})),
|
|
75
75
|
style: {
|
|
76
76
|
...styleProps.style,
|
|
@@ -78,23 +78,23 @@ function $7e7a2952509f3a56$var$Toast(props, ref) {
|
|
|
78
78
|
},
|
|
79
79
|
"data-animation": animation,
|
|
80
80
|
onAnimationEnd: ()=>{
|
|
81
|
-
if (animation ===
|
|
81
|
+
if (animation === 'exiting') state.remove(key);
|
|
82
82
|
}
|
|
83
83
|
}, Icon && /*#__PURE__*/ (0, $iu2Jc$react).createElement(Icon, {
|
|
84
84
|
"aria-label": iconLabel,
|
|
85
|
-
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
85
|
+
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-typeIcon')
|
|
86
86
|
}), /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
87
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
87
|
+
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-body')
|
|
88
88
|
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
89
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
89
|
+
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-content'),
|
|
90
90
|
...titleProps
|
|
91
91
|
}, children), actionLabel && /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$Button), {
|
|
92
92
|
onPress: handleAction,
|
|
93
|
-
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
93
|
+
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Button'),
|
|
94
94
|
variant: "secondary",
|
|
95
95
|
staticColor: "white"
|
|
96
96
|
}, actionLabel)), /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
97
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))),
|
|
97
|
+
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-buttons')
|
|
98
98
|
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$ClearButton), {
|
|
99
99
|
...closeButtonProps,
|
|
100
100
|
variant: "overBackground"
|
|
@@ -95,8 +95,8 @@ function $56cdf77f3be52eaf$export$f2815235e76a62b9(props) {
|
|
|
95
95
|
}
|
|
96
96
|
function $56cdf77f3be52eaf$var$addToast(children, variant, options = {}) {
|
|
97
97
|
// Dispatch a custom event so that toasts can be intercepted and re-targeted, e.g. when inside an iframe.
|
|
98
|
-
if (typeof CustomEvent !==
|
|
99
|
-
let event = new CustomEvent(
|
|
98
|
+
if (typeof CustomEvent !== 'undefined' && typeof window !== 'undefined') {
|
|
99
|
+
let event = new CustomEvent('react-spectrum-toast', {
|
|
100
100
|
cancelable: true,
|
|
101
101
|
bubbles: true,
|
|
102
102
|
detail: {
|
|
@@ -129,16 +129,16 @@ function $56cdf77f3be52eaf$var$addToast(children, variant, options = {}) {
|
|
|
129
129
|
}
|
|
130
130
|
const $56cdf77f3be52eaf$export$f1f8569633bbbec4 = {
|
|
131
131
|
/** Queues a neutral toast. */ neutral (children, options = {}) {
|
|
132
|
-
return $56cdf77f3be52eaf$var$addToast(children,
|
|
132
|
+
return $56cdf77f3be52eaf$var$addToast(children, 'neutral', options);
|
|
133
133
|
},
|
|
134
134
|
/** Queues a positive toast. */ positive (children, options = {}) {
|
|
135
|
-
return $56cdf77f3be52eaf$var$addToast(children,
|
|
135
|
+
return $56cdf77f3be52eaf$var$addToast(children, 'positive', options);
|
|
136
136
|
},
|
|
137
137
|
/** Queues a negative toast. */ negative (children, options = {}) {
|
|
138
|
-
return $56cdf77f3be52eaf$var$addToast(children,
|
|
138
|
+
return $56cdf77f3be52eaf$var$addToast(children, 'negative', options);
|
|
139
139
|
},
|
|
140
140
|
/** Queues an informational toast. */ info (children, options = {}) {
|
|
141
|
-
return $56cdf77f3be52eaf$var$addToast(children,
|
|
141
|
+
return $56cdf77f3be52eaf$var$addToast(children, 'info', options);
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
144
|
|
package/dist/ToastContainer.mjs
CHANGED
|
@@ -84,8 +84,8 @@ function $02c59b34bd70955a$export$f2815235e76a62b9(props) {
|
|
|
84
84
|
}
|
|
85
85
|
function $02c59b34bd70955a$var$addToast(children, variant, options = {}) {
|
|
86
86
|
// Dispatch a custom event so that toasts can be intercepted and re-targeted, e.g. when inside an iframe.
|
|
87
|
-
if (typeof CustomEvent !==
|
|
88
|
-
let event = new CustomEvent(
|
|
87
|
+
if (typeof CustomEvent !== 'undefined' && typeof window !== 'undefined') {
|
|
88
|
+
let event = new CustomEvent('react-spectrum-toast', {
|
|
89
89
|
cancelable: true,
|
|
90
90
|
bubbles: true,
|
|
91
91
|
detail: {
|
|
@@ -118,19 +118,19 @@ function $02c59b34bd70955a$var$addToast(children, variant, options = {}) {
|
|
|
118
118
|
}
|
|
119
119
|
const $02c59b34bd70955a$export$f1f8569633bbbec4 = {
|
|
120
120
|
/** Queues a neutral toast. */ neutral (children, options = {}) {
|
|
121
|
-
return $02c59b34bd70955a$var$addToast(children,
|
|
121
|
+
return $02c59b34bd70955a$var$addToast(children, 'neutral', options);
|
|
122
122
|
},
|
|
123
123
|
/** Queues a positive toast. */ positive (children, options = {}) {
|
|
124
|
-
return $02c59b34bd70955a$var$addToast(children,
|
|
124
|
+
return $02c59b34bd70955a$var$addToast(children, 'positive', options);
|
|
125
125
|
},
|
|
126
126
|
/** Queues a negative toast. */ negative (children, options = {}) {
|
|
127
|
-
return $02c59b34bd70955a$var$addToast(children,
|
|
127
|
+
return $02c59b34bd70955a$var$addToast(children, 'negative', options);
|
|
128
128
|
},
|
|
129
129
|
/** Queues an informational toast. */ info (children, options = {}) {
|
|
130
|
-
return $02c59b34bd70955a$var$addToast(children,
|
|
130
|
+
return $02c59b34bd70955a$var$addToast(children, 'info', options);
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
export {$02c59b34bd70955a$export$320311f0e4ecb3ae as clearToastQueue, $02c59b34bd70955a$export$f2815235e76a62b9 as ToastContainer, $02c59b34bd70955a$export$f1f8569633bbbec4 as ToastQueue};
|
|
136
|
-
//# sourceMappingURL=ToastContainer.
|
|
136
|
+
//# sourceMappingURL=ToastContainer.module.js.map
|
|
@@ -84,8 +84,8 @@ function $02c59b34bd70955a$export$f2815235e76a62b9(props) {
|
|
|
84
84
|
}
|
|
85
85
|
function $02c59b34bd70955a$var$addToast(children, variant, options = {}) {
|
|
86
86
|
// Dispatch a custom event so that toasts can be intercepted and re-targeted, e.g. when inside an iframe.
|
|
87
|
-
if (typeof CustomEvent !==
|
|
88
|
-
let event = new CustomEvent(
|
|
87
|
+
if (typeof CustomEvent !== 'undefined' && typeof window !== 'undefined') {
|
|
88
|
+
let event = new CustomEvent('react-spectrum-toast', {
|
|
89
89
|
cancelable: true,
|
|
90
90
|
bubbles: true,
|
|
91
91
|
detail: {
|
|
@@ -118,16 +118,16 @@ function $02c59b34bd70955a$var$addToast(children, variant, options = {}) {
|
|
|
118
118
|
}
|
|
119
119
|
const $02c59b34bd70955a$export$f1f8569633bbbec4 = {
|
|
120
120
|
/** Queues a neutral toast. */ neutral (children, options = {}) {
|
|
121
|
-
return $02c59b34bd70955a$var$addToast(children,
|
|
121
|
+
return $02c59b34bd70955a$var$addToast(children, 'neutral', options);
|
|
122
122
|
},
|
|
123
123
|
/** Queues a positive toast. */ positive (children, options = {}) {
|
|
124
|
-
return $02c59b34bd70955a$var$addToast(children,
|
|
124
|
+
return $02c59b34bd70955a$var$addToast(children, 'positive', options);
|
|
125
125
|
},
|
|
126
126
|
/** Queues a negative toast. */ negative (children, options = {}) {
|
|
127
|
-
return $02c59b34bd70955a$var$addToast(children,
|
|
127
|
+
return $02c59b34bd70955a$var$addToast(children, 'negative', options);
|
|
128
128
|
},
|
|
129
129
|
/** Queues an informational toast. */ info (children, options = {}) {
|
|
130
|
-
return $02c59b34bd70955a$var$addToast(children,
|
|
130
|
+
return $02c59b34bd70955a$var$addToast(children, 'info', options);
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
|
package/dist/Toaster.main.js
CHANGED
|
@@ -48,7 +48,7 @@ function $5b9f2c86c1b1395c$export$fb98e3a2a4cd92d7(props) {
|
|
|
48
48
|
let { getContainer: getContainer } = (0, $acAHv$reactariaoverlays.useUNSTABLE_PortalContext)();
|
|
49
49
|
let contents = /*#__PURE__*/ (0, ($parcel$interopDefault($acAHv$react))).createElement((0, $acAHv$reactspectrumprovider.Provider), {
|
|
50
50
|
UNSAFE_style: {
|
|
51
|
-
background:
|
|
51
|
+
background: 'transparent'
|
|
52
52
|
}
|
|
53
53
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($acAHv$react))).createElement($5b9f2c86c1b1395c$export$9194c0aa0cd7a9ff.Provider, {
|
|
54
54
|
value: isFocusVisible
|
|
@@ -57,7 +57,7 @@ function $5b9f2c86c1b1395c$export$fb98e3a2a4cd92d7(props) {
|
|
|
57
57
|
ref: ref,
|
|
58
58
|
"data-position": "bottom",
|
|
59
59
|
"data-placement": "center",
|
|
60
|
-
className: (0, $acAHv$reactspectrumutils.classNames)((0, ($parcel$interopDefault($e20782d0579ed886$exports))),
|
|
60
|
+
className: (0, $acAHv$reactspectrumutils.classNames)((0, ($parcel$interopDefault($e20782d0579ed886$exports))), 'react-spectrum-ToastContainer')
|
|
61
61
|
}, children)));
|
|
62
62
|
var _getContainer;
|
|
63
63
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($acAHv$reactdom))).createPortal(contents, (_getContainer = getContainer === null || getContainer === void 0 ? void 0 : getContainer()) !== null && _getContainer !== void 0 ? _getContainer : document.body);
|
package/dist/Toaster.mjs
CHANGED
|
@@ -41,7 +41,7 @@ function $e46feef4e4c28a4b$export$fb98e3a2a4cd92d7(props) {
|
|
|
41
41
|
let { getContainer: getContainer } = (0, $7Pdp8$useUNSTABLE_PortalContext)();
|
|
42
42
|
let contents = /*#__PURE__*/ (0, $7Pdp8$react).createElement((0, $7Pdp8$Provider), {
|
|
43
43
|
UNSAFE_style: {
|
|
44
|
-
background:
|
|
44
|
+
background: 'transparent'
|
|
45
45
|
}
|
|
46
46
|
}, /*#__PURE__*/ (0, $7Pdp8$react).createElement($e46feef4e4c28a4b$export$9194c0aa0cd7a9ff.Provider, {
|
|
47
47
|
value: isFocusVisible
|
|
@@ -50,7 +50,7 @@ function $e46feef4e4c28a4b$export$fb98e3a2a4cd92d7(props) {
|
|
|
50
50
|
ref: ref,
|
|
51
51
|
"data-position": "bottom",
|
|
52
52
|
"data-placement": "center",
|
|
53
|
-
className: (0, $7Pdp8$classNames)((0, ($parcel$interopDefault($7Pdp8$toastContainer_cssmodulejs))),
|
|
53
|
+
className: (0, $7Pdp8$classNames)((0, ($parcel$interopDefault($7Pdp8$toastContainer_cssmodulejs))), 'react-spectrum-ToastContainer')
|
|
54
54
|
}, children)));
|
|
55
55
|
var _getContainer;
|
|
56
56
|
return /*#__PURE__*/ (0, $7Pdp8$reactdom).createPortal(contents, (_getContainer = getContainer === null || getContainer === void 0 ? void 0 : getContainer()) !== null && _getContainer !== void 0 ? _getContainer : document.body);
|
|
@@ -58,4 +58,4 @@ function $e46feef4e4c28a4b$export$fb98e3a2a4cd92d7(props) {
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
export {$e46feef4e4c28a4b$export$9194c0aa0cd7a9ff as ToasterContext, $e46feef4e4c28a4b$export$fb98e3a2a4cd92d7 as Toaster};
|
|
61
|
-
//# sourceMappingURL=Toaster.
|
|
61
|
+
//# sourceMappingURL=Toaster.module.js.map
|
package/dist/Toaster.module.js
CHANGED
|
@@ -41,7 +41,7 @@ function $e46feef4e4c28a4b$export$fb98e3a2a4cd92d7(props) {
|
|
|
41
41
|
let { getContainer: getContainer } = (0, $7Pdp8$useUNSTABLE_PortalContext)();
|
|
42
42
|
let contents = /*#__PURE__*/ (0, $7Pdp8$react).createElement((0, $7Pdp8$Provider), {
|
|
43
43
|
UNSAFE_style: {
|
|
44
|
-
background:
|
|
44
|
+
background: 'transparent'
|
|
45
45
|
}
|
|
46
46
|
}, /*#__PURE__*/ (0, $7Pdp8$react).createElement($e46feef4e4c28a4b$export$9194c0aa0cd7a9ff.Provider, {
|
|
47
47
|
value: isFocusVisible
|
|
@@ -50,7 +50,7 @@ function $e46feef4e4c28a4b$export$fb98e3a2a4cd92d7(props) {
|
|
|
50
50
|
ref: ref,
|
|
51
51
|
"data-position": "bottom",
|
|
52
52
|
"data-placement": "center",
|
|
53
|
-
className: (0, $7Pdp8$classNames)((0, ($parcel$interopDefault($7Pdp8$toastContainer_cssmodulejs))),
|
|
53
|
+
className: (0, $7Pdp8$classNames)((0, ($parcel$interopDefault($7Pdp8$toastContainer_cssmodulejs))), 'react-spectrum-ToastContainer')
|
|
54
54
|
}, children)));
|
|
55
55
|
var _getContainer;
|
|
56
56
|
return /*#__PURE__*/ (0, $7Pdp8$reactdom).createPortal(contents, (_getContainer = getContainer === null || getContainer === void 0 ? void 0 : getContainer()) !== null && _getContainer !== void 0 ? _getContainer : document.body);
|
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/toast_vars_css.mjs
CHANGED
package/dist/tr-TR.mjs
CHANGED
package/dist/uk-UA.mjs
CHANGED
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-spectrum/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",
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/focus": "^3.17.
|
|
40
|
-
"@react-aria/i18n": "^3.11.
|
|
41
|
-
"@react-aria/overlays": "^3.22.
|
|
42
|
-
"@react-aria/toast": "3.0.0-beta.
|
|
43
|
-
"@react-aria/utils": "^3.24.
|
|
44
|
-
"@react-spectrum/button": "^3.16.
|
|
45
|
-
"@react-spectrum/utils": "^3.11.
|
|
46
|
-
"@react-stately/toast": "3.0.0-beta.
|
|
47
|
-
"@react-types/shared": "^3.23.
|
|
48
|
-
"@spectrum-icons/ui": "^3.6.
|
|
39
|
+
"@react-aria/focus": "^3.17.1",
|
|
40
|
+
"@react-aria/i18n": "^3.11.1",
|
|
41
|
+
"@react-aria/overlays": "^3.22.1",
|
|
42
|
+
"@react-aria/toast": "3.0.0-beta.12",
|
|
43
|
+
"@react-aria/utils": "^3.24.1",
|
|
44
|
+
"@react-spectrum/button": "^3.16.4",
|
|
45
|
+
"@react-spectrum/utils": "^3.11.7",
|
|
46
|
+
"@react-stately/toast": "3.0.0-beta.4",
|
|
47
|
+
"@react-types/shared": "^3.23.1",
|
|
48
|
+
"@spectrum-icons/ui": "^3.6.7",
|
|
49
49
|
"@swc/helpers": "^0.5.0",
|
|
50
50
|
"use-sync-external-store": "^1.2.0"
|
|
51
51
|
},
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
66
66
|
}
|