@react-spectrum/dialog 3.9.6 → 3.10.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 +5 -7
- package/dist/main.js +9 -11
- package/dist/main.js.map +1 -1
- package/dist/module.js +5 -7
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +8 -0
- package/package.json +12 -43
- package/src/index.ts +8 -7
- package/dist/AlertDialog.main.js +0 -97
- package/dist/AlertDialog.main.js.map +0 -1
- package/dist/AlertDialog.mjs +0 -92
- package/dist/AlertDialog.module.js +0 -92
- package/dist/AlertDialog.module.js.map +0 -1
- package/dist/Dialog.main.js +0 -131
- package/dist/Dialog.main.js.map +0 -1
- package/dist/Dialog.mjs +0 -126
- package/dist/Dialog.module.js +0 -126
- package/dist/Dialog.module.js.map +0 -1
- package/dist/DialogContainer.main.js +0 -63
- package/dist/DialogContainer.main.js.map +0 -1
- package/dist/DialogContainer.mjs +0 -54
- package/dist/DialogContainer.module.js +0 -54
- package/dist/DialogContainer.module.js.map +0 -1
- package/dist/DialogTrigger.main.js +0 -161
- package/dist/DialogTrigger.main.js.map +0 -1
- package/dist/DialogTrigger.mjs +0 -152
- package/dist/DialogTrigger.module.js +0 -152
- package/dist/DialogTrigger.module.js.map +0 -1
- package/dist/ar-AE.main.js +0 -7
- package/dist/ar-AE.main.js.map +0 -1
- package/dist/ar-AE.mjs +0 -9
- package/dist/ar-AE.module.js +0 -9
- package/dist/ar-AE.module.js.map +0 -1
- package/dist/bg-BG.main.js +0 -7
- package/dist/bg-BG.main.js.map +0 -1
- package/dist/bg-BG.mjs +0 -9
- package/dist/bg-BG.module.js +0 -9
- package/dist/bg-BG.module.js.map +0 -1
- package/dist/context.main.js +0 -27
- package/dist/context.main.js.map +0 -1
- package/dist/context.mjs +0 -18
- package/dist/context.module.js +0 -18
- package/dist/context.module.js.map +0 -1
- package/dist/cs-CZ.main.js +0 -7
- package/dist/cs-CZ.main.js.map +0 -1
- package/dist/cs-CZ.mjs +0 -9
- package/dist/cs-CZ.module.js +0 -9
- package/dist/cs-CZ.module.js.map +0 -1
- package/dist/da-DK.main.js +0 -7
- package/dist/da-DK.main.js.map +0 -1
- package/dist/da-DK.mjs +0 -9
- package/dist/da-DK.module.js +0 -9
- package/dist/da-DK.module.js.map +0 -1
- package/dist/de-DE.main.js +0 -7
- package/dist/de-DE.main.js.map +0 -1
- package/dist/de-DE.mjs +0 -9
- package/dist/de-DE.module.js +0 -9
- package/dist/de-DE.module.js.map +0 -1
- package/dist/dialog.1f91a33b.css +0 -519
- package/dist/dialog.1f91a33b.css.map +0 -1
- package/dist/dialog_vars_css.main.js +0 -161
- package/dist/dialog_vars_css.main.js.map +0 -1
- package/dist/dialog_vars_css.mjs +0 -163
- package/dist/dialog_vars_css.module.js +0 -163
- package/dist/dialog_vars_css.module.js.map +0 -1
- package/dist/el-GR.main.js +0 -7
- package/dist/el-GR.main.js.map +0 -1
- package/dist/el-GR.mjs +0 -9
- package/dist/el-GR.module.js +0 -9
- package/dist/el-GR.module.js.map +0 -1
- package/dist/en-US.main.js +0 -7
- package/dist/en-US.main.js.map +0 -1
- package/dist/en-US.mjs +0 -9
- package/dist/en-US.module.js +0 -9
- package/dist/en-US.module.js.map +0 -1
- package/dist/es-ES.main.js +0 -7
- package/dist/es-ES.main.js.map +0 -1
- package/dist/es-ES.mjs +0 -9
- package/dist/es-ES.module.js +0 -9
- package/dist/es-ES.module.js.map +0 -1
- package/dist/et-EE.main.js +0 -7
- package/dist/et-EE.main.js.map +0 -1
- package/dist/et-EE.mjs +0 -9
- package/dist/et-EE.module.js +0 -9
- package/dist/et-EE.module.js.map +0 -1
- package/dist/fi-FI.main.js +0 -7
- package/dist/fi-FI.main.js.map +0 -1
- package/dist/fi-FI.mjs +0 -9
- package/dist/fi-FI.module.js +0 -9
- package/dist/fi-FI.module.js.map +0 -1
- package/dist/fr-FR.main.js +0 -7
- package/dist/fr-FR.main.js.map +0 -1
- package/dist/fr-FR.mjs +0 -9
- package/dist/fr-FR.module.js +0 -9
- package/dist/fr-FR.module.js.map +0 -1
- package/dist/he-IL.main.js +0 -7
- package/dist/he-IL.main.js.map +0 -1
- package/dist/he-IL.mjs +0 -9
- package/dist/he-IL.module.js +0 -9
- package/dist/he-IL.module.js.map +0 -1
- package/dist/hr-HR.main.js +0 -7
- package/dist/hr-HR.main.js.map +0 -1
- package/dist/hr-HR.mjs +0 -9
- package/dist/hr-HR.module.js +0 -9
- package/dist/hr-HR.module.js.map +0 -1
- package/dist/hu-HU.main.js +0 -7
- package/dist/hu-HU.main.js.map +0 -1
- package/dist/hu-HU.mjs +0 -9
- package/dist/hu-HU.module.js +0 -9
- 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 -7
- package/dist/it-IT.main.js.map +0 -1
- package/dist/it-IT.mjs +0 -9
- package/dist/it-IT.module.js +0 -9
- package/dist/it-IT.module.js.map +0 -1
- package/dist/ja-JP.main.js +0 -7
- package/dist/ja-JP.main.js.map +0 -1
- package/dist/ja-JP.mjs +0 -9
- package/dist/ja-JP.module.js +0 -9
- package/dist/ja-JP.module.js.map +0 -1
- package/dist/ko-KR.main.js +0 -7
- package/dist/ko-KR.main.js.map +0 -1
- package/dist/ko-KR.mjs +0 -9
- package/dist/ko-KR.module.js +0 -9
- package/dist/ko-KR.module.js.map +0 -1
- package/dist/lt-LT.main.js +0 -7
- package/dist/lt-LT.main.js.map +0 -1
- package/dist/lt-LT.mjs +0 -9
- package/dist/lt-LT.module.js +0 -9
- package/dist/lt-LT.module.js.map +0 -1
- package/dist/lv-LV.main.js +0 -7
- package/dist/lv-LV.main.js.map +0 -1
- package/dist/lv-LV.mjs +0 -9
- package/dist/lv-LV.module.js +0 -9
- package/dist/lv-LV.module.js.map +0 -1
- package/dist/nb-NO.main.js +0 -7
- package/dist/nb-NO.main.js.map +0 -1
- package/dist/nb-NO.mjs +0 -9
- package/dist/nb-NO.module.js +0 -9
- package/dist/nb-NO.module.js.map +0 -1
- package/dist/nl-NL.main.js +0 -7
- package/dist/nl-NL.main.js.map +0 -1
- package/dist/nl-NL.mjs +0 -9
- package/dist/nl-NL.module.js +0 -9
- package/dist/nl-NL.module.js.map +0 -1
- package/dist/pl-PL.main.js +0 -7
- package/dist/pl-PL.main.js.map +0 -1
- package/dist/pl-PL.mjs +0 -9
- package/dist/pl-PL.module.js +0 -9
- package/dist/pl-PL.module.js.map +0 -1
- package/dist/pt-BR.main.js +0 -7
- package/dist/pt-BR.main.js.map +0 -1
- package/dist/pt-BR.mjs +0 -9
- package/dist/pt-BR.module.js +0 -9
- package/dist/pt-BR.module.js.map +0 -1
- package/dist/pt-PT.main.js +0 -7
- package/dist/pt-PT.main.js.map +0 -1
- package/dist/pt-PT.mjs +0 -9
- package/dist/pt-PT.module.js +0 -9
- package/dist/pt-PT.module.js.map +0 -1
- package/dist/ro-RO.main.js +0 -7
- package/dist/ro-RO.main.js.map +0 -1
- package/dist/ro-RO.mjs +0 -9
- package/dist/ro-RO.module.js +0 -9
- package/dist/ro-RO.module.js.map +0 -1
- package/dist/ru-RU.main.js +0 -7
- package/dist/ru-RU.main.js.map +0 -1
- package/dist/ru-RU.mjs +0 -9
- package/dist/ru-RU.module.js +0 -9
- package/dist/ru-RU.module.js.map +0 -1
- package/dist/sk-SK.main.js +0 -7
- package/dist/sk-SK.main.js.map +0 -1
- package/dist/sk-SK.mjs +0 -9
- package/dist/sk-SK.module.js +0 -9
- package/dist/sk-SK.module.js.map +0 -1
- package/dist/sl-SI.main.js +0 -7
- package/dist/sl-SI.main.js.map +0 -1
- package/dist/sl-SI.mjs +0 -9
- package/dist/sl-SI.module.js +0 -9
- package/dist/sl-SI.module.js.map +0 -1
- package/dist/sr-SP.main.js +0 -7
- package/dist/sr-SP.main.js.map +0 -1
- package/dist/sr-SP.mjs +0 -9
- package/dist/sr-SP.module.js +0 -9
- package/dist/sr-SP.module.js.map +0 -1
- package/dist/sv-SE.main.js +0 -7
- package/dist/sv-SE.main.js.map +0 -1
- package/dist/sv-SE.mjs +0 -9
- package/dist/sv-SE.module.js +0 -9
- package/dist/sv-SE.module.js.map +0 -1
- package/dist/tr-TR.main.js +0 -7
- package/dist/tr-TR.main.js.map +0 -1
- package/dist/tr-TR.mjs +0 -9
- package/dist/tr-TR.module.js +0 -9
- package/dist/tr-TR.module.js.map +0 -1
- package/dist/types.d.ts +0 -32
- package/dist/types.d.ts.map +0 -1
- package/dist/uk-UA.main.js +0 -7
- package/dist/uk-UA.main.js.map +0 -1
- package/dist/uk-UA.mjs +0 -9
- package/dist/uk-UA.module.js +0 -9
- package/dist/uk-UA.module.js.map +0 -1
- package/dist/useDialogContainer.main.js +0 -34
- package/dist/useDialogContainer.main.js.map +0 -1
- package/dist/useDialogContainer.mjs +0 -29
- package/dist/useDialogContainer.module.js +0 -29
- package/dist/useDialogContainer.module.js.map +0 -1
- package/dist/zh-CN.main.js +0 -7
- package/dist/zh-CN.main.js.map +0 -1
- package/dist/zh-CN.mjs +0 -9
- package/dist/zh-CN.module.js +0 -9
- package/dist/zh-CN.module.js.map +0 -1
- package/dist/zh-TW.main.js +0 -7
- package/dist/zh-TW.main.js.map +0 -1
- package/dist/zh-TW.mjs +0 -9
- package/dist/zh-TW.module.js +0 -9
- package/dist/zh-TW.module.js.map +0 -1
- package/src/AlertDialog.tsx +0 -115
- package/src/Dialog.tsx +0 -118
- package/src/DialogContainer.tsx +0 -79
- package/src/DialogTrigger.tsx +0 -207
- package/src/context.ts +0 -21
- package/src/useDialogContainer.ts +0 -33
package/dist/import.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {AlertDialog as $
|
|
2
|
-
import {Dialog as $
|
|
3
|
-
import {DialogTrigger as $
|
|
4
|
-
import {DialogContainer as $
|
|
5
|
-
import {useDialogContainer as $faffee7da30e8f89$export$a2f2d8fa6720dab1} from "./useDialogContainer.mjs";
|
|
1
|
+
import {AlertDialog as $5c1ddb3f52d41297$re_export$AlertDialog} from "@adobe/react-spectrum/AlertDialog";
|
|
2
|
+
import {Dialog as $5c1ddb3f52d41297$re_export$Dialog} from "@adobe/react-spectrum/Dialog";
|
|
3
|
+
import {DialogTrigger as $5c1ddb3f52d41297$re_export$DialogTrigger} from "@adobe/react-spectrum/DialogTrigger";
|
|
4
|
+
import {DialogContainer as $5c1ddb3f52d41297$re_export$DialogContainer, useDialogContainer as $5c1ddb3f52d41297$re_export$useDialogContainer} from "@adobe/react-spectrum/DialogContainer";
|
|
6
5
|
|
|
7
6
|
/*
|
|
8
7
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -21,6 +20,5 @@ import {useDialogContainer as $faffee7da30e8f89$export$a2f2d8fa6720dab1} from ".
|
|
|
21
20
|
|
|
22
21
|
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog, $99cd51dc4eb569f7$export$3ddf2d174ce01153 as Dialog, $c412c5ea680c1e4f$export$2e1e1122cf0cba88 as DialogTrigger, $2a9f0ad39ddaa8d9$export$547754aada6e339f as DialogContainer, $faffee7da30e8f89$export$a2f2d8fa6720dab1 as useDialogContainer};
|
|
23
|
+
export {$5c1ddb3f52d41297$re_export$AlertDialog as AlertDialog, $5c1ddb3f52d41297$re_export$Dialog as Dialog, $5c1ddb3f52d41297$re_export$DialogTrigger as DialogTrigger, $5c1ddb3f52d41297$re_export$DialogContainer as DialogContainer, $5c1ddb3f52d41297$re_export$useDialogContainer as useDialogContainer};
|
|
26
24
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $1f05ce3abe26c4cc$exports = require("./useDialogContainer.main.js");
|
|
1
|
+
var $bn5lc$adobereactspectrumAlertDialog = require("@adobe/react-spectrum/AlertDialog");
|
|
2
|
+
var $bn5lc$adobereactspectrumDialog = require("@adobe/react-spectrum/Dialog");
|
|
3
|
+
var $bn5lc$adobereactspectrumDialogTrigger = require("@adobe/react-spectrum/DialogTrigger");
|
|
4
|
+
var $bn5lc$adobereactspectrumDialogContainer = require("@adobe/react-spectrum/DialogContainer");
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
function $parcel$export(e, n, v, s) {
|
|
9
8
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
$parcel$export(module.exports, "AlertDialog", ()
|
|
13
|
-
$parcel$export(module.exports, "Dialog", ()
|
|
14
|
-
$parcel$export(module.exports, "DialogTrigger", ()
|
|
15
|
-
$parcel$export(module.exports, "DialogContainer", ()
|
|
16
|
-
$parcel$export(module.exports, "useDialogContainer", ()
|
|
11
|
+
$parcel$export(module.exports, "AlertDialog", function () { return $bn5lc$adobereactspectrumAlertDialog.AlertDialog; });
|
|
12
|
+
$parcel$export(module.exports, "Dialog", function () { return $bn5lc$adobereactspectrumDialog.Dialog; });
|
|
13
|
+
$parcel$export(module.exports, "DialogTrigger", function () { return $bn5lc$adobereactspectrumDialogTrigger.DialogTrigger; });
|
|
14
|
+
$parcel$export(module.exports, "DialogContainer", function () { return $bn5lc$adobereactspectrumDialogContainer.DialogContainer; });
|
|
15
|
+
$parcel$export(module.exports, "useDialogContainer", function () { return $bn5lc$adobereactspectrumDialogContainer.useDialogContainer; });
|
|
17
16
|
/*
|
|
18
17
|
* Copyright 2020 Adobe. All rights reserved.
|
|
19
18
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -31,5 +30,4 @@ $parcel$export(module.exports, "useDialogContainer", () => $1f05ce3abe26c4cc$exp
|
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
|
|
34
|
-
|
|
35
33
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/dialog/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 {AlertDialog} from '@adobe/react-spectrum/AlertDialog';\n\nexport {Dialog} from '@adobe/react-spectrum/Dialog';\nexport {DialogTrigger} from '@adobe/react-spectrum/DialogTrigger';\nexport {DialogContainer, useDialogContainer} from '@adobe/react-spectrum/DialogContainer';\nexport type {SpectrumAlertDialogProps} from '@adobe/react-spectrum/AlertDialog';\nexport type {SpectrumDialogProps} from '@adobe/react-spectrum/Dialog';\nexport type {SpectrumDialogContainerProps, DialogContainerValue} from '@adobe/react-spectrum/DialogContainer';\nexport type {SpectrumDialogTriggerProps, SpectrumDialogClose} from '@adobe/react-spectrum/DialogTrigger';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {AlertDialog as $
|
|
2
|
-
import {Dialog as $
|
|
3
|
-
import {DialogTrigger as $
|
|
4
|
-
import {DialogContainer as $
|
|
5
|
-
import {useDialogContainer as $faffee7da30e8f89$export$a2f2d8fa6720dab1} from "./useDialogContainer.module.js";
|
|
1
|
+
import {AlertDialog as $5c1ddb3f52d41297$re_export$AlertDialog} from "@adobe/react-spectrum/AlertDialog";
|
|
2
|
+
import {Dialog as $5c1ddb3f52d41297$re_export$Dialog} from "@adobe/react-spectrum/Dialog";
|
|
3
|
+
import {DialogTrigger as $5c1ddb3f52d41297$re_export$DialogTrigger} from "@adobe/react-spectrum/DialogTrigger";
|
|
4
|
+
import {DialogContainer as $5c1ddb3f52d41297$re_export$DialogContainer, useDialogContainer as $5c1ddb3f52d41297$re_export$useDialogContainer} from "@adobe/react-spectrum/DialogContainer";
|
|
6
5
|
|
|
7
6
|
/*
|
|
8
7
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -21,6 +20,5 @@ import {useDialogContainer as $faffee7da30e8f89$export$a2f2d8fa6720dab1} from ".
|
|
|
21
20
|
|
|
22
21
|
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog, $99cd51dc4eb569f7$export$3ddf2d174ce01153 as Dialog, $c412c5ea680c1e4f$export$2e1e1122cf0cba88 as DialogTrigger, $2a9f0ad39ddaa8d9$export$547754aada6e339f as DialogContainer, $faffee7da30e8f89$export$a2f2d8fa6720dab1 as useDialogContainer};
|
|
23
|
+
export {$5c1ddb3f52d41297$re_export$AlertDialog as AlertDialog, $5c1ddb3f52d41297$re_export$Dialog as Dialog, $5c1ddb3f52d41297$re_export$DialogTrigger as DialogTrigger, $5c1ddb3f52d41297$re_export$DialogContainer as DialogContainer, $5c1ddb3f52d41297$re_export$useDialogContainer as useDialogContainer};
|
|
26
24
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/dialog/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 {AlertDialog} from '@adobe/react-spectrum/AlertDialog';\n\nexport {Dialog} from '@adobe/react-spectrum/Dialog';\nexport {DialogTrigger} from '@adobe/react-spectrum/DialogTrigger';\nexport {DialogContainer, useDialogContainer} from '@adobe/react-spectrum/DialogContainer';\nexport type {SpectrumAlertDialogProps} from '@adobe/react-spectrum/AlertDialog';\nexport type {SpectrumDialogProps} from '@adobe/react-spectrum/Dialog';\nexport type {SpectrumDialogContainerProps, DialogContainerValue} from '@adobe/react-spectrum/DialogContainer';\nexport type {SpectrumDialogTriggerProps, SpectrumDialogClose} from '@adobe/react-spectrum/DialogTrigger';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { AlertDialog } from '@adobe/react-spectrum/AlertDialog';
|
|
2
|
+
export { Dialog } from '@adobe/react-spectrum/Dialog';
|
|
3
|
+
export { DialogTrigger } from '@adobe/react-spectrum/DialogTrigger';
|
|
4
|
+
export { DialogContainer, useDialogContainer } from '@adobe/react-spectrum/DialogContainer';
|
|
5
|
+
export type { SpectrumAlertDialogProps } from '@adobe/react-spectrum/AlertDialog';
|
|
6
|
+
export type { SpectrumDialogProps } from '@adobe/react-spectrum/Dialog';
|
|
7
|
+
export type { SpectrumDialogContainerProps, DialogContainerValue } from '@adobe/react-spectrum/DialogContainer';
|
|
8
|
+
export type { SpectrumDialogTriggerProps, SpectrumDialogClose } from '@adobe/react-spectrum/DialogTrigger';
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/dialog",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.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,53 +24,22 @@
|
|
|
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
|
-
"@react-aria/i18n": "^3.12.15",
|
|
45
|
-
"@react-aria/interactions": "^3.27.0",
|
|
46
|
-
"@react-aria/overlays": "^3.31.1",
|
|
47
|
-
"@react-aria/utils": "^3.33.0",
|
|
48
|
-
"@react-spectrum/button": "^3.17.6",
|
|
49
|
-
"@react-spectrum/buttongroup": "^3.6.28",
|
|
50
|
-
"@react-spectrum/divider": "^3.5.29",
|
|
51
|
-
"@react-spectrum/layout": "^3.6.21",
|
|
52
|
-
"@react-spectrum/overlays": "^5.9.2",
|
|
53
|
-
"@react-spectrum/text": "^3.5.24",
|
|
54
|
-
"@react-spectrum/utils": "^3.12.11",
|
|
55
|
-
"@react-spectrum/view": "^3.6.25",
|
|
56
|
-
"@react-stately/overlays": "^3.6.22",
|
|
57
|
-
"@react-types/button": "^3.15.0",
|
|
58
|
-
"@react-types/dialog": "^3.5.23",
|
|
59
|
-
"@react-types/shared": "^3.33.0",
|
|
60
|
-
"@spectrum-icons/ui": "^3.6.22",
|
|
34
|
+
"@adobe/react-spectrum": "3.47.0",
|
|
61
35
|
"@swc/helpers": "^0.5.0"
|
|
62
36
|
},
|
|
63
|
-
"devDependencies": {
|
|
64
|
-
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
|
|
65
|
-
"@react-spectrum/test-utils-internal": "3.0.0-alpha.1"
|
|
66
|
-
},
|
|
67
37
|
"peerDependencies": {
|
|
68
|
-
"@react-spectrum/provider": "^3.0.0",
|
|
69
38
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
70
39
|
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
71
40
|
},
|
|
72
41
|
"publishConfig": {
|
|
73
42
|
"access": "public"
|
|
74
43
|
},
|
|
75
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
76
45
|
}
|
package/src/index.ts
CHANGED
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
/// <reference types="css-module-types" />
|
|
14
14
|
|
|
15
|
-
export {AlertDialog} from '
|
|
16
|
-
export {Dialog} from './Dialog';
|
|
17
|
-
export {DialogTrigger} from './DialogTrigger';
|
|
18
|
-
export {DialogContainer} from './DialogContainer';
|
|
19
|
-
export {useDialogContainer} from './useDialogContainer';
|
|
15
|
+
export {AlertDialog} from '@adobe/react-spectrum/AlertDialog';
|
|
20
16
|
|
|
21
|
-
export
|
|
22
|
-
export
|
|
17
|
+
export {Dialog} from '@adobe/react-spectrum/Dialog';
|
|
18
|
+
export {DialogTrigger} from '@adobe/react-spectrum/DialogTrigger';
|
|
19
|
+
export {DialogContainer, useDialogContainer} from '@adobe/react-spectrum/DialogContainer';
|
|
20
|
+
export type {SpectrumAlertDialogProps} from '@adobe/react-spectrum/AlertDialog';
|
|
21
|
+
export type {SpectrumDialogProps} from '@adobe/react-spectrum/Dialog';
|
|
22
|
+
export type {SpectrumDialogContainerProps, DialogContainerValue} from '@adobe/react-spectrum/DialogContainer';
|
|
23
|
+
export type {SpectrumDialogTriggerProps, SpectrumDialogClose} from '@adobe/react-spectrum/DialogTrigger';
|
package/dist/AlertDialog.main.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
var $a57fc2323bf98a33$exports = require("./Dialog.main.js");
|
|
2
|
-
var $0eb909ad2388d989$exports = require("./context.main.js");
|
|
3
|
-
var $7827d180f5c8b41b$exports = require("./intlStrings.main.js");
|
|
4
|
-
require("./dialog.1f91a33b.css");
|
|
5
|
-
var $a74c0984b1adb651$exports = require("./dialog_vars_css.main.js");
|
|
6
|
-
var $cXXKy$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
|
|
7
|
-
var $cXXKy$reactspectrumbutton = require("@react-spectrum/button");
|
|
8
|
-
var $cXXKy$reactspectrumbuttongroup = require("@react-spectrum/buttongroup");
|
|
9
|
-
var $cXXKy$reactariautils = require("@react-aria/utils");
|
|
10
|
-
var $cXXKy$reactspectrumutils = require("@react-spectrum/utils");
|
|
11
|
-
var $cXXKy$reactspectrumview = require("@react-spectrum/view");
|
|
12
|
-
var $cXXKy$reactspectrumdivider = require("@react-spectrum/divider");
|
|
13
|
-
var $cXXKy$reactspectrumtext = require("@react-spectrum/text");
|
|
14
|
-
var $cXXKy$react = require("react");
|
|
15
|
-
var $cXXKy$reactariai18n = require("@react-aria/i18n");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function $parcel$interopDefault(a) {
|
|
19
|
-
return a && a.__esModule ? a.default : a;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function $parcel$export(e, n, v, s) {
|
|
23
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
$parcel$export(module.exports, "AlertDialog", () => $66f8653ff750aa27$export$de466dd8317b0b75);
|
|
27
|
-
/*
|
|
28
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
29
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
30
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
31
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
32
|
-
*
|
|
33
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
34
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
35
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
36
|
-
* governing permissions and limitations under the License.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const $66f8653ff750aa27$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $cXXKy$react.forwardRef)(function AlertDialog(props, ref) {
|
|
52
|
-
let { onClose: onClose = ()=>{} } = (0, $cXXKy$react.useContext)((0, $0eb909ad2388d989$exports.DialogContext)) || {};
|
|
53
|
-
let { variant: variant, children: children, primaryActionLabel: primaryActionLabel, secondaryActionLabel: secondaryActionLabel, cancelLabel: cancelLabel, autoFocusButton: autoFocusButton, title: title, isPrimaryActionDisabled: isPrimaryActionDisabled, isSecondaryActionDisabled: isSecondaryActionDisabled, onCancel: onCancel = ()=>{}, onPrimaryAction: onPrimaryAction = ()=>{}, onSecondaryAction: onSecondaryAction = ()=>{}, ...otherProps } = props;
|
|
54
|
-
let { styleProps: styleProps } = (0, $cXXKy$reactspectrumutils.useStyleProps)(otherProps);
|
|
55
|
-
let stringFormatter = (0, $cXXKy$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7827d180f5c8b41b$exports))), '@react-spectrum/dialog');
|
|
56
|
-
let confirmVariant = 'primary';
|
|
57
|
-
if (variant) {
|
|
58
|
-
if (variant === 'confirmation') confirmVariant = 'cta';
|
|
59
|
-
else if (variant === 'destructive') confirmVariant = 'negative';
|
|
60
|
-
}
|
|
61
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $a57fc2323bf98a33$exports.Dialog), {
|
|
62
|
-
UNSAFE_style: styleProps.style,
|
|
63
|
-
UNSAFE_className: (0, $cXXKy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), {
|
|
64
|
-
[`spectrum-Dialog--${variant}`]: variant
|
|
65
|
-
}, styleProps.className),
|
|
66
|
-
isHidden: styleProps.hidden,
|
|
67
|
-
size: "M",
|
|
68
|
-
role: "alertdialog",
|
|
69
|
-
ref: ref,
|
|
70
|
-
...(0, $cXXKy$reactariautils.filterDOMProps)(props)
|
|
71
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumtext.Heading), null, title), (variant === 'error' || variant === 'warning') && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, ($parcel$interopDefault($cXXKy$spectrumiconsuiAlertMedium))), {
|
|
72
|
-
slot: "typeIcon",
|
|
73
|
-
"aria-label": stringFormatter.format('alert')
|
|
74
|
-
}), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumdivider.Divider), null), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumview.Content), null, children), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbuttongroup.ButtonGroup), {
|
|
75
|
-
align: "end"
|
|
76
|
-
}, cancelLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
|
|
77
|
-
variant: "secondary",
|
|
78
|
-
onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onCancel()),
|
|
79
|
-
autoFocus: autoFocusButton === 'cancel',
|
|
80
|
-
"data-testid": "rsp-AlertDialog-cancelButton"
|
|
81
|
-
}, cancelLabel), secondaryActionLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
|
|
82
|
-
variant: "secondary",
|
|
83
|
-
onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onSecondaryAction()),
|
|
84
|
-
isDisabled: isSecondaryActionDisabled,
|
|
85
|
-
autoFocus: autoFocusButton === 'secondary',
|
|
86
|
-
"data-testid": "rsp-AlertDialog-secondaryButton"
|
|
87
|
-
}, secondaryActionLabel), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
|
|
88
|
-
variant: confirmVariant,
|
|
89
|
-
onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onPrimaryAction()),
|
|
90
|
-
isDisabled: isPrimaryActionDisabled,
|
|
91
|
-
autoFocus: autoFocusButton === 'primary',
|
|
92
|
-
"data-testid": "rsp-AlertDialog-confirmButton"
|
|
93
|
-
}, primaryActionLabel)));
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
//# sourceMappingURL=AlertDialog.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAwBM,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAAY,KAA+B,EAAE,GAAW;IACrG,IAAI,WACF,UAAU,KAAO,GAClB,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,uCAAY,MAAM,CAAC;IAElC,IAAI,WACF,OAAO,YACP,QAAQ,sBACR,kBAAkB,wBAClB,oBAAoB,eACpB,WAAW,mBACX,eAAe,SACf,KAAK,2BACL,uBAAuB,6BACvB,yBAAyB,YACzB,WAAW,KAAO,oBAClB,kBAAkB,KAAO,sBACzB,oBAAoB,KAAO,GAC3B,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,IAAI,iBAAiD;IACrD,IAAI,SAAS;QACX,IAAI,YAAY,gBACd,iBAAiB;aACZ,IAAI,YAAY,eACrB,iBAAiB;IAErB;IAEA,qBACE,0DAAC,CAAA,GAAA,gCAAK;QACJ,cAAc,WAAW,KAAK;QAC9B,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YAAC,CAAC,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE;QAAO,GAAG,WAAW,SAAS;QACrG,UAAU,WAAW,MAAM;QAC3B,MAAK;QACL,MAAK;QACL,KAAK;QACJ,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAM;qBACzB,0DAAC,CAAA,GAAA,gCAAM,SAAG,QACT,AAAC,CAAA,YAAY,WAAW,YAAY,SAAQ,mBAC3C,0DAAC,CAAA,GAAA,2DAAU;QACT,MAAK;QACL,cAAY,gBAAgB,MAAM,CAAC;sBAEvC,0DAAC,CAAA,GAAA,mCAAM,wBACP,0DAAC,CAAA,GAAA,gCAAM,SAAG,yBACV,0DAAC,CAAA,GAAA,2CAAU;QAAE,OAAM;OAChB,6BACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,WAAW,oBAAoB;QAC/B,eAAY;OACX,cAGJ,sCACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;QAC/B,eAAY;OACX,qCAGL,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;QAC/B,eAAY;OACX;AAKX","sources":["packages/@react-spectrum/dialog/src/AlertDialog.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} from '@react-spectrum/button';\nimport {ButtonGroup} from '@react-spectrum/buttongroup';\nimport {chain, filterDOMProps} from '@react-aria/utils';\nimport {classNames, useStyleProps} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {Dialog} from './Dialog';\nimport {DialogContext, DialogContextValue} from './context';\nimport {Divider} from '@react-spectrum/divider';\nimport {DOMRef} from '@react-types/shared';\nimport {Heading} from '@react-spectrum/text';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {forwardRef, useContext} from 'react';\nimport {SpectrumAlertDialogProps} from '@react-types/dialog';\nimport {SpectrumButtonProps} from '@react-types/button';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {\n let {\n onClose = () => {}\n } = useContext(DialogContext) || {} as DialogContextValue;\n\n let {\n variant,\n children,\n primaryActionLabel,\n secondaryActionLabel,\n cancelLabel,\n autoFocusButton,\n title,\n isPrimaryActionDisabled,\n isSecondaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n\n let confirmVariant: SpectrumButtonProps['variant'] = 'primary';\n if (variant) {\n if (variant === 'confirmation') {\n confirmVariant = 'cta';\n } else if (variant === 'destructive') {\n confirmVariant = 'negative';\n }\n }\n\n return (\n <Dialog\n UNSAFE_style={styleProps.style}\n UNSAFE_className={classNames(styles, {[`spectrum-Dialog--${variant}`]: variant}, styleProps.className)}\n isHidden={styleProps.hidden}\n size=\"M\"\n role=\"alertdialog\"\n ref={ref}\n {...filterDOMProps(props)}>\n <Heading>{title}</Heading>\n {(variant === 'error' || variant === 'warning') &&\n <AlertMedium\n slot=\"typeIcon\"\n aria-label={stringFormatter.format('alert')} />\n }\n <Divider />\n <Content>{children}</Content>\n <ButtonGroup align=\"end\">\n {cancelLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onCancel())}\n autoFocus={autoFocusButton === 'cancel'}\n data-testid=\"rsp-AlertDialog-cancelButton\">\n {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}\n data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.main.js.map"}
|
package/dist/AlertDialog.mjs
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import {Dialog as $99cd51dc4eb569f7$export$3ddf2d174ce01153} from "./Dialog.mjs";
|
|
2
|
-
import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.mjs";
|
|
3
|
-
import $7TaMJ$intlStringsmodulejs from "./intlStrings.mjs";
|
|
4
|
-
import "./dialog.1f91a33b.css";
|
|
5
|
-
import $7TaMJ$dialog_vars_cssmodulejs from "./dialog_vars_css.mjs";
|
|
6
|
-
import $7TaMJ$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
|
7
|
-
import {Button as $7TaMJ$Button} from "@react-spectrum/button";
|
|
8
|
-
import {ButtonGroup as $7TaMJ$ButtonGroup} from "@react-spectrum/buttongroup";
|
|
9
|
-
import {filterDOMProps as $7TaMJ$filterDOMProps, chain as $7TaMJ$chain} from "@react-aria/utils";
|
|
10
|
-
import {useStyleProps as $7TaMJ$useStyleProps, classNames as $7TaMJ$classNames} from "@react-spectrum/utils";
|
|
11
|
-
import {Content as $7TaMJ$Content} from "@react-spectrum/view";
|
|
12
|
-
import {Divider as $7TaMJ$Divider} from "@react-spectrum/divider";
|
|
13
|
-
import {Heading as $7TaMJ$Heading} from "@react-spectrum/text";
|
|
14
|
-
import $7TaMJ$react, {forwardRef as $7TaMJ$forwardRef, useContext as $7TaMJ$useContext} from "react";
|
|
15
|
-
import {useLocalizedStringFormatter as $7TaMJ$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function $parcel$interopDefault(a) {
|
|
19
|
-
return a && a.__esModule ? a.default : a;
|
|
20
|
-
}
|
|
21
|
-
/*
|
|
22
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
23
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
24
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
25
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
-
*
|
|
27
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
-
* governing permissions and limitations under the License.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)(function AlertDialog(props, ref) {
|
|
46
|
-
let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
|
|
47
|
-
let { variant: variant, children: children, primaryActionLabel: primaryActionLabel, secondaryActionLabel: secondaryActionLabel, cancelLabel: cancelLabel, autoFocusButton: autoFocusButton, title: title, isPrimaryActionDisabled: isPrimaryActionDisabled, isSecondaryActionDisabled: isSecondaryActionDisabled, onCancel: onCancel = ()=>{}, onPrimaryAction: onPrimaryAction = ()=>{}, onSecondaryAction: onSecondaryAction = ()=>{}, ...otherProps } = props;
|
|
48
|
-
let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
|
|
49
|
-
let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))), '@react-spectrum/dialog');
|
|
50
|
-
let confirmVariant = 'primary';
|
|
51
|
-
if (variant) {
|
|
52
|
-
if (variant === 'confirmation') confirmVariant = 'cta';
|
|
53
|
-
else if (variant === 'destructive') confirmVariant = 'negative';
|
|
54
|
-
}
|
|
55
|
-
return /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $99cd51dc4eb569f7$export$3ddf2d174ce01153), {
|
|
56
|
-
UNSAFE_style: styleProps.style,
|
|
57
|
-
UNSAFE_className: (0, $7TaMJ$classNames)((0, ($parcel$interopDefault($7TaMJ$dialog_vars_cssmodulejs))), {
|
|
58
|
-
[`spectrum-Dialog--${variant}`]: variant
|
|
59
|
-
}, styleProps.className),
|
|
60
|
-
isHidden: styleProps.hidden,
|
|
61
|
-
size: "M",
|
|
62
|
-
role: "alertdialog",
|
|
63
|
-
ref: ref,
|
|
64
|
-
...(0, $7TaMJ$filterDOMProps)(props)
|
|
65
|
-
}, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant === 'error' || variant === 'warning') && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$spectrumiconsuiAlertMedium), {
|
|
66
|
-
slot: "typeIcon",
|
|
67
|
-
"aria-label": stringFormatter.format('alert')
|
|
68
|
-
}), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Divider), null), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Content), null, children), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$ButtonGroup), {
|
|
69
|
-
align: "end"
|
|
70
|
-
}, cancelLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
71
|
-
variant: "secondary",
|
|
72
|
-
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onCancel()),
|
|
73
|
-
autoFocus: autoFocusButton === 'cancel',
|
|
74
|
-
"data-testid": "rsp-AlertDialog-cancelButton"
|
|
75
|
-
}, cancelLabel), secondaryActionLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
76
|
-
variant: "secondary",
|
|
77
|
-
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onSecondaryAction()),
|
|
78
|
-
isDisabled: isSecondaryActionDisabled,
|
|
79
|
-
autoFocus: autoFocusButton === 'secondary',
|
|
80
|
-
"data-testid": "rsp-AlertDialog-secondaryButton"
|
|
81
|
-
}, secondaryActionLabel), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
82
|
-
variant: confirmVariant,
|
|
83
|
-
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onPrimaryAction()),
|
|
84
|
-
isDisabled: isPrimaryActionDisabled,
|
|
85
|
-
autoFocus: autoFocusButton === 'primary',
|
|
86
|
-
"data-testid": "rsp-AlertDialog-confirmButton"
|
|
87
|
-
}, primaryActionLabel)));
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog};
|
|
92
|
-
//# sourceMappingURL=AlertDialog.module.js.map
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import {Dialog as $99cd51dc4eb569f7$export$3ddf2d174ce01153} from "./Dialog.module.js";
|
|
2
|
-
import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.module.js";
|
|
3
|
-
import $7TaMJ$intlStringsmodulejs from "./intlStrings.module.js";
|
|
4
|
-
import "./dialog.1f91a33b.css";
|
|
5
|
-
import $7TaMJ$dialog_vars_cssmodulejs from "./dialog_vars_css.module.js";
|
|
6
|
-
import $7TaMJ$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
|
7
|
-
import {Button as $7TaMJ$Button} from "@react-spectrum/button";
|
|
8
|
-
import {ButtonGroup as $7TaMJ$ButtonGroup} from "@react-spectrum/buttongroup";
|
|
9
|
-
import {filterDOMProps as $7TaMJ$filterDOMProps, chain as $7TaMJ$chain} from "@react-aria/utils";
|
|
10
|
-
import {useStyleProps as $7TaMJ$useStyleProps, classNames as $7TaMJ$classNames} from "@react-spectrum/utils";
|
|
11
|
-
import {Content as $7TaMJ$Content} from "@react-spectrum/view";
|
|
12
|
-
import {Divider as $7TaMJ$Divider} from "@react-spectrum/divider";
|
|
13
|
-
import {Heading as $7TaMJ$Heading} from "@react-spectrum/text";
|
|
14
|
-
import $7TaMJ$react, {forwardRef as $7TaMJ$forwardRef, useContext as $7TaMJ$useContext} from "react";
|
|
15
|
-
import {useLocalizedStringFormatter as $7TaMJ$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function $parcel$interopDefault(a) {
|
|
19
|
-
return a && a.__esModule ? a.default : a;
|
|
20
|
-
}
|
|
21
|
-
/*
|
|
22
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
23
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
24
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
25
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
-
*
|
|
27
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
-
* governing permissions and limitations under the License.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)(function AlertDialog(props, ref) {
|
|
46
|
-
let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
|
|
47
|
-
let { variant: variant, children: children, primaryActionLabel: primaryActionLabel, secondaryActionLabel: secondaryActionLabel, cancelLabel: cancelLabel, autoFocusButton: autoFocusButton, title: title, isPrimaryActionDisabled: isPrimaryActionDisabled, isSecondaryActionDisabled: isSecondaryActionDisabled, onCancel: onCancel = ()=>{}, onPrimaryAction: onPrimaryAction = ()=>{}, onSecondaryAction: onSecondaryAction = ()=>{}, ...otherProps } = props;
|
|
48
|
-
let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
|
|
49
|
-
let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))), '@react-spectrum/dialog');
|
|
50
|
-
let confirmVariant = 'primary';
|
|
51
|
-
if (variant) {
|
|
52
|
-
if (variant === 'confirmation') confirmVariant = 'cta';
|
|
53
|
-
else if (variant === 'destructive') confirmVariant = 'negative';
|
|
54
|
-
}
|
|
55
|
-
return /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $99cd51dc4eb569f7$export$3ddf2d174ce01153), {
|
|
56
|
-
UNSAFE_style: styleProps.style,
|
|
57
|
-
UNSAFE_className: (0, $7TaMJ$classNames)((0, ($parcel$interopDefault($7TaMJ$dialog_vars_cssmodulejs))), {
|
|
58
|
-
[`spectrum-Dialog--${variant}`]: variant
|
|
59
|
-
}, styleProps.className),
|
|
60
|
-
isHidden: styleProps.hidden,
|
|
61
|
-
size: "M",
|
|
62
|
-
role: "alertdialog",
|
|
63
|
-
ref: ref,
|
|
64
|
-
...(0, $7TaMJ$filterDOMProps)(props)
|
|
65
|
-
}, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant === 'error' || variant === 'warning') && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$spectrumiconsuiAlertMedium), {
|
|
66
|
-
slot: "typeIcon",
|
|
67
|
-
"aria-label": stringFormatter.format('alert')
|
|
68
|
-
}), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Divider), null), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Content), null, children), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$ButtonGroup), {
|
|
69
|
-
align: "end"
|
|
70
|
-
}, cancelLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
71
|
-
variant: "secondary",
|
|
72
|
-
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onCancel()),
|
|
73
|
-
autoFocus: autoFocusButton === 'cancel',
|
|
74
|
-
"data-testid": "rsp-AlertDialog-cancelButton"
|
|
75
|
-
}, cancelLabel), secondaryActionLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
76
|
-
variant: "secondary",
|
|
77
|
-
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onSecondaryAction()),
|
|
78
|
-
isDisabled: isSecondaryActionDisabled,
|
|
79
|
-
autoFocus: autoFocusButton === 'secondary',
|
|
80
|
-
"data-testid": "rsp-AlertDialog-secondaryButton"
|
|
81
|
-
}, secondaryActionLabel), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
82
|
-
variant: confirmVariant,
|
|
83
|
-
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onPrimaryAction()),
|
|
84
|
-
isDisabled: isPrimaryActionDisabled,
|
|
85
|
-
autoFocus: autoFocusButton === 'primary',
|
|
86
|
-
"data-testid": "rsp-AlertDialog-confirmButton"
|
|
87
|
-
}, primaryActionLabel)));
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog};
|
|
92
|
-
//# sourceMappingURL=AlertDialog.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAwBM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAAY,KAA+B,EAAE,GAAW;IACrG,IAAI,WACF,UAAU,KAAO,GAClB,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAY,MAAM,CAAC;IAElC,IAAI,WACF,OAAO,YACP,QAAQ,sBACR,kBAAkB,wBAClB,oBAAoB,eACpB,WAAW,mBACX,eAAe,SACf,KAAK,2BACL,uBAAuB,6BACvB,yBAAyB,YACzB,WAAW,KAAO,oBAClB,kBAAkB,KAAO,sBACzB,oBAAoB,KAAO,GAC3B,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAEhE,IAAI,iBAAiD;IACrD,IAAI,SAAS;QACX,IAAI,YAAY,gBACd,iBAAiB;aACZ,IAAI,YAAY,eACrB,iBAAiB;IAErB;IAEA,qBACE,gCAAC,CAAA,GAAA,yCAAK;QACJ,cAAc,WAAW,KAAK;QAC9B,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;YAAC,CAAC,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE;QAAO,GAAG,WAAW,SAAS;QACrG,UAAU,WAAW,MAAM;QAC3B,MAAK;QACL,MAAK;QACL,KAAK;QACJ,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;qBACzB,gCAAC,CAAA,GAAA,cAAM,SAAG,QACT,AAAC,CAAA,YAAY,WAAW,YAAY,SAAQ,mBAC3C,gCAAC,CAAA,GAAA,iCAAU;QACT,MAAK;QACL,cAAY,gBAAgB,MAAM,CAAC;sBAEvC,gCAAC,CAAA,GAAA,cAAM,wBACP,gCAAC,CAAA,GAAA,cAAM,SAAG,yBACV,gCAAC,CAAA,GAAA,kBAAU;QAAE,OAAM;OAChB,6BACC,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,WAAW,oBAAoB;QAC/B,eAAY;OACX,cAGJ,sCACC,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;QAC/B,eAAY;OACX,qCAGL,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;QAC/B,eAAY;OACX;AAKX","sources":["packages/@react-spectrum/dialog/src/AlertDialog.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} from '@react-spectrum/button';\nimport {ButtonGroup} from '@react-spectrum/buttongroup';\nimport {chain, filterDOMProps} from '@react-aria/utils';\nimport {classNames, useStyleProps} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {Dialog} from './Dialog';\nimport {DialogContext, DialogContextValue} from './context';\nimport {Divider} from '@react-spectrum/divider';\nimport {DOMRef} from '@react-types/shared';\nimport {Heading} from '@react-spectrum/text';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {forwardRef, useContext} from 'react';\nimport {SpectrumAlertDialogProps} from '@react-types/dialog';\nimport {SpectrumButtonProps} from '@react-types/button';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {\n let {\n onClose = () => {}\n } = useContext(DialogContext) || {} as DialogContextValue;\n\n let {\n variant,\n children,\n primaryActionLabel,\n secondaryActionLabel,\n cancelLabel,\n autoFocusButton,\n title,\n isPrimaryActionDisabled,\n isSecondaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n\n let confirmVariant: SpectrumButtonProps['variant'] = 'primary';\n if (variant) {\n if (variant === 'confirmation') {\n confirmVariant = 'cta';\n } else if (variant === 'destructive') {\n confirmVariant = 'negative';\n }\n }\n\n return (\n <Dialog\n UNSAFE_style={styleProps.style}\n UNSAFE_className={classNames(styles, {[`spectrum-Dialog--${variant}`]: variant}, styleProps.className)}\n isHidden={styleProps.hidden}\n size=\"M\"\n role=\"alertdialog\"\n ref={ref}\n {...filterDOMProps(props)}>\n <Heading>{title}</Heading>\n {(variant === 'error' || variant === 'warning') &&\n <AlertMedium\n slot=\"typeIcon\"\n aria-label={stringFormatter.format('alert')} />\n }\n <Divider />\n <Content>{children}</Content>\n <ButtonGroup align=\"end\">\n {cancelLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onCancel())}\n autoFocus={autoFocusButton === 'cancel'}\n data-testid=\"rsp-AlertDialog-cancelButton\">\n {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}\n data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.module.js.map"}
|