@react-spectrum/dialog 3.8.16 → 3.8.18

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.
@@ -1,7 +1,7 @@
1
1
  var $a57fc2323bf98a33$exports = require("./Dialog.main.js");
2
2
  var $0eb909ad2388d989$exports = require("./context.main.js");
3
3
  var $7827d180f5c8b41b$exports = require("./intlStrings.main.js");
4
- require("./vars.cfc79477.css");
4
+ require("./vars.895d8ff6.css");
5
5
  var $a74c0984b1adb651$exports = require("./dialog_vars_css.main.js");
6
6
  var $cXXKy$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
7
7
  var $cXXKy$reactspectrumbutton = require("@react-spectrum/button");
@@ -48,9 +48,7 @@ $parcel$export(module.exports, "AlertDialog", () => $66f8653ff750aa27$export$de4
48
48
 
49
49
 
50
50
 
51
- /**
52
- * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
53
- */ function $66f8653ff750aa27$var$AlertDialog(props, ref) {
51
+ const $66f8653ff750aa27$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $cXXKy$react.forwardRef)(function AlertDialog(props, ref) {
54
52
  let { onClose: onClose = ()=>{} } = (0, $cXXKy$react.useContext)((0, $0eb909ad2388d989$exports.DialogContext)) || {};
55
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;
56
54
  let { styleProps: styleProps } = (0, $cXXKy$reactspectrumutils.useStyleProps)(otherProps);
@@ -89,10 +87,7 @@ $parcel$export(module.exports, "AlertDialog", () => $66f8653ff750aa27$export$de4
89
87
  isDisabled: isPrimaryActionDisabled,
90
88
  autoFocus: autoFocusButton === 'primary'
91
89
  }, primaryActionLabel)));
92
- }
93
- /**
94
- * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
95
- */ let $66f8653ff750aa27$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $cXXKy$react.forwardRef)($66f8653ff750aa27$var$AlertDialog);
90
+ });
96
91
 
97
92
 
98
93
  //# sourceMappingURL=AlertDialog.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqBD;;CAEC,GACD,SAAS,kCAAY,KAA+B,EAAE,GAAW;IAC/D,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;qBACL,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;OAC9B,cAGJ,sCACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B,qCAGL,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,uBAAS,EAAE","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} 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 */\nfunction 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 <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 {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n}\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nlet _AlertDialog = forwardRef(AlertDialog);\nexport {_AlertDialog as AlertDialog};\n"],"names":[],"version":3,"file":"AlertDialog.main.js.map"}
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;qBACL,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;OAC9B,cAGJ,sCACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B,qCAGL,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B;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} 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 <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 {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.main.js.map"}
@@ -1,7 +1,7 @@
1
1
  import {Dialog as $99cd51dc4eb569f7$export$3ddf2d174ce01153} from "./Dialog.mjs";
2
2
  import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.mjs";
3
3
  import $7TaMJ$intlStringsmodulejs from "./intlStrings.mjs";
4
- import "./vars.cfc79477.css";
4
+ import "./vars.895d8ff6.css";
5
5
  import $7TaMJ$dialog_vars_cssmodulejs from "./dialog_vars_css.mjs";
6
6
  import $7TaMJ$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
7
7
  import {Button as $7TaMJ$Button} from "@react-spectrum/button";
@@ -11,7 +11,7 @@ import {useStyleProps as $7TaMJ$useStyleProps, classNames as $7TaMJ$classNames}
11
11
  import {Content as $7TaMJ$Content} from "@react-spectrum/view";
12
12
  import {Divider as $7TaMJ$Divider} from "@react-spectrum/divider";
13
13
  import {Heading as $7TaMJ$Heading} from "@react-spectrum/text";
14
- import $7TaMJ$react, {useContext as $7TaMJ$useContext, forwardRef as $7TaMJ$forwardRef} from "react";
14
+ import $7TaMJ$react, {forwardRef as $7TaMJ$forwardRef, useContext as $7TaMJ$useContext} from "react";
15
15
  import {useLocalizedStringFormatter as $7TaMJ$useLocalizedStringFormatter} from "@react-aria/i18n";
16
16
 
17
17
 
@@ -42,9 +42,7 @@ function $parcel$interopDefault(a) {
42
42
 
43
43
 
44
44
 
45
- /**
46
- * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
47
- */ function $2a8395160fff9af3$var$AlertDialog(props, ref) {
45
+ const $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)(function AlertDialog(props, ref) {
48
46
  let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
49
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;
50
48
  let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
@@ -83,10 +81,7 @@ function $parcel$interopDefault(a) {
83
81
  isDisabled: isPrimaryActionDisabled,
84
82
  autoFocus: autoFocusButton === 'primary'
85
83
  }, primaryActionLabel)));
86
- }
87
- /**
88
- * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
89
- */ let $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)($2a8395160fff9af3$var$AlertDialog);
84
+ });
90
85
 
91
86
 
92
87
  export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog};
@@ -1,7 +1,7 @@
1
1
  import {Dialog as $99cd51dc4eb569f7$export$3ddf2d174ce01153} from "./Dialog.module.js";
2
2
  import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.module.js";
3
3
  import $7TaMJ$intlStringsmodulejs from "./intlStrings.module.js";
4
- import "./vars.cfc79477.css";
4
+ import "./vars.895d8ff6.css";
5
5
  import $7TaMJ$dialog_vars_cssmodulejs from "./dialog_vars_css.module.js";
6
6
  import $7TaMJ$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
7
7
  import {Button as $7TaMJ$Button} from "@react-spectrum/button";
@@ -11,7 +11,7 @@ import {useStyleProps as $7TaMJ$useStyleProps, classNames as $7TaMJ$classNames}
11
11
  import {Content as $7TaMJ$Content} from "@react-spectrum/view";
12
12
  import {Divider as $7TaMJ$Divider} from "@react-spectrum/divider";
13
13
  import {Heading as $7TaMJ$Heading} from "@react-spectrum/text";
14
- import $7TaMJ$react, {useContext as $7TaMJ$useContext, forwardRef as $7TaMJ$forwardRef} from "react";
14
+ import $7TaMJ$react, {forwardRef as $7TaMJ$forwardRef, useContext as $7TaMJ$useContext} from "react";
15
15
  import {useLocalizedStringFormatter as $7TaMJ$useLocalizedStringFormatter} from "@react-aria/i18n";
16
16
 
17
17
 
@@ -42,9 +42,7 @@ function $parcel$interopDefault(a) {
42
42
 
43
43
 
44
44
 
45
- /**
46
- * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
47
- */ function $2a8395160fff9af3$var$AlertDialog(props, ref) {
45
+ const $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)(function AlertDialog(props, ref) {
48
46
  let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
49
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;
50
48
  let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
@@ -83,10 +81,7 @@ function $parcel$interopDefault(a) {
83
81
  isDisabled: isPrimaryActionDisabled,
84
82
  autoFocus: autoFocusButton === 'primary'
85
83
  }, primaryActionLabel)));
86
- }
87
- /**
88
- * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
89
- */ let $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)($2a8395160fff9af3$var$AlertDialog);
84
+ });
90
85
 
91
86
 
92
87
  export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog};
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqBD;;CAEC,GACD,SAAS,kCAAY,KAA+B,EAAE,GAAW;IAC/D,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;qBACL,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;OAC9B,cAGJ,sCACC,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B,qCAGL,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,iBAAS,EAAE","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} 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 */\nfunction 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 <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 {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n}\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nlet _AlertDialog = forwardRef(AlertDialog);\nexport {_AlertDialog as AlertDialog};\n"],"names":[],"version":3,"file":"AlertDialog.module.js.map"}
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,GAA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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} 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 <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 {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.module.js.map"}
@@ -1,6 +1,6 @@
1
1
  var $0eb909ad2388d989$exports = require("./context.main.js");
2
2
  var $7827d180f5c8b41b$exports = require("./intlStrings.main.js");
3
- require("./vars.cfc79477.css");
3
+ require("./vars.895d8ff6.css");
4
4
  var $a74c0984b1adb651$exports = require("./dialog_vars_css.main.js");
5
5
  var $1DWg7$reactspectrumbutton = require("@react-spectrum/button");
6
6
  var $1DWg7$reactspectrumutils = require("@react-spectrum/utils");
@@ -49,7 +49,7 @@ let $a57fc2323bf98a33$var$sizeMap = {
49
49
  fullscreen: 'fullscreen',
50
50
  fullscreenTakeover: 'fullscreenTakeover'
51
51
  };
52
- function $a57fc2323bf98a33$var$Dialog(props, ref) {
52
+ const $a57fc2323bf98a33$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).forwardRef(function Dialog(props, ref) {
53
53
  props = (0, $1DWg7$reactspectrumutils.useSlotProps)(props, 'dialog');
54
54
  let { type: type = 'modal', ...contextProps } = (0, $1DWg7$react.useContext)((0, $0eb909ad2388d989$exports.DialogContext)) || {};
55
55
  let { children: children, isDismissable: isDismissable = contextProps.isDismissable, onDismiss: onDismiss = contextProps.onClose, size: size, ...otherProps } = props;
@@ -125,11 +125,7 @@ function $a57fc2323bf98a33$var$Dialog(props, ref) {
125
125
  "aria-label": stringFormatter.format('dismiss'),
126
126
  onPress: onDismiss
127
127
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement((0, ($parcel$interopDefault($1DWg7$spectrumiconsuiCrossLarge))), null))));
128
- }
129
- /**
130
- * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
131
- * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
132
- */ let $a57fc2323bf98a33$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).forwardRef($a57fc2323bf98a33$var$Dialog);
128
+ });
133
129
 
134
130
 
135
131
  //# sourceMappingURL=Dialog.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAyBD,IAAI,gCAAU;IACZ,GAAG;IACH,GAAG;IACH,GAAG;IACH,YAAY;IACZ,oBAAoB;AACtB;AAEA,SAAS,6BAAO,KAA0B,EAAE,GAAW;IACrD,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,QACF,OAAO,SACP,GAAG,cACJ,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,uCAAY,MAAM,CAAC;IAClC,IAAI,YACF,QAAQ,iBACR,gBAAgB,aAAa,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AA8B;QACvD,SAAA;QACA,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS;qBACT,0DAAC,CAAA,GAAA,0DAAS;AAMtB;AAEA;;;CAGC,GACD,IAAI,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/dialog/src/Dialog.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 {ActionButton} from '@react-spectrum/button';\nimport {\n classNames,\n SlotProvider,\n unwrapDOMRef,\n useDOMRef,\n useHasChild,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DialogContext, DialogContextValue} from './context';\nimport {DOMRef} from '@react-types/shared';\nimport {Grid} from '@react-spectrum/layout';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useMemo, useRef} from 'react';\nimport {SpectrumDialogProps} from '@react-types/dialog';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useDialog} from '@react-aria/dialog';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nlet sizeMap = {\n S: 'small',\n M: 'medium',\n L: 'large',\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nfunction Dialog(props: SpectrumDialogProps, ref: DOMRef) {\n props = useSlotProps(props, 'dialog');\n let {\n type = 'modal',\n ...contextProps\n } = useContext(DialogContext) || {} as DialogContextValue;\n let {\n children,\n isDismissable = contextProps.isDismissable,\n onDismiss = contextProps.onClose,\n size,\n ...otherProps\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef(null);\n let sizeVariant = sizeMap[type] || sizeMap[size];\n let {dialogProps, titleProps} = useDialog(mergeProps(contextProps, props), domRef);\n\n let hasHeader = useHasChild(`.${styles['spectrum-Dialog-header']}`, unwrapDOMRef(gridRef));\n let hasHeading = useHasChild(`.${styles['spectrum-Dialog-heading']}`, unwrapDOMRef(gridRef));\n let hasFooter = useHasChild(`.${styles['spectrum-Dialog-footer']}`, unwrapDOMRef(gridRef));\n let hasTypeIcon = useHasChild(`.${styles['spectrum-Dialog-typeIcon']}`, unwrapDOMRef(gridRef));\n\n let slots = useMemo(() => ({\n hero: {UNSAFE_className: styles['spectrum-Dialog-hero']},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-heading', {'spectrum-Dialog-heading--noHeader': !hasHeader, 'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon}), level: 2, ...titleProps},\n header: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-header', {'spectrum-Dialog-header--noHeading': !hasHeading, 'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon})},\n typeIcon: {UNSAFE_className: styles['spectrum-Dialog-typeIcon']},\n divider: {UNSAFE_className: styles['spectrum-Dialog-divider'], size: 'M'},\n content: {UNSAFE_className: styles['spectrum-Dialog-content']},\n footer: {UNSAFE_className: styles['spectrum-Dialog-footer']},\n buttonGroup: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-buttonGroup', {'spectrum-Dialog-buttonGroup--noFooter': !hasFooter}), align: 'end'}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [hasFooter, hasHeader, titleProps]);\n\n return (\n <section\n {...styleProps}\n {...dialogProps}\n className={classNames(\n styles,\n 'spectrum-Dialog',\n {\n [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,\n 'spectrum-Dialog--dismissable': isDismissable\n },\n styleProps.className\n )}\n ref={domRef}>\n <Grid ref={gridRef} UNSAFE_className={styles['spectrum-Dialog-grid']}>\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n {isDismissable &&\n <ActionButton\n UNSAFE_className={styles['spectrum-Dialog-closeButton']}\n isQuiet\n aria-label={stringFormatter.format('dismiss')}\n onPress={onDismiss}>\n <CrossLarge />\n </ActionButton>\n }\n </Grid>\n </section>\n );\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = React.forwardRef(Dialog);\nexport {_Dialog as Dialog};\n"],"names":[],"version":3,"file":"Dialog.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAyBD,IAAI,gCAAU;IACZ,GAAG;IACH,GAAG;IACH,GAAG;IACH,YAAY;IACZ,oBAAoB;AACtB;AAMO,MAAM,0DAAS,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,OAAO,KAA0B,EAAE,GAAW;IAC5F,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,QACF,OAAO,SACP,GAAG,cACJ,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,uCAAY,MAAM,CAAC;IAClC,IAAI,YACF,QAAQ,iBACR,gBAAgB,aAAa,aAAa,aAC1C,YAAY,aAAa,OAAO,QAChC,IAAI,EACJ,GAAG,YACJ,GAAG;IACJ,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,OAAO,SAAS,YAAa,QAAQ,MAAQ,QAAQ;IAErD,IAAI,SAAS,CAA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C;gBAAW;YAAE;YAC/K,UAAU;gBAAC,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,2BAA2B;YAAA;YAC/D,SAAS;gBAAC,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,0BAA0B;gBAAE,MAAM;YAAG;YACxE,SAAS;gBAAC,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,0BAA0B;YAAA;YAC7D,QAAQ;gBAAC,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,yBAAyB;YAAA;YAC3D,aAAa;gBAAC,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,+BAA+B;oBAAC,yCAAyC,CAAC;gBAAS;gBAAI,OAAO;YAAK;QAExJ,CAAA,GAAI;QAAC;QAAW;QAAW;KAAW;IAEtC,qBACE,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,WAAW;QACf,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,mBACA;YACE,CAAC,CAAC,iBAAiB,EAAE,aAAa,CAAC,EAAE;YACrC,gCAAgC;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,0DAAC,CAAA,GAAA,+BAAG;QAAE,KAAK;QAAS,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,uBAAuB;qBAClE,0DAAC,CAAA,GAAA,sCAAW;QAAE,OAAO;OAClB,WAEF,+BACC,0DAAC,CAAA,GAAA,uCAAW;QACV,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,8BAA8B;QACvD,SAAA;QACA,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS;qBACT,0DAAC,CAAA,GAAA,0DAAS;AAMtB","sources":["packages/@react-spectrum/dialog/src/Dialog.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 {ActionButton} from '@react-spectrum/button';\nimport {\n classNames,\n SlotProvider,\n unwrapDOMRef,\n useDOMRef,\n useHasChild,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DialogContext, DialogContextValue} from './context';\nimport {DOMRef} from '@react-types/shared';\nimport {Grid} from '@react-spectrum/layout';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useMemo, useRef} from 'react';\nimport {SpectrumDialogProps} from '@react-types/dialog';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useDialog} from '@react-aria/dialog';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nlet sizeMap = {\n S: 'small',\n M: 'medium',\n L: 'large',\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nexport const Dialog = React.forwardRef(function Dialog(props: SpectrumDialogProps, ref: DOMRef) {\n props = useSlotProps(props, 'dialog');\n let {\n type = 'modal',\n ...contextProps\n } = useContext(DialogContext) || {} as DialogContextValue;\n let {\n children,\n isDismissable = contextProps.isDismissable,\n onDismiss = contextProps.onClose,\n size,\n ...otherProps\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef(null);\n let sizeVariant = sizeMap[type] || sizeMap[size];\n let {dialogProps, titleProps} = useDialog(mergeProps(contextProps, props), domRef);\n\n let hasHeader = useHasChild(`.${styles['spectrum-Dialog-header']}`, unwrapDOMRef(gridRef));\n let hasHeading = useHasChild(`.${styles['spectrum-Dialog-heading']}`, unwrapDOMRef(gridRef));\n let hasFooter = useHasChild(`.${styles['spectrum-Dialog-footer']}`, unwrapDOMRef(gridRef));\n let hasTypeIcon = useHasChild(`.${styles['spectrum-Dialog-typeIcon']}`, unwrapDOMRef(gridRef));\n\n let slots = useMemo(() => ({\n hero: {UNSAFE_className: styles['spectrum-Dialog-hero']},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-heading', {'spectrum-Dialog-heading--noHeader': !hasHeader, 'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon}), level: 2, ...titleProps},\n header: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-header', {'spectrum-Dialog-header--noHeading': !hasHeading, 'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon})},\n typeIcon: {UNSAFE_className: styles['spectrum-Dialog-typeIcon']},\n divider: {UNSAFE_className: styles['spectrum-Dialog-divider'], size: 'M'},\n content: {UNSAFE_className: styles['spectrum-Dialog-content']},\n footer: {UNSAFE_className: styles['spectrum-Dialog-footer']},\n buttonGroup: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-buttonGroup', {'spectrum-Dialog-buttonGroup--noFooter': !hasFooter}), align: 'end'}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [hasFooter, hasHeader, titleProps]);\n\n return (\n <section\n {...styleProps}\n {...dialogProps}\n className={classNames(\n styles,\n 'spectrum-Dialog',\n {\n [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,\n 'spectrum-Dialog--dismissable': isDismissable\n },\n styleProps.className\n )}\n ref={domRef}>\n <Grid ref={gridRef} UNSAFE_className={styles['spectrum-Dialog-grid']}>\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n {isDismissable &&\n <ActionButton\n UNSAFE_className={styles['spectrum-Dialog-closeButton']}\n isQuiet\n aria-label={stringFormatter.format('dismiss')}\n onPress={onDismiss}>\n <CrossLarge />\n </ActionButton>\n }\n </Grid>\n </section>\n );\n});\n"],"names":[],"version":3,"file":"Dialog.main.js.map"}
package/dist/Dialog.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.mjs";
2
2
  import $3e38X$intlStringsmodulejs from "./intlStrings.mjs";
3
- import "./vars.cfc79477.css";
3
+ import "./vars.895d8ff6.css";
4
4
  import $3e38X$dialog_vars_cssmodulejs from "./dialog_vars_css.mjs";
5
5
  import {ActionButton as $3e38X$ActionButton} from "@react-spectrum/button";
6
6
  import {useSlotProps as $3e38X$useSlotProps, useStyleProps as $3e38X$useStyleProps, useDOMRef as $3e38X$useDOMRef, useHasChild as $3e38X$useHasChild, unwrapDOMRef as $3e38X$unwrapDOMRef, classNames as $3e38X$classNames, SlotProvider as $3e38X$SlotProvider} from "@react-spectrum/utils";
@@ -43,7 +43,7 @@ let $99cd51dc4eb569f7$var$sizeMap = {
43
43
  fullscreen: 'fullscreen',
44
44
  fullscreenTakeover: 'fullscreenTakeover'
45
45
  };
46
- function $99cd51dc4eb569f7$var$Dialog(props, ref) {
46
+ const $99cd51dc4eb569f7$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $3e38X$react).forwardRef(function Dialog(props, ref) {
47
47
  props = (0, $3e38X$useSlotProps)(props, 'dialog');
48
48
  let { type: type = 'modal', ...contextProps } = (0, $3e38X$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
49
49
  let { children: children, isDismissable: isDismissable = contextProps.isDismissable, onDismiss: onDismiss = contextProps.onClose, size: size, ...otherProps } = props;
@@ -119,11 +119,7 @@ function $99cd51dc4eb569f7$var$Dialog(props, ref) {
119
119
  "aria-label": stringFormatter.format('dismiss'),
120
120
  onPress: onDismiss
121
121
  }, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$spectrumiconsuiCrossLarge), null))));
122
- }
123
- /**
124
- * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
125
- * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
126
- */ let $99cd51dc4eb569f7$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $3e38X$react).forwardRef($99cd51dc4eb569f7$var$Dialog);
122
+ });
127
123
 
128
124
 
129
125
  export {$99cd51dc4eb569f7$export$3ddf2d174ce01153 as Dialog};
@@ -1,6 +1,6 @@
1
1
  import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.module.js";
2
2
  import $3e38X$intlStringsmodulejs from "./intlStrings.module.js";
3
- import "./vars.cfc79477.css";
3
+ import "./vars.895d8ff6.css";
4
4
  import $3e38X$dialog_vars_cssmodulejs from "./dialog_vars_css.module.js";
5
5
  import {ActionButton as $3e38X$ActionButton} from "@react-spectrum/button";
6
6
  import {useSlotProps as $3e38X$useSlotProps, useStyleProps as $3e38X$useStyleProps, useDOMRef as $3e38X$useDOMRef, useHasChild as $3e38X$useHasChild, unwrapDOMRef as $3e38X$unwrapDOMRef, classNames as $3e38X$classNames, SlotProvider as $3e38X$SlotProvider} from "@react-spectrum/utils";
@@ -43,7 +43,7 @@ let $99cd51dc4eb569f7$var$sizeMap = {
43
43
  fullscreen: 'fullscreen',
44
44
  fullscreenTakeover: 'fullscreenTakeover'
45
45
  };
46
- function $99cd51dc4eb569f7$var$Dialog(props, ref) {
46
+ const $99cd51dc4eb569f7$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $3e38X$react).forwardRef(function Dialog(props, ref) {
47
47
  props = (0, $3e38X$useSlotProps)(props, 'dialog');
48
48
  let { type: type = 'modal', ...contextProps } = (0, $3e38X$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
49
49
  let { children: children, isDismissable: isDismissable = contextProps.isDismissable, onDismiss: onDismiss = contextProps.onClose, size: size, ...otherProps } = props;
@@ -119,11 +119,7 @@ function $99cd51dc4eb569f7$var$Dialog(props, ref) {
119
119
  "aria-label": stringFormatter.format('dismiss'),
120
120
  onPress: onDismiss
121
121
  }, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$spectrumiconsuiCrossLarge), null))));
122
- }
123
- /**
124
- * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
125
- * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
126
- */ let $99cd51dc4eb569f7$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $3e38X$react).forwardRef($99cd51dc4eb569f7$var$Dialog);
122
+ });
127
123
 
128
124
 
129
125
  export {$99cd51dc4eb569f7$export$3ddf2d174ce01153 as Dialog};
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAyBD,IAAI,gCAAU;IACZ,GAAG;IACH,GAAG;IACH,GAAG;IACH,YAAY;IACZ,oBAAoB;AACtB;AAEA,SAAS,6BAAO,KAA0B,EAAE,GAAW;IACrD,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,IAAI,QACF,OAAO,SACP,GAAG,cACJ,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAY,MAAM,CAAC;IAClC,IAAI,YACF,QAAQ,iBACR,gBAAgB,aAAa,aAAa,aAC1C,YAAY,aAAa,OAAO,QAChC,IAAI,EACJ,GAAG,YACJ,GAAG;IACJ,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAEjC,OAAO,SAAS,YAAa,QAAQ,MAAQ,QAAQ;IAErD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,UAAU,CAAA,GAAA,aAAK,EAAE;IACrB,IAAI,cAAc,6BAAO,CAAC,KAAK,IAAI,6BAAO,CAAC,KAAK;I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wDAAK,CAAC,CAAC,0BAA0B;gBAAE,MAAM;YAAG;YACxE,SAAS;gBAAC,kBAAkB,CAAA,GAAA,wDAAK,CAAC,CAAC,0BAA0B;YAAA;YAC7D,QAAQ;gBAAC,kBAAkB,CAAA,GAAA,wDAAK,CAAC,CAAC,yBAAyB;YAAA;YAC3D,aAAa;gBAAC,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG,+BAA+B;oBAAC,yCAAyC,CAAC;gBAAS;gBAAI,OAAO;YAAK;QAExJ,CAAA,GAAI;QAAC;QAAW;QAAW;KAAW;IAEtC,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,WAAW;QACf,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,wDAAK,GACL,mBACA;YACE,CAAC,CAAC,iBAAiB,EAAE,aAAa,CAAC,EAAE;YACrC,gCAAgC;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,gCAAC,CAAA,GAAA,WAAG;QAAE,KAAK;QAAS,kBAAkB,CAAA,GAAA,wDAAK,CAAC,CAAC,uBAAuB;qBAClE,gCAAC,CAAA,GAAA,mBAAW;QAAE,OAAO;OAClB,WAEF,+BACC,gCAAC,CAAA,GAAA,mBAAW;QACV,kBAAkB,CAAA,GAAA,wDAAK,CAAC,CAAC,8BAA8B;QACvD,SAAA;QACA,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS;qBACT,gCAAC,CAAA,GAAA,gCAAS;AAMtB;AAEA;;;CAGC,GACD,IAAI,0DAAU,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/dialog/src/Dialog.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 {ActionButton} from '@react-spectrum/button';\nimport {\n classNames,\n SlotProvider,\n unwrapDOMRef,\n useDOMRef,\n useHasChild,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DialogContext, DialogContextValue} from './context';\nimport {DOMRef} from '@react-types/shared';\nimport {Grid} from '@react-spectrum/layout';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useMemo, useRef} from 'react';\nimport {SpectrumDialogProps} from '@react-types/dialog';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useDialog} from '@react-aria/dialog';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nlet sizeMap = {\n S: 'small',\n M: 'medium',\n L: 'large',\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nfunction Dialog(props: SpectrumDialogProps, ref: DOMRef) {\n props = useSlotProps(props, 'dialog');\n let {\n type = 'modal',\n ...contextProps\n } = useContext(DialogContext) || {} as DialogContextValue;\n let {\n children,\n isDismissable = contextProps.isDismissable,\n onDismiss = contextProps.onClose,\n size,\n ...otherProps\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef(null);\n let sizeVariant = sizeMap[type] || sizeMap[size];\n let {dialogProps, titleProps} = useDialog(mergeProps(contextProps, props), domRef);\n\n let hasHeader = useHasChild(`.${styles['spectrum-Dialog-header']}`, unwrapDOMRef(gridRef));\n let hasHeading = useHasChild(`.${styles['spectrum-Dialog-heading']}`, unwrapDOMRef(gridRef));\n let hasFooter = useHasChild(`.${styles['spectrum-Dialog-footer']}`, unwrapDOMRef(gridRef));\n let hasTypeIcon = useHasChild(`.${styles['spectrum-Dialog-typeIcon']}`, unwrapDOMRef(gridRef));\n\n let slots = useMemo(() => ({\n hero: {UNSAFE_className: styles['spectrum-Dialog-hero']},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-heading', {'spectrum-Dialog-heading--noHeader': !hasHeader, 'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon}), level: 2, ...titleProps},\n header: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-header', {'spectrum-Dialog-header--noHeading': !hasHeading, 'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon})},\n typeIcon: {UNSAFE_className: styles['spectrum-Dialog-typeIcon']},\n divider: {UNSAFE_className: styles['spectrum-Dialog-divider'], size: 'M'},\n content: {UNSAFE_className: styles['spectrum-Dialog-content']},\n footer: {UNSAFE_className: styles['spectrum-Dialog-footer']},\n buttonGroup: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-buttonGroup', {'spectrum-Dialog-buttonGroup--noFooter': !hasFooter}), align: 'end'}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [hasFooter, hasHeader, titleProps]);\n\n return (\n <section\n {...styleProps}\n {...dialogProps}\n className={classNames(\n styles,\n 'spectrum-Dialog',\n {\n [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,\n 'spectrum-Dialog--dismissable': isDismissable\n },\n styleProps.className\n )}\n ref={domRef}>\n <Grid ref={gridRef} UNSAFE_className={styles['spectrum-Dialog-grid']}>\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n {isDismissable &&\n <ActionButton\n UNSAFE_className={styles['spectrum-Dialog-closeButton']}\n isQuiet\n aria-label={stringFormatter.format('dismiss')}\n onPress={onDismiss}>\n <CrossLarge />\n </ActionButton>\n }\n </Grid>\n </section>\n );\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = React.forwardRef(Dialog);\nexport {_Dialog as Dialog};\n"],"names":[],"version":3,"file":"Dialog.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAyBD,IAAI,gCAAU;IACZ,GAAG;IACH,GAAG;IACH,GAAG;IACH,YAAY;IACZ,oBAAoB;AACtB;AAMO,MAAM,0DAAS,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,OAAO,KAA0B,EAAE,GAAW;IAC5F,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,IAAI,QACF,OAAO,SACP,GAAG,cACJ,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAY,MAAM,CAAC;IAClC,IAAI,YACF,QAAQ,iBACR,gBAAgB,aAAa,aAAa,aAC1C,YAAY,aAAa,OAAO,QAChC,IAAI,EACJ,GAAG,YACJ,GAAG;IACJ,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAEjC,OAAO,SAAS,YAAa,QAAQ,MAAQ,QAAQ;IAErD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,UAAU,CAAA,GAAA,aAAK,EAAE;IACrB,IAAI,cAAc,6BAAO,CAAC,KAAK,IAAI,6BAAO,CAAC,KAAK;IAChD,IAAI,eAAC,WAAW,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE,CAAA,GAAA,iBAAS,EAAE,cAAc,QAAQ;IAE3E,IAAI,YAAY,CAAA,GAAA,kBAAU,EAAE,CAAC,CAAC,EAAE,CAAA,GAAA,wDAAK,CAAC,CAAC,yBAAyB,EAAE,EAAE,CAAA,GAAA,mBAAW,EAAE;IACjF,IAAI,aAAa,CAAA,GAAA,k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;oBAAC,yCAAyC,CAAC;gBAAS;gBAAI,OAAO;YAAK;QAExJ,CAAA,GAAI;QAAC;QAAW;QAAW;KAAW;IAEtC,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,WAAW;QACf,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,wDAAK,GACL,mBACA;YACE,CAAC,CAAC,iBAAiB,EAAE,aAAa,CAAC,EAAE;YACrC,gCAAgC;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,gCAAC,CAAA,GAAA,WAAG;QAAE,KAAK;QAAS,kBAAkB,CAAA,GAAA,wDAAK,CAAC,CAAC,uBAAuB;qBAClE,gCAAC,CAAA,GAAA,mBAAW;QAAE,OAAO;OAClB,WAEF,+BACC,gCAAC,CAAA,GAAA,mBAAW;QACV,kBAAkB,CAAA,GAAA,wDAAK,CAAC,CAAC,8BAA8B;QACvD,SAAA;QACA,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS;qBACT,gCAAC,CAAA,GAAA,gCAAS;AAMtB","sources":["packages/@react-spectrum/dialog/src/Dialog.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 {ActionButton} from '@react-spectrum/button';\nimport {\n classNames,\n SlotProvider,\n unwrapDOMRef,\n useDOMRef,\n useHasChild,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DialogContext, DialogContextValue} from './context';\nimport {DOMRef} from '@react-types/shared';\nimport {Grid} from '@react-spectrum/layout';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useMemo, useRef} from 'react';\nimport {SpectrumDialogProps} from '@react-types/dialog';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useDialog} from '@react-aria/dialog';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nlet sizeMap = {\n S: 'small',\n M: 'medium',\n L: 'large',\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nexport const Dialog = React.forwardRef(function Dialog(props: SpectrumDialogProps, ref: DOMRef) {\n props = useSlotProps(props, 'dialog');\n let {\n type = 'modal',\n ...contextProps\n } = useContext(DialogContext) || {} as DialogContextValue;\n let {\n children,\n isDismissable = contextProps.isDismissable,\n onDismiss = contextProps.onClose,\n size,\n ...otherProps\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef(null);\n let sizeVariant = sizeMap[type] || sizeMap[size];\n let {dialogProps, titleProps} = useDialog(mergeProps(contextProps, props), domRef);\n\n let hasHeader = useHasChild(`.${styles['spectrum-Dialog-header']}`, unwrapDOMRef(gridRef));\n let hasHeading = useHasChild(`.${styles['spectrum-Dialog-heading']}`, unwrapDOMRef(gridRef));\n let hasFooter = useHasChild(`.${styles['spectrum-Dialog-footer']}`, unwrapDOMRef(gridRef));\n let hasTypeIcon = useHasChild(`.${styles['spectrum-Dialog-typeIcon']}`, unwrapDOMRef(gridRef));\n\n let slots = useMemo(() => ({\n hero: {UNSAFE_className: styles['spectrum-Dialog-hero']},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-heading', {'spectrum-Dialog-heading--noHeader': !hasHeader, 'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon}), level: 2, ...titleProps},\n header: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-header', {'spectrum-Dialog-header--noHeading': !hasHeading, 'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon})},\n typeIcon: {UNSAFE_className: styles['spectrum-Dialog-typeIcon']},\n divider: {UNSAFE_className: styles['spectrum-Dialog-divider'], size: 'M'},\n content: {UNSAFE_className: styles['spectrum-Dialog-content']},\n footer: {UNSAFE_className: styles['spectrum-Dialog-footer']},\n buttonGroup: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-buttonGroup', {'spectrum-Dialog-buttonGroup--noFooter': !hasFooter}), align: 'end'}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [hasFooter, hasHeader, titleProps]);\n\n return (\n <section\n {...styleProps}\n {...dialogProps}\n className={classNames(\n styles,\n 'spectrum-Dialog',\n {\n [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,\n 'spectrum-Dialog--dismissable': isDismissable\n },\n styleProps.className\n )}\n ref={domRef}>\n <Grid ref={gridRef} UNSAFE_className={styles['spectrum-Dialog-grid']}>\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n {isDismissable &&\n <ActionButton\n UNSAFE_className={styles['spectrum-Dialog-closeButton']}\n isQuiet\n aria-label={stringFormatter.format('dismiss')}\n onPress={onDismiss}>\n <CrossLarge />\n </ActionButton>\n }\n </Grid>\n </section>\n );\n});\n"],"names":[],"version":3,"file":"Dialog.module.js.map"}
package/dist/types.d.ts CHANGED
@@ -5,11 +5,11 @@ import { DOMRefValue } from "@react-types/shared";
5
5
  * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
6
6
  * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
7
7
  */
8
- export let Dialog: React.ForwardRefExoticComponent<SpectrumDialogProps & React.RefAttributes<DOMRefValue<HTMLElement>>>;
8
+ export const Dialog: React.ForwardRefExoticComponent<SpectrumDialogProps & React.RefAttributes<DOMRefValue<HTMLElement>>>;
9
9
  /**
10
10
  * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
11
11
  */
12
- export let AlertDialog: React.ForwardRefExoticComponent<SpectrumAlertDialogProps & React.RefAttributes<DOMRefValue<HTMLElement>>>;
12
+ export const AlertDialog: React.ForwardRefExoticComponent<SpectrumAlertDialogProps & React.RefAttributes<DOMRefValue<HTMLElement>>>;
13
13
  /**
14
14
  * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's
15
15
  * open state with the trigger's press state. Additionally, it allows you to customize the type and
@@ -1 +1 @@
1
- {"mappings":";;;ACmHA;;;GAGG;AACH,OAAA,IAAI,4GAAkC,CAAC;ACPvC;;GAEG;AACH,OAAA,IAAI,sHAAsC,CAAC;ACoB3C;;;;GAIG;AAGH,OAAA,IAAI,eAAkC,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,OAAO,CAAC;AC5HzF;;;;GAIG;AACH,gCAAgC,KAAK,EAAE,4BAA4B,qBAuDlE;AC/DD;IACE,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,GAAG,oBAAoB,CAAC;IACzE,OAAO,IAAI,IAAI,CAAA;CAChB;AAED,sCAAsC,oBAAoB,CAYzD;ACZD,YAAY,EAAC,wBAAwB,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,0BAA0B,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/context.ts","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/Dialog.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/AlertDialog.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/DialogTrigger.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/DialogContainer.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/useDialogContainer.ts","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/index.ts","packages/@react-spectrum/dialog/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {AlertDialog} from './AlertDialog';\nexport {Dialog} from './Dialog';\nexport {DialogTrigger} from './DialogTrigger';\nexport {DialogContainer} from './DialogContainer';\nexport {useDialogContainer} from './useDialogContainer';\n\nexport type {SpectrumAlertDialogProps, SpectrumDialogProps, SpectrumDialogContainerProps, SpectrumDialogTriggerProps} from '@react-types/dialog';\nexport type {DialogContainerValue} from './useDialogContainer';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;AC2CA;;;GAGG;AACH,OAAO,MAAM,4GAsEX,CAAC;ACtFH;;GAEG;AACH,OAAO,MAAM,sHA4EX,CAAC;ACyBH;;;;GAIG;AAGH,OAAA,IAAI,eAAkC,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,OAAO,CAAC;AC5HzF;;;;GAIG;AACH,gCAAgC,KAAK,EAAE,4BAA4B,qBAuDlE;AC/DD;IACE,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,GAAG,oBAAoB,CAAC;IACzE,OAAO,IAAI,IAAI,CAAA;CAChB;AAED,sCAAsC,oBAAoB,CAYzD;ACZD,YAAY,EAAC,wBAAwB,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,0BAA0B,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/context.ts","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/Dialog.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/AlertDialog.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/DialogTrigger.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/DialogContainer.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/useDialogContainer.ts","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/index.ts","packages/@react-spectrum/dialog/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {AlertDialog} from './AlertDialog';\nexport {Dialog} from './Dialog';\nexport {DialogTrigger} from './DialogTrigger';\nexport {DialogContainer} from './DialogContainer';\nexport {useDialogContainer} from './useDialogContainer';\n\nexport type {SpectrumAlertDialogProps, SpectrumDialogProps, SpectrumDialogContainerProps, SpectrumDialogTriggerProps} from '@react-types/dialog';\nexport type {DialogContainerValue} from './useDialogContainer';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -110,15 +110,15 @@
110
110
 
111
111
  .Ecg7PG_spectrum-Dialog {
112
112
  box-sizing: border-box;
113
+ width: fit-content;
113
114
  min-width: var(--spectrum-dialog-min-width, var(--spectrum-global-dimension-static-size-3600));
115
+ max-width: 100%;
114
116
  max-height: inherit;
115
117
  --spectrum-dialog-padding-x: var(--spectrum-dialog-padding);
116
118
  --spectrum-dialog-padding-y: var(--spectrum-dialog-padding);
117
119
  --spectrum-dialog-border-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
118
120
  border-radius: var(--spectrum-dialog-border-radius, var(--spectrum-global-dimension-size-50));
119
121
  outline: none;
120
- width: fit-content;
121
- max-width: 100%;
122
122
  display: flex;
123
123
  overflow: hidden;
124
124
  }
@@ -199,10 +199,10 @@
199
199
  }
200
200
 
201
201
  .Ecg7PG_spectrum-Dialog .Ecg7PG_spectrum-Dialog-divider {
202
+ width: 100%;
202
203
  margin-top: var(--spectrum-dialog-rule-margin-top, var(--spectrum-global-dimension-static-size-150));
203
204
  margin-bottom: var(--spectrum-dialog-rule-margin-bottom, var(--spectrum-global-dimension-static-size-200));
204
205
  grid-area: Ecg7PG_divider;
205
- width: 100%;
206
206
  }
207
207
 
208
208
  .Ecg7PG_spectrum-Dialog--noDivider .Ecg7PG_spectrum-Dialog-divider {
@@ -236,9 +236,9 @@
236
236
  }
237
237
 
238
238
  .Ecg7PG_spectrum-Dialog-buttonGroup {
239
+ max-width: 100%;
239
240
  grid-area: Ecg7PG_buttonGroup;
240
241
  justify-content: flex-end;
241
- max-width: 100%;
242
242
  padding-block-start: var(--spectrum-global-dimension-static-size-500, 40px);
243
243
  padding-inline-start: var(--spectrum-global-dimension-size-200);
244
244
  display: flex;
@@ -516,4 +516,4 @@
516
516
  .Ecg7PG_spectrum-Dialog--warning .Ecg7PG_spectrum-Dialog-typeIcon {
517
517
  color: var(--spectrum-semantic-notice-color-icon, var(--spectrum-global-color-orange-600));
518
518
  }
519
- /*# sourceMappingURL=vars.cfc79477.css.map */
519
+ /*# sourceMappingURL=vars.895d8ff6.css.map */
@@ -1 +1 @@
1
- {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAkBJ;;;;;;;AAYA;;;;;;;AAWA;;;;AAIA;;;;AAUA;;;;AAIA;;;;AAIA;;;;;;;;;;;;;;;AAuBA;;;;AAIA;;;;AAIA;;;;AAIA;;;;;;;;;;AAYA;;;;;;;;;;;;;;AAeA;;;;;;;;;;AAaE;;;;;AAKA;;;;;AAMF;;;;;;;;;;AAYE;;;;;AAMF;;;;AAIA;;;;;;;AAQE;;;;AAKF;;;;;;;;;;;;;;AA6BA;;;;;;;;AAWE;;;;AAMF;;;;;;;;;AAWE;;;;AAKF;;;;;;;;;;;;AAYE;;;;AAGA;;;;AAKF;;;;;;;AAYA;;;;AAIA;;;;;AAKA;;;;;;;AAUA;;;;;AAKE;;;;;;;;;;;AAYA;;;;AAGE;;;;;AAYA;;;;;AAMF;;;;AAIA;;;;AAKA;;;;AAIA;;;;AAKF;EAEE;;;;EAIA;;;;;;;;;;;;;EAcE;;;;EAKA;;;;EAKA;;;;EAKF;;;;;;;;;;;;;EAcA;;;;EAIA;;;;EAIA;;;;EAOE;;;;;;;;;;;;;EAcE;;;;EAWA;;;;EAKF;;;;EAIA;;;;;AAQJ;EACE;;;;;;;;;;;;;;;;;EAoBE;;;;;EAOA;;;;;EAOA;;;;;EAMF;;;;;;EAMA;;;;;AAKF;EAII;;;;;;;;;;;;;EAcE;;;;EAWA;;;;EAKF;;;;EAIA;;;;;AAkBJ;;;;AAIA;;;;AAIA;;;;AAKE;;;;AAMA","sources":["packages/@adobe/spectrum-css-temp/components/dialog/vars.css"],"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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.cfc79477.css.map"}
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAkBJ;;;;;;;AAYA;;;;;;;AAWA;;;;AAIA;;;;AAUA;;;;AAIA;;;;AAIA;;;;;;;;;;;;;;;AAuBA;;;;AAIA;;;;AAIA;;;;AAIA;;;;;;;;;;AAYA;;;;;;;;;;;;;;AAeA;;;;;;;;;;AAaE;;;;;AAKA;;;;;AAMF;;;;;;;;;;AAYE;;;;;AAMF;;;;AAIA;;;;;;;AAQE;;;;AAKF;;;;;;;;;;;;;;AA6BA;;;;;;;;AAWE;;;;AAMF;;;;;;;;;AAWE;;;;AAKF;;;;;;;;;;;;AAYE;;;;AAGA;;;;AAKF;;;;;;;AAYA;;;;AAIA;;;;;AAKA;;;;;;;AAUA;;;;;AAKE;;;;;;;;;;;AAYA;;;;AAGE;;;;;AAYA;;;;;AAMF;;;;AAIA;;;;AAKA;;;;AAIA;;;;AAKF;EAEE;;;;EAIA;;;;;;;;;;;;;EAcE;;;;EAKA;;;;EAKA;;;;EAKF;;;;;;;;;;;;;EAcA;;;;EAIA;;;;EAIA;;;;EAOE;;;;;;;;;;;;;EAcE;;;;EAWA;;;;EAKF;;;;EAIA;;;;;AAQJ;EACE;;;;;;;;;;;;;;;;;EAoBE;;;;;EAOA;;;;;EAOA;;;;;EAMF;;;;;;EAMA;;;;;AAKF;EAII;;;;;;;;;;;;;EAcE;;;;EAWA;;;;EAKF;;;;EAIA;;;;;AAkBJ;;;;AAIA;;;;AAIA;;;;AAKE;;;;AAMA","sources":["packages/@adobe/spectrum-css-temp/components/dialog/vars.css"],"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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.895d8ff6.css.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/dialog",
3
- "version": "3.8.16",
3
+ "version": "3.8.18",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,24 +36,24 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/dialog": "^3.5.20",
40
- "@react-aria/i18n": "^3.12.4",
41
- "@react-aria/interactions": "^3.22.5",
42
- "@react-aria/overlays": "^3.24.0",
43
- "@react-aria/utils": "^3.26.0",
44
- "@react-spectrum/button": "^3.16.9",
45
- "@react-spectrum/buttongroup": "^3.6.17",
46
- "@react-spectrum/divider": "^3.5.18",
47
- "@react-spectrum/layout": "^3.6.10",
48
- "@react-spectrum/overlays": "^5.7.0",
49
- "@react-spectrum/text": "^3.5.10",
50
- "@react-spectrum/utils": "^3.12.0",
51
- "@react-spectrum/view": "^3.6.14",
52
- "@react-stately/overlays": "^3.6.12",
53
- "@react-types/button": "^3.10.1",
54
- "@react-types/dialog": "^3.5.14",
55
- "@react-types/shared": "^3.26.0",
56
- "@spectrum-icons/ui": "^3.6.11",
39
+ "@react-aria/dialog": "^3.5.22",
40
+ "@react-aria/i18n": "^3.12.6",
41
+ "@react-aria/interactions": "^3.24.0",
42
+ "@react-aria/overlays": "^3.26.0",
43
+ "@react-aria/utils": "^3.28.0",
44
+ "@react-spectrum/button": "^3.16.11",
45
+ "@react-spectrum/buttongroup": "^3.6.19",
46
+ "@react-spectrum/divider": "^3.5.20",
47
+ "@react-spectrum/layout": "^3.6.12",
48
+ "@react-spectrum/overlays": "^5.7.2",
49
+ "@react-spectrum/text": "^3.5.12",
50
+ "@react-spectrum/utils": "^3.12.2",
51
+ "@react-spectrum/view": "^3.6.16",
52
+ "@react-stately/overlays": "^3.6.14",
53
+ "@react-types/button": "^3.11.0",
54
+ "@react-types/dialog": "^3.5.16",
55
+ "@react-types/shared": "^3.28.0",
56
+ "@spectrum-icons/ui": "^3.6.13",
57
57
  "@swc/helpers": "^0.5.0"
58
58
  },
59
59
  "devDependencies": {
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
71
+ "gitHead": "4d3c72c94eea2d72eb3a0e7d56000c6ef7e39726"
72
72
  }
@@ -32,7 +32,7 @@ import {useLocalizedStringFormatter} from '@react-aria/i18n';
32
32
  /**
33
33
  * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
34
34
  */
35
- function AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {
35
+ export const AlertDialog = forwardRef(function AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {
36
36
  let {
37
37
  onClose = () => {}
38
38
  } = useContext(DialogContext) || {} as DialogContextValue;
@@ -108,10 +108,4 @@ function AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {
108
108
  </ButtonGroup>
109
109
  </Dialog>
110
110
  );
111
- }
112
-
113
- /**
114
- * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
115
- */
116
- let _AlertDialog = forwardRef(AlertDialog);
117
- export {_AlertDialog as AlertDialog};
111
+ });
package/src/Dialog.tsx CHANGED
@@ -41,7 +41,11 @@ let sizeMap = {
41
41
  fullscreenTakeover: 'fullscreenTakeover'
42
42
  };
43
43
 
44
- function Dialog(props: SpectrumDialogProps, ref: DOMRef) {
44
+ /**
45
+ * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
46
+ * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
47
+ */
48
+ export const Dialog = React.forwardRef(function Dialog(props: SpectrumDialogProps, ref: DOMRef) {
45
49
  props = useSlotProps(props, 'dialog');
46
50
  let {
47
51
  type = 'modal',
@@ -111,11 +115,4 @@ function Dialog(props: SpectrumDialogProps, ref: DOMRef) {
111
115
  </Grid>
112
116
  </section>
113
117
  );
114
- }
115
-
116
- /**
117
- * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
118
- * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
119
- */
120
- let _Dialog = React.forwardRef(Dialog);
121
- export {_Dialog as Dialog};
118
+ });