@react-spectrum/toast 3.1.7 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import.mjs +2 -2
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/module.js +2 -2
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/package.json +13 -35
- package/src/index.ts +2 -2
- package/dist/Toast.main.js +0 -109
- package/dist/Toast.main.js.map +0 -1
- package/dist/Toast.mjs +0 -104
- package/dist/Toast.module.js +0 -104
- package/dist/Toast.module.js.map +0 -1
- package/dist/ToastContainer.main.js +0 -180
- package/dist/ToastContainer.main.js.map +0 -1
- package/dist/ToastContainer.mjs +0 -174
- package/dist/ToastContainer.module.js +0 -174
- package/dist/ToastContainer.module.js.map +0 -1
- package/dist/Toaster.main.js +0 -78
- package/dist/Toaster.main.js.map +0 -1
- package/dist/Toaster.mjs +0 -73
- package/dist/Toaster.module.js +0 -73
- package/dist/Toaster.module.js.map +0 -1
- package/dist/ar-AE.main.js +0 -8
- package/dist/ar-AE.main.js.map +0 -1
- package/dist/ar-AE.mjs +0 -10
- package/dist/ar-AE.module.js +0 -10
- package/dist/ar-AE.module.js.map +0 -1
- package/dist/bg-BG.main.js +0 -8
- package/dist/bg-BG.main.js.map +0 -1
- package/dist/bg-BG.mjs +0 -10
- package/dist/bg-BG.module.js +0 -10
- package/dist/bg-BG.module.js.map +0 -1
- package/dist/cs-CZ.main.js +0 -8
- package/dist/cs-CZ.main.js.map +0 -1
- package/dist/cs-CZ.mjs +0 -10
- package/dist/cs-CZ.module.js +0 -10
- package/dist/cs-CZ.module.js.map +0 -1
- package/dist/da-DK.main.js +0 -8
- package/dist/da-DK.main.js.map +0 -1
- package/dist/da-DK.mjs +0 -10
- package/dist/da-DK.module.js +0 -10
- package/dist/da-DK.module.js.map +0 -1
- package/dist/de-DE.main.js +0 -8
- package/dist/de-DE.main.js.map +0 -1
- package/dist/de-DE.mjs +0 -10
- package/dist/de-DE.module.js +0 -10
- package/dist/de-DE.module.js.map +0 -1
- package/dist/el-GR.main.js +0 -8
- package/dist/el-GR.main.js.map +0 -1
- package/dist/el-GR.mjs +0 -10
- package/dist/el-GR.module.js +0 -10
- package/dist/el-GR.module.js.map +0 -1
- package/dist/en-US.main.js +0 -8
- package/dist/en-US.main.js.map +0 -1
- package/dist/en-US.mjs +0 -10
- package/dist/en-US.module.js +0 -10
- package/dist/en-US.module.js.map +0 -1
- package/dist/es-ES.main.js +0 -8
- package/dist/es-ES.main.js.map +0 -1
- package/dist/es-ES.mjs +0 -10
- package/dist/es-ES.module.js +0 -10
- package/dist/es-ES.module.js.map +0 -1
- package/dist/et-EE.main.js +0 -8
- package/dist/et-EE.main.js.map +0 -1
- package/dist/et-EE.mjs +0 -10
- package/dist/et-EE.module.js +0 -10
- package/dist/et-EE.module.js.map +0 -1
- package/dist/fi-FI.main.js +0 -8
- package/dist/fi-FI.main.js.map +0 -1
- package/dist/fi-FI.mjs +0 -10
- package/dist/fi-FI.module.js +0 -10
- package/dist/fi-FI.module.js.map +0 -1
- package/dist/fr-FR.main.js +0 -8
- package/dist/fr-FR.main.js.map +0 -1
- package/dist/fr-FR.mjs +0 -10
- package/dist/fr-FR.module.js +0 -10
- package/dist/fr-FR.module.js.map +0 -1
- package/dist/he-IL.main.js +0 -8
- package/dist/he-IL.main.js.map +0 -1
- package/dist/he-IL.mjs +0 -10
- package/dist/he-IL.module.js +0 -10
- package/dist/he-IL.module.js.map +0 -1
- package/dist/hr-HR.main.js +0 -8
- package/dist/hr-HR.main.js.map +0 -1
- package/dist/hr-HR.mjs +0 -10
- package/dist/hr-HR.module.js +0 -10
- package/dist/hr-HR.module.js.map +0 -1
- package/dist/hu-HU.main.js +0 -8
- package/dist/hu-HU.main.js.map +0 -1
- package/dist/hu-HU.mjs +0 -10
- package/dist/hu-HU.module.js +0 -10
- package/dist/hu-HU.module.js.map +0 -1
- package/dist/intlStrings.main.js +0 -108
- package/dist/intlStrings.main.js.map +0 -1
- package/dist/intlStrings.mjs +0 -110
- package/dist/intlStrings.module.js +0 -110
- package/dist/intlStrings.module.js.map +0 -1
- package/dist/it-IT.main.js +0 -8
- package/dist/it-IT.main.js.map +0 -1
- package/dist/it-IT.mjs +0 -10
- package/dist/it-IT.module.js +0 -10
- package/dist/it-IT.module.js.map +0 -1
- package/dist/ja-JP.main.js +0 -8
- package/dist/ja-JP.main.js.map +0 -1
- package/dist/ja-JP.mjs +0 -10
- package/dist/ja-JP.module.js +0 -10
- package/dist/ja-JP.module.js.map +0 -1
- package/dist/ko-KR.main.js +0 -8
- package/dist/ko-KR.main.js.map +0 -1
- package/dist/ko-KR.mjs +0 -10
- package/dist/ko-KR.module.js +0 -10
- package/dist/ko-KR.module.js.map +0 -1
- package/dist/lt-LT.main.js +0 -8
- package/dist/lt-LT.main.js.map +0 -1
- package/dist/lt-LT.mjs +0 -10
- package/dist/lt-LT.module.js +0 -10
- package/dist/lt-LT.module.js.map +0 -1
- package/dist/lv-LV.main.js +0 -8
- package/dist/lv-LV.main.js.map +0 -1
- package/dist/lv-LV.mjs +0 -10
- package/dist/lv-LV.module.js +0 -10
- package/dist/lv-LV.module.js.map +0 -1
- package/dist/nb-NO.main.js +0 -8
- package/dist/nb-NO.main.js.map +0 -1
- package/dist/nb-NO.mjs +0 -10
- package/dist/nb-NO.module.js +0 -10
- package/dist/nb-NO.module.js.map +0 -1
- package/dist/nl-NL.main.js +0 -8
- package/dist/nl-NL.main.js.map +0 -1
- package/dist/nl-NL.mjs +0 -10
- package/dist/nl-NL.module.js +0 -10
- package/dist/nl-NL.module.js.map +0 -1
- package/dist/pl-PL.main.js +0 -8
- package/dist/pl-PL.main.js.map +0 -1
- package/dist/pl-PL.mjs +0 -10
- package/dist/pl-PL.module.js +0 -10
- package/dist/pl-PL.module.js.map +0 -1
- package/dist/pt-BR.main.js +0 -8
- package/dist/pt-BR.main.js.map +0 -1
- package/dist/pt-BR.mjs +0 -10
- package/dist/pt-BR.module.js +0 -10
- package/dist/pt-BR.module.js.map +0 -1
- package/dist/pt-PT.main.js +0 -8
- package/dist/pt-PT.main.js.map +0 -1
- package/dist/pt-PT.mjs +0 -10
- package/dist/pt-PT.module.js +0 -10
- package/dist/pt-PT.module.js.map +0 -1
- package/dist/ro-RO.main.js +0 -8
- package/dist/ro-RO.main.js.map +0 -1
- package/dist/ro-RO.mjs +0 -10
- package/dist/ro-RO.module.js +0 -10
- package/dist/ro-RO.module.js.map +0 -1
- package/dist/ru-RU.main.js +0 -8
- package/dist/ru-RU.main.js.map +0 -1
- package/dist/ru-RU.mjs +0 -10
- package/dist/ru-RU.module.js +0 -10
- package/dist/ru-RU.module.js.map +0 -1
- package/dist/sk-SK.main.js +0 -8
- package/dist/sk-SK.main.js.map +0 -1
- package/dist/sk-SK.mjs +0 -10
- package/dist/sk-SK.module.js +0 -10
- package/dist/sk-SK.module.js.map +0 -1
- package/dist/sl-SI.main.js +0 -8
- package/dist/sl-SI.main.js.map +0 -1
- package/dist/sl-SI.mjs +0 -10
- package/dist/sl-SI.module.js +0 -10
- package/dist/sl-SI.module.js.map +0 -1
- package/dist/sr-SP.main.js +0 -8
- package/dist/sr-SP.main.js.map +0 -1
- package/dist/sr-SP.mjs +0 -10
- package/dist/sr-SP.module.js +0 -10
- package/dist/sr-SP.module.js.map +0 -1
- package/dist/sv-SE.main.js +0 -8
- package/dist/sv-SE.main.js.map +0 -1
- package/dist/sv-SE.mjs +0 -10
- package/dist/sv-SE.module.js +0 -10
- package/dist/sv-SE.module.js.map +0 -1
- package/dist/toast.62356566.css +0 -91
- package/dist/toast.62356566.css.map +0 -1
- package/dist/toast.69f125e3.css +0 -187
- package/dist/toast.69f125e3.css.map +0 -1
- package/dist/toastContainer_css.main.js +0 -65
- package/dist/toastContainer_css.main.js.map +0 -1
- package/dist/toastContainer_css.mjs +0 -67
- package/dist/toastContainer_css.module.js +0 -67
- package/dist/toastContainer_css.module.js.map +0 -1
- package/dist/toast_vars_css.main.js +0 -38
- package/dist/toast_vars_css.main.js.map +0 -1
- package/dist/toast_vars_css.mjs +0 -40
- package/dist/toast_vars_css.module.js +0 -40
- package/dist/toast_vars_css.module.js.map +0 -1
- package/dist/tr-TR.main.js +0 -8
- package/dist/tr-TR.main.js.map +0 -1
- package/dist/tr-TR.mjs +0 -10
- package/dist/tr-TR.module.js +0 -10
- package/dist/tr-TR.module.js.map +0 -1
- package/dist/types.d.ts +0 -34
- package/dist/types.d.ts.map +0 -1
- package/dist/uk-UA.main.js +0 -8
- package/dist/uk-UA.main.js.map +0 -1
- package/dist/uk-UA.mjs +0 -10
- package/dist/uk-UA.module.js +0 -10
- package/dist/uk-UA.module.js.map +0 -1
- package/dist/zh-CN.main.js +0 -8
- package/dist/zh-CN.main.js.map +0 -1
- package/dist/zh-CN.mjs +0 -10
- package/dist/zh-CN.module.js +0 -10
- package/dist/zh-CN.module.js.map +0 -1
- package/dist/zh-TW.main.js +0 -8
- package/dist/zh-TW.main.js.map +0 -1
- package/dist/zh-TW.mjs +0 -10
- package/dist/zh-TW.module.js +0 -10
- package/dist/zh-TW.module.js.map +0 -1
- package/src/Toast.tsx +0 -135
- package/src/ToastContainer.tsx +0 -216
- package/src/Toaster.tsx +0 -71
- package/src/toastContainer.css +0 -154
package/dist/import.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ToastContainer as $
|
|
1
|
+
import {ToastContainer as $2f6c38cdaa140f0d$re_export$ToastContainer, ToastQueue as $2f6c38cdaa140f0d$re_export$ToastQueue} from "@adobe/react-spectrum/Toast";
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -14,5 +14,5 @@ import {ToastContainer as $02c59b34bd70955a$export$f2815235e76a62b9, ToastQueue
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
export {$
|
|
17
|
+
export {$2f6c38cdaa140f0d$re_export$ToastContainer as ToastContainer, $2f6c38cdaa140f0d$re_export$ToastQueue as ToastQueue};
|
|
18
18
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var $
|
|
1
|
+
var $gIiD2$adobereactspectrumToast = require("@adobe/react-spectrum/Toast");
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
function $parcel$export(e, n, v, s) {
|
|
5
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
$parcel$export(module.exports, "ToastContainer", ()
|
|
9
|
-
$parcel$export(module.exports, "ToastQueue", ()
|
|
8
|
+
$parcel$export(module.exports, "ToastContainer", function () { return $gIiD2$adobereactspectrumToast.ToastContainer; });
|
|
9
|
+
$parcel$export(module.exports, "ToastQueue", function () { return $gIiD2$adobereactspectrumToast.ToastQueue; });
|
|
10
10
|
/*
|
|
11
11
|
* Copyright 2020 Adobe. All rights reserved.
|
|
12
12
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/toast/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {ToastContainer, ToastQueue} from '
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/toast/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {ToastContainer, ToastQueue} from '@adobe/react-spectrum/Toast';\n\nexport type {SpectrumToastOptions, SpectrumToastContainerProps, CloseFunction} from '@adobe/react-spectrum/Toast';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ToastContainer as $
|
|
1
|
+
import {ToastContainer as $2f6c38cdaa140f0d$re_export$ToastContainer, ToastQueue as $2f6c38cdaa140f0d$re_export$ToastQueue} from "@adobe/react-spectrum/Toast";
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -14,5 +14,5 @@ import {ToastContainer as $02c59b34bd70955a$export$f2815235e76a62b9, ToastQueue
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
export {$
|
|
17
|
+
export {$2f6c38cdaa140f0d$re_export$ToastContainer as ToastContainer, $2f6c38cdaa140f0d$re_export$ToastQueue as ToastQueue};
|
|
18
18
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/toast/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {ToastContainer, ToastQueue} from '
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/toast/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {ToastContainer, ToastQueue} from '@adobe/react-spectrum/Toast';\n\nexport type {SpectrumToastOptions, SpectrumToastContainerProps, CloseFunction} from '@adobe/react-spectrum/Toast';\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/toast",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/module.js",
|
|
8
8
|
"exports": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"./dist/types.d.ts",
|
|
12
|
-
"./
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
9
|
+
".": {
|
|
10
|
+
"source": "./src/index.ts",
|
|
11
|
+
"types": "./dist/types/src/index.d.ts",
|
|
12
|
+
"import": "./dist/import.mjs",
|
|
13
|
+
"require": "./dist/main.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
16
|
},
|
|
17
|
-
"types": "dist/types.d.ts",
|
|
17
|
+
"types": "dist/types/src/index.d.ts",
|
|
18
18
|
"source": "src/index.ts",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
@@ -24,47 +24,25 @@
|
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
26
|
"targets": {
|
|
27
|
-
"
|
|
28
|
-
"includeNodeModules": [
|
|
29
|
-
"@adobe/spectrum-css-temp"
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"module": {
|
|
33
|
-
"includeNodeModules": [
|
|
34
|
-
"@adobe/spectrum-css-temp"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
27
|
+
"types": false
|
|
37
28
|
},
|
|
38
29
|
"repository": {
|
|
39
30
|
"type": "git",
|
|
40
31
|
"url": "https://github.com/adobe/react-spectrum"
|
|
41
32
|
},
|
|
42
33
|
"dependencies": {
|
|
43
|
-
"@react-
|
|
44
|
-
"@
|
|
45
|
-
"@react-aria/overlays": "^3.31.2",
|
|
46
|
-
"@react-aria/toast": "^3.0.11",
|
|
47
|
-
"@react-aria/utils": "^3.33.1",
|
|
48
|
-
"@react-spectrum/button": "^3.17.7",
|
|
49
|
-
"@react-spectrum/utils": "^3.12.12",
|
|
50
|
-
"@react-stately/toast": "^3.1.3",
|
|
51
|
-
"@react-types/shared": "^3.33.1",
|
|
52
|
-
"@spectrum-icons/ui": "^3.6.23",
|
|
53
|
-
"@swc/helpers": "^0.5.0",
|
|
54
|
-
"use-sync-external-store": "^1.6.0"
|
|
34
|
+
"@adobe/react-spectrum": "3.47.0",
|
|
35
|
+
"@swc/helpers": "^0.5.0"
|
|
55
36
|
},
|
|
56
37
|
"devDependencies": {
|
|
57
|
-
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
|
|
58
|
-
"@react-spectrum/test-utils-internal": "3.0.0-alpha.1",
|
|
59
38
|
"@types/use-sync-external-store": "^0.0.3"
|
|
60
39
|
},
|
|
61
40
|
"peerDependencies": {
|
|
62
|
-
"@react-spectrum/provider": "^3.0.0",
|
|
63
41
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
64
42
|
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
65
43
|
},
|
|
66
44
|
"publishConfig": {
|
|
67
45
|
"access": "public"
|
|
68
46
|
},
|
|
69
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
70
48
|
}
|
package/src/index.ts
CHANGED
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
/// <reference types="css-module-types" />
|
|
14
14
|
|
|
15
|
-
export {ToastContainer, ToastQueue} from '
|
|
15
|
+
export {ToastContainer, ToastQueue} from '@adobe/react-spectrum/Toast';
|
|
16
16
|
|
|
17
|
-
export type {SpectrumToastOptions, SpectrumToastContainerProps} from '
|
|
17
|
+
export type {SpectrumToastOptions, SpectrumToastContainerProps, CloseFunction} from '@adobe/react-spectrum/Toast';
|
package/dist/Toast.main.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
var $1e709ec471c88b75$exports = require("./intlStrings.main.js");
|
|
2
|
-
require("./toast.62356566.css");
|
|
3
|
-
var $b6e6aa676f8f9e47$exports = require("./toast_vars_css.main.js");
|
|
4
|
-
require("./toast.69f125e3.css");
|
|
5
|
-
var $e20782d0579ed886$exports = require("./toastContainer_css.main.js");
|
|
6
|
-
var $8Jify$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
|
|
7
|
-
var $8Jify$reactspectrumbutton = require("@react-spectrum/button");
|
|
8
|
-
var $8Jify$reactspectrumutils = require("@react-spectrum/utils");
|
|
9
|
-
var $8Jify$spectrumiconsuiCrossMedium = require("@spectrum-icons/ui/CrossMedium");
|
|
10
|
-
var $8Jify$reactariautils = require("@react-aria/utils");
|
|
11
|
-
var $8Jify$spectrumiconsuiInfoMedium = require("@spectrum-icons/ui/InfoMedium");
|
|
12
|
-
var $8Jify$react = require("react");
|
|
13
|
-
var $8Jify$spectrumiconsuiSuccessMedium = require("@spectrum-icons/ui/SuccessMedium");
|
|
14
|
-
var $8Jify$reactariafocus = require("@react-aria/focus");
|
|
15
|
-
var $8Jify$reactariai18n = require("@react-aria/i18n");
|
|
16
|
-
var $8Jify$reactariatoast = require("@react-aria/toast");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function $parcel$interopDefault(a) {
|
|
20
|
-
return a && a.__esModule ? a.default : a;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function $parcel$export(e, n, v, s) {
|
|
24
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
$parcel$export(module.exports, "Toast", () => $6c5bd1047ecc310e$export$8d8dc7d5f743331b);
|
|
28
|
-
/*
|
|
29
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
30
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
31
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
32
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
33
|
-
*
|
|
34
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
35
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
36
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
37
|
-
* governing permissions and limitations under the License.
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const $6c5bd1047ecc310e$export$fde44257752a9f60 = {
|
|
53
|
-
info: (0, ($parcel$interopDefault($8Jify$spectrumiconsuiInfoMedium))),
|
|
54
|
-
negative: (0, ($parcel$interopDefault($8Jify$spectrumiconsuiAlertMedium))),
|
|
55
|
-
positive: (0, ($parcel$interopDefault($8Jify$spectrumiconsuiSuccessMedium)))
|
|
56
|
-
};
|
|
57
|
-
const $6c5bd1047ecc310e$export$8d8dc7d5f743331b = /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).forwardRef(function Toast(props, ref) {
|
|
58
|
-
let { toast: { key: key, content: { children: children, variant: variant, actionLabel: actionLabel, onAction: onAction, shouldCloseOnAction: shouldCloseOnAction } }, state: state, ...otherProps } = props;
|
|
59
|
-
let domRef = (0, $8Jify$reactspectrumutils.useDOMRef)(ref);
|
|
60
|
-
let { closeButtonProps: closeButtonProps, titleProps: titleProps, toastProps: toastProps, contentProps: contentProps } = (0, $8Jify$reactariatoast.useToast)(props, state, domRef);
|
|
61
|
-
let { styleProps: styleProps } = (0, $8Jify$reactspectrumutils.useStyleProps)(otherProps);
|
|
62
|
-
let stringFormatter = (0, $8Jify$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1e709ec471c88b75$exports))), '@react-spectrum/toast');
|
|
63
|
-
let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;
|
|
64
|
-
let Icon = $6c5bd1047ecc310e$export$fde44257752a9f60[variant];
|
|
65
|
-
let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $8Jify$reactariafocus.useFocusRing)();
|
|
66
|
-
const handleAction = ()=>{
|
|
67
|
-
if (onAction) onAction();
|
|
68
|
-
if (shouldCloseOnAction) state.close(key);
|
|
69
|
-
};
|
|
70
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement("div", {
|
|
71
|
-
...styleProps,
|
|
72
|
-
...(0, $8Jify$reactariautils.mergeProps)(toastProps, focusProps),
|
|
73
|
-
...(0, $8Jify$reactariautils.filterDOMProps)(props.toast.content),
|
|
74
|
-
ref: domRef,
|
|
75
|
-
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast', {
|
|
76
|
-
['spectrum-Toast--' + variant]: variant
|
|
77
|
-
}, styleProps.className, (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($e20782d0579ed886$exports))), 'spectrum-Toast', {
|
|
78
|
-
'focus-ring': isFocusVisible
|
|
79
|
-
}))
|
|
80
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement("div", {
|
|
81
|
-
...contentProps,
|
|
82
|
-
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($e20782d0579ed886$exports))), 'spectrum-Toast-contentWrapper')
|
|
83
|
-
}, Icon && /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement(Icon, {
|
|
84
|
-
"aria-label": iconLabel,
|
|
85
|
-
UNSAFE_className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast-typeIcon')
|
|
86
|
-
}), /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement("div", {
|
|
87
|
-
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast-body'),
|
|
88
|
-
role: "presentation"
|
|
89
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement("div", {
|
|
90
|
-
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast-content'),
|
|
91
|
-
role: "presentation",
|
|
92
|
-
...titleProps
|
|
93
|
-
}, children), actionLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement((0, $8Jify$reactspectrumbutton.Button), {
|
|
94
|
-
onPress: handleAction,
|
|
95
|
-
UNSAFE_className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Button'),
|
|
96
|
-
variant: "secondary",
|
|
97
|
-
staticColor: "white",
|
|
98
|
-
"data-testid": "rsp-Toast-secondaryButton"
|
|
99
|
-
}, actionLabel))), /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement("div", {
|
|
100
|
-
className: (0, $8Jify$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b6e6aa676f8f9e47$exports))), 'spectrum-Toast-buttons')
|
|
101
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement((0, $8Jify$reactspectrumbutton.ClearButton), {
|
|
102
|
-
...closeButtonProps,
|
|
103
|
-
variant: "overBackground",
|
|
104
|
-
"data-testid": "rsp-Toast-closeButton"
|
|
105
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($8Jify$react))).createElement((0, ($parcel$interopDefault($8Jify$spectrumiconsuiCrossMedium))), null))));
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
//# sourceMappingURL=Toast.main.js.map
|
package/dist/Toast.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAkCM,MAAM,4CAAQ;IACnB,MAAM,CAAA,GAAA,0DAAS;IACf,UAAU,CAAA,GAAA,2DAAU;IACpB,UAAU,CAAA,GAAA,6DAAY;AACxB;AAEO,MAAM,0DAAQ,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,MAAM,KAAyB,EAAE,GAA2B;IACzG,IAAI,EACF,OAAO,OACL,GAAG,EACH,SAAS,YACP,QAAQ,WACR,OAAO,eACP,WAAW,YACX,QAAQ,uBACR,mBAAmB,EACpB,EACF,SACD,KAAK,EACL,GAAG,YACJ,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,oBACF,gBAAgB,cAChB,UAAU,cACV,UAAU,gBACV,YAAY,EACb,GAAG,CAAA,GAAA,8BAAO,EAAE,OAAO,OAAO;IAC3B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,YAAY,WAAW,YAAY,YAAY,gBAAgB,MAAM,CAAC,WAAW;IACrF,IAAI,OAAO,yCAAK,CAAC,QAAQ;IACzB,IAAI,kBAAC,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,kCAAW;IAE9C,MAAM,eAAe;QACnB,IAAI,UACF;QAGF,IAAI,qBACF,MAAM,KAAK,CAAC;IAEhB;IAEA,qBACE,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,WAAW;QACrC,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC;QACvC,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GACzB,kBACA;YAAC,CAAC,qBAAqB,QAAQ,EAAE;QAAO,GACxC,WAAW,SAAS,EACpB,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAmB,GACnB,kBACA;YAAC,cAAc;QAAc;qBAGjC,0DAAC;QACE,GAAG,YAAY;QAChB,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAmB,GAAG;OAC3C,sBACC,0DAAC;QACC,cAAY;QACZ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;sBAEzC,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAAwB,MAAK;qBAC9D,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAA2B,MAAK;QAAgB,GAAG,UAAU;OAAG,WAClG,6BACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAS;QACT,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACrC,SAAQ;QACR,aAAY;QACZ,eAAY;OACX,8BAKT,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBACjC,0DAAC,CAAA,GAAA,sCAAU;QAAG,GAAG,gBAAgB;QAAE,SAAQ;QAAiB,eAAY;qBACtE,0DAAC,CAAA,GAAA,2DAAU;AAKrB","sources":["packages/@react-spectrum/toast/src/Toast.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\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 {DOMProps, DOMRef} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport InfoMedium from '@spectrum-icons/ui/InfoMedium';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {QueuedToast, ToastState} from '@react-stately/toast';\nimport React 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 {useFocusRing} from '@react-aria/focus';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useToast} from '@react-aria/toast';\n\nexport interface SpectrumToastValue extends DOMProps {\n children: string,\n variant: 'positive' | 'negative' | 'info' | 'neutral',\n actionLabel?: string,\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\nexport const Toast = React.forwardRef(function Toast(props: SpectrumToastProps, ref: DOMRef<HTMLDivElement>) {\n let {\n toast: {\n key,\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 contentProps\n } = useToast(props, state, domRef);\n let {styleProps} = useStyleProps(otherProps);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/toast');\n let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;\n let Icon = ICONS[variant];\n let {isFocusVisible, focusProps} = useFocusRing();\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 {...mergeProps(toastProps, focusProps)}\n {...filterDOMProps(props.toast.content)}\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 {'focus-ring': isFocusVisible}\n )\n )}>\n <div\n {...contentProps}\n className={classNames(toastContainerStyles, 'spectrum-Toast-contentWrapper')}>\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')} role=\"presentation\">\n <div className={classNames(styles, 'spectrum-Toast-content')} role=\"presentation\" {...titleProps}>{children}</div>\n {actionLabel &&\n <Button\n onPress={handleAction}\n UNSAFE_className={classNames(styles, 'spectrum-Button')}\n variant=\"secondary\"\n staticColor=\"white\"\n data-testid=\"rsp-Toast-secondaryButton\">\n {actionLabel}\n </Button>\n }\n </div>\n </div>\n <div className={classNames(styles, 'spectrum-Toast-buttons')}>\n <ClearButton {...closeButtonProps} variant=\"overBackground\" data-testid=\"rsp-Toast-closeButton\">\n <CrossMedium />\n </ClearButton>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.main.js.map"}
|
package/dist/Toast.mjs
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import $iu2Jc$intlStringsmodulejs from "./intlStrings.mjs";
|
|
2
|
-
import "./toast.62356566.css";
|
|
3
|
-
import $iu2Jc$toast_vars_cssmodulejs from "./toast_vars_css.mjs";
|
|
4
|
-
import "./toast.69f125e3.css";
|
|
5
|
-
import $iu2Jc$toastContainer_cssmodulejs from "./toastContainer_css.mjs";
|
|
6
|
-
import $iu2Jc$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
|
7
|
-
import {Button as $iu2Jc$Button, ClearButton as $iu2Jc$ClearButton} from "@react-spectrum/button";
|
|
8
|
-
import {useDOMRef as $iu2Jc$useDOMRef, useStyleProps as $iu2Jc$useStyleProps, classNames as $iu2Jc$classNames} from "@react-spectrum/utils";
|
|
9
|
-
import $iu2Jc$spectrumiconsuiCrossMedium from "@spectrum-icons/ui/CrossMedium";
|
|
10
|
-
import {mergeProps as $iu2Jc$mergeProps, filterDOMProps as $iu2Jc$filterDOMProps} from "@react-aria/utils";
|
|
11
|
-
import $iu2Jc$spectrumiconsuiInfoMedium from "@spectrum-icons/ui/InfoMedium";
|
|
12
|
-
import $iu2Jc$react from "react";
|
|
13
|
-
import $iu2Jc$spectrumiconsuiSuccessMedium from "@spectrum-icons/ui/SuccessMedium";
|
|
14
|
-
import {useFocusRing as $iu2Jc$useFocusRing} from "@react-aria/focus";
|
|
15
|
-
import {useLocalizedStringFormatter as $iu2Jc$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
16
|
-
import {useToast as $iu2Jc$useToast} from "@react-aria/toast";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function $parcel$interopDefault(a) {
|
|
20
|
-
return a && a.__esModule ? a.default : a;
|
|
21
|
-
}
|
|
22
|
-
/*
|
|
23
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
24
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
25
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
26
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
-
*
|
|
28
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
29
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
30
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
31
|
-
* governing permissions and limitations under the License.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const $7e7a2952509f3a56$export$fde44257752a9f60 = {
|
|
47
|
-
info: (0, $iu2Jc$spectrumiconsuiInfoMedium),
|
|
48
|
-
negative: (0, $iu2Jc$spectrumiconsuiAlertMedium),
|
|
49
|
-
positive: (0, $iu2Jc$spectrumiconsuiSuccessMedium)
|
|
50
|
-
};
|
|
51
|
-
const $7e7a2952509f3a56$export$8d8dc7d5f743331b = /*#__PURE__*/ (0, $iu2Jc$react).forwardRef(function Toast(props, ref) {
|
|
52
|
-
let { toast: { key: key, content: { children: children, variant: variant, actionLabel: actionLabel, onAction: onAction, shouldCloseOnAction: shouldCloseOnAction } }, state: state, ...otherProps } = props;
|
|
53
|
-
let domRef = (0, $iu2Jc$useDOMRef)(ref);
|
|
54
|
-
let { closeButtonProps: closeButtonProps, titleProps: titleProps, toastProps: toastProps, contentProps: contentProps } = (0, $iu2Jc$useToast)(props, state, domRef);
|
|
55
|
-
let { styleProps: styleProps } = (0, $iu2Jc$useStyleProps)(otherProps);
|
|
56
|
-
let stringFormatter = (0, $iu2Jc$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iu2Jc$intlStringsmodulejs))), '@react-spectrum/toast');
|
|
57
|
-
let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;
|
|
58
|
-
let Icon = $7e7a2952509f3a56$export$fde44257752a9f60[variant];
|
|
59
|
-
let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $iu2Jc$useFocusRing)();
|
|
60
|
-
const handleAction = ()=>{
|
|
61
|
-
if (onAction) onAction();
|
|
62
|
-
if (shouldCloseOnAction) state.close(key);
|
|
63
|
-
};
|
|
64
|
-
return /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
65
|
-
...styleProps,
|
|
66
|
-
...(0, $iu2Jc$mergeProps)(toastProps, focusProps),
|
|
67
|
-
...(0, $iu2Jc$filterDOMProps)(props.toast.content),
|
|
68
|
-
ref: domRef,
|
|
69
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast', {
|
|
70
|
-
['spectrum-Toast--' + variant]: variant
|
|
71
|
-
}, styleProps.className, (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toastContainer_cssmodulejs))), 'spectrum-Toast', {
|
|
72
|
-
'focus-ring': isFocusVisible
|
|
73
|
-
}))
|
|
74
|
-
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
75
|
-
...contentProps,
|
|
76
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toastContainer_cssmodulejs))), 'spectrum-Toast-contentWrapper')
|
|
77
|
-
}, Icon && /*#__PURE__*/ (0, $iu2Jc$react).createElement(Icon, {
|
|
78
|
-
"aria-label": iconLabel,
|
|
79
|
-
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-typeIcon')
|
|
80
|
-
}), /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
81
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-body'),
|
|
82
|
-
role: "presentation"
|
|
83
|
-
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
84
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-content'),
|
|
85
|
-
role: "presentation",
|
|
86
|
-
...titleProps
|
|
87
|
-
}, children), actionLabel && /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$Button), {
|
|
88
|
-
onPress: handleAction,
|
|
89
|
-
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Button'),
|
|
90
|
-
variant: "secondary",
|
|
91
|
-
staticColor: "white",
|
|
92
|
-
"data-testid": "rsp-Toast-secondaryButton"
|
|
93
|
-
}, actionLabel))), /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
94
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-buttons')
|
|
95
|
-
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$ClearButton), {
|
|
96
|
-
...closeButtonProps,
|
|
97
|
-
variant: "overBackground",
|
|
98
|
-
"data-testid": "rsp-Toast-closeButton"
|
|
99
|
-
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$spectrumiconsuiCrossMedium), null))));
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
export {$7e7a2952509f3a56$export$fde44257752a9f60 as ICONS, $7e7a2952509f3a56$export$8d8dc7d5f743331b as Toast};
|
|
104
|
-
//# sourceMappingURL=Toast.module.js.map
|
package/dist/Toast.module.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import $iu2Jc$intlStringsmodulejs from "./intlStrings.module.js";
|
|
2
|
-
import "./toast.62356566.css";
|
|
3
|
-
import $iu2Jc$toast_vars_cssmodulejs from "./toast_vars_css.module.js";
|
|
4
|
-
import "./toast.69f125e3.css";
|
|
5
|
-
import $iu2Jc$toastContainer_cssmodulejs from "./toastContainer_css.module.js";
|
|
6
|
-
import $iu2Jc$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
|
7
|
-
import {Button as $iu2Jc$Button, ClearButton as $iu2Jc$ClearButton} from "@react-spectrum/button";
|
|
8
|
-
import {useDOMRef as $iu2Jc$useDOMRef, useStyleProps as $iu2Jc$useStyleProps, classNames as $iu2Jc$classNames} from "@react-spectrum/utils";
|
|
9
|
-
import $iu2Jc$spectrumiconsuiCrossMedium from "@spectrum-icons/ui/CrossMedium";
|
|
10
|
-
import {mergeProps as $iu2Jc$mergeProps, filterDOMProps as $iu2Jc$filterDOMProps} from "@react-aria/utils";
|
|
11
|
-
import $iu2Jc$spectrumiconsuiInfoMedium from "@spectrum-icons/ui/InfoMedium";
|
|
12
|
-
import $iu2Jc$react from "react";
|
|
13
|
-
import $iu2Jc$spectrumiconsuiSuccessMedium from "@spectrum-icons/ui/SuccessMedium";
|
|
14
|
-
import {useFocusRing as $iu2Jc$useFocusRing} from "@react-aria/focus";
|
|
15
|
-
import {useLocalizedStringFormatter as $iu2Jc$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
16
|
-
import {useToast as $iu2Jc$useToast} from "@react-aria/toast";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function $parcel$interopDefault(a) {
|
|
20
|
-
return a && a.__esModule ? a.default : a;
|
|
21
|
-
}
|
|
22
|
-
/*
|
|
23
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
24
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
25
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
26
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
-
*
|
|
28
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
29
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
30
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
31
|
-
* governing permissions and limitations under the License.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const $7e7a2952509f3a56$export$fde44257752a9f60 = {
|
|
47
|
-
info: (0, $iu2Jc$spectrumiconsuiInfoMedium),
|
|
48
|
-
negative: (0, $iu2Jc$spectrumiconsuiAlertMedium),
|
|
49
|
-
positive: (0, $iu2Jc$spectrumiconsuiSuccessMedium)
|
|
50
|
-
};
|
|
51
|
-
const $7e7a2952509f3a56$export$8d8dc7d5f743331b = /*#__PURE__*/ (0, $iu2Jc$react).forwardRef(function Toast(props, ref) {
|
|
52
|
-
let { toast: { key: key, content: { children: children, variant: variant, actionLabel: actionLabel, onAction: onAction, shouldCloseOnAction: shouldCloseOnAction } }, state: state, ...otherProps } = props;
|
|
53
|
-
let domRef = (0, $iu2Jc$useDOMRef)(ref);
|
|
54
|
-
let { closeButtonProps: closeButtonProps, titleProps: titleProps, toastProps: toastProps, contentProps: contentProps } = (0, $iu2Jc$useToast)(props, state, domRef);
|
|
55
|
-
let { styleProps: styleProps } = (0, $iu2Jc$useStyleProps)(otherProps);
|
|
56
|
-
let stringFormatter = (0, $iu2Jc$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iu2Jc$intlStringsmodulejs))), '@react-spectrum/toast');
|
|
57
|
-
let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;
|
|
58
|
-
let Icon = $7e7a2952509f3a56$export$fde44257752a9f60[variant];
|
|
59
|
-
let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $iu2Jc$useFocusRing)();
|
|
60
|
-
const handleAction = ()=>{
|
|
61
|
-
if (onAction) onAction();
|
|
62
|
-
if (shouldCloseOnAction) state.close(key);
|
|
63
|
-
};
|
|
64
|
-
return /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
65
|
-
...styleProps,
|
|
66
|
-
...(0, $iu2Jc$mergeProps)(toastProps, focusProps),
|
|
67
|
-
...(0, $iu2Jc$filterDOMProps)(props.toast.content),
|
|
68
|
-
ref: domRef,
|
|
69
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast', {
|
|
70
|
-
['spectrum-Toast--' + variant]: variant
|
|
71
|
-
}, styleProps.className, (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toastContainer_cssmodulejs))), 'spectrum-Toast', {
|
|
72
|
-
'focus-ring': isFocusVisible
|
|
73
|
-
}))
|
|
74
|
-
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
75
|
-
...contentProps,
|
|
76
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toastContainer_cssmodulejs))), 'spectrum-Toast-contentWrapper')
|
|
77
|
-
}, Icon && /*#__PURE__*/ (0, $iu2Jc$react).createElement(Icon, {
|
|
78
|
-
"aria-label": iconLabel,
|
|
79
|
-
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-typeIcon')
|
|
80
|
-
}), /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
81
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-body'),
|
|
82
|
-
role: "presentation"
|
|
83
|
-
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
84
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-content'),
|
|
85
|
-
role: "presentation",
|
|
86
|
-
...titleProps
|
|
87
|
-
}, children), actionLabel && /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$Button), {
|
|
88
|
-
onPress: handleAction,
|
|
89
|
-
UNSAFE_className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Button'),
|
|
90
|
-
variant: "secondary",
|
|
91
|
-
staticColor: "white",
|
|
92
|
-
"data-testid": "rsp-Toast-secondaryButton"
|
|
93
|
-
}, actionLabel))), /*#__PURE__*/ (0, $iu2Jc$react).createElement("div", {
|
|
94
|
-
className: (0, $iu2Jc$classNames)((0, ($parcel$interopDefault($iu2Jc$toast_vars_cssmodulejs))), 'spectrum-Toast-buttons')
|
|
95
|
-
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$ClearButton), {
|
|
96
|
-
...closeButtonProps,
|
|
97
|
-
variant: "overBackground",
|
|
98
|
-
"data-testid": "rsp-Toast-closeButton"
|
|
99
|
-
}, /*#__PURE__*/ (0, $iu2Jc$react).createElement((0, $iu2Jc$spectrumiconsuiCrossMedium), null))));
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
export {$7e7a2952509f3a56$export$fde44257752a9f60 as ICONS, $7e7a2952509f3a56$export$8d8dc7d5f743331b as Toast};
|
|
104
|
-
//# sourceMappingURL=Toast.module.js.map
|
package/dist/Toast.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAkCM,MAAM,4CAAQ;IACnB,MAAM,CAAA,GAAA,gCAAS;IACf,UAAU,CAAA,GAAA,iCAAU;IACpB,UAAU,CAAA,GAAA,mCAAY;AACxB;AAEO,MAAM,0DAAQ,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,MAAM,KAAyB,EAAE,GAA2B;IACzG,IAAI,EACF,OAAO,OACL,GAAG,EACH,SAAS,YACP,QAAQ,WACR,OAAO,eACP,WAAW,YACX,QAAQ,uBACR,mBAAmB,EACpB,EACF,SACD,KAAK,EACL,GAAG,YACJ,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,oBACF,gBAAgB,cAChB,UAAU,cACV,UAAU,gBACV,YAAY,EACb,GAAG,CAAA,GAAA,eAAO,EAAE,OAAO,OAAO;IAC3B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAEjC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,YAAY,WAAW,YAAY,YAAY,gBAAgB,MAAM,CAAC,WAAW;IACrF,IAAI,OAAO,yCAAK,CAAC,QAAQ;IACzB,IAAI,kBAAC,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW;IAE9C,MAAM,eAAe;QACnB,IAAI,UACF;QAGF,IAAI,qBACF,MAAM,KAAK,CAAC;IAEhB;IAEA,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QACrC,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC;QACvC,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GACzB,kBACA;YAAC,CAAC,qBAAqB,QAAQ,EAAE;QAAO,GACxC,WAAW,SAAS,EACpB,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,2DAAmB,GACnB,kBACA;YAAC,cAAc;QAAc;qBAGjC,gCAAC;QACE,GAAG,YAAY;QAChB,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,2DAAmB,GAAG;OAC3C,sBACC,gCAAC;QACC,cAAY;QACZ,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;sBAEzC,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;QAAwB,MAAK;qBAC9D,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;QAA2B,MAAK;QAAgB,GAAG,UAAU;OAAG,WAClG,6BACC,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAS;QACT,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;QACrC,SAAQ;QACR,aAAY;QACZ,eAAY;OACX,8BAKT,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;qBACjC,gCAAC,CAAA,GAAA,kBAAU;QAAG,GAAG,gBAAgB;QAAE,SAAQ;QAAiB,eAAY;qBACtE,gCAAC,CAAA,GAAA,iCAAU;AAKrB","sources":["packages/@react-spectrum/toast/src/Toast.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\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 {DOMProps, DOMRef} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport InfoMedium from '@spectrum-icons/ui/InfoMedium';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {QueuedToast, ToastState} from '@react-stately/toast';\nimport React 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 {useFocusRing} from '@react-aria/focus';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useToast} from '@react-aria/toast';\n\nexport interface SpectrumToastValue extends DOMProps {\n children: string,\n variant: 'positive' | 'negative' | 'info' | 'neutral',\n actionLabel?: string,\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\nexport const Toast = React.forwardRef(function Toast(props: SpectrumToastProps, ref: DOMRef<HTMLDivElement>) {\n let {\n toast: {\n key,\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 contentProps\n } = useToast(props, state, domRef);\n let {styleProps} = useStyleProps(otherProps);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/toast');\n let iconLabel = variant && variant !== 'neutral' ? stringFormatter.format(variant) : null;\n let Icon = ICONS[variant];\n let {isFocusVisible, focusProps} = useFocusRing();\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 {...mergeProps(toastProps, focusProps)}\n {...filterDOMProps(props.toast.content)}\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 {'focus-ring': isFocusVisible}\n )\n )}>\n <div\n {...contentProps}\n className={classNames(toastContainerStyles, 'spectrum-Toast-contentWrapper')}>\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')} role=\"presentation\">\n <div className={classNames(styles, 'spectrum-Toast-content')} role=\"presentation\" {...titleProps}>{children}</div>\n {actionLabel &&\n <Button\n onPress={handleAction}\n UNSAFE_className={classNames(styles, 'spectrum-Button')}\n variant=\"secondary\"\n staticColor=\"white\"\n data-testid=\"rsp-Toast-secondaryButton\">\n {actionLabel}\n </Button>\n }\n </div>\n </div>\n <div className={classNames(styles, 'spectrum-Toast-buttons')}>\n <ClearButton {...closeButtonProps} variant=\"overBackground\" data-testid=\"rsp-Toast-closeButton\">\n <CrossMedium />\n </ClearButton>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.module.js.map"}
|