@react-spectrum/toast 3.0.0-beta.1 → 3.0.0-beta.2
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 +9 -5
- package/dist/main.js +9 -5
- package/dist/main.js.map +1 -1
- package/dist/module.js +9 -5
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/ToastContainer.tsx +10 -4
package/dist/import.mjs
CHANGED
|
@@ -57,7 +57,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
var $
|
|
60
|
+
var $41e47081d30453d1$exports = {};
|
|
61
61
|
var $4ef3586572b5c0bd$exports = {};
|
|
62
62
|
$4ef3586572b5c0bd$exports = {
|
|
63
63
|
"info": `معلومات`,
|
|
@@ -330,7 +330,7 @@ $19cbd4230357935e$exports = {
|
|
|
330
330
|
};
|
|
331
331
|
|
|
332
332
|
|
|
333
|
-
$
|
|
333
|
+
$41e47081d30453d1$exports = {
|
|
334
334
|
"ar-AE": $4ef3586572b5c0bd$exports,
|
|
335
335
|
"bg-BG": $9294a3bc0be7c803$exports,
|
|
336
336
|
"cs-CZ": $2301cc9fa70c79b7$exports,
|
|
@@ -435,7 +435,7 @@ function $7e7a2952509f3a56$var$Toast(props, ref) {
|
|
|
435
435
|
let domRef = (0, $jn1ib$useDOMRef)(ref);
|
|
436
436
|
let { closeButtonProps: closeButtonProps , titleProps: titleProps , toastProps: toastProps } = (0, $jn1ib$useToast)(props, state, domRef);
|
|
437
437
|
let { styleProps: styleProps } = (0, $jn1ib$useStyleProps)(otherProps);
|
|
438
|
-
let stringFormatter = (0, $jn1ib$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
438
|
+
let stringFormatter = (0, $jn1ib$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($41e47081d30453d1$exports))));
|
|
439
439
|
let iconLabel = variant && variant !== "neutral" ? stringFormatter.format(variant) : null;
|
|
440
440
|
let Icon = $7e7a2952509f3a56$export$fde44257752a9f60[variant];
|
|
441
441
|
const handleAction = ()=>{
|
|
@@ -539,6 +539,9 @@ function $02c59b34bd70955a$var$subscribe(fn) {
|
|
|
539
539
|
$02c59b34bd70955a$var$subscriptions.add(fn);
|
|
540
540
|
return ()=>$02c59b34bd70955a$var$subscriptions.delete(fn);
|
|
541
541
|
}
|
|
542
|
+
function $02c59b34bd70955a$var$triggerSubscriptions() {
|
|
543
|
+
for (let fn of $02c59b34bd70955a$var$subscriptions)fn();
|
|
544
|
+
}
|
|
542
545
|
function $02c59b34bd70955a$var$getActiveToastContainer() {
|
|
543
546
|
return $02c59b34bd70955a$var$toastProviders.values().next().value;
|
|
544
547
|
}
|
|
@@ -551,9 +554,10 @@ function $02c59b34bd70955a$export$f2815235e76a62b9(props) {
|
|
|
551
554
|
// We use a ref to do this, since it will have a stable identity
|
|
552
555
|
// over the lifetime of the component.
|
|
553
556
|
let ref = (0, $jn1ib$useRef)();
|
|
554
|
-
$02c59b34bd70955a$var$toastProviders.add(ref);
|
|
555
557
|
// eslint-disable-next-line arrow-body-style
|
|
556
558
|
(0, $jn1ib$useEffect)(()=>{
|
|
559
|
+
$02c59b34bd70955a$var$toastProviders.add(ref);
|
|
560
|
+
$02c59b34bd70955a$var$triggerSubscriptions();
|
|
557
561
|
return ()=>{
|
|
558
562
|
// When this toast provider unmounts, reset all animations so that
|
|
559
563
|
// when the new toast provider renders, it is seamless.
|
|
@@ -562,7 +566,7 @@ function $02c59b34bd70955a$export$f2815235e76a62b9(props) {
|
|
|
562
566
|
// This will cause all other instances to re-render,
|
|
563
567
|
// and the first one to become the new active toast provider.
|
|
564
568
|
$02c59b34bd70955a$var$toastProviders.delete(ref);
|
|
565
|
-
|
|
569
|
+
$02c59b34bd70955a$var$triggerSubscriptions();
|
|
566
570
|
};
|
|
567
571
|
}, []);
|
|
568
572
|
// Only render if this is the active toast provider instance, and there are visible toasts.
|
package/dist/main.js
CHANGED
|
@@ -60,7 +60,7 @@ $parcel$export(module.exports, "ToastQueue", () => $56cdf77f3be52eaf$export$f1f8
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
var $
|
|
63
|
+
var $1e709ec471c88b75$exports = {};
|
|
64
64
|
var $0cf579c4d0619650$exports = {};
|
|
65
65
|
$0cf579c4d0619650$exports = {
|
|
66
66
|
"info": `معلومات`,
|
|
@@ -333,7 +333,7 @@ $a73ba38da5e03e12$exports = {
|
|
|
333
333
|
};
|
|
334
334
|
|
|
335
335
|
|
|
336
|
-
$
|
|
336
|
+
$1e709ec471c88b75$exports = {
|
|
337
337
|
"ar-AE": $0cf579c4d0619650$exports,
|
|
338
338
|
"bg-BG": $01a5f2e754a3aca3$exports,
|
|
339
339
|
"cs-CZ": $349346d24fea9f93$exports,
|
|
@@ -438,7 +438,7 @@ function $6c5bd1047ecc310e$var$Toast(props, ref) {
|
|
|
438
438
|
let domRef = (0, $9Oq2J$reactspectrumutils.useDOMRef)(ref);
|
|
439
439
|
let { closeButtonProps: closeButtonProps , titleProps: titleProps , toastProps: toastProps } = (0, $9Oq2J$reactariatoast.useToast)(props, state, domRef);
|
|
440
440
|
let { styleProps: styleProps } = (0, $9Oq2J$reactspectrumutils.useStyleProps)(otherProps);
|
|
441
|
-
let stringFormatter = (0, $9Oq2J$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
441
|
+
let stringFormatter = (0, $9Oq2J$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($1e709ec471c88b75$exports))));
|
|
442
442
|
let iconLabel = variant && variant !== "neutral" ? stringFormatter.format(variant) : null;
|
|
443
443
|
let Icon = $6c5bd1047ecc310e$export$fde44257752a9f60[variant];
|
|
444
444
|
const handleAction = ()=>{
|
|
@@ -542,6 +542,9 @@ function $56cdf77f3be52eaf$var$subscribe(fn) {
|
|
|
542
542
|
$56cdf77f3be52eaf$var$subscriptions.add(fn);
|
|
543
543
|
return ()=>$56cdf77f3be52eaf$var$subscriptions.delete(fn);
|
|
544
544
|
}
|
|
545
|
+
function $56cdf77f3be52eaf$var$triggerSubscriptions() {
|
|
546
|
+
for (let fn of $56cdf77f3be52eaf$var$subscriptions)fn();
|
|
547
|
+
}
|
|
545
548
|
function $56cdf77f3be52eaf$var$getActiveToastContainer() {
|
|
546
549
|
return $56cdf77f3be52eaf$var$toastProviders.values().next().value;
|
|
547
550
|
}
|
|
@@ -554,9 +557,10 @@ function $56cdf77f3be52eaf$export$f2815235e76a62b9(props) {
|
|
|
554
557
|
// We use a ref to do this, since it will have a stable identity
|
|
555
558
|
// over the lifetime of the component.
|
|
556
559
|
let ref = (0, $9Oq2J$react.useRef)();
|
|
557
|
-
$56cdf77f3be52eaf$var$toastProviders.add(ref);
|
|
558
560
|
// eslint-disable-next-line arrow-body-style
|
|
559
561
|
(0, $9Oq2J$react.useEffect)(()=>{
|
|
562
|
+
$56cdf77f3be52eaf$var$toastProviders.add(ref);
|
|
563
|
+
$56cdf77f3be52eaf$var$triggerSubscriptions();
|
|
560
564
|
return ()=>{
|
|
561
565
|
// When this toast provider unmounts, reset all animations so that
|
|
562
566
|
// when the new toast provider renders, it is seamless.
|
|
@@ -565,7 +569,7 @@ function $56cdf77f3be52eaf$export$f2815235e76a62b9(props) {
|
|
|
565
569
|
// This will cause all other instances to re-render,
|
|
566
570
|
// and the first one to become the new active toast provider.
|
|
567
571
|
$56cdf77f3be52eaf$var$toastProviders.delete(ref);
|
|
568
|
-
|
|
572
|
+
$56cdf77f3be52eaf$var$triggerSubscriptions();
|
|
569
573
|
};
|
|
570
574
|
}, []);
|
|
571
575
|
// Only render if this is the active toast provider instance, and there are visible toasts.
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;AC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AAC,CAAC,EAAiB;QAC/E,OAAO,+BAAS,UAAU,YAAY;IACxC;IACA,6BAA6B,GAC7B,UAAS,QAAmB,EAAE,UAAgC,CAAC,CAAC,EAAiB;QAC/E,OAAO,+BAAS,UAAU,YAAY;IACxC;IACA,mCAAmC,GACnC,MAAK,QAAmB,EAAE,UAAgC,CAAC,CAAC,EAAiB;QAC3E,OAAO,+BAAS,UAAU,QAAQ;IACpC;AACF;AAIA,wDAAwD;AACxD,sGAAsG;AACtG,MAAM,yCAAmB;IACvB,UAAU;IACV,UAAU;IACV,MAAM;IACN,SAAS;AACX;AAEA,SAAS,kCAAY,OAAsC,EAAE,OAA6B,EAAE;IAC1F,IAAI,WAAW,sCAAgB,CAAC,QAAQ,IAAI;IAC5C,IAAI,QAAQ,QAAQ,EAClB,YAAY;IAEd,OAAO;AACT;;AD7KA","sources":["packages/@react-spectrum/toast/src/index.ts","packages/@react-spectrum/toast/src/ToastContainer.tsx","packages/@react-spectrum/toast/src/Toast.tsx","packages/@react-spectrum/toast/intl/*.js","packages/@react-spectrum/toast/intl/ar-AE.json","packages/@react-spectrum/toast/intl/bg-BG.json","packages/@react-spectrum/toast/intl/cs-CZ.json","packages/@react-spectrum/toast/intl/da-DK.json","packages/@react-spectrum/toast/intl/de-DE.json","packages/@react-spectrum/toast/intl/el-GR.json","packages/@react-spectrum/toast/intl/en-US.json","packages/@react-spectrum/toast/intl/es-ES.json","packages/@react-spectrum/toast/intl/et-EE.json","packages/@react-spectrum/toast/intl/fi-FI.json","packages/@react-spectrum/toast/intl/fr-FR.json","packages/@react-spectrum/toast/intl/he-IL.json","packages/@react-spectrum/toast/intl/hr-HR.json","packages/@react-spectrum/toast/intl/hu-HU.json","packages/@react-spectrum/toast/intl/it-IT.json","packages/@react-spectrum/toast/intl/ja-JP.json","packages/@react-spectrum/toast/intl/ko-KR.json","packages/@react-spectrum/toast/intl/lt-LT.json","packages/@react-spectrum/toast/intl/lv-LV.json","packages/@react-spectrum/toast/intl/nb-NO.json","packages/@react-spectrum/toast/intl/nl-NL.json","packages/@react-spectrum/toast/intl/pl-PL.json","packages/@react-spectrum/toast/intl/pt-BR.json","packages/@react-spectrum/toast/intl/pt-PT.json","packages/@react-spectrum/toast/intl/ro-RO.json","packages/@react-spectrum/toast/intl/ru-RU.json","packages/@react-spectrum/toast/intl/sk-SK.json","packages/@react-spectrum/toast/intl/sl-SI.json","packages/@react-spectrum/toast/intl/sr-SP.json","packages/@react-spectrum/toast/intl/sv-SE.json","packages/@react-spectrum/toast/intl/tr-TR.json","packages/@react-spectrum/toast/intl/uk-UA.json","packages/@react-spectrum/toast/intl/zh-CN.json","packages/@react-spectrum/toast/intl/zh-TW.json","packages/@adobe/spectrum-css-temp/components/toast/vars.css","packages/@react-spectrum/toast/src/toastContainer.css","packages/@react-spectrum/toast/src/Toaster.tsx"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {ToastContainer, ToastQueue} from './ToastContainer';\n\nexport type {SpectrumToastOptions, SpectrumToastContainerProps} from './ToastContainer';\n","/*\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 {AriaToastRegionProps} from '@react-aria/toast';\nimport React, {ReactElement, ReactNode, useEffect, useRef} from 'react';\nimport {SpectrumToastValue, Toast} from './Toast';\nimport {Toaster} from './Toaster';\nimport {ToastOptions, ToastQueue, useToastQueue} from '@react-stately/toast';\nimport {useSyncExternalStore} from 'use-sync-external-store/shim/index.js';\n\nexport interface SpectrumToastContainerProps extends AriaToastRegionProps {}\n\nexport interface SpectrumToastOptions extends Omit<ToastOptions, 'priority'> {\n /** A label for the action button within the toast. */\n actionLabel?: ReactNode,\n /** Handler that is called when the action button is pressed. */\n onAction?: () => void,\n /** Whether the toast should automatically close when an action is performed. */\n shouldCloseOnAction?: boolean\n}\n\ntype CloseFunction = () => void;\n\n// There is a single global toast queue instance for the whole app, initialized lazily.\nlet globalToastQueue: ToastQueue<SpectrumToastValue> | null = null;\nfunction getGlobalToastQueue() {\n if (!globalToastQueue) {\n globalToastQueue = new ToastQueue({\n maxVisibleToasts: 1,\n hasExitAnimation: true\n });\n }\n\n return globalToastQueue;\n}\n\n// For testing. Not exported from the package index.\nexport function clearToastQueue() {\n globalToastQueue = null;\n}\n\nlet toastProviders = new Set();\nlet subscriptions = new Set<() => void>();\nfunction subscribe(fn: () => void) {\n subscriptions.add(fn);\n return () => subscriptions.delete(fn);\n}\n\nfunction getActiveToastContainer() {\n return toastProviders.values().next().value;\n}\n\nfunction useActiveToastContainer() {\n return useSyncExternalStore(subscribe, getActiveToastContainer, getActiveToastContainer);\n}\n\n/**\n * A ToastContainer renders the queued toasts in an application. It should be placed\n * at the root of the app.\n */\nexport function ToastContainer(props: SpectrumToastContainerProps): ReactElement {\n // Track all toast provider instances in a set.\n // Only the first one will actually render.\n // We use a ref to do this, since it will have a stable identity\n // over the lifetime of the component.\n let ref = useRef();\n toastProviders.add(ref);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n // When this toast provider unmounts, reset all animations so that\n // when the new toast provider renders, it is seamless.\n for (let toast of getGlobalToastQueue().visibleToasts) {\n toast.animation = null;\n }\n\n // Remove this toast provider, and call subscriptions.\n // This will cause all other instances to re-render,\n // and the first one to become the new active toast provider.\n toastProviders.delete(ref);\n for (let fn of subscriptions) {\n fn();\n }\n };\n }, []);\n\n // Only render if this is the active toast provider instance, and there are visible toasts.\n let activeToastContainer = useActiveToastContainer();\n let state = useToastQueue(getGlobalToastQueue());\n if (ref === activeToastContainer && state.visibleToasts.length > 0) {\n return (\n <Toaster state={state} {...props}>\n {state.visibleToasts.map((toast) => (\n <Toast\n key={toast.key}\n toast={toast}\n state={state} />\n ))}\n </Toaster>\n );\n }\n\n return null;\n}\n\nfunction addToast(children: ReactNode, variant: SpectrumToastValue['variant'], options: SpectrumToastOptions = {}) {\n // Dispatch a custom event so that toasts can be intercepted and re-targeted, e.g. when inside an iframe.\n if (typeof CustomEvent !== 'undefined' && typeof window !== 'undefined') {\n let event = new CustomEvent('react-spectrum-toast', {\n cancelable: true,\n bubbles: true,\n detail: {\n children,\n variant,\n options\n }\n });\n\n let shouldContinue = window.dispatchEvent(event);\n if (!shouldContinue) {\n return;\n }\n }\n\n let value = {\n children,\n variant,\n actionLabel: options.actionLabel,\n onAction: options.onAction,\n shouldCloseOnAction: options.shouldCloseOnAction\n };\n\n // Minimum time of 5s from https://spectrum.adobe.com/page/toast/#Auto-dismissible\n // Actionable toasts cannot be auto dismissed. That would fail WCAG SC 2.2.1.\n // It is debatable whether non-actionable toasts would also fail.\n let timeout = options.timeout && !options.onAction ? Math.max(options.timeout, 5000) : null;\n let queue = getGlobalToastQueue();\n let key = queue.add(value, {priority: getPriority(variant, options), timeout, onClose: options.onClose});\n return () => queue.close(key);\n}\n\nconst SpectrumToastQueue = {\n /** Queues a neutral toast. */\n neutral(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'neutral', options);\n },\n /** Queues a positive toast. */\n positive(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'positive', options);\n },\n /** Queues a negative toast. */\n negative(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'negative', options);\n },\n /** Queues an informational toast. */\n info(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'info', options);\n }\n};\n\nexport {SpectrumToastQueue as ToastQueue};\n\n// https://spectrum.adobe.com/page/toast/#Priority-queue\n// TODO: if a lower priority toast comes in, no way to know until you dismiss the higher priority one.\nconst VARIANT_PRIORITY = {\n negative: 10,\n positive: 3,\n info: 2,\n neutral: 1\n};\n\nfunction getPriority(variant: SpectrumToastValue['variant'], options: SpectrumToastOptions) {\n let priority = VARIANT_PRIORITY[variant] || 1;\n if (options.onAction) {\n priority += 4;\n }\n return priority;\n}\n","/*\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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {Button, ClearButton} from '@react-spectrum/button';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossMedium from '@spectrum-icons/ui/CrossMedium';\nimport {DOMRef} from '@react-types/shared';\nimport InfoMedium from '@spectrum-icons/ui/InfoMedium';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {QueuedToast, ToastState} from '@react-stately/toast';\nimport React, {ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/toast/vars.css';\nimport SuccessMedium from '@spectrum-icons/ui/SuccessMedium';\nimport toastContainerStyles from './toastContainer.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useToast} from '@react-aria/toast';\n\nexport interface SpectrumToastValue {\n children: ReactNode,\n variant: 'positive' | 'negative' | 'info' | 'neutral',\n actionLabel?: ReactNode,\n onAction?: () => void,\n shouldCloseOnAction?: boolean\n}\n\nexport interface SpectrumToastProps {\n toast: QueuedToast<SpectrumToastValue>,\n state: ToastState<SpectrumToastValue>\n}\n\n// TODO: express should use filled icons...\nexport const ICONS = {\n info: InfoMedium,\n negative: AlertMedium,\n positive: SuccessMedium\n};\n\nfunction Toast(props: SpectrumToastProps, ref: DOMRef<HTMLDivElement>) {\n let {\n toast: {\n key,\n animation,\n content: {\n children,\n variant,\n actionLabel,\n onAction,\n shouldCloseOnAction\n }\n },\n state,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {\n closeButtonProps,\n titleProps,\n toastProps\n } = useToast(props, state, domRef);\n let {styleProps} = useStyleProps(otherProps);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;\n let Icon = ICONS[variant];\n\n const handleAction = () => {\n if (onAction) {\n onAction();\n }\n\n if (shouldCloseOnAction) {\n state.close(key);\n }\n };\n\n return (\n <div\n {...styleProps}\n {...toastProps}\n ref={domRef}\n className={classNames(styles,\n 'spectrum-Toast',\n {['spectrum-Toast--' + variant]: variant},\n styleProps.className,\n classNames(\n toastContainerStyles,\n 'spectrum-Toast'\n )\n )}\n style={{\n ...styleProps.style,\n zIndex: props.toast.priority\n }}\n data-animation={animation}\n onAnimationEnd={() => {\n if (animation === 'exiting') {\n state.remove(key);\n }\n }}>\n {Icon &&\n <Icon\n aria-label={iconLabel}\n UNSAFE_className={classNames(styles, 'spectrum-Toast-typeIcon')} />\n }\n <div className={classNames(styles, 'spectrum-Toast-body')}>\n <div className={classNames(styles, 'spectrum-Toast-content')} {...titleProps}>{children}</div>\n {actionLabel &&\n <Button\n onPress={handleAction}\n UNSAFE_className={classNames(styles, 'spectrum-Button')}\n variant=\"secondary\"\n staticColor=\"white\">\n {actionLabel}\n </Button>\n }\n </div>\n <div className={classNames(styles, 'spectrum-Toast-buttons')}>\n <ClearButton {...closeButtonProps} variant=\"overBackground\">\n <CrossMedium />\n </ClearButton>\n </div>\n </div>\n );\n}\n\nlet _Toast = React.forwardRef(Toast);\nexport {_Toast as Toast};\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"info\": \"معلومات\",\n \"negative\": \"خطأ\",\n \"positive\": \"تم بنجاح\"\n}\n","{\n \"info\": \"Информация\",\n \"negative\": \"Грешка\",\n \"positive\": \"Успешно\"\n}\n","{\n \"info\": \"Informace\",\n \"negative\": \"Chyba\",\n \"positive\": \"Úspěch\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fejl\",\n \"positive\": \"Fuldført\"\n}\n","{\n \"info\": \"Informationen\",\n \"negative\": \"Fehler\",\n \"positive\": \"Erfolg\"\n}\n","{\n \"info\": \"Πληροφορίες\",\n \"negative\": \"Σφάλμα\",\n \"positive\": \"Επιτυχία\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Error\",\n \"positive\": \"Success\"\n}\n","{\n \"info\": \"Información\",\n \"negative\": \"Error\",\n \"positive\": \"Éxito\"\n}\n","{\n \"info\": \"Teave\",\n \"negative\": \"Viga\",\n \"positive\": \"Valmis\"\n}\n","{\n \"info\": \"Tiedot\",\n \"negative\": \"Virhe\",\n \"positive\": \"Onnistui\"\n}\n","{\n \"info\": \"Infos\",\n \"negative\": \"Erreur\",\n \"positive\": \"Succès\"\n}\n","{\n \"info\": \"מידע\",\n \"negative\": \"שגיאה\",\n \"positive\": \"הצלחה\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Pogreška\",\n \"positive\": \"Uspješno\"\n}\n","{\n \"info\": \"Információ\",\n \"negative\": \"Hiba\",\n \"positive\": \"Siker\"\n}\n","{\n \"info\": \"Informazioni\",\n \"negative\": \"Errore\",\n \"positive\": \"Operazione riuscita\"\n}\n","{\n \"info\": \"情報\",\n \"negative\": \"エラー\",\n \"positive\": \"成功\"\n}\n","{\n \"info\": \"정보\",\n \"negative\": \"오류\",\n \"positive\": \"성공\"\n}\n","{\n \"info\": \"Informacija\",\n \"negative\": \"Klaida\",\n \"positive\": \"Sėkmingai\"\n}\n","{\n \"info\": \"Informācija\",\n \"negative\": \"Kļūda\",\n \"positive\": \"Izdevās\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Feil\",\n \"positive\": \"Vellykket\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fout\",\n \"positive\": \"Geslaagd\"\n}\n","{\n \"info\": \"Informacje\",\n \"negative\": \"Błąd\",\n \"positive\": \"Powodzenie\"\n}\n","{\n \"info\": \"Informações\",\n \"negative\": \"Erro\",\n \"positive\": \"Sucesso\"\n}\n","{\n \"info\": \"Informação\",\n \"negative\": \"Erro\",\n \"positive\": \"Sucesso\"\n}\n","{\n \"info\": \"Informații\",\n \"negative\": \"Eroare\",\n \"positive\": \"Succes\"\n}\n","{\n \"info\": \"Информация\",\n \"negative\": \"Ошибка\",\n \"positive\": \"Успешно\"\n}\n","{\n \"info\": \"Informácie\",\n \"negative\": \"Chyba\",\n \"positive\": \"Úspech\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Napaka\",\n \"positive\": \"Uspešno\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Greška\",\n \"positive\": \"Uspešno\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fel\",\n \"positive\": \"Lyckades\"\n}\n","{\n \"info\": \"Bilgiler\",\n \"negative\": \"Hata\",\n \"positive\": \"Başarılı\"\n}\n","{\n \"info\": \"Інформація\",\n \"negative\": \"Помилка\",\n \"positive\": \"Успішно\"\n}\n","{\n \"info\": \"信息\",\n \"negative\": \"错误\",\n \"positive\": \"成功\"\n}\n","{\n \"info\": \"資訊\",\n \"negative\": \"錯誤\",\n \"positive\": \"成功\"\n}\n","/*\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\n@import './index.css';\n@import './skin.css';\n","/*\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\n@import \"../../../@adobe/spectrum-css-temp/components/commons/focus-ring.css\";\n\n.react-spectrum-ToastContainer {\n position: fixed;\n inset-inline-start: 0;\n inset-inline-end: 0;\n z-index: 100050; /* above modals */\n display: flex;\n pointer-events: none;\n outline: none;\n\n > :first-child {\n @inherit %spectrum-FocusRing-ring;\n --spectrum-focus-ring-border-radius: var(--spectrum-toast-border-radius);\n --spectrum-focus-ring-gap: var(--spectrum-alias-focus-ring-gap);\n --spectrum-focus-ring-size: var(--spectrum-alias-focus-ring-size);\n }\n\n &:focus-ring > :first-child {\n @inherit %spectrum-FocusRing-active;\n }\n\n .spectrum-Toast {\n position: absolute;\n margin: 16px;\n pointer-events: all;\n }\n\n &[data-position=top] {\n top: 0;\n flex-direction: column;\n --slide-from: translateY(-100%);\n --slide-to: translateY(0);\n }\n\n &[data-position=bottom] {\n bottom: 0;\n flex-direction: column-reverse;\n --slide-from: translateY(100%);\n --slide-to: translateY(0);\n }\n\n &[data-placement=left] {\n align-items: flex-start;\n --slide-from: translateX(-100%);\n --slide-to: translateX(0);\n\n &:dir(rtl) {\n --slide-from: translateX(100%);\n }\n }\n\n &[data-placement=center] {\n align-items: center;\n }\n\n &[data-placement=right] {\n align-items: flex-end;\n --slide-from: translateX(100%);\n --slide-to: translateX(0);\n\n &:dir(rtl) {\n --slide-from: translateX(-100%);\n }\n }\n}\n\n.spectrum-Toast {\n &[data-animation=entering] {\n animation: slide-in 300ms;\n }\n\n &[data-animation=exiting] {\n animation: fade-out 300ms forwards;\n }\n}\n\n@keyframes slide-in {\n from {\n transform: var(--slide-from);\n }\n\n to {\n transform: var(--slide-to);\n }\n}\n\n@keyframes fade-out {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n","/*\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 {AriaToastRegionProps, useToastRegion} from '@react-aria/toast';\nimport {classNames, useIsMobileDevice} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {ReactElement, ReactNode, useRef} from 'react';\nimport ReactDOM from 'react-dom';\nimport toastContainerStyles from './toastContainer.css';\nimport {ToastState} from '@react-stately/toast';\n\ninterface ToastContainerProps extends AriaToastRegionProps {\n children: ReactNode,\n state: ToastState<unknown>\n}\n\nexport function Toaster(props: ToastContainerProps): ReactElement {\n let {\n children,\n state\n } = props;\n let containerPlacement = useIsMobileDevice() ? 'center' : 'right';\n\n let ref = useRef();\n let {regionProps} = useToastRegion(props, state, ref);\n\n let contents = (\n <Provider UNSAFE_style={{background: 'transparent'}}>\n <FocusRing focusRingClass={classNames(toastContainerStyles, 'focus-ring')}>\n <div\n {...regionProps}\n ref={ref}\n data-position=\"bottom\"\n data-placement={containerPlacement}\n className={classNames(\n toastContainerStyles,\n 'react-spectrum-ToastContainer'\n )}>\n {children}\n </div>\n </FocusRing>\n </Provider>\n );\n\n return ReactDOM.createPortal(contents, document.body);\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;ACVD;;;;;;;;;;CAUC;;;;;;;AEVD,4BAAiB;IAAG,QAAQ,CAAC,OAAO,CAAC;IACnC,YAAY,CAAC,GAAG,CAAC;IACjB,YAAY,CAAC,QAAQ,CAAC;AACxB;;;;ACHA,4BAAiB;IAAG,QAAQ,CAAC,UAAU,CAAC;IACtC,YAAY,CAAC,MAAM,CAAC;IACpB,YAAY,CAAC,OAAO,CAAC;AACvB;;;;ACHA,4BAAiB;IAAG,QAAQ,CAAC,SAAS,CAAC;IACrC,YAAY,CAAC,KAAK,CAAC;IACnB,YAAY,CAAC,MAAM,CAAC;AACtB;;;;ACHA,4BAAiB;IAAG,QAAQ,CAAC,IAAI,CAAC;IAChC,YAAY,CAAC,IAAI,CAAC;IAClB,YAAY,CAAC,QAAQ,CAAC;AACxB;;;;ACHA,4BAAiB;IAAG,QAAQ,CAAC,aAAa,CAAC;IACzC,YAAY,CAAC,MAAM,CAAC;IACpB,YAAY,CAAC,MAAM,CAAC;AACtB;;;;ACHA,4BAAiB;IAAG,QAAQ,CAA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AC7B,UAAS,QAAmB,EAAE,UAAgC,CAAC,CAAC;QAC9D,OAAO,+BAAS,UAAU,YAAY;IACxC;IACA,6BAA6B,GAC7B,UAAS,QAAmB,EAAE,UAAgC,CAAC,CAAC;QAC9D,OAAO,+BAAS,UAAU,YAAY;IACxC;IACA,mCAAmC,GACnC,MAAK,QAAmB,EAAE,UAAgC,CAAC,CAAC;QAC1D,OAAO,+BAAS,UAAU,QAAQ;IACpC;AACF;AAIA,wDAAwD;AACxD,sGAAsG;AACtG,MAAM,yCAAmB;IACvB,UAAU;IACV,UAAU;IACV,MAAM;IACN,SAAS;AACX;AAEA,SAAS,kCAAY,OAAsC,EAAE,OAA6B;IACxF,IAAI,WAAW,sCAAgB,CAAC,QAAQ,IAAI;IAC5C,IAAI,QAAQ,UACV,YAAY;IAEd,OAAO;AACT;","sources":["packages/@react-spectrum/toast/src/index.ts","packages/@react-spectrum/toast/src/ToastContainer.tsx","packages/@react-spectrum/toast/src/Toast.tsx","packages/@react-spectrum/toast/src/*.js","packages/@react-spectrum/toast/intl/ar-AE.json","packages/@react-spectrum/toast/intl/bg-BG.json","packages/@react-spectrum/toast/intl/cs-CZ.json","packages/@react-spectrum/toast/intl/da-DK.json","packages/@react-spectrum/toast/intl/de-DE.json","packages/@react-spectrum/toast/intl/el-GR.json","packages/@react-spectrum/toast/intl/en-US.json","packages/@react-spectrum/toast/intl/es-ES.json","packages/@react-spectrum/toast/intl/et-EE.json","packages/@react-spectrum/toast/intl/fi-FI.json","packages/@react-spectrum/toast/intl/fr-FR.json","packages/@react-spectrum/toast/intl/he-IL.json","packages/@react-spectrum/toast/intl/hr-HR.json","packages/@react-spectrum/toast/intl/hu-HU.json","packages/@react-spectrum/toast/intl/it-IT.json","packages/@react-spectrum/toast/intl/ja-JP.json","packages/@react-spectrum/toast/intl/ko-KR.json","packages/@react-spectrum/toast/intl/lt-LT.json","packages/@react-spectrum/toast/intl/lv-LV.json","packages/@react-spectrum/toast/intl/nb-NO.json","packages/@react-spectrum/toast/intl/nl-NL.json","packages/@react-spectrum/toast/intl/pl-PL.json","packages/@react-spectrum/toast/intl/pt-BR.json","packages/@react-spectrum/toast/intl/pt-PT.json","packages/@react-spectrum/toast/intl/ro-RO.json","packages/@react-spectrum/toast/intl/ru-RU.json","packages/@react-spectrum/toast/intl/sk-SK.json","packages/@react-spectrum/toast/intl/sl-SI.json","packages/@react-spectrum/toast/intl/sr-SP.json","packages/@react-spectrum/toast/intl/sv-SE.json","packages/@react-spectrum/toast/intl/tr-TR.json","packages/@react-spectrum/toast/intl/uk-UA.json","packages/@react-spectrum/toast/intl/zh-CN.json","packages/@react-spectrum/toast/intl/zh-TW.json","packages/@adobe/spectrum-css-temp/components/toast/vars.css","packages/@react-spectrum/toast/src/toastContainer.css","packages/@react-spectrum/toast/src/Toaster.tsx"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {ToastContainer, ToastQueue} from './ToastContainer';\n\nexport type {SpectrumToastOptions, SpectrumToastContainerProps} from './ToastContainer';\n","/*\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 {AriaToastRegionProps} from '@react-aria/toast';\nimport React, {ReactElement, ReactNode, useEffect, useRef} from 'react';\nimport {SpectrumToastValue, Toast} from './Toast';\nimport {Toaster} from './Toaster';\nimport {ToastOptions, ToastQueue, useToastQueue} from '@react-stately/toast';\nimport {useSyncExternalStore} from 'use-sync-external-store/shim/index.js';\n\nexport interface SpectrumToastContainerProps extends AriaToastRegionProps {}\n\nexport interface SpectrumToastOptions extends Omit<ToastOptions, 'priority'> {\n /** A label for the action button within the toast. */\n actionLabel?: ReactNode,\n /** Handler that is called when the action button is pressed. */\n onAction?: () => void,\n /** Whether the toast should automatically close when an action is performed. */\n shouldCloseOnAction?: boolean\n}\n\ntype CloseFunction = () => void;\n\n// There is a single global toast queue instance for the whole app, initialized lazily.\nlet globalToastQueue: ToastQueue<SpectrumToastValue> | null = null;\nfunction getGlobalToastQueue() {\n if (!globalToastQueue) {\n globalToastQueue = new ToastQueue({\n maxVisibleToasts: 1,\n hasExitAnimation: true\n });\n }\n\n return globalToastQueue;\n}\n\n// For testing. Not exported from the package index.\nexport function clearToastQueue() {\n globalToastQueue = null;\n}\n\nlet toastProviders = new Set();\nlet subscriptions = new Set<() => void>();\nfunction subscribe(fn: () => void) {\n subscriptions.add(fn);\n return () => subscriptions.delete(fn);\n}\n\nfunction triggerSubscriptions() {\n for (let fn of subscriptions) {\n fn();\n }\n}\n\nfunction getActiveToastContainer() {\n return toastProviders.values().next().value;\n}\n\nfunction useActiveToastContainer() {\n return useSyncExternalStore(subscribe, getActiveToastContainer, getActiveToastContainer);\n}\n\n/**\n * A ToastContainer renders the queued toasts in an application. It should be placed\n * at the root of the app.\n */\nexport function ToastContainer(props: SpectrumToastContainerProps): ReactElement {\n // Track all toast provider instances in a set.\n // Only the first one will actually render.\n // We use a ref to do this, since it will have a stable identity\n // over the lifetime of the component.\n let ref = useRef();\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n toastProviders.add(ref);\n triggerSubscriptions();\n\n return () => {\n // When this toast provider unmounts, reset all animations so that\n // when the new toast provider renders, it is seamless.\n for (let toast of getGlobalToastQueue().visibleToasts) {\n toast.animation = null;\n }\n\n // Remove this toast provider, and call subscriptions.\n // This will cause all other instances to re-render,\n // and the first one to become the new active toast provider.\n toastProviders.delete(ref);\n triggerSubscriptions();\n };\n }, []);\n\n // Only render if this is the active toast provider instance, and there are visible toasts.\n let activeToastContainer = useActiveToastContainer();\n let state = useToastQueue(getGlobalToastQueue());\n if (ref === activeToastContainer && state.visibleToasts.length > 0) {\n return (\n <Toaster state={state} {...props}>\n {state.visibleToasts.map((toast) => (\n <Toast\n key={toast.key}\n toast={toast}\n state={state} />\n ))}\n </Toaster>\n );\n }\n\n return null;\n}\n\nfunction addToast(children: ReactNode, variant: SpectrumToastValue['variant'], options: SpectrumToastOptions = {}) {\n // Dispatch a custom event so that toasts can be intercepted and re-targeted, e.g. when inside an iframe.\n if (typeof CustomEvent !== 'undefined' && typeof window !== 'undefined') {\n let event = new CustomEvent('react-spectrum-toast', {\n cancelable: true,\n bubbles: true,\n detail: {\n children,\n variant,\n options\n }\n });\n\n let shouldContinue = window.dispatchEvent(event);\n if (!shouldContinue) {\n return;\n }\n }\n\n let value = {\n children,\n variant,\n actionLabel: options.actionLabel,\n onAction: options.onAction,\n shouldCloseOnAction: options.shouldCloseOnAction\n };\n\n // Minimum time of 5s from https://spectrum.adobe.com/page/toast/#Auto-dismissible\n // Actionable toasts cannot be auto dismissed. That would fail WCAG SC 2.2.1.\n // It is debatable whether non-actionable toasts would also fail.\n let timeout = options.timeout && !options.onAction ? Math.max(options.timeout, 5000) : null;\n let queue = getGlobalToastQueue();\n let key = queue.add(value, {priority: getPriority(variant, options), timeout, onClose: options.onClose});\n return () => queue.close(key);\n}\n\nconst SpectrumToastQueue = {\n /** Queues a neutral toast. */\n neutral(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'neutral', options);\n },\n /** Queues a positive toast. */\n positive(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'positive', options);\n },\n /** Queues a negative toast. */\n negative(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'negative', options);\n },\n /** Queues an informational toast. */\n info(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'info', options);\n }\n};\n\nexport {SpectrumToastQueue as ToastQueue};\n\n// https://spectrum.adobe.com/page/toast/#Priority-queue\n// TODO: if a lower priority toast comes in, no way to know until you dismiss the higher priority one.\nconst VARIANT_PRIORITY = {\n negative: 10,\n positive: 3,\n info: 2,\n neutral: 1\n};\n\nfunction getPriority(variant: SpectrumToastValue['variant'], options: SpectrumToastOptions) {\n let priority = VARIANT_PRIORITY[variant] || 1;\n if (options.onAction) {\n priority += 4;\n }\n return priority;\n}\n","/*\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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {Button, ClearButton} from '@react-spectrum/button';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossMedium from '@spectrum-icons/ui/CrossMedium';\nimport {DOMRef} from '@react-types/shared';\nimport InfoMedium from '@spectrum-icons/ui/InfoMedium';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {QueuedToast, ToastState} from '@react-stately/toast';\nimport React, {ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/toast/vars.css';\nimport SuccessMedium from '@spectrum-icons/ui/SuccessMedium';\nimport toastContainerStyles from './toastContainer.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useToast} from '@react-aria/toast';\n\nexport interface SpectrumToastValue {\n children: ReactNode,\n variant: 'positive' | 'negative' | 'info' | 'neutral',\n actionLabel?: ReactNode,\n onAction?: () => void,\n shouldCloseOnAction?: boolean\n}\n\nexport interface SpectrumToastProps {\n toast: QueuedToast<SpectrumToastValue>,\n state: ToastState<SpectrumToastValue>\n}\n\n// TODO: express should use filled icons...\nexport const ICONS = {\n info: InfoMedium,\n negative: AlertMedium,\n positive: SuccessMedium\n};\n\nfunction Toast(props: SpectrumToastProps, ref: DOMRef<HTMLDivElement>) {\n let {\n toast: {\n key,\n animation,\n content: {\n children,\n variant,\n actionLabel,\n onAction,\n shouldCloseOnAction\n }\n },\n state,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {\n closeButtonProps,\n titleProps,\n toastProps\n } = useToast(props, state, domRef);\n let {styleProps} = useStyleProps(otherProps);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;\n let Icon = ICONS[variant];\n\n const handleAction = () => {\n if (onAction) {\n onAction();\n }\n\n if (shouldCloseOnAction) {\n state.close(key);\n }\n };\n\n return (\n <div\n {...styleProps}\n {...toastProps}\n ref={domRef}\n className={classNames(styles,\n 'spectrum-Toast',\n {['spectrum-Toast--' + variant]: variant},\n styleProps.className,\n classNames(\n toastContainerStyles,\n 'spectrum-Toast'\n )\n )}\n style={{\n ...styleProps.style,\n zIndex: props.toast.priority\n }}\n data-animation={animation}\n onAnimationEnd={() => {\n if (animation === 'exiting') {\n state.remove(key);\n }\n }}>\n {Icon &&\n <Icon\n aria-label={iconLabel}\n UNSAFE_className={classNames(styles, 'spectrum-Toast-typeIcon')} />\n }\n <div className={classNames(styles, 'spectrum-Toast-body')}>\n <div className={classNames(styles, 'spectrum-Toast-content')} {...titleProps}>{children}</div>\n {actionLabel &&\n <Button\n onPress={handleAction}\n UNSAFE_className={classNames(styles, 'spectrum-Button')}\n variant=\"secondary\"\n staticColor=\"white\">\n {actionLabel}\n </Button>\n }\n </div>\n <div className={classNames(styles, 'spectrum-Toast-buttons')}>\n <ClearButton {...closeButtonProps} variant=\"overBackground\">\n <CrossMedium />\n </ClearButton>\n </div>\n </div>\n );\n}\n\nlet _Toast = React.forwardRef(Toast);\nexport {_Toast as Toast};\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"info\": \"معلومات\",\n \"negative\": \"خطأ\",\n \"positive\": \"تم بنجاح\"\n}\n","{\n \"info\": \"Информация\",\n \"negative\": \"Грешка\",\n \"positive\": \"Успешно\"\n}\n","{\n \"info\": \"Informace\",\n \"negative\": \"Chyba\",\n \"positive\": \"Úspěch\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fejl\",\n \"positive\": \"Fuldført\"\n}\n","{\n \"info\": \"Informationen\",\n \"negative\": \"Fehler\",\n \"positive\": \"Erfolg\"\n}\n","{\n \"info\": \"Πληροφορίες\",\n \"negative\": \"Σφάλμα\",\n \"positive\": \"Επιτυχία\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Error\",\n \"positive\": \"Success\"\n}\n","{\n \"info\": \"Información\",\n \"negative\": \"Error\",\n \"positive\": \"Éxito\"\n}\n","{\n \"info\": \"Teave\",\n \"negative\": \"Viga\",\n \"positive\": \"Valmis\"\n}\n","{\n \"info\": \"Tiedot\",\n \"negative\": \"Virhe\",\n \"positive\": \"Onnistui\"\n}\n","{\n \"info\": \"Infos\",\n \"negative\": \"Erreur\",\n \"positive\": \"Succès\"\n}\n","{\n \"info\": \"מידע\",\n \"negative\": \"שגיאה\",\n \"positive\": \"הצלחה\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Pogreška\",\n \"positive\": \"Uspješno\"\n}\n","{\n \"info\": \"Információ\",\n \"negative\": \"Hiba\",\n \"positive\": \"Siker\"\n}\n","{\n \"info\": \"Informazioni\",\n \"negative\": \"Errore\",\n \"positive\": \"Operazione riuscita\"\n}\n","{\n \"info\": \"情報\",\n \"negative\": \"エラー\",\n \"positive\": \"成功\"\n}\n","{\n \"info\": \"정보\",\n \"negative\": \"오류\",\n \"positive\": \"성공\"\n}\n","{\n \"info\": \"Informacija\",\n \"negative\": \"Klaida\",\n \"positive\": \"Sėkmingai\"\n}\n","{\n \"info\": \"Informācija\",\n \"negative\": \"Kļūda\",\n \"positive\": \"Izdevās\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Feil\",\n \"positive\": \"Vellykket\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fout\",\n \"positive\": \"Geslaagd\"\n}\n","{\n \"info\": \"Informacje\",\n \"negative\": \"Błąd\",\n \"positive\": \"Powodzenie\"\n}\n","{\n \"info\": \"Informações\",\n \"negative\": \"Erro\",\n \"positive\": \"Sucesso\"\n}\n","{\n \"info\": \"Informação\",\n \"negative\": \"Erro\",\n \"positive\": \"Sucesso\"\n}\n","{\n \"info\": \"Informații\",\n \"negative\": \"Eroare\",\n \"positive\": \"Succes\"\n}\n","{\n \"info\": \"Информация\",\n \"negative\": \"Ошибка\",\n \"positive\": \"Успешно\"\n}\n","{\n \"info\": \"Informácie\",\n \"negative\": \"Chyba\",\n \"positive\": \"Úspech\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Napaka\",\n \"positive\": \"Uspešno\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Greška\",\n \"positive\": \"Uspešno\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fel\",\n \"positive\": \"Lyckades\"\n}\n","{\n \"info\": \"Bilgiler\",\n \"negative\": \"Hata\",\n \"positive\": \"Başarılı\"\n}\n","{\n \"info\": \"Інформація\",\n \"negative\": \"Помилка\",\n \"positive\": \"Успішно\"\n}\n","{\n \"info\": \"信息\",\n \"negative\": \"错误\",\n \"positive\": \"成功\"\n}\n","{\n \"info\": \"資訊\",\n \"negative\": \"錯誤\",\n \"positive\": \"成功\"\n}\n","/*\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\n@import './index.css';\n@import './skin.css';\n","/*\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\n@import \"../../../@adobe/spectrum-css-temp/components/commons/focus-ring.css\";\n\n.react-spectrum-ToastContainer {\n position: fixed;\n inset-inline-start: 0;\n inset-inline-end: 0;\n z-index: 100050; /* above modals */\n display: flex;\n pointer-events: none;\n outline: none;\n\n > :first-child {\n @inherit %spectrum-FocusRing-ring;\n --spectrum-focus-ring-border-radius: var(--spectrum-toast-border-radius);\n --spectrum-focus-ring-gap: var(--spectrum-alias-focus-ring-gap);\n --spectrum-focus-ring-size: var(--spectrum-alias-focus-ring-size);\n }\n\n &:focus-ring > :first-child {\n @inherit %spectrum-FocusRing-active;\n }\n\n .spectrum-Toast {\n position: absolute;\n margin: 16px;\n pointer-events: all;\n }\n\n &[data-position=top] {\n top: 0;\n flex-direction: column;\n --slide-from: translateY(-100%);\n --slide-to: translateY(0);\n }\n\n &[data-position=bottom] {\n bottom: 0;\n flex-direction: column-reverse;\n --slide-from: translateY(100%);\n --slide-to: translateY(0);\n }\n\n &[data-placement=left] {\n align-items: flex-start;\n --slide-from: translateX(-100%);\n --slide-to: translateX(0);\n\n &:dir(rtl) {\n --slide-from: translateX(100%);\n }\n }\n\n &[data-placement=center] {\n align-items: center;\n }\n\n &[data-placement=right] {\n align-items: flex-end;\n --slide-from: translateX(100%);\n --slide-to: translateX(0);\n\n &:dir(rtl) {\n --slide-from: translateX(-100%);\n }\n }\n}\n\n.spectrum-Toast {\n &[data-animation=entering] {\n animation: slide-in 300ms;\n }\n\n &[data-animation=exiting] {\n animation: fade-out 300ms forwards;\n }\n}\n\n@keyframes slide-in {\n from {\n transform: var(--slide-from);\n }\n\n to {\n transform: var(--slide-to);\n }\n}\n\n@keyframes fade-out {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n","/*\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 {AriaToastRegionProps, useToastRegion} from '@react-aria/toast';\nimport {classNames, useIsMobileDevice} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {ReactElement, ReactNode, useRef} from 'react';\nimport ReactDOM from 'react-dom';\nimport toastContainerStyles from './toastContainer.css';\nimport {ToastState} from '@react-stately/toast';\n\ninterface ToastContainerProps extends AriaToastRegionProps {\n children: ReactNode,\n state: ToastState<unknown>\n}\n\nexport function Toaster(props: ToastContainerProps): ReactElement {\n let {\n children,\n state\n } = props;\n let containerPlacement = useIsMobileDevice() ? 'center' : 'right';\n\n let ref = useRef();\n let {regionProps} = useToastRegion(props, state, ref);\n\n let contents = (\n <Provider UNSAFE_style={{background: 'transparent'}}>\n <FocusRing focusRingClass={classNames(toastContainerStyles, 'focus-ring')}>\n <div\n {...regionProps}\n ref={ref}\n data-position=\"bottom\"\n data-placement={containerPlacement}\n className={classNames(\n toastContainerStyles,\n 'react-spectrum-ToastContainer'\n )}>\n {children}\n </div>\n </FocusRing>\n </Provider>\n );\n\n return ReactDOM.createPortal(contents, document.body);\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -57,7 +57,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
var $
|
|
60
|
+
var $41e47081d30453d1$exports = {};
|
|
61
61
|
var $4ef3586572b5c0bd$exports = {};
|
|
62
62
|
$4ef3586572b5c0bd$exports = {
|
|
63
63
|
"info": `معلومات`,
|
|
@@ -330,7 +330,7 @@ $19cbd4230357935e$exports = {
|
|
|
330
330
|
};
|
|
331
331
|
|
|
332
332
|
|
|
333
|
-
$
|
|
333
|
+
$41e47081d30453d1$exports = {
|
|
334
334
|
"ar-AE": $4ef3586572b5c0bd$exports,
|
|
335
335
|
"bg-BG": $9294a3bc0be7c803$exports,
|
|
336
336
|
"cs-CZ": $2301cc9fa70c79b7$exports,
|
|
@@ -435,7 +435,7 @@ function $7e7a2952509f3a56$var$Toast(props, ref) {
|
|
|
435
435
|
let domRef = (0, $jn1ib$useDOMRef)(ref);
|
|
436
436
|
let { closeButtonProps: closeButtonProps , titleProps: titleProps , toastProps: toastProps } = (0, $jn1ib$useToast)(props, state, domRef);
|
|
437
437
|
let { styleProps: styleProps } = (0, $jn1ib$useStyleProps)(otherProps);
|
|
438
|
-
let stringFormatter = (0, $jn1ib$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
438
|
+
let stringFormatter = (0, $jn1ib$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($41e47081d30453d1$exports))));
|
|
439
439
|
let iconLabel = variant && variant !== "neutral" ? stringFormatter.format(variant) : null;
|
|
440
440
|
let Icon = $7e7a2952509f3a56$export$fde44257752a9f60[variant];
|
|
441
441
|
const handleAction = ()=>{
|
|
@@ -539,6 +539,9 @@ function $02c59b34bd70955a$var$subscribe(fn) {
|
|
|
539
539
|
$02c59b34bd70955a$var$subscriptions.add(fn);
|
|
540
540
|
return ()=>$02c59b34bd70955a$var$subscriptions.delete(fn);
|
|
541
541
|
}
|
|
542
|
+
function $02c59b34bd70955a$var$triggerSubscriptions() {
|
|
543
|
+
for (let fn of $02c59b34bd70955a$var$subscriptions)fn();
|
|
544
|
+
}
|
|
542
545
|
function $02c59b34bd70955a$var$getActiveToastContainer() {
|
|
543
546
|
return $02c59b34bd70955a$var$toastProviders.values().next().value;
|
|
544
547
|
}
|
|
@@ -551,9 +554,10 @@ function $02c59b34bd70955a$export$f2815235e76a62b9(props) {
|
|
|
551
554
|
// We use a ref to do this, since it will have a stable identity
|
|
552
555
|
// over the lifetime of the component.
|
|
553
556
|
let ref = (0, $jn1ib$useRef)();
|
|
554
|
-
$02c59b34bd70955a$var$toastProviders.add(ref);
|
|
555
557
|
// eslint-disable-next-line arrow-body-style
|
|
556
558
|
(0, $jn1ib$useEffect)(()=>{
|
|
559
|
+
$02c59b34bd70955a$var$toastProviders.add(ref);
|
|
560
|
+
$02c59b34bd70955a$var$triggerSubscriptions();
|
|
557
561
|
return ()=>{
|
|
558
562
|
// When this toast provider unmounts, reset all animations so that
|
|
559
563
|
// when the new toast provider renders, it is seamless.
|
|
@@ -562,7 +566,7 @@ function $02c59b34bd70955a$export$f2815235e76a62b9(props) {
|
|
|
562
566
|
// This will cause all other instances to re-render,
|
|
563
567
|
// and the first one to become the new active toast provider.
|
|
564
568
|
$02c59b34bd70955a$var$toastProviders.delete(ref);
|
|
565
|
-
|
|
569
|
+
$02c59b34bd70955a$var$triggerSubscriptions();
|
|
566
570
|
};
|
|
567
571
|
}, []);
|
|
568
572
|
// Only render if this is the active toast provider instance, and there are visible toasts.
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;ACZA;;;;;;;;;;CAUC,GAED;;;;;;;AEZA,4BAAiB;IAAG,QAAQ,CAAC,OAAO,CAAC;IACnC,YAAY,CAAC,GAAG,CAAC;IACjB,YAAY,CAAC,QAAQ,CAAC;AACxB;;ADHA;;AEAA,4BAAiB;IAAG,QAAQ,CAAC,UAAU,CAAC;IACtC,YAAY,CAAC,MAAM,CAAC;IACpB,YAAY,CAAC,OAAO,CAAC;AACvB;;;;ACHA,4BAAiB;IAAG,QAAQ,CAAC,SAAS,CAAC;IACrC,YAAY,CAAC,KAAK,CAAC;IACnB,YAAY,CAAC,MAAM,CAAC;AACtB;;;;ACHA,4BAAiB;IAAG,QAAQ,CAAC,IAAI,CAAC;IAChC,YAAY,CAAC,IAAI,CAAC;IAClB,YAAY,CAAC,QAAQ,CAAC;AACxB;;;;ACHA,4BAAiB;IAAG,QAAQ,CAAC,aAAa,CAAC;IACzC,YAAY,CAAC,MAAM,CAAC;IACpB,YAAY,CAAC,MAAM,CAAC;AACtB;;;;ACHA,4BAAiB;IAAG,QAAQ,CAAC,WAAW,CAAC;IACvC,YAAY,CAAC,MAAM,CAAC;IACpB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7E,iEAAiE;IACjE,IAAI,UAAU,QAAQ,OAAO,IAAI,CAAC,QAAQ,QAAQ,GAAG,KAAK,GAAG,CAAC,QAAQ,OAAO,EAAE,QAAQ,IAAI;IAC3F,IAAI,QAAQ;IACZ,IAAI,MAAM,MAAM,GAAG,CAAC,OAAO;QAAC,UAAU,kCAAY,SAAS;iBAAU;QAAS,SAAS,QAAQ,OAAO;IAAA;IACtG,OAAO,IAAM,MAAM,KAAK,CAAC;AAC3B;AAEA,MAAM,4CAAqB;IACzB,4BAA4B,GAC5B,SAAQ,QAAmB,EAAE,UAAgC,CAAC,CAAC,EAAiB;QAC9E,OAAO,+BAAS,UAAU,WAAW;IACvC;IACA,6BAA6B,GAC7B,UAAS,QAAmB,EAAE,UAAgC,CAAC,CAAC,EAAiB;QAC/E,OAAO,+BAAS,UAAU,YAAY;IACxC;IACA,6BAA6B,GAC7B,UAAS,QAAmB,EAAE,UAAgC,CAAC,CAAC,EAAiB;QAC/E,OAAO,+BAAS,UAAU,YAAY;IACxC;IACA,mCAAmC,GACnC,MAAK,QAAmB,EAAE,UAAgC,CAAC,CAAC,EAAiB;QAC3E,OAAO,+BAAS,UAAU,QAAQ;IACpC;AACF;AAIA,wDAAwD;AACxD,sGAAsG;AACtG,MAAM,yCAAmB;IACvB,UAAU;IACV,UAAU;IACV,MAAM;IACN,SAAS;AACX;AAEA,SAAS,kCAAY,OAAsC,EAAE,OAA6B,EAAE;IAC1F,IAAI,WAAW,sCAAgB,CAAC,QAAQ,IAAI;IAC5C,IAAI,QAAQ,QAAQ,EAClB,YAAY;IAEd,OAAO;AACT;;AD7KA","sources":["packages/@react-spectrum/toast/src/index.ts","packages/@react-spectrum/toast/src/ToastContainer.tsx","packages/@react-spectrum/toast/src/Toast.tsx","packages/@react-spectrum/toast/intl/*.js","packages/@react-spectrum/toast/intl/ar-AE.json","packages/@react-spectrum/toast/intl/bg-BG.json","packages/@react-spectrum/toast/intl/cs-CZ.json","packages/@react-spectrum/toast/intl/da-DK.json","packages/@react-spectrum/toast/intl/de-DE.json","packages/@react-spectrum/toast/intl/el-GR.json","packages/@react-spectrum/toast/intl/en-US.json","packages/@react-spectrum/toast/intl/es-ES.json","packages/@react-spectrum/toast/intl/et-EE.json","packages/@react-spectrum/toast/intl/fi-FI.json","packages/@react-spectrum/toast/intl/fr-FR.json","packages/@react-spectrum/toast/intl/he-IL.json","packages/@react-spectrum/toast/intl/hr-HR.json","packages/@react-spectrum/toast/intl/hu-HU.json","packages/@react-spectrum/toast/intl/it-IT.json","packages/@react-spectrum/toast/intl/ja-JP.json","packages/@react-spectrum/toast/intl/ko-KR.json","packages/@react-spectrum/toast/intl/lt-LT.json","packages/@react-spectrum/toast/intl/lv-LV.json","packages/@react-spectrum/toast/intl/nb-NO.json","packages/@react-spectrum/toast/intl/nl-NL.json","packages/@react-spectrum/toast/intl/pl-PL.json","packages/@react-spectrum/toast/intl/pt-BR.json","packages/@react-spectrum/toast/intl/pt-PT.json","packages/@react-spectrum/toast/intl/ro-RO.json","packages/@react-spectrum/toast/intl/ru-RU.json","packages/@react-spectrum/toast/intl/sk-SK.json","packages/@react-spectrum/toast/intl/sl-SI.json","packages/@react-spectrum/toast/intl/sr-SP.json","packages/@react-spectrum/toast/intl/sv-SE.json","packages/@react-spectrum/toast/intl/tr-TR.json","packages/@react-spectrum/toast/intl/uk-UA.json","packages/@react-spectrum/toast/intl/zh-CN.json","packages/@react-spectrum/toast/intl/zh-TW.json","packages/@adobe/spectrum-css-temp/components/toast/vars.css","packages/@react-spectrum/toast/src/toastContainer.css","packages/@react-spectrum/toast/src/Toaster.tsx"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {ToastContainer, ToastQueue} from './ToastContainer';\n\nexport type {SpectrumToastOptions, SpectrumToastContainerProps} from './ToastContainer';\n","/*\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 {AriaToastRegionProps} from '@react-aria/toast';\nimport React, {ReactElement, ReactNode, useEffect, useRef} from 'react';\nimport {SpectrumToastValue, Toast} from './Toast';\nimport {Toaster} from './Toaster';\nimport {ToastOptions, ToastQueue, useToastQueue} from '@react-stately/toast';\nimport {useSyncExternalStore} from 'use-sync-external-store/shim/index.js';\n\nexport interface SpectrumToastContainerProps extends AriaToastRegionProps {}\n\nexport interface SpectrumToastOptions extends Omit<ToastOptions, 'priority'> {\n /** A label for the action button within the toast. */\n actionLabel?: ReactNode,\n /** Handler that is called when the action button is pressed. */\n onAction?: () => void,\n /** Whether the toast should automatically close when an action is performed. */\n shouldCloseOnAction?: boolean\n}\n\ntype CloseFunction = () => void;\n\n// There is a single global toast queue instance for the whole app, initialized lazily.\nlet globalToastQueue: ToastQueue<SpectrumToastValue> | null = null;\nfunction getGlobalToastQueue() {\n if (!globalToastQueue) {\n globalToastQueue = new ToastQueue({\n maxVisibleToasts: 1,\n hasExitAnimation: true\n });\n }\n\n return globalToastQueue;\n}\n\n// For testing. Not exported from the package index.\nexport function clearToastQueue() {\n globalToastQueue = null;\n}\n\nlet toastProviders = new Set();\nlet subscriptions = new Set<() => void>();\nfunction subscribe(fn: () => void) {\n subscriptions.add(fn);\n return () => subscriptions.delete(fn);\n}\n\nfunction getActiveToastContainer() {\n return toastProviders.values().next().value;\n}\n\nfunction useActiveToastContainer() {\n return useSyncExternalStore(subscribe, getActiveToastContainer, getActiveToastContainer);\n}\n\n/**\n * A ToastContainer renders the queued toasts in an application. It should be placed\n * at the root of the app.\n */\nexport function ToastContainer(props: SpectrumToastContainerProps): ReactElement {\n // Track all toast provider instances in a set.\n // Only the first one will actually render.\n // We use a ref to do this, since it will have a stable identity\n // over the lifetime of the component.\n let ref = useRef();\n toastProviders.add(ref);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n // When this toast provider unmounts, reset all animations so that\n // when the new toast provider renders, it is seamless.\n for (let toast of getGlobalToastQueue().visibleToasts) {\n toast.animation = null;\n }\n\n // Remove this toast provider, and call subscriptions.\n // This will cause all other instances to re-render,\n // and the first one to become the new active toast provider.\n toastProviders.delete(ref);\n for (let fn of subscriptions) {\n fn();\n }\n };\n }, []);\n\n // Only render if this is the active toast provider instance, and there are visible toasts.\n let activeToastContainer = useActiveToastContainer();\n let state = useToastQueue(getGlobalToastQueue());\n if (ref === activeToastContainer && state.visibleToasts.length > 0) {\n return (\n <Toaster state={state} {...props}>\n {state.visibleToasts.map((toast) => (\n <Toast\n key={toast.key}\n toast={toast}\n state={state} />\n ))}\n </Toaster>\n );\n }\n\n return null;\n}\n\nfunction addToast(children: ReactNode, variant: SpectrumToastValue['variant'], options: SpectrumToastOptions = {}) {\n // Dispatch a custom event so that toasts can be intercepted and re-targeted, e.g. when inside an iframe.\n if (typeof CustomEvent !== 'undefined' && typeof window !== 'undefined') {\n let event = new CustomEvent('react-spectrum-toast', {\n cancelable: true,\n bubbles: true,\n detail: {\n children,\n variant,\n options\n }\n });\n\n let shouldContinue = window.dispatchEvent(event);\n if (!shouldContinue) {\n return;\n }\n }\n\n let value = {\n children,\n variant,\n actionLabel: options.actionLabel,\n onAction: options.onAction,\n shouldCloseOnAction: options.shouldCloseOnAction\n };\n\n // Minimum time of 5s from https://spectrum.adobe.com/page/toast/#Auto-dismissible\n // Actionable toasts cannot be auto dismissed. That would fail WCAG SC 2.2.1.\n // It is debatable whether non-actionable toasts would also fail.\n let timeout = options.timeout && !options.onAction ? Math.max(options.timeout, 5000) : null;\n let queue = getGlobalToastQueue();\n let key = queue.add(value, {priority: getPriority(variant, options), timeout, onClose: options.onClose});\n return () => queue.close(key);\n}\n\nconst SpectrumToastQueue = {\n /** Queues a neutral toast. */\n neutral(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'neutral', options);\n },\n /** Queues a positive toast. */\n positive(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'positive', options);\n },\n /** Queues a negative toast. */\n negative(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'negative', options);\n },\n /** Queues an informational toast. */\n info(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'info', options);\n }\n};\n\nexport {SpectrumToastQueue as ToastQueue};\n\n// https://spectrum.adobe.com/page/toast/#Priority-queue\n// TODO: if a lower priority toast comes in, no way to know until you dismiss the higher priority one.\nconst VARIANT_PRIORITY = {\n negative: 10,\n positive: 3,\n info: 2,\n neutral: 1\n};\n\nfunction getPriority(variant: SpectrumToastValue['variant'], options: SpectrumToastOptions) {\n let priority = VARIANT_PRIORITY[variant] || 1;\n if (options.onAction) {\n priority += 4;\n }\n return priority;\n}\n","/*\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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {Button, ClearButton} from '@react-spectrum/button';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossMedium from '@spectrum-icons/ui/CrossMedium';\nimport {DOMRef} from '@react-types/shared';\nimport InfoMedium from '@spectrum-icons/ui/InfoMedium';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {QueuedToast, ToastState} from '@react-stately/toast';\nimport React, {ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/toast/vars.css';\nimport SuccessMedium from '@spectrum-icons/ui/SuccessMedium';\nimport toastContainerStyles from './toastContainer.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useToast} from '@react-aria/toast';\n\nexport interface SpectrumToastValue {\n children: ReactNode,\n variant: 'positive' | 'negative' | 'info' | 'neutral',\n actionLabel?: ReactNode,\n onAction?: () => void,\n shouldCloseOnAction?: boolean\n}\n\nexport interface SpectrumToastProps {\n toast: QueuedToast<SpectrumToastValue>,\n state: ToastState<SpectrumToastValue>\n}\n\n// TODO: express should use filled icons...\nexport const ICONS = {\n info: InfoMedium,\n negative: AlertMedium,\n positive: SuccessMedium\n};\n\nfunction Toast(props: SpectrumToastProps, ref: DOMRef<HTMLDivElement>) {\n let {\n toast: {\n key,\n animation,\n content: {\n children,\n variant,\n actionLabel,\n onAction,\n shouldCloseOnAction\n }\n },\n state,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {\n closeButtonProps,\n titleProps,\n toastProps\n } = useToast(props, state, domRef);\n let {styleProps} = useStyleProps(otherProps);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;\n let Icon = ICONS[variant];\n\n const handleAction = () => {\n if (onAction) {\n onAction();\n }\n\n if (shouldCloseOnAction) {\n state.close(key);\n }\n };\n\n return (\n <div\n {...styleProps}\n {...toastProps}\n ref={domRef}\n className={classNames(styles,\n 'spectrum-Toast',\n {['spectrum-Toast--' + variant]: variant},\n styleProps.className,\n classNames(\n toastContainerStyles,\n 'spectrum-Toast'\n )\n )}\n style={{\n ...styleProps.style,\n zIndex: props.toast.priority\n }}\n data-animation={animation}\n onAnimationEnd={() => {\n if (animation === 'exiting') {\n state.remove(key);\n }\n }}>\n {Icon &&\n <Icon\n aria-label={iconLabel}\n UNSAFE_className={classNames(styles, 'spectrum-Toast-typeIcon')} />\n }\n <div className={classNames(styles, 'spectrum-Toast-body')}>\n <div className={classNames(styles, 'spectrum-Toast-content')} {...titleProps}>{children}</div>\n {actionLabel &&\n <Button\n onPress={handleAction}\n UNSAFE_className={classNames(styles, 'spectrum-Button')}\n variant=\"secondary\"\n staticColor=\"white\">\n {actionLabel}\n </Button>\n }\n </div>\n <div className={classNames(styles, 'spectrum-Toast-buttons')}>\n <ClearButton {...closeButtonProps} variant=\"overBackground\">\n <CrossMedium />\n </ClearButton>\n </div>\n </div>\n );\n}\n\nlet _Toast = React.forwardRef(Toast);\nexport {_Toast as Toast};\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"info\": \"معلومات\",\n \"negative\": \"خطأ\",\n \"positive\": \"تم بنجاح\"\n}\n","{\n \"info\": \"Информация\",\n \"negative\": \"Грешка\",\n \"positive\": \"Успешно\"\n}\n","{\n \"info\": \"Informace\",\n \"negative\": \"Chyba\",\n \"positive\": \"Úspěch\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fejl\",\n \"positive\": \"Fuldført\"\n}\n","{\n \"info\": \"Informationen\",\n \"negative\": \"Fehler\",\n \"positive\": \"Erfolg\"\n}\n","{\n \"info\": \"Πληροφορίες\",\n \"negative\": \"Σφάλμα\",\n \"positive\": \"Επιτυχία\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Error\",\n \"positive\": \"Success\"\n}\n","{\n \"info\": \"Información\",\n \"negative\": \"Error\",\n \"positive\": \"Éxito\"\n}\n","{\n \"info\": \"Teave\",\n \"negative\": \"Viga\",\n \"positive\": \"Valmis\"\n}\n","{\n \"info\": \"Tiedot\",\n \"negative\": \"Virhe\",\n \"positive\": \"Onnistui\"\n}\n","{\n \"info\": \"Infos\",\n \"negative\": \"Erreur\",\n \"positive\": \"Succès\"\n}\n","{\n \"info\": \"מידע\",\n \"negative\": \"שגיאה\",\n \"positive\": \"הצלחה\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Pogreška\",\n \"positive\": \"Uspješno\"\n}\n","{\n \"info\": \"Információ\",\n \"negative\": \"Hiba\",\n \"positive\": \"Siker\"\n}\n","{\n \"info\": \"Informazioni\",\n \"negative\": \"Errore\",\n \"positive\": \"Operazione riuscita\"\n}\n","{\n \"info\": \"情報\",\n \"negative\": \"エラー\",\n \"positive\": \"成功\"\n}\n","{\n \"info\": \"정보\",\n \"negative\": \"오류\",\n \"positive\": \"성공\"\n}\n","{\n \"info\": \"Informacija\",\n \"negative\": \"Klaida\",\n \"positive\": \"Sėkmingai\"\n}\n","{\n \"info\": \"Informācija\",\n \"negative\": \"Kļūda\",\n \"positive\": \"Izdevās\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Feil\",\n \"positive\": \"Vellykket\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fout\",\n \"positive\": \"Geslaagd\"\n}\n","{\n \"info\": \"Informacje\",\n \"negative\": \"Błąd\",\n \"positive\": \"Powodzenie\"\n}\n","{\n \"info\": \"Informações\",\n \"negative\": \"Erro\",\n \"positive\": \"Sucesso\"\n}\n","{\n \"info\": \"Informação\",\n \"negative\": \"Erro\",\n \"positive\": \"Sucesso\"\n}\n","{\n \"info\": \"Informații\",\n \"negative\": \"Eroare\",\n \"positive\": \"Succes\"\n}\n","{\n \"info\": \"Информация\",\n \"negative\": \"Ошибка\",\n \"positive\": \"Успешно\"\n}\n","{\n \"info\": \"Informácie\",\n \"negative\": \"Chyba\",\n \"positive\": \"Úspech\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Napaka\",\n \"positive\": \"Uspešno\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Greška\",\n \"positive\": \"Uspešno\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fel\",\n \"positive\": \"Lyckades\"\n}\n","{\n \"info\": \"Bilgiler\",\n \"negative\": \"Hata\",\n \"positive\": \"Başarılı\"\n}\n","{\n \"info\": \"Інформація\",\n \"negative\": \"Помилка\",\n \"positive\": \"Успішно\"\n}\n","{\n \"info\": \"信息\",\n \"negative\": \"错误\",\n \"positive\": \"成功\"\n}\n","{\n \"info\": \"資訊\",\n \"negative\": \"錯誤\",\n \"positive\": \"成功\"\n}\n","/*\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\n@import './index.css';\n@import './skin.css';\n","/*\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\n@import \"../../../@adobe/spectrum-css-temp/components/commons/focus-ring.css\";\n\n.react-spectrum-ToastContainer {\n position: fixed;\n inset-inline-start: 0;\n inset-inline-end: 0;\n z-index: 100050; /* above modals */\n display: flex;\n pointer-events: none;\n outline: none;\n\n > :first-child {\n @inherit %spectrum-FocusRing-ring;\n --spectrum-focus-ring-border-radius: var(--spectrum-toast-border-radius);\n --spectrum-focus-ring-gap: var(--spectrum-alias-focus-ring-gap);\n --spectrum-focus-ring-size: var(--spectrum-alias-focus-ring-size);\n }\n\n &:focus-ring > :first-child {\n @inherit %spectrum-FocusRing-active;\n }\n\n .spectrum-Toast {\n position: absolute;\n margin: 16px;\n pointer-events: all;\n }\n\n &[data-position=top] {\n top: 0;\n flex-direction: column;\n --slide-from: translateY(-100%);\n --slide-to: translateY(0);\n }\n\n &[data-position=bottom] {\n bottom: 0;\n flex-direction: column-reverse;\n --slide-from: translateY(100%);\n --slide-to: translateY(0);\n }\n\n &[data-placement=left] {\n align-items: flex-start;\n --slide-from: translateX(-100%);\n --slide-to: translateX(0);\n\n &:dir(rtl) {\n --slide-from: translateX(100%);\n }\n }\n\n &[data-placement=center] {\n align-items: center;\n }\n\n &[data-placement=right] {\n align-items: flex-end;\n --slide-from: translateX(100%);\n --slide-to: translateX(0);\n\n &:dir(rtl) {\n --slide-from: translateX(-100%);\n }\n }\n}\n\n.spectrum-Toast {\n &[data-animation=entering] {\n animation: slide-in 300ms;\n }\n\n &[data-animation=exiting] {\n animation: fade-out 300ms forwards;\n }\n}\n\n@keyframes slide-in {\n from {\n transform: var(--slide-from);\n }\n\n to {\n transform: var(--slide-to);\n }\n}\n\n@keyframes fade-out {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n","/*\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 {AriaToastRegionProps, useToastRegion} from '@react-aria/toast';\nimport {classNames, useIsMobileDevice} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {ReactElement, ReactNode, useRef} from 'react';\nimport ReactDOM from 'react-dom';\nimport toastContainerStyles from './toastContainer.css';\nimport {ToastState} from '@react-stately/toast';\n\ninterface ToastContainerProps extends AriaToastRegionProps {\n children: ReactNode,\n state: ToastState<unknown>\n}\n\nexport function Toaster(props: ToastContainerProps): ReactElement {\n let {\n children,\n state\n } = props;\n let containerPlacement = useIsMobileDevice() ? 'center' : 'right';\n\n let ref = useRef();\n let {regionProps} = useToastRegion(props, state, ref);\n\n let contents = (\n <Provider UNSAFE_style={{background: 'transparent'}}>\n <FocusRing focusRingClass={classNames(toastContainerStyles, 'focus-ring')}>\n <div\n {...regionProps}\n ref={ref}\n data-position=\"bottom\"\n data-placement={containerPlacement}\n className={classNames(\n toastContainerStyles,\n 'react-spectrum-ToastContainer'\n )}>\n {children}\n </div>\n </FocusRing>\n </Provider>\n );\n\n return ReactDOM.createPortal(contents, document.body);\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;ACVD;;;;;;;;;;CAUC;;;;;;;AEVD,4BAAiB;IAAG,QAAQ,CAAC,OAAO,CAAC;IACnC,YAAY,CAAC,GAAG,CAAC;IACjB,YAAY,CAAC,QAAQ,CAAC;AACxB;;;;ACHA,4BAAiB;IAAG,QAAQ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ACrB,UAAU,QAAQ;QAClB,qBAAqB,QAAQ;IAC/B;IAEA,kFAAkF;IAClF,6EAA6E;IAC7E,iEAAiE;IACjE,IAAI,UAAU,QAAQ,WAAW,CAAC,QAAQ,WAAW,KAAK,IAAI,QAAQ,SAAS,QAAQ;IACvF,IAAI,QAAQ;IACZ,IAAI,MAAM,MAAM,IAAI,OAAO;QAAC,UAAU,kCAAY,SAAS;iBAAU;QAAS,SAAS,QAAQ;IAAO;IACtG,OAAO,IAAM,MAAM,MAAM;AAC3B;AAEA,MAAM,4CAAqB;IACzB,4BAA4B,GAC5B,SAAQ,QAAmB,EAAE,UAAgC,CAAC,CAAC;QAC7D,OAAO,+BAAS,UAAU,WAAW;IACvC;IACA,6BAA6B,GAC7B,UAAS,QAAmB,EAAE,UAAgC,CAAC,CAAC;QAC9D,OAAO,+BAAS,UAAU,YAAY;IACxC;IACA,6BAA6B,GAC7B,UAAS,QAAmB,EAAE,UAAgC,CAAC,CAAC;QAC9D,OAAO,+BAAS,UAAU,YAAY;IACxC;IACA,mCAAmC,GACnC,MAAK,QAAmB,EAAE,UAAgC,CAAC,CAAC;QAC1D,OAAO,+BAAS,UAAU,QAAQ;IACpC;AACF;AAIA,wDAAwD;AACxD,sGAAsG;AACtG,MAAM,yCAAmB;IACvB,UAAU;IACV,UAAU;IACV,MAAM;IACN,SAAS;AACX;AAEA,SAAS,kCAAY,OAAsC,EAAE,OAA6B;IACxF,IAAI,WAAW,sCAAgB,CAAC,QAAQ,IAAI;IAC5C,IAAI,QAAQ,UACV,YAAY;IAEd,OAAO;AACT;","sources":["packages/@react-spectrum/toast/src/index.ts","packages/@react-spectrum/toast/src/ToastContainer.tsx","packages/@react-spectrum/toast/src/Toast.tsx","packages/@react-spectrum/toast/src/*.js","packages/@react-spectrum/toast/intl/ar-AE.json","packages/@react-spectrum/toast/intl/bg-BG.json","packages/@react-spectrum/toast/intl/cs-CZ.json","packages/@react-spectrum/toast/intl/da-DK.json","packages/@react-spectrum/toast/intl/de-DE.json","packages/@react-spectrum/toast/intl/el-GR.json","packages/@react-spectrum/toast/intl/en-US.json","packages/@react-spectrum/toast/intl/es-ES.json","packages/@react-spectrum/toast/intl/et-EE.json","packages/@react-spectrum/toast/intl/fi-FI.json","packages/@react-spectrum/toast/intl/fr-FR.json","packages/@react-spectrum/toast/intl/he-IL.json","packages/@react-spectrum/toast/intl/hr-HR.json","packages/@react-spectrum/toast/intl/hu-HU.json","packages/@react-spectrum/toast/intl/it-IT.json","packages/@react-spectrum/toast/intl/ja-JP.json","packages/@react-spectrum/toast/intl/ko-KR.json","packages/@react-spectrum/toast/intl/lt-LT.json","packages/@react-spectrum/toast/intl/lv-LV.json","packages/@react-spectrum/toast/intl/nb-NO.json","packages/@react-spectrum/toast/intl/nl-NL.json","packages/@react-spectrum/toast/intl/pl-PL.json","packages/@react-spectrum/toast/intl/pt-BR.json","packages/@react-spectrum/toast/intl/pt-PT.json","packages/@react-spectrum/toast/intl/ro-RO.json","packages/@react-spectrum/toast/intl/ru-RU.json","packages/@react-spectrum/toast/intl/sk-SK.json","packages/@react-spectrum/toast/intl/sl-SI.json","packages/@react-spectrum/toast/intl/sr-SP.json","packages/@react-spectrum/toast/intl/sv-SE.json","packages/@react-spectrum/toast/intl/tr-TR.json","packages/@react-spectrum/toast/intl/uk-UA.json","packages/@react-spectrum/toast/intl/zh-CN.json","packages/@react-spectrum/toast/intl/zh-TW.json","packages/@adobe/spectrum-css-temp/components/toast/vars.css","packages/@react-spectrum/toast/src/toastContainer.css","packages/@react-spectrum/toast/src/Toaster.tsx"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {ToastContainer, ToastQueue} from './ToastContainer';\n\nexport type {SpectrumToastOptions, SpectrumToastContainerProps} from './ToastContainer';\n","/*\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 {AriaToastRegionProps} from '@react-aria/toast';\nimport React, {ReactElement, ReactNode, useEffect, useRef} from 'react';\nimport {SpectrumToastValue, Toast} from './Toast';\nimport {Toaster} from './Toaster';\nimport {ToastOptions, ToastQueue, useToastQueue} from '@react-stately/toast';\nimport {useSyncExternalStore} from 'use-sync-external-store/shim/index.js';\n\nexport interface SpectrumToastContainerProps extends AriaToastRegionProps {}\n\nexport interface SpectrumToastOptions extends Omit<ToastOptions, 'priority'> {\n /** A label for the action button within the toast. */\n actionLabel?: ReactNode,\n /** Handler that is called when the action button is pressed. */\n onAction?: () => void,\n /** Whether the toast should automatically close when an action is performed. */\n shouldCloseOnAction?: boolean\n}\n\ntype CloseFunction = () => void;\n\n// There is a single global toast queue instance for the whole app, initialized lazily.\nlet globalToastQueue: ToastQueue<SpectrumToastValue> | null = null;\nfunction getGlobalToastQueue() {\n if (!globalToastQueue) {\n globalToastQueue = new ToastQueue({\n maxVisibleToasts: 1,\n hasExitAnimation: true\n });\n }\n\n return globalToastQueue;\n}\n\n// For testing. Not exported from the package index.\nexport function clearToastQueue() {\n globalToastQueue = null;\n}\n\nlet toastProviders = new Set();\nlet subscriptions = new Set<() => void>();\nfunction subscribe(fn: () => void) {\n subscriptions.add(fn);\n return () => subscriptions.delete(fn);\n}\n\nfunction triggerSubscriptions() {\n for (let fn of subscriptions) {\n fn();\n }\n}\n\nfunction getActiveToastContainer() {\n return toastProviders.values().next().value;\n}\n\nfunction useActiveToastContainer() {\n return useSyncExternalStore(subscribe, getActiveToastContainer, getActiveToastContainer);\n}\n\n/**\n * A ToastContainer renders the queued toasts in an application. It should be placed\n * at the root of the app.\n */\nexport function ToastContainer(props: SpectrumToastContainerProps): ReactElement {\n // Track all toast provider instances in a set.\n // Only the first one will actually render.\n // We use a ref to do this, since it will have a stable identity\n // over the lifetime of the component.\n let ref = useRef();\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n toastProviders.add(ref);\n triggerSubscriptions();\n\n return () => {\n // When this toast provider unmounts, reset all animations so that\n // when the new toast provider renders, it is seamless.\n for (let toast of getGlobalToastQueue().visibleToasts) {\n toast.animation = null;\n }\n\n // Remove this toast provider, and call subscriptions.\n // This will cause all other instances to re-render,\n // and the first one to become the new active toast provider.\n toastProviders.delete(ref);\n triggerSubscriptions();\n };\n }, []);\n\n // Only render if this is the active toast provider instance, and there are visible toasts.\n let activeToastContainer = useActiveToastContainer();\n let state = useToastQueue(getGlobalToastQueue());\n if (ref === activeToastContainer && state.visibleToasts.length > 0) {\n return (\n <Toaster state={state} {...props}>\n {state.visibleToasts.map((toast) => (\n <Toast\n key={toast.key}\n toast={toast}\n state={state} />\n ))}\n </Toaster>\n );\n }\n\n return null;\n}\n\nfunction addToast(children: ReactNode, variant: SpectrumToastValue['variant'], options: SpectrumToastOptions = {}) {\n // Dispatch a custom event so that toasts can be intercepted and re-targeted, e.g. when inside an iframe.\n if (typeof CustomEvent !== 'undefined' && typeof window !== 'undefined') {\n let event = new CustomEvent('react-spectrum-toast', {\n cancelable: true,\n bubbles: true,\n detail: {\n children,\n variant,\n options\n }\n });\n\n let shouldContinue = window.dispatchEvent(event);\n if (!shouldContinue) {\n return;\n }\n }\n\n let value = {\n children,\n variant,\n actionLabel: options.actionLabel,\n onAction: options.onAction,\n shouldCloseOnAction: options.shouldCloseOnAction\n };\n\n // Minimum time of 5s from https://spectrum.adobe.com/page/toast/#Auto-dismissible\n // Actionable toasts cannot be auto dismissed. That would fail WCAG SC 2.2.1.\n // It is debatable whether non-actionable toasts would also fail.\n let timeout = options.timeout && !options.onAction ? Math.max(options.timeout, 5000) : null;\n let queue = getGlobalToastQueue();\n let key = queue.add(value, {priority: getPriority(variant, options), timeout, onClose: options.onClose});\n return () => queue.close(key);\n}\n\nconst SpectrumToastQueue = {\n /** Queues a neutral toast. */\n neutral(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'neutral', options);\n },\n /** Queues a positive toast. */\n positive(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'positive', options);\n },\n /** Queues a negative toast. */\n negative(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'negative', options);\n },\n /** Queues an informational toast. */\n info(children: ReactNode, options: SpectrumToastOptions = {}): CloseFunction {\n return addToast(children, 'info', options);\n }\n};\n\nexport {SpectrumToastQueue as ToastQueue};\n\n// https://spectrum.adobe.com/page/toast/#Priority-queue\n// TODO: if a lower priority toast comes in, no way to know until you dismiss the higher priority one.\nconst VARIANT_PRIORITY = {\n negative: 10,\n positive: 3,\n info: 2,\n neutral: 1\n};\n\nfunction getPriority(variant: SpectrumToastValue['variant'], options: SpectrumToastOptions) {\n let priority = VARIANT_PRIORITY[variant] || 1;\n if (options.onAction) {\n priority += 4;\n }\n return priority;\n}\n","/*\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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {Button, ClearButton} from '@react-spectrum/button';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossMedium from '@spectrum-icons/ui/CrossMedium';\nimport {DOMRef} from '@react-types/shared';\nimport InfoMedium from '@spectrum-icons/ui/InfoMedium';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {QueuedToast, ToastState} from '@react-stately/toast';\nimport React, {ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/toast/vars.css';\nimport SuccessMedium from '@spectrum-icons/ui/SuccessMedium';\nimport toastContainerStyles from './toastContainer.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useToast} from '@react-aria/toast';\n\nexport interface SpectrumToastValue {\n children: ReactNode,\n variant: 'positive' | 'negative' | 'info' | 'neutral',\n actionLabel?: ReactNode,\n onAction?: () => void,\n shouldCloseOnAction?: boolean\n}\n\nexport interface SpectrumToastProps {\n toast: QueuedToast<SpectrumToastValue>,\n state: ToastState<SpectrumToastValue>\n}\n\n// TODO: express should use filled icons...\nexport const ICONS = {\n info: InfoMedium,\n negative: AlertMedium,\n positive: SuccessMedium\n};\n\nfunction Toast(props: SpectrumToastProps, ref: DOMRef<HTMLDivElement>) {\n let {\n toast: {\n key,\n animation,\n content: {\n children,\n variant,\n actionLabel,\n onAction,\n shouldCloseOnAction\n }\n },\n state,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {\n closeButtonProps,\n titleProps,\n toastProps\n } = useToast(props, state, domRef);\n let {styleProps} = useStyleProps(otherProps);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;\n let Icon = ICONS[variant];\n\n const handleAction = () => {\n if (onAction) {\n onAction();\n }\n\n if (shouldCloseOnAction) {\n state.close(key);\n }\n };\n\n return (\n <div\n {...styleProps}\n {...toastProps}\n ref={domRef}\n className={classNames(styles,\n 'spectrum-Toast',\n {['spectrum-Toast--' + variant]: variant},\n styleProps.className,\n classNames(\n toastContainerStyles,\n 'spectrum-Toast'\n )\n )}\n style={{\n ...styleProps.style,\n zIndex: props.toast.priority\n }}\n data-animation={animation}\n onAnimationEnd={() => {\n if (animation === 'exiting') {\n state.remove(key);\n }\n }}>\n {Icon &&\n <Icon\n aria-label={iconLabel}\n UNSAFE_className={classNames(styles, 'spectrum-Toast-typeIcon')} />\n }\n <div className={classNames(styles, 'spectrum-Toast-body')}>\n <div className={classNames(styles, 'spectrum-Toast-content')} {...titleProps}>{children}</div>\n {actionLabel &&\n <Button\n onPress={handleAction}\n UNSAFE_className={classNames(styles, 'spectrum-Button')}\n variant=\"secondary\"\n staticColor=\"white\">\n {actionLabel}\n </Button>\n }\n </div>\n <div className={classNames(styles, 'spectrum-Toast-buttons')}>\n <ClearButton {...closeButtonProps} variant=\"overBackground\">\n <CrossMedium />\n </ClearButton>\n </div>\n </div>\n );\n}\n\nlet _Toast = React.forwardRef(Toast);\nexport {_Toast as Toast};\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"info\": \"معلومات\",\n \"negative\": \"خطأ\",\n \"positive\": \"تم بنجاح\"\n}\n","{\n \"info\": \"Информация\",\n \"negative\": \"Грешка\",\n \"positive\": \"Успешно\"\n}\n","{\n \"info\": \"Informace\",\n \"negative\": \"Chyba\",\n \"positive\": \"Úspěch\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fejl\",\n \"positive\": \"Fuldført\"\n}\n","{\n \"info\": \"Informationen\",\n \"negative\": \"Fehler\",\n \"positive\": \"Erfolg\"\n}\n","{\n \"info\": \"Πληροφορίες\",\n \"negative\": \"Σφάλμα\",\n \"positive\": \"Επιτυχία\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Error\",\n \"positive\": \"Success\"\n}\n","{\n \"info\": \"Información\",\n \"negative\": \"Error\",\n \"positive\": \"Éxito\"\n}\n","{\n \"info\": \"Teave\",\n \"negative\": \"Viga\",\n \"positive\": \"Valmis\"\n}\n","{\n \"info\": \"Tiedot\",\n \"negative\": \"Virhe\",\n \"positive\": \"Onnistui\"\n}\n","{\n \"info\": \"Infos\",\n \"negative\": \"Erreur\",\n \"positive\": \"Succès\"\n}\n","{\n \"info\": \"מידע\",\n \"negative\": \"שגיאה\",\n \"positive\": \"הצלחה\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Pogreška\",\n \"positive\": \"Uspješno\"\n}\n","{\n \"info\": \"Információ\",\n \"negative\": \"Hiba\",\n \"positive\": \"Siker\"\n}\n","{\n \"info\": \"Informazioni\",\n \"negative\": \"Errore\",\n \"positive\": \"Operazione riuscita\"\n}\n","{\n \"info\": \"情報\",\n \"negative\": \"エラー\",\n \"positive\": \"成功\"\n}\n","{\n \"info\": \"정보\",\n \"negative\": \"오류\",\n \"positive\": \"성공\"\n}\n","{\n \"info\": \"Informacija\",\n \"negative\": \"Klaida\",\n \"positive\": \"Sėkmingai\"\n}\n","{\n \"info\": \"Informācija\",\n \"negative\": \"Kļūda\",\n \"positive\": \"Izdevās\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Feil\",\n \"positive\": \"Vellykket\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fout\",\n \"positive\": \"Geslaagd\"\n}\n","{\n \"info\": \"Informacje\",\n \"negative\": \"Błąd\",\n \"positive\": \"Powodzenie\"\n}\n","{\n \"info\": \"Informações\",\n \"negative\": \"Erro\",\n \"positive\": \"Sucesso\"\n}\n","{\n \"info\": \"Informação\",\n \"negative\": \"Erro\",\n \"positive\": \"Sucesso\"\n}\n","{\n \"info\": \"Informații\",\n \"negative\": \"Eroare\",\n \"positive\": \"Succes\"\n}\n","{\n \"info\": \"Информация\",\n \"negative\": \"Ошибка\",\n \"positive\": \"Успешно\"\n}\n","{\n \"info\": \"Informácie\",\n \"negative\": \"Chyba\",\n \"positive\": \"Úspech\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Napaka\",\n \"positive\": \"Uspešno\"\n}\n","{\n \"info\": \"Informacije\",\n \"negative\": \"Greška\",\n \"positive\": \"Uspešno\"\n}\n","{\n \"info\": \"Info\",\n \"negative\": \"Fel\",\n \"positive\": \"Lyckades\"\n}\n","{\n \"info\": \"Bilgiler\",\n \"negative\": \"Hata\",\n \"positive\": \"Başarılı\"\n}\n","{\n \"info\": \"Інформація\",\n \"negative\": \"Помилка\",\n \"positive\": \"Успішно\"\n}\n","{\n \"info\": \"信息\",\n \"negative\": \"错误\",\n \"positive\": \"成功\"\n}\n","{\n \"info\": \"資訊\",\n \"negative\": \"錯誤\",\n \"positive\": \"成功\"\n}\n","/*\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\n@import './index.css';\n@import './skin.css';\n","/*\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\n@import \"../../../@adobe/spectrum-css-temp/components/commons/focus-ring.css\";\n\n.react-spectrum-ToastContainer {\n position: fixed;\n inset-inline-start: 0;\n inset-inline-end: 0;\n z-index: 100050; /* above modals */\n display: flex;\n pointer-events: none;\n outline: none;\n\n > :first-child {\n @inherit %spectrum-FocusRing-ring;\n --spectrum-focus-ring-border-radius: var(--spectrum-toast-border-radius);\n --spectrum-focus-ring-gap: var(--spectrum-alias-focus-ring-gap);\n --spectrum-focus-ring-size: var(--spectrum-alias-focus-ring-size);\n }\n\n &:focus-ring > :first-child {\n @inherit %spectrum-FocusRing-active;\n }\n\n .spectrum-Toast {\n position: absolute;\n margin: 16px;\n pointer-events: all;\n }\n\n &[data-position=top] {\n top: 0;\n flex-direction: column;\n --slide-from: translateY(-100%);\n --slide-to: translateY(0);\n }\n\n &[data-position=bottom] {\n bottom: 0;\n flex-direction: column-reverse;\n --slide-from: translateY(100%);\n --slide-to: translateY(0);\n }\n\n &[data-placement=left] {\n align-items: flex-start;\n --slide-from: translateX(-100%);\n --slide-to: translateX(0);\n\n &:dir(rtl) {\n --slide-from: translateX(100%);\n }\n }\n\n &[data-placement=center] {\n align-items: center;\n }\n\n &[data-placement=right] {\n align-items: flex-end;\n --slide-from: translateX(100%);\n --slide-to: translateX(0);\n\n &:dir(rtl) {\n --slide-from: translateX(-100%);\n }\n }\n}\n\n.spectrum-Toast {\n &[data-animation=entering] {\n animation: slide-in 300ms;\n }\n\n &[data-animation=exiting] {\n animation: fade-out 300ms forwards;\n }\n}\n\n@keyframes slide-in {\n from {\n transform: var(--slide-from);\n }\n\n to {\n transform: var(--slide-to);\n }\n}\n\n@keyframes fade-out {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n","/*\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 {AriaToastRegionProps, useToastRegion} from '@react-aria/toast';\nimport {classNames, useIsMobileDevice} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {ReactElement, ReactNode, useRef} from 'react';\nimport ReactDOM from 'react-dom';\nimport toastContainerStyles from './toastContainer.css';\nimport {ToastState} from '@react-stately/toast';\n\ninterface ToastContainerProps extends AriaToastRegionProps {\n children: ReactNode,\n state: ToastState<unknown>\n}\n\nexport function Toaster(props: ToastContainerProps): ReactElement {\n let {\n children,\n state\n } = props;\n let containerPlacement = useIsMobileDevice() ? 'center' : 'right';\n\n let ref = useRef();\n let {regionProps} = useToastRegion(props, state, ref);\n\n let contents = (\n <Provider UNSAFE_style={{background: 'transparent'}}>\n <FocusRing focusRingClass={classNames(toastContainerStyles, 'focus-ring')}>\n <div\n {...regionProps}\n ref={ref}\n data-position=\"bottom\"\n data-placement={containerPlacement}\n className={classNames(\n toastContainerStyles,\n 'react-spectrum-ToastContainer'\n )}>\n {children}\n </div>\n </FocusRing>\n </Provider>\n );\n\n return ReactDOM.createPortal(contents, document.body);\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AEmBA,4CAA6C,SAAQ,oBAAoB;CAAG;AAE5E,qCAAsC,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;IAC1E,sDAAsD;IACtD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,gFAAgF;IAChF,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,qBAAqB,MAAM,IAAI,CAAC;
|
|
1
|
+
{"mappings":";;;AEmBA,4CAA6C,SAAQ,oBAAoB;CAAG;AAE5E,qCAAsC,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;IAC1E,sDAAsD;IACtD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,gFAAgF;IAChF,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,qBAAqB,MAAM,IAAI,CAAC;AAyChC;;;GAGG;AACH,+BAA+B,KAAK,EAAE,2BAA2B,GAAG,YAAY,CA4C/E;AAsCD,OAAA,MAAM;IACJ,8BAA8B;sBACZ,SAAS,YAAW,oBAAoB,GAAQ,aAAa;IAG/E,+BAA+B;uBACZ,SAAS,YAAW,oBAAoB,GAAQ,aAAa;IAGhF,+BAA+B;uBACZ,SAAS,YAAW,oBAAoB,GAAQ,aAAa;IAGhF,qCAAqC;mBACtB,SAAS,YAAW,oBAAoB,GAAQ,aAAa;CAG7E,CAAC","sources":["packages/@react-spectrum/toast/src/packages/@react-spectrum/toast/src/Toast.tsx","packages/@react-spectrum/toast/src/packages/@react-spectrum/toast/src/Toaster.tsx","packages/@react-spectrum/toast/src/packages/@react-spectrum/toast/src/ToastContainer.tsx","packages/@react-spectrum/toast/src/packages/@react-spectrum/toast/src/index.ts","packages/@react-spectrum/toast/src/index.ts"],"sourcesContent":[null,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 */\n\n/// <reference types=\"css-module-types\" />\n\nexport {ToastContainer, ToastQueue} from './ToastContainer';\n\nexport type {SpectrumToastOptions, SpectrumToastContainerProps} from './ToastContainer';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
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.2",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/focus": "^3.
|
|
40
|
-
"@react-aria/i18n": "^3.
|
|
41
|
-
"@react-aria/toast": "3.0.0-beta.
|
|
42
|
-
"@react-spectrum/button": "^3.12.
|
|
43
|
-
"@react-spectrum/utils": "^3.
|
|
44
|
-
"@react-stately/toast": "3.0.0-beta.
|
|
39
|
+
"@react-aria/focus": "^3.13.0",
|
|
40
|
+
"@react-aria/i18n": "^3.8.0",
|
|
41
|
+
"@react-aria/toast": "3.0.0-beta.2",
|
|
42
|
+
"@react-spectrum/button": "^3.12.3",
|
|
43
|
+
"@react-spectrum/utils": "^3.10.0",
|
|
44
|
+
"@react-stately/toast": "3.0.0-beta.1",
|
|
45
45
|
"@react-types/shared": "^3.18.1",
|
|
46
|
-
"@spectrum-icons/ui": "^3.5.
|
|
47
|
-
"@swc/helpers": "^0.
|
|
46
|
+
"@spectrum-icons/ui": "^3.5.3",
|
|
47
|
+
"@swc/helpers": "^0.5.0",
|
|
48
48
|
"use-sync-external-store": "^1.2.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "504e40e0a50c1b20ed0fb3ba9561a263b6d5565e"
|
|
64
64
|
}
|
package/src/ToastContainer.tsx
CHANGED
|
@@ -55,6 +55,12 @@ function subscribe(fn: () => void) {
|
|
|
55
55
|
return () => subscriptions.delete(fn);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
function triggerSubscriptions() {
|
|
59
|
+
for (let fn of subscriptions) {
|
|
60
|
+
fn();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
function getActiveToastContainer() {
|
|
59
65
|
return toastProviders.values().next().value;
|
|
60
66
|
}
|
|
@@ -73,10 +79,12 @@ export function ToastContainer(props: SpectrumToastContainerProps): ReactElement
|
|
|
73
79
|
// We use a ref to do this, since it will have a stable identity
|
|
74
80
|
// over the lifetime of the component.
|
|
75
81
|
let ref = useRef();
|
|
76
|
-
toastProviders.add(ref);
|
|
77
82
|
|
|
78
83
|
// eslint-disable-next-line arrow-body-style
|
|
79
84
|
useEffect(() => {
|
|
85
|
+
toastProviders.add(ref);
|
|
86
|
+
triggerSubscriptions();
|
|
87
|
+
|
|
80
88
|
return () => {
|
|
81
89
|
// When this toast provider unmounts, reset all animations so that
|
|
82
90
|
// when the new toast provider renders, it is seamless.
|
|
@@ -88,9 +96,7 @@ export function ToastContainer(props: SpectrumToastContainerProps): ReactElement
|
|
|
88
96
|
// This will cause all other instances to re-render,
|
|
89
97
|
// and the first one to become the new active toast provider.
|
|
90
98
|
toastProviders.delete(ref);
|
|
91
|
-
|
|
92
|
-
fn();
|
|
93
|
-
}
|
|
99
|
+
triggerSubscriptions();
|
|
94
100
|
};
|
|
95
101
|
}, []);
|
|
96
102
|
|