@react-spectrum/dialog 3.7.1 → 3.8.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 CHANGED
@@ -3,11 +3,11 @@ import $b4euU$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
3
3
  import {Button as $b4euU$Button, ActionButton as $b4euU$ActionButton} from "@react-spectrum/button";
4
4
  import {ButtonGroup as $b4euU$ButtonGroup} from "@react-spectrum/buttongroup";
5
5
  import {chain as $b4euU$chain, mergeProps as $b4euU$mergeProps} from "@react-aria/utils";
6
- import {useStyleProps as $b4euU$useStyleProps, classNames as $b4euU$classNames, useDOMRef as $b4euU$useDOMRef, useHasChild as $b4euU$useHasChild, unwrapDOMRef as $b4euU$unwrapDOMRef, SlotProvider as $b4euU$SlotProvider, useIsMobileDevice as $b4euU$useIsMobileDevice} from "@react-spectrum/utils";
6
+ import {useStyleProps as $b4euU$useStyleProps, classNames as $b4euU$classNames, useSlotProps as $b4euU$useSlotProps, useDOMRef as $b4euU$useDOMRef, useHasChild as $b4euU$useHasChild, unwrapDOMRef as $b4euU$unwrapDOMRef, SlotProvider as $b4euU$SlotProvider, useIsMobileDevice as $b4euU$useIsMobileDevice} from "@react-spectrum/utils";
7
7
  import {Content as $b4euU$Content} from "@react-spectrum/view";
8
8
  import {Divider as $b4euU$Divider} from "@react-spectrum/divider";
9
9
  import {Heading as $b4euU$Heading} from "@react-spectrum/text";
10
- import $b4euU$react, {useContext as $b4euU$useContext, forwardRef as $b4euU$forwardRef, useRef as $b4euU$useRef, useMemo as $b4euU$useMemo, useEffect as $b4euU$useEffect, Fragment as $b4euU$Fragment} from "react";
10
+ import $b4euU$react, {useContext as $b4euU$useContext, forwardRef as $b4euU$forwardRef, useRef as $b4euU$useRef, useMemo as $b4euU$useMemo, useEffect as $b4euU$useEffect, Fragment as $b4euU$Fragment, useState as $b4euU$useState} from "react";
11
11
  import {useLocalizedStringFormatter as $b4euU$useLocalizedStringFormatter} from "@react-aria/i18n";
12
12
  import $b4euU$spectrumiconsuiCrossLarge from "@spectrum-icons/ui/CrossLarge";
13
13
  import {Grid as $b4euU$Grid} from "@react-spectrum/layout";
@@ -78,7 +78,7 @@ const $97b119e05830ea0d$export$8b93a07348a7730c = (0, $b4euU$react).createContex
78
78
 
79
79
 
80
80
 
81
- var $5c372ca6bd75272c$exports = {};
81
+ var $f3fff851f5cc5a1e$exports = {};
82
82
  var $cc8cbf248c4ac933$exports = {};
83
83
  $cc8cbf248c4ac933$exports = {
84
84
  "alert": `تنبيه`,
@@ -317,7 +317,7 @@ $03712eabbcfd201c$exports = {
317
317
  };
318
318
 
319
319
 
320
- $5c372ca6bd75272c$exports = {
320
+ $f3fff851f5cc5a1e$exports = {
321
321
  "ar-AE": $cc8cbf248c4ac933$exports,
322
322
  "bg-BG": $c23042f930ed2466$exports,
323
323
  "cs-CZ": $22339168a6e88f2f$exports,
@@ -446,9 +446,10 @@ let $99cd51dc4eb569f7$var$sizeMap = {
446
446
  fullscreenTakeover: "fullscreenTakeover"
447
447
  };
448
448
  function $99cd51dc4eb569f7$var$Dialog(props, ref) {
449
+ props = (0, $b4euU$useSlotProps)(props, "dialog");
449
450
  let { type: type = "modal" , ...contextProps } = (0, $b4euU$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
450
451
  let { children: children , isDismissable: isDismissable = contextProps.isDismissable , onDismiss: onDismiss = contextProps.onClose , size: size , ...otherProps } = props;
451
- let stringFormatter = (0, $b4euU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($5c372ca6bd75272c$exports))));
452
+ let stringFormatter = (0, $b4euU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f3fff851f5cc5a1e$exports))));
452
453
  let { styleProps: styleProps } = (0, $b4euU$useStyleProps)(otherProps);
453
454
  size = type === "popover" ? size || "S" : size || "L";
454
455
  let domRef = (0, $b4euU$useDOMRef)(ref);
@@ -540,7 +541,7 @@ function $99cd51dc4eb569f7$var$Dialog(props, ref) {
540
541
  let { onClose: onClose = ()=>{} } = (0, $b4euU$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
541
542
  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;
542
543
  let { styleProps: styleProps } = (0, $b4euU$useStyleProps)(otherProps);
543
- let stringFormatter = (0, $b4euU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($5c372ca6bd75272c$exports))));
544
+ let stringFormatter = (0, $b4euU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f3fff851f5cc5a1e$exports))));
544
545
  let confirmVariant = "primary";
545
546
  if (variant) {
546
547
  if (variant === "confirmation") confirmVariant = "cta";
@@ -667,6 +668,7 @@ function $c412c5ea680c1e4f$var$DialogTrigger(props) {
667
668
  }
668
669
  // Support DialogTrigger inside components using CollectionBuilder.
669
670
  $c412c5ea680c1e4f$var$DialogTrigger.getCollectionNode = function*(props) {
671
+ // @ts-ignore - seems like types are wrong. Function children work fine.
670
672
  let [trigger] = (0, $b4euU$react).Children.toArray(props.children);
671
673
  let [, content] = props.children;
672
674
  yield {
@@ -742,9 +744,13 @@ function $2a9f0ad39ddaa8d9$export$547754aada6e339f(props) {
742
744
  let { children: children , type: type = "modal" , onDismiss: onDismiss , isDismissable: isDismissable , isKeyboardDismissDisabled: isKeyboardDismissDisabled } = props;
743
745
  let childArray = (0, $b4euU$react).Children.toArray(children);
744
746
  if (childArray.length > 1) throw new Error("Only a single child can be passed to DialogContainer.");
745
- let lastChild = (0, $b4euU$useRef)(null);
746
- let child = /*#__PURE__*/ (0, $b4euU$react).isValidElement(childArray[0]) ? childArray[0] : null;
747
- if (child) lastChild.current = child;
747
+ let [lastChild, setLastChild] = (0, $b4euU$useState)(null);
748
+ // React.Children.toArray mutates the children, and we need them to be stable
749
+ // between renders so that the lastChild comparison works.
750
+ let child = null;
751
+ if (Array.isArray(children)) child = children.find((0, $b4euU$react).isValidElement);
752
+ else if (/*#__PURE__*/ (0, $b4euU$react).isValidElement(children)) child = children;
753
+ if (child && child !== lastChild) setLastChild(child);
748
754
  let context = {
749
755
  type: type,
750
756
  onClose: onDismiss,
@@ -763,7 +769,7 @@ function $2a9f0ad39ddaa8d9$export$547754aada6e339f(props) {
763
769
  isKeyboardDismissDisabled: isKeyboardDismissDisabled
764
770
  }, /*#__PURE__*/ (0, $b4euU$react).createElement((0, $97b119e05830ea0d$export$8b93a07348a7730c).Provider, {
765
771
  value: context
766
- }, lastChild.current));
772
+ }, lastChild));
767
773
  }
768
774
 
769
775
 
package/dist/main.js CHANGED
@@ -84,7 +84,7 @@ const $0eb909ad2388d989$export$8b93a07348a7730c = (0, ($parcel$interopDefault($i
84
84
 
85
85
 
86
86
 
87
- var $27a5e9bc18eefb32$exports = {};
87
+ var $7827d180f5c8b41b$exports = {};
88
88
  var $a55551a02f9dcb5c$exports = {};
89
89
  $a55551a02f9dcb5c$exports = {
90
90
  "alert": `تنبيه`,
@@ -323,7 +323,7 @@ $6fb708b0a8fb135e$exports = {
323
323
  };
324
324
 
325
325
 
326
- $27a5e9bc18eefb32$exports = {
326
+ $7827d180f5c8b41b$exports = {
327
327
  "ar-AE": $a55551a02f9dcb5c$exports,
328
328
  "bg-BG": $d9c7f58ad2bbfa4c$exports,
329
329
  "cs-CZ": $cc8c40dafb8d03b0$exports,
@@ -452,9 +452,10 @@ let $a57fc2323bf98a33$var$sizeMap = {
452
452
  fullscreenTakeover: "fullscreenTakeover"
453
453
  };
454
454
  function $a57fc2323bf98a33$var$Dialog(props, ref) {
455
+ props = (0, $iaoFN$reactspectrumutils.useSlotProps)(props, "dialog");
455
456
  let { type: type = "modal" , ...contextProps } = (0, $iaoFN$react.useContext)((0, $0eb909ad2388d989$export$8b93a07348a7730c)) || {};
456
457
  let { children: children , isDismissable: isDismissable = contextProps.isDismissable , onDismiss: onDismiss = contextProps.onClose , size: size , ...otherProps } = props;
457
- let stringFormatter = (0, $iaoFN$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($27a5e9bc18eefb32$exports))));
458
+ let stringFormatter = (0, $iaoFN$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($7827d180f5c8b41b$exports))));
458
459
  let { styleProps: styleProps } = (0, $iaoFN$reactspectrumutils.useStyleProps)(otherProps);
459
460
  size = type === "popover" ? size || "S" : size || "L";
460
461
  let domRef = (0, $iaoFN$reactspectrumutils.useDOMRef)(ref);
@@ -546,7 +547,7 @@ function $a57fc2323bf98a33$var$Dialog(props, ref) {
546
547
  let { onClose: onClose = ()=>{} } = (0, $iaoFN$react.useContext)((0, $0eb909ad2388d989$export$8b93a07348a7730c)) || {};
547
548
  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;
548
549
  let { styleProps: styleProps } = (0, $iaoFN$reactspectrumutils.useStyleProps)(otherProps);
549
- let stringFormatter = (0, $iaoFN$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($27a5e9bc18eefb32$exports))));
550
+ let stringFormatter = (0, $iaoFN$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($7827d180f5c8b41b$exports))));
550
551
  let confirmVariant = "primary";
551
552
  if (variant) {
552
553
  if (variant === "confirmation") confirmVariant = "cta";
@@ -673,6 +674,7 @@ function $46e54a192dc519c9$var$DialogTrigger(props) {
673
674
  }
674
675
  // Support DialogTrigger inside components using CollectionBuilder.
675
676
  $46e54a192dc519c9$var$DialogTrigger.getCollectionNode = function*(props) {
677
+ // @ts-ignore - seems like types are wrong. Function children work fine.
676
678
  let [trigger] = (0, ($parcel$interopDefault($iaoFN$react))).Children.toArray(props.children);
677
679
  let [, content] = props.children;
678
680
  yield {
@@ -748,9 +750,13 @@ function $1b7050825e0eb5b6$export$547754aada6e339f(props) {
748
750
  let { children: children , type: type = "modal" , onDismiss: onDismiss , isDismissable: isDismissable , isKeyboardDismissDisabled: isKeyboardDismissDisabled } = props;
749
751
  let childArray = (0, ($parcel$interopDefault($iaoFN$react))).Children.toArray(children);
750
752
  if (childArray.length > 1) throw new Error("Only a single child can be passed to DialogContainer.");
751
- let lastChild = (0, $iaoFN$react.useRef)(null);
752
- let child = /*#__PURE__*/ (0, ($parcel$interopDefault($iaoFN$react))).isValidElement(childArray[0]) ? childArray[0] : null;
753
- if (child) lastChild.current = child;
753
+ let [lastChild, setLastChild] = (0, $iaoFN$react.useState)(null);
754
+ // React.Children.toArray mutates the children, and we need them to be stable
755
+ // between renders so that the lastChild comparison works.
756
+ let child = null;
757
+ if (Array.isArray(children)) child = children.find((0, ($parcel$interopDefault($iaoFN$react))).isValidElement);
758
+ else if (/*#__PURE__*/ (0, ($parcel$interopDefault($iaoFN$react))).isValidElement(children)) child = children;
759
+ if (child && child !== lastChild) setLastChild(child);
754
760
  let context = {
755
761
  type: type,
756
762
  onClose: onDismiss,
@@ -769,7 +775,7 @@ function $1b7050825e0eb5b6$export$547754aada6e339f(props) {
769
775
  isKeyboardDismissDisabled: isKeyboardDismissDisabled
770
776
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($iaoFN$react))).createElement((0, $0eb909ad2388d989$export$8b93a07348a7730c).Provider, {
771
777
  value: context
772
- },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B;AAIT;;;AC7MA;;;;;;;;;;CAUC,GAED;;;;AAWO,SAAS,0CAAgB,KAAmC,EAAE;IACnE,IAAI,YACF,SAAQ,QACR,OAAO,qBACP,UAAS,iBACT,cAAa,6BACb,0BAAyB,EAC1B,GAAG;IAEJ,IAAI,aAAa,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;IACxC,IAAI,WAAW,MAAM,GAAG,GACtB,MAAM,IAAI,MAAM,yDAAyD;IAG3E,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAgB,IAAI;IACzC,IAAI,sBAAQ,CAAA,GAAA,sCAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAAE,IAAI,UAAU,CAAC,EAAE,GAAG,IAAI;IACtE,IAAI,OACF,UAAU,OAAO,GAAG;IAGtB,IAAI,UAAU;cACZ;QACA,SAAS;uBACT;IACF;IAEA,IAAI,QAAQ,CAAA,GAAA,kDAAqB,EAAE;QACjC,QAAQ,CAAC,CAAC;QACV,cAAc,CAAA,SAAU;YACtB,IAAI,CAAC,QACH;QAEJ;IACF;IAEA,qBACE,0DAAC,CAAA,GAAA,kCAAK,AAAD;QACH,OAAO;QACP,MAAM;QACN,eAAe;QACf,2BAA2B;qBAC3B,0DAAC,CAAA,GAAA,yCAAa,AAAD,EAAE,QAAQ;QAAC,OAAO;OAC5B,UAAU,OAAO;AAI1B;;;ACrEA;;;;;;;;;;CAUC,GAED;;AAQO,SAAS,4CAA2C;IACzD,IAAI,UAAU,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,yCAAY;IACrC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,gFAAgF;IAGlG,OAAO;QACL,MAAM,QAAQ,IAAI;QAClB,WAAU;YACR,QAAQ,OAAO;QACjB;IACF;AACF;;","sources":["packages/@react-spectrum/dialog/src/index.ts","packages/@react-spectrum/dialog/src/AlertDialog.tsx","packages/@react-spectrum/dialog/src/Dialog.tsx","packages/@react-spectrum/dialog/src/context.ts","packages/@react-spectrum/dialog/intl/*.js","packages/@react-spectrum/dialog/intl/ar-AE.json","packages/@react-spectrum/dialog/intl/bg-BG.json","packages/@react-spectrum/dialog/intl/cs-CZ.json","packages/@react-spectrum/dialog/intl/da-DK.json","packages/@react-spectrum/dialog/intl/de-DE.json","packages/@react-spectrum/dialog/intl/el-GR.json","packages/@react-spectrum/dialog/intl/en-US.json","packages/@react-spectrum/dialog/intl/es-ES.json","packages/@react-spectrum/dialog/intl/et-EE.json","packages/@react-spectrum/dialog/intl/fi-FI.json","packages/@react-spectrum/dialog/intl/fr-FR.json","packages/@react-spectrum/dialog/intl/he-IL.json","packages/@react-spectrum/dialog/intl/hr-HR.json","packages/@react-spectrum/dialog/intl/hu-HU.json","packages/@react-spectrum/dialog/intl/it-IT.json","packages/@react-spectrum/dialog/intl/ja-JP.json","packages/@react-spectrum/dialog/intl/ko-KR.json","packages/@react-spectrum/dialog/intl/lt-LT.json","packages/@react-spectrum/dialog/intl/lv-LV.json","packages/@react-spectrum/dialog/intl/nb-NO.json","packages/@react-spectrum/dialog/intl/nl-NL.json","packages/@react-spectrum/dialog/intl/pl-PL.json","packages/@react-spectrum/dialog/intl/pt-BR.json","packages/@react-spectrum/dialog/intl/pt-PT.json","packages/@react-spectrum/dialog/intl/ro-RO.json","packages/@react-spectrum/dialog/intl/ru-RU.json","packages/@react-spectrum/dialog/intl/sk-SK.json","packages/@react-spectrum/dialog/intl/sl-SI.json","packages/@react-spectrum/dialog/intl/sr-SP.json","packages/@react-spectrum/dialog/intl/sv-SE.json","packages/@react-spectrum/dialog/intl/tr-TR.json","packages/@react-spectrum/dialog/intl/uk-UA.json","packages/@react-spectrum/dialog/intl/zh-CN.json","packages/@react-spectrum/dialog/intl/zh-TW.json","packages/@adobe/spectrum-css-temp/components/dialog/vars.css","packages/@react-spectrum/dialog/src/DialogTrigger.tsx","packages/@react-spectrum/dialog/src/DialogContainer.tsx","packages/@react-spectrum/dialog/src/useDialogContainer.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 './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","/*\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);\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","/*\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 {classNames, SlotProvider, unwrapDOMRef, useDOMRef, useHasChild, useStyleProps} 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 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);\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef();\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","/*\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 React, {HTMLAttributes} from 'react';\n\nexport interface DialogContextValue extends HTMLAttributes<HTMLElement> {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n isDismissable?: boolean,\n onClose: () => void\n}\n\nexport const DialogContext = React.createContext<DialogContextValue>(null);\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"alert\": \"تنبيه\",\n \"dismiss\": \"تجاهل\"\n}\n","{\n \"alert\": \"Сигнал\",\n \"dismiss\": \"Отхвърляне\"\n}\n","{\n \"alert\": \"Výstraha\",\n \"dismiss\": \"Odstranit\"\n}\n","{\n \"alert\": \"Advarsel\",\n \"dismiss\": \"Luk\"\n}\n","{\n \"alert\": \"Warnhinweis\",\n \"dismiss\": \"Schließen\"\n}\n","{\n \"alert\": \"Ειδοποίηση\",\n \"dismiss\": \"Απόρριψη\"\n}\n","{\n \"dismiss\": \"Dismiss\",\n \"alert\": \"Alert\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Descartar\"\n}\n","{\n \"alert\": \"Teade\",\n \"dismiss\": \"Lõpeta\"\n}\n","{\n \"alert\": \"Hälytys\",\n \"dismiss\": \"Hylkää\"\n}\n","{\n \"alert\": \"Alerte\",\n \"dismiss\": \"Rejeter\"\n}\n","{\n \"alert\": \"התראה\",\n \"dismiss\": \"התעלם\"\n}\n","{\n \"alert\": \"Upozorenje\",\n \"dismiss\": \"Odbaci\"\n}\n","{\n \"alert\": \"Figyelmeztetés\",\n \"dismiss\": \"Elutasítás\"\n}\n","{\n \"alert\": \"Avviso\",\n \"dismiss\": \"Ignora\"\n}\n","{\n \"alert\": \"アラート\",\n \"dismiss\": \"閉じる\"\n}\n","{\n \"alert\": \"경고\",\n \"dismiss\": \"무시\"\n}\n","{\n \"alert\": \"Įspėjimas\",\n \"dismiss\": \"Atmesti\"\n}\n","{\n \"alert\": \"Brīdinājums\",\n \"dismiss\": \"Nerādīt\"\n}\n","{\n \"alert\": \"Varsel\",\n \"dismiss\": \"Lukk\"\n}\n","{\n \"alert\": \"Melding\",\n \"dismiss\": \"Negeren\"\n}\n","{\n \"alert\": \"Ostrzeżenie\",\n \"dismiss\": \"Zignoruj\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Descartar\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Dispensar\"\n}\n","{\n \"alert\": \"Alertă\",\n \"dismiss\": \"Revocare\"\n}\n","{\n \"alert\": \"Предупреждение\",\n \"dismiss\": \"Пропустить\"\n}\n","{\n \"alert\": \"Upozornenie\",\n \"dismiss\": \"Zrušiť\"\n}\n","{\n \"alert\": \"Opozorilo\",\n \"dismiss\": \"Opusti\"\n}\n","{\n \"alert\": \"Upozorenje\",\n \"dismiss\": \"Odbaci\"\n}\n","{\n \"alert\": \"Varning\",\n \"dismiss\": \"Avvisa\"\n}\n","{\n \"alert\": \"Uyarı\",\n \"dismiss\": \"Kapat\"\n}\n","{\n \"alert\": \"Сигнал тривоги\",\n \"dismiss\": \"Скасувати\"\n}\n","{\n \"alert\": \"警报\",\n \"dismiss\": \"取消\"\n}\n","{\n \"alert\": \"警示\",\n \"dismiss\": \"關閉\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {Modal, Popover, Tray} from '@react-spectrum/overlays';\nimport {OverlayTriggerState, useOverlayTriggerState} from '@react-stately/overlays';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {Fragment, ReactElement, useEffect, useRef} from 'react';\nimport {SpectrumDialogClose, SpectrumDialogProps, SpectrumDialogTriggerProps} from '@react-types/dialog';\nimport {useIsMobileDevice} from '@react-spectrum/utils';\nimport {useOverlayTrigger} from '@react-aria/overlays';\n\nfunction DialogTrigger(props: SpectrumDialogTriggerProps) {\n let {\n children,\n type = 'modal',\n mobileType = type === 'popover' ? 'modal' : type,\n hideArrow,\n targetRef,\n isDismissable,\n isKeyboardDismissDisabled,\n ...positionProps\n } = props;\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('DialogTrigger must have exactly 2 children');\n }\n // if a function is passed as the second child, it won't appear in toArray\n let [trigger, content] = children as [ReactElement, SpectrumDialogClose];\n\n // On small devices, show a modal or tray instead of a popover.\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // handle cases where desktop popovers need a close button for the mobile modal view\n if (type !== 'modal' && mobileType === 'modal') {\n isDismissable = true;\n }\n\n type = mobileType;\n }\n\n let state = useOverlayTriggerState(props);\n let wasOpen = useRef(false);\n useEffect(() => {\n wasOpen.current = state.isOpen;\n }, [state.isOpen]);\n\n let isExiting = useRef(false);\n let onExiting = () => isExiting.current = true;\n let onExited = () => isExiting.current = false;\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n if ((wasOpen.current || isExiting.current) && type !== 'popover' && type !== 'tray') {\n console.warn('A DialogTrigger unmounted while open. This is likely due to being placed within a trigger that unmounts or inside a conditional. Consider using a DialogContainer instead.');\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (type === 'popover') {\n return (\n <PopoverTrigger\n {...positionProps}\n state={state}\n targetRef={targetRef}\n trigger={trigger}\n content={content}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n hideArrow={hideArrow} />\n );\n }\n\n let renderOverlay = () => {\n switch (type) {\n case 'fullscreen':\n case 'fullscreenTakeover':\n case 'modal':\n return (\n <Modal\n state={state}\n isDismissable={type === 'modal' ? isDismissable : false}\n type={type}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n onExiting={onExiting}\n onExited={onExited}>\n {typeof content === 'function' ? content(state.close) : content}\n </Modal>\n );\n case 'tray':\n return (\n <Tray\n state={state}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n {typeof content === 'function' ? content(state.close) : content}\n </Tray>\n );\n }\n };\n\n return (\n <DialogTriggerBase\n type={type}\n state={state}\n isDismissable={isDismissable}\n trigger={trigger}\n overlay={renderOverlay()} />\n );\n}\n\n// Support DialogTrigger inside components using CollectionBuilder.\nDialogTrigger.getCollectionNode = function* (props: SpectrumDialogTriggerProps) {\n let [trigger] = React.Children.toArray(props.children);\n let [, content] = props.children as [ReactElement, SpectrumDialogClose];\n yield {\n element: trigger,\n wrapper: (element) => (\n <DialogTrigger key={element.key} {...props}>\n {element}\n {content}\n </DialogTrigger>\n )\n };\n};\n\n/**\n * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's\n * open state with the trigger's press state. Additionally, it allows you to customize the type and\n * positioning of the Dialog.\n */\n\n// We don't want getCollectionNode to show up in the type definition\nlet _DialogTrigger = DialogTrigger as (props: SpectrumDialogTriggerProps) => JSX.Element;\nexport {_DialogTrigger as DialogTrigger};\n\nfunction PopoverTrigger({state, targetRef, trigger, content, hideArrow, ...props}) {\n let triggerRef = useRef<HTMLElement>();\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'dialog'}, state, triggerRef);\n\n let triggerPropsWithRef = {\n ...triggerProps,\n ref: targetRef ? undefined : triggerRef\n };\n\n let overlay = (\n <Popover\n {...props}\n hideArrow={hideArrow}\n triggerRef={targetRef || triggerRef}\n state={state}>\n {typeof content === 'function' ? content(state.close) : content}\n </Popover>\n );\n\n return (\n <DialogTriggerBase\n type=\"popover\"\n state={state}\n triggerProps={triggerPropsWithRef}\n dialogProps={overlayProps}\n trigger={trigger}\n overlay={overlay} />\n );\n}\n\ninterface SpectrumDialogTriggerBase {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n state: OverlayTriggerState,\n isDismissable?: boolean,\n dialogProps?: SpectrumDialogProps | {},\n triggerProps?: any,\n overlay: ReactElement,\n trigger: ReactElement\n}\n\nfunction DialogTriggerBase({type, state, isDismissable, dialogProps = {}, triggerProps = {}, overlay, trigger}: SpectrumDialogTriggerBase) {\n let context = {\n type,\n onClose: state.close,\n isDismissable,\n ...dialogProps\n };\n\n return (\n <Fragment>\n <PressResponder\n {...triggerProps}\n onPress={state.toggle}\n isPressed={state.isOpen && type !== 'modal' && type !== 'fullscreen' && type !== 'fullscreenTakeover'}>\n {trigger}\n </PressResponder>\n <DialogContext.Provider value={context}>\n {overlay}\n </DialogContext.Provider>\n </Fragment>\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {Modal} from '@react-spectrum/overlays';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDialogContainerProps} from '@react-types/dialog';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\n\n/**\n * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding\n * it in a modal. Useful in cases where there is no trigger element\n * or when the trigger unmounts while the dialog is open.\n */\nexport function DialogContainer(props: SpectrumDialogContainerProps) {\n let {\n children,\n type = 'modal',\n onDismiss,\n isDismissable,\n isKeyboardDismissDisabled\n } = props;\n\n let childArray = React.Children.toArray(children);\n if (childArray.length > 1) {\n throw new Error('Only a single child can be passed to DialogContainer.');\n }\n\n let lastChild = useRef<ReactElement>(null);\n let child = React.isValidElement(childArray[0]) ? childArray[0] : null;\n if (child) {\n lastChild.current = child;\n }\n\n let context = {\n type,\n onClose: onDismiss,\n isDismissable\n };\n\n let state = useOverlayTriggerState({\n isOpen: !!child,\n onOpenChange: isOpen => {\n if (!isOpen) {\n onDismiss();\n }\n }\n });\n\n return (\n <Modal\n state={state}\n type={type}\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogContext.Provider value={context}>\n {lastChild.current}\n </DialogContext.Provider>\n </Modal>\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {useContext} from 'react';\n\nexport interface DialogContainerValue {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useContext(DialogContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n type: context.type,\n dismiss() {\n context.onClose();\n }\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;ACVD;;;;;;;;;;CAUC;;;ACVD;;;;;;;;;;CAUC;AAUM,MAAM,4CAAgB,CAAA,GAAA,sCAAI,EAAE,cAAkC;;;;;;AEpBrE,4BAAiB;IAAG,SAAS,CAAC,K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CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,OAAO;QACL,MAAM,QAAQ;QACd;YACE,QAAQ;QACV;IACF;AACF;;","sources":["packages/@react-spectrum/dialog/src/index.ts","packages/@react-spectrum/dialog/src/AlertDialog.tsx","packages/@react-spectrum/dialog/src/Dialog.tsx","packages/@react-spectrum/dialog/src/context.ts","packages/@react-spectrum/dialog/src/*.js","packages/@react-spectrum/dialog/intl/ar-AE.json","packages/@react-spectrum/dialog/intl/bg-BG.json","packages/@react-spectrum/dialog/intl/cs-CZ.json","packages/@react-spectrum/dialog/intl/da-DK.json","packages/@react-spectrum/dialog/intl/de-DE.json","packages/@react-spectrum/dialog/intl/el-GR.json","packages/@react-spectrum/dialog/intl/en-US.json","packages/@react-spectrum/dialog/intl/es-ES.json","packages/@react-spectrum/dialog/intl/et-EE.json","packages/@react-spectrum/dialog/intl/fi-FI.json","packages/@react-spectrum/dialog/intl/fr-FR.json","packages/@react-spectrum/dialog/intl/he-IL.json","packages/@react-spectrum/dialog/intl/hr-HR.json","packages/@react-spectrum/dialog/intl/hu-HU.json","packages/@react-spectrum/dialog/intl/it-IT.json","packages/@react-spectrum/dialog/intl/ja-JP.json","packages/@react-spectrum/dialog/intl/ko-KR.json","packages/@react-spectrum/dialog/intl/lt-LT.json","packages/@react-spectrum/dialog/intl/lv-LV.json","packages/@react-spectrum/dialog/intl/nb-NO.json","packages/@react-spectrum/dialog/intl/nl-NL.json","packages/@react-spectrum/dialog/intl/pl-PL.json","packages/@react-spectrum/dialog/intl/pt-BR.json","packages/@react-spectrum/dialog/intl/pt-PT.json","packages/@react-spectrum/dialog/intl/ro-RO.json","packages/@react-spectrum/dialog/intl/ru-RU.json","packages/@react-spectrum/dialog/intl/sk-SK.json","packages/@react-spectrum/dialog/intl/sl-SI.json","packages/@react-spectrum/dialog/intl/sr-SP.json","packages/@react-spectrum/dialog/intl/sv-SE.json","packages/@react-spectrum/dialog/intl/tr-TR.json","packages/@react-spectrum/dialog/intl/uk-UA.json","packages/@react-spectrum/dialog/intl/zh-CN.json","packages/@react-spectrum/dialog/intl/zh-TW.json","packages/@adobe/spectrum-css-temp/components/dialog/vars.css","packages/@react-spectrum/dialog/src/DialogTrigger.tsx","packages/@react-spectrum/dialog/src/DialogContainer.tsx","packages/@react-spectrum/dialog/src/useDialogContainer.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 './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","/*\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);\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","/*\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);\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef();\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","/*\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 React, {HTMLAttributes} from 'react';\n\nexport interface DialogContextValue extends HTMLAttributes<HTMLElement> {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n isDismissable?: boolean,\n onClose: () => void\n}\n\nexport const DialogContext = React.createContext<DialogContextValue>(null);\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"alert\": \"تنبيه\",\n \"dismiss\": \"تجاهل\"\n}\n","{\n \"alert\": \"Сигнал\",\n \"dismiss\": \"Отхвърляне\"\n}\n","{\n \"alert\": \"Výstraha\",\n \"dismiss\": \"Odstranit\"\n}\n","{\n \"alert\": \"Advarsel\",\n \"dismiss\": \"Luk\"\n}\n","{\n \"alert\": \"Warnhinweis\",\n \"dismiss\": \"Schließen\"\n}\n","{\n \"alert\": \"Ειδοποίηση\",\n \"dismiss\": \"Απόρριψη\"\n}\n","{\n \"dismiss\": \"Dismiss\",\n \"alert\": \"Alert\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Descartar\"\n}\n","{\n \"alert\": \"Teade\",\n \"dismiss\": \"Lõpeta\"\n}\n","{\n \"alert\": \"Hälytys\",\n \"dismiss\": \"Hylkää\"\n}\n","{\n \"alert\": \"Alerte\",\n \"dismiss\": \"Rejeter\"\n}\n","{\n \"alert\": \"התראה\",\n \"dismiss\": \"התעלם\"\n}\n","{\n \"alert\": \"Upozorenje\",\n \"dismiss\": \"Odbaci\"\n}\n","{\n \"alert\": \"Figyelmeztetés\",\n \"dismiss\": \"Elutasítás\"\n}\n","{\n \"alert\": \"Avviso\",\n \"dismiss\": \"Ignora\"\n}\n","{\n \"alert\": \"アラート\",\n \"dismiss\": \"閉じる\"\n}\n","{\n \"alert\": \"경고\",\n \"dismiss\": \"무시\"\n}\n","{\n \"alert\": \"Įspėjimas\",\n \"dismiss\": \"Atmesti\"\n}\n","{\n \"alert\": \"Brīdinājums\",\n \"dismiss\": \"Nerādīt\"\n}\n","{\n \"alert\": \"Varsel\",\n \"dismiss\": \"Lukk\"\n}\n","{\n \"alert\": \"Melding\",\n \"dismiss\": \"Negeren\"\n}\n","{\n \"alert\": \"Ostrzeżenie\",\n \"dismiss\": \"Zignoruj\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Descartar\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Dispensar\"\n}\n","{\n \"alert\": \"Alertă\",\n \"dismiss\": \"Revocare\"\n}\n","{\n \"alert\": \"Предупреждение\",\n \"dismiss\": \"Пропустить\"\n}\n","{\n \"alert\": \"Upozornenie\",\n \"dismiss\": \"Zrušiť\"\n}\n","{\n \"alert\": \"Opozorilo\",\n \"dismiss\": \"Opusti\"\n}\n","{\n \"alert\": \"Upozorenje\",\n \"dismiss\": \"Odbaci\"\n}\n","{\n \"alert\": \"Varning\",\n \"dismiss\": \"Avvisa\"\n}\n","{\n \"alert\": \"Uyarı\",\n \"dismiss\": \"Kapat\"\n}\n","{\n \"alert\": \"Сигнал тривоги\",\n \"dismiss\": \"Скасувати\"\n}\n","{\n \"alert\": \"警报\",\n \"dismiss\": \"取消\"\n}\n","{\n \"alert\": \"警示\",\n \"dismiss\": \"關閉\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {Modal, Popover, Tray} from '@react-spectrum/overlays';\nimport {OverlayTriggerState, useOverlayTriggerState} from '@react-stately/overlays';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {Fragment, ReactElement, useEffect, useRef} from 'react';\nimport {SpectrumDialogClose, SpectrumDialogProps, SpectrumDialogTriggerProps} from '@react-types/dialog';\nimport {useIsMobileDevice} from '@react-spectrum/utils';\nimport {useOverlayTrigger} from '@react-aria/overlays';\n\nfunction DialogTrigger(props: SpectrumDialogTriggerProps) {\n let {\n children,\n type = 'modal',\n mobileType = type === 'popover' ? 'modal' : type,\n hideArrow,\n targetRef,\n isDismissable,\n isKeyboardDismissDisabled,\n ...positionProps\n } = props;\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('DialogTrigger must have exactly 2 children');\n }\n // if a function is passed as the second child, it won't appear in toArray\n let [trigger, content] = children as [ReactElement, SpectrumDialogClose];\n\n // On small devices, show a modal or tray instead of a popover.\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // handle cases where desktop popovers need a close button for the mobile modal view\n if (type !== 'modal' && mobileType === 'modal') {\n isDismissable = true;\n }\n\n type = mobileType;\n }\n\n let state = useOverlayTriggerState(props);\n let wasOpen = useRef(false);\n useEffect(() => {\n wasOpen.current = state.isOpen;\n }, [state.isOpen]);\n\n let isExiting = useRef(false);\n let onExiting = () => isExiting.current = true;\n let onExited = () => isExiting.current = false;\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n if ((wasOpen.current || isExiting.current) && type !== 'popover' && type !== 'tray') {\n console.warn('A DialogTrigger unmounted while open. This is likely due to being placed within a trigger that unmounts or inside a conditional. Consider using a DialogContainer instead.');\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (type === 'popover') {\n return (\n <PopoverTrigger\n {...positionProps}\n state={state}\n targetRef={targetRef}\n trigger={trigger}\n content={content}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n hideArrow={hideArrow} />\n );\n }\n\n let renderOverlay = () => {\n switch (type) {\n case 'fullscreen':\n case 'fullscreenTakeover':\n case 'modal':\n return (\n <Modal\n state={state}\n isDismissable={type === 'modal' ? isDismissable : false}\n type={type}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n onExiting={onExiting}\n onExited={onExited}>\n {typeof content === 'function' ? content(state.close) : content}\n </Modal>\n );\n case 'tray':\n return (\n <Tray\n state={state}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n {typeof content === 'function' ? content(state.close) : content}\n </Tray>\n );\n }\n };\n\n return (\n <DialogTriggerBase\n type={type}\n state={state}\n isDismissable={isDismissable}\n trigger={trigger}\n overlay={renderOverlay()} />\n );\n}\n\n// Support DialogTrigger inside components using CollectionBuilder.\nDialogTrigger.getCollectionNode = function* (props: SpectrumDialogTriggerProps) {\n // @ts-ignore - seems like types are wrong. Function children work fine.\n let [trigger] = React.Children.toArray(props.children);\n let [, content] = props.children as [ReactElement, SpectrumDialogClose];\n yield {\n element: trigger,\n wrapper: (element) => (\n <DialogTrigger key={element.key} {...props}>\n {element}\n {content}\n </DialogTrigger>\n )\n };\n};\n\n/**\n * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's\n * open state with the trigger's press state. Additionally, it allows you to customize the type and\n * positioning of the Dialog.\n */\n\n// We don't want getCollectionNode to show up in the type definition\nlet _DialogTrigger = DialogTrigger as (props: SpectrumDialogTriggerProps) => JSX.Element;\nexport {_DialogTrigger as DialogTrigger};\n\nfunction PopoverTrigger({state, targetRef, trigger, content, hideArrow, ...props}) {\n let triggerRef = useRef<HTMLElement>();\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'dialog'}, state, triggerRef);\n\n let triggerPropsWithRef = {\n ...triggerProps,\n ref: targetRef ? undefined : triggerRef\n };\n\n let overlay = (\n <Popover\n {...props}\n hideArrow={hideArrow}\n triggerRef={targetRef || triggerRef}\n state={state}>\n {typeof content === 'function' ? content(state.close) : content}\n </Popover>\n );\n\n return (\n <DialogTriggerBase\n type=\"popover\"\n state={state}\n triggerProps={triggerPropsWithRef}\n dialogProps={overlayProps}\n trigger={trigger}\n overlay={overlay} />\n );\n}\n\ninterface SpectrumDialogTriggerBase {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n state: OverlayTriggerState,\n isDismissable?: boolean,\n dialogProps?: SpectrumDialogProps | {},\n triggerProps?: any,\n overlay: ReactElement,\n trigger: ReactElement\n}\n\nfunction DialogTriggerBase({type, state, isDismissable, dialogProps = {}, triggerProps = {}, overlay, trigger}: SpectrumDialogTriggerBase) {\n let context = {\n type,\n onClose: state.close,\n isDismissable,\n ...dialogProps\n };\n\n return (\n <Fragment>\n <PressResponder\n {...triggerProps}\n onPress={state.toggle}\n isPressed={state.isOpen && type !== 'modal' && type !== 'fullscreen' && type !== 'fullscreenTakeover'}>\n {trigger}\n </PressResponder>\n <DialogContext.Provider value={context}>\n {overlay}\n </DialogContext.Provider>\n </Fragment>\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {Modal} from '@react-spectrum/overlays';\nimport React, {ReactElement, useState} from 'react';\nimport {SpectrumDialogContainerProps} from '@react-types/dialog';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\n\n/**\n * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding\n * it in a modal. Useful in cases where there is no trigger element\n * or when the trigger unmounts while the dialog is open.\n */\nexport function DialogContainer(props: SpectrumDialogContainerProps) {\n let {\n children,\n type = 'modal',\n onDismiss,\n isDismissable,\n isKeyboardDismissDisabled\n } = props;\n\n let childArray = React.Children.toArray(children);\n if (childArray.length > 1) {\n throw new Error('Only a single child can be passed to DialogContainer.');\n }\n\n let [lastChild, setLastChild] = useState<ReactElement | null>(null);\n\n // React.Children.toArray mutates the children, and we need them to be stable\n // between renders so that the lastChild comparison works.\n let child = null;\n if (Array.isArray(children)) {\n child = children.find(React.isValidElement);\n } else if (React.isValidElement(children)) {\n child = children;\n }\n\n if (child && child !== lastChild) {\n setLastChild(child);\n }\n\n let context = {\n type,\n onClose: onDismiss,\n isDismissable\n };\n\n let state = useOverlayTriggerState({\n isOpen: !!child,\n onOpenChange: isOpen => {\n if (!isOpen) {\n onDismiss();\n }\n }\n });\n\n return (\n <Modal\n state={state}\n type={type}\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogContext.Provider value={context}>\n {lastChild}\n </DialogContext.Provider>\n </Modal>\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {useContext} from 'react';\n\nexport interface DialogContainerValue {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useContext(DialogContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n type: context.type,\n dismiss() {\n context.onClose();\n }\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -3,11 +3,11 @@ import $b4euU$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
3
3
  import {Button as $b4euU$Button, ActionButton as $b4euU$ActionButton} from "@react-spectrum/button";
4
4
  import {ButtonGroup as $b4euU$ButtonGroup} from "@react-spectrum/buttongroup";
5
5
  import {chain as $b4euU$chain, mergeProps as $b4euU$mergeProps} from "@react-aria/utils";
6
- import {useStyleProps as $b4euU$useStyleProps, classNames as $b4euU$classNames, useDOMRef as $b4euU$useDOMRef, useHasChild as $b4euU$useHasChild, unwrapDOMRef as $b4euU$unwrapDOMRef, SlotProvider as $b4euU$SlotProvider, useIsMobileDevice as $b4euU$useIsMobileDevice} from "@react-spectrum/utils";
6
+ import {useStyleProps as $b4euU$useStyleProps, classNames as $b4euU$classNames, useSlotProps as $b4euU$useSlotProps, useDOMRef as $b4euU$useDOMRef, useHasChild as $b4euU$useHasChild, unwrapDOMRef as $b4euU$unwrapDOMRef, SlotProvider as $b4euU$SlotProvider, useIsMobileDevice as $b4euU$useIsMobileDevice} from "@react-spectrum/utils";
7
7
  import {Content as $b4euU$Content} from "@react-spectrum/view";
8
8
  import {Divider as $b4euU$Divider} from "@react-spectrum/divider";
9
9
  import {Heading as $b4euU$Heading} from "@react-spectrum/text";
10
- import $b4euU$react, {useContext as $b4euU$useContext, forwardRef as $b4euU$forwardRef, useRef as $b4euU$useRef, useMemo as $b4euU$useMemo, useEffect as $b4euU$useEffect, Fragment as $b4euU$Fragment} from "react";
10
+ import $b4euU$react, {useContext as $b4euU$useContext, forwardRef as $b4euU$forwardRef, useRef as $b4euU$useRef, useMemo as $b4euU$useMemo, useEffect as $b4euU$useEffect, Fragment as $b4euU$Fragment, useState as $b4euU$useState} from "react";
11
11
  import {useLocalizedStringFormatter as $b4euU$useLocalizedStringFormatter} from "@react-aria/i18n";
12
12
  import $b4euU$spectrumiconsuiCrossLarge from "@spectrum-icons/ui/CrossLarge";
13
13
  import {Grid as $b4euU$Grid} from "@react-spectrum/layout";
@@ -78,7 +78,7 @@ const $97b119e05830ea0d$export$8b93a07348a7730c = (0, $b4euU$react).createContex
78
78
 
79
79
 
80
80
 
81
- var $5c372ca6bd75272c$exports = {};
81
+ var $f3fff851f5cc5a1e$exports = {};
82
82
  var $cc8cbf248c4ac933$exports = {};
83
83
  $cc8cbf248c4ac933$exports = {
84
84
  "alert": `تنبيه`,
@@ -317,7 +317,7 @@ $03712eabbcfd201c$exports = {
317
317
  };
318
318
 
319
319
 
320
- $5c372ca6bd75272c$exports = {
320
+ $f3fff851f5cc5a1e$exports = {
321
321
  "ar-AE": $cc8cbf248c4ac933$exports,
322
322
  "bg-BG": $c23042f930ed2466$exports,
323
323
  "cs-CZ": $22339168a6e88f2f$exports,
@@ -446,9 +446,10 @@ let $99cd51dc4eb569f7$var$sizeMap = {
446
446
  fullscreenTakeover: "fullscreenTakeover"
447
447
  };
448
448
  function $99cd51dc4eb569f7$var$Dialog(props, ref) {
449
+ props = (0, $b4euU$useSlotProps)(props, "dialog");
449
450
  let { type: type = "modal" , ...contextProps } = (0, $b4euU$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
450
451
  let { children: children , isDismissable: isDismissable = contextProps.isDismissable , onDismiss: onDismiss = contextProps.onClose , size: size , ...otherProps } = props;
451
- let stringFormatter = (0, $b4euU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($5c372ca6bd75272c$exports))));
452
+ let stringFormatter = (0, $b4euU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f3fff851f5cc5a1e$exports))));
452
453
  let { styleProps: styleProps } = (0, $b4euU$useStyleProps)(otherProps);
453
454
  size = type === "popover" ? size || "S" : size || "L";
454
455
  let domRef = (0, $b4euU$useDOMRef)(ref);
@@ -540,7 +541,7 @@ function $99cd51dc4eb569f7$var$Dialog(props, ref) {
540
541
  let { onClose: onClose = ()=>{} } = (0, $b4euU$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
541
542
  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;
542
543
  let { styleProps: styleProps } = (0, $b4euU$useStyleProps)(otherProps);
543
- let stringFormatter = (0, $b4euU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($5c372ca6bd75272c$exports))));
544
+ let stringFormatter = (0, $b4euU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f3fff851f5cc5a1e$exports))));
544
545
  let confirmVariant = "primary";
545
546
  if (variant) {
546
547
  if (variant === "confirmation") confirmVariant = "cta";
@@ -667,6 +668,7 @@ function $c412c5ea680c1e4f$var$DialogTrigger(props) {
667
668
  }
668
669
  // Support DialogTrigger inside components using CollectionBuilder.
669
670
  $c412c5ea680c1e4f$var$DialogTrigger.getCollectionNode = function*(props) {
671
+ // @ts-ignore - seems like types are wrong. Function children work fine.
670
672
  let [trigger] = (0, $b4euU$react).Children.toArray(props.children);
671
673
  let [, content] = props.children;
672
674
  yield {
@@ -742,9 +744,13 @@ function $2a9f0ad39ddaa8d9$export$547754aada6e339f(props) {
742
744
  let { children: children , type: type = "modal" , onDismiss: onDismiss , isDismissable: isDismissable , isKeyboardDismissDisabled: isKeyboardDismissDisabled } = props;
743
745
  let childArray = (0, $b4euU$react).Children.toArray(children);
744
746
  if (childArray.length > 1) throw new Error("Only a single child can be passed to DialogContainer.");
745
- let lastChild = (0, $b4euU$useRef)(null);
746
- let child = /*#__PURE__*/ (0, $b4euU$react).isValidElement(childArray[0]) ? childArray[0] : null;
747
- if (child) lastChild.current = child;
747
+ let [lastChild, setLastChild] = (0, $b4euU$useState)(null);
748
+ // React.Children.toArray mutates the children, and we need them to be stable
749
+ // between renders so that the lastChild comparison works.
750
+ let child = null;
751
+ if (Array.isArray(children)) child = children.find((0, $b4euU$react).isValidElement);
752
+ else if (/*#__PURE__*/ (0, $b4euU$react).isValidElement(children)) child = children;
753
+ if (child && child !== lastChild) setLastChild(child);
748
754
  let context = {
749
755
  type: type,
750
756
  onClose: onDismiss,
@@ -763,7 +769,7 @@ function $2a9f0ad39ddaa8d9$export$547754aada6e339f(props) {
763
769
  isKeyboardDismissDisabled: isKeyboardDismissDisabled
764
770
  }, /*#__PURE__*/ (0, $b4euU$react).createElement((0, $97b119e05830ea0d$export$8b93a07348a7730c).Provider, {
765
771
  value: context
766
- }, lastChild.current));
772
+ }, lastChild));
767
773
  }
768
774
 
769
775
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;ACZA;;;;;;;;;;CAUC,GAED;;;ACZA;;;;;;;;;;CAUC,GAED;AAQO,MAAM,4CAAgB,CAAA,GAAA,YAAK,AAAD,EAAE,aAAa,CAAqB,IAAI;;;;;;AEpBzE,4BAAiB;IAAG,SAAS,CAAC,KAAK,CAAC;IAClC,WAAW,CAAC,KAAK,CAAC;AACpB;;ADFA;;AEAA,4BAAiB;IAAG,SAAS,CAAC,MAAM,CAAC;IACnC,WAAW,CAAC,UAAU,CAAC;AACzB;;;;ACFA,4BAAiB;IAAG,SAAS,C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BAAqB,EAAE;QACjC,QAAQ,CAAC,CAAC;QACV,cAAc,CAAA,SAAU;YACtB,IAAI,CAAC,QACH;QAEJ;IACF;IAEA,qBACE,gCAAC,CAAA,GAAA,YAAK,AAAD;QACH,OAAO;QACP,MAAM;QACN,eAAe;QACf,2BAA2B;qBAC3B,gCAAC,CAAA,GAAA,yCAAa,AAAD,EAAE,QAAQ;QAAC,OAAO;OAC5B,UAAU,OAAO;AAI1B;;;ACrEA;;;;;;;;;;CAUC,GAED;;AAQO,SAAS,4CAA2C;IACzD,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAY;IACrC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,gFAAgF;IAGlG,OAAO;QACL,MAAM,QAAQ,IAAI;QAClB,WAAU;YACR,QAAQ,OAAO;QACjB;IACF;AACF;;","sources":["packages/@react-spectrum/dialog/src/index.ts","packages/@react-spectrum/dialog/src/AlertDialog.tsx","packages/@react-spectrum/dialog/src/Dialog.tsx","packages/@react-spectrum/dialog/src/context.ts","packages/@react-spectrum/dialog/intl/*.js","packages/@react-spectrum/dialog/intl/ar-AE.json","packages/@react-spectrum/dialog/intl/bg-BG.json","packages/@react-spectrum/dialog/intl/cs-CZ.json","packages/@react-spectrum/dialog/intl/da-DK.json","packages/@react-spectrum/dialog/intl/de-DE.json","packages/@react-spectrum/dialog/intl/el-GR.json","packages/@react-spectrum/dialog/intl/en-US.json","packages/@react-spectrum/dialog/intl/es-ES.json","packages/@react-spectrum/dialog/intl/et-EE.json","packages/@react-spectrum/dialog/intl/fi-FI.json","packages/@react-spectrum/dialog/intl/fr-FR.json","packages/@react-spectrum/dialog/intl/he-IL.json","packages/@react-spectrum/dialog/intl/hr-HR.json","packages/@react-spectrum/dialog/intl/hu-HU.json","packages/@react-spectrum/dialog/intl/it-IT.json","packages/@react-spectrum/dialog/intl/ja-JP.json","packages/@react-spectrum/dialog/intl/ko-KR.json","packages/@react-spectrum/dialog/intl/lt-LT.json","packages/@react-spectrum/dialog/intl/lv-LV.json","packages/@react-spectrum/dialog/intl/nb-NO.json","packages/@react-spectrum/dialog/intl/nl-NL.json","packages/@react-spectrum/dialog/intl/pl-PL.json","packages/@react-spectrum/dialog/intl/pt-BR.json","packages/@react-spectrum/dialog/intl/pt-PT.json","packages/@react-spectrum/dialog/intl/ro-RO.json","packages/@react-spectrum/dialog/intl/ru-RU.json","packages/@react-spectrum/dialog/intl/sk-SK.json","packages/@react-spectrum/dialog/intl/sl-SI.json","packages/@react-spectrum/dialog/intl/sr-SP.json","packages/@react-spectrum/dialog/intl/sv-SE.json","packages/@react-spectrum/dialog/intl/tr-TR.json","packages/@react-spectrum/dialog/intl/uk-UA.json","packages/@react-spectrum/dialog/intl/zh-CN.json","packages/@react-spectrum/dialog/intl/zh-TW.json","packages/@adobe/spectrum-css-temp/components/dialog/vars.css","packages/@react-spectrum/dialog/src/DialogTrigger.tsx","packages/@react-spectrum/dialog/src/DialogContainer.tsx","packages/@react-spectrum/dialog/src/useDialogContainer.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 './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","/*\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);\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","/*\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 {classNames, SlotProvider, unwrapDOMRef, useDOMRef, useHasChild, useStyleProps} 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 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);\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef();\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","/*\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 React, {HTMLAttributes} from 'react';\n\nexport interface DialogContextValue extends HTMLAttributes<HTMLElement> {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n isDismissable?: boolean,\n onClose: () => void\n}\n\nexport const DialogContext = React.createContext<DialogContextValue>(null);\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"alert\": \"تنبيه\",\n \"dismiss\": \"تجاهل\"\n}\n","{\n \"alert\": \"Сигнал\",\n \"dismiss\": \"Отхвърляне\"\n}\n","{\n \"alert\": \"Výstraha\",\n \"dismiss\": \"Odstranit\"\n}\n","{\n \"alert\": \"Advarsel\",\n \"dismiss\": \"Luk\"\n}\n","{\n \"alert\": \"Warnhinweis\",\n \"dismiss\": \"Schließen\"\n}\n","{\n \"alert\": \"Ειδοποίηση\",\n \"dismiss\": \"Απόρριψη\"\n}\n","{\n \"dismiss\": \"Dismiss\",\n \"alert\": \"Alert\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Descartar\"\n}\n","{\n \"alert\": \"Teade\",\n \"dismiss\": \"Lõpeta\"\n}\n","{\n \"alert\": \"Hälytys\",\n \"dismiss\": \"Hylkää\"\n}\n","{\n \"alert\": \"Alerte\",\n \"dismiss\": \"Rejeter\"\n}\n","{\n \"alert\": \"התראה\",\n \"dismiss\": \"התעלם\"\n}\n","{\n \"alert\": \"Upozorenje\",\n \"dismiss\": \"Odbaci\"\n}\n","{\n \"alert\": \"Figyelmeztetés\",\n \"dismiss\": \"Elutasítás\"\n}\n","{\n \"alert\": \"Avviso\",\n \"dismiss\": \"Ignora\"\n}\n","{\n \"alert\": \"アラート\",\n \"dismiss\": \"閉じる\"\n}\n","{\n \"alert\": \"경고\",\n \"dismiss\": \"무시\"\n}\n","{\n \"alert\": \"Įspėjimas\",\n \"dismiss\": \"Atmesti\"\n}\n","{\n \"alert\": \"Brīdinājums\",\n \"dismiss\": \"Nerādīt\"\n}\n","{\n \"alert\": \"Varsel\",\n \"dismiss\": \"Lukk\"\n}\n","{\n \"alert\": \"Melding\",\n \"dismiss\": \"Negeren\"\n}\n","{\n \"alert\": \"Ostrzeżenie\",\n \"dismiss\": \"Zignoruj\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Descartar\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Dispensar\"\n}\n","{\n \"alert\": \"Alertă\",\n \"dismiss\": \"Revocare\"\n}\n","{\n \"alert\": \"Предупреждение\",\n \"dismiss\": \"Пропустить\"\n}\n","{\n \"alert\": \"Upozornenie\",\n \"dismiss\": \"Zrušiť\"\n}\n","{\n \"alert\": \"Opozorilo\",\n \"dismiss\": \"Opusti\"\n}\n","{\n \"alert\": \"Upozorenje\",\n \"dismiss\": \"Odbaci\"\n}\n","{\n \"alert\": \"Varning\",\n \"dismiss\": \"Avvisa\"\n}\n","{\n \"alert\": \"Uyarı\",\n \"dismiss\": \"Kapat\"\n}\n","{\n \"alert\": \"Сигнал тривоги\",\n \"dismiss\": \"Скасувати\"\n}\n","{\n \"alert\": \"警报\",\n \"dismiss\": \"取消\"\n}\n","{\n \"alert\": \"警示\",\n \"dismiss\": \"關閉\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {Modal, Popover, Tray} from '@react-spectrum/overlays';\nimport {OverlayTriggerState, useOverlayTriggerState} from '@react-stately/overlays';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {Fragment, ReactElement, useEffect, useRef} from 'react';\nimport {SpectrumDialogClose, SpectrumDialogProps, SpectrumDialogTriggerProps} from '@react-types/dialog';\nimport {useIsMobileDevice} from '@react-spectrum/utils';\nimport {useOverlayTrigger} from '@react-aria/overlays';\n\nfunction DialogTrigger(props: SpectrumDialogTriggerProps) {\n let {\n children,\n type = 'modal',\n mobileType = type === 'popover' ? 'modal' : type,\n hideArrow,\n targetRef,\n isDismissable,\n isKeyboardDismissDisabled,\n ...positionProps\n } = props;\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('DialogTrigger must have exactly 2 children');\n }\n // if a function is passed as the second child, it won't appear in toArray\n let [trigger, content] = children as [ReactElement, SpectrumDialogClose];\n\n // On small devices, show a modal or tray instead of a popover.\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // handle cases where desktop popovers need a close button for the mobile modal view\n if (type !== 'modal' && mobileType === 'modal') {\n isDismissable = true;\n }\n\n type = mobileType;\n }\n\n let state = useOverlayTriggerState(props);\n let wasOpen = useRef(false);\n useEffect(() => {\n wasOpen.current = state.isOpen;\n }, [state.isOpen]);\n\n let isExiting = useRef(false);\n let onExiting = () => isExiting.current = true;\n let onExited = () => isExiting.current = false;\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n if ((wasOpen.current || isExiting.current) && type !== 'popover' && type !== 'tray') {\n console.warn('A DialogTrigger unmounted while open. This is likely due to being placed within a trigger that unmounts or inside a conditional. Consider using a DialogContainer instead.');\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (type === 'popover') {\n return (\n <PopoverTrigger\n {...positionProps}\n state={state}\n targetRef={targetRef}\n trigger={trigger}\n content={content}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n hideArrow={hideArrow} />\n );\n }\n\n let renderOverlay = () => {\n switch (type) {\n case 'fullscreen':\n case 'fullscreenTakeover':\n case 'modal':\n return (\n <Modal\n state={state}\n isDismissable={type === 'modal' ? isDismissable : false}\n type={type}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n onExiting={onExiting}\n onExited={onExited}>\n {typeof content === 'function' ? content(state.close) : content}\n </Modal>\n );\n case 'tray':\n return (\n <Tray\n state={state}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n {typeof content === 'function' ? content(state.close) : content}\n </Tray>\n );\n }\n };\n\n return (\n <DialogTriggerBase\n type={type}\n state={state}\n isDismissable={isDismissable}\n trigger={trigger}\n overlay={renderOverlay()} />\n );\n}\n\n// Support DialogTrigger inside components using CollectionBuilder.\nDialogTrigger.getCollectionNode = function* (props: SpectrumDialogTriggerProps) {\n let [trigger] = React.Children.toArray(props.children);\n let [, content] = props.children as [ReactElement, SpectrumDialogClose];\n yield {\n element: trigger,\n wrapper: (element) => (\n <DialogTrigger key={element.key} {...props}>\n {element}\n {content}\n </DialogTrigger>\n )\n };\n};\n\n/**\n * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's\n * open state with the trigger's press state. Additionally, it allows you to customize the type and\n * positioning of the Dialog.\n */\n\n// We don't want getCollectionNode to show up in the type definition\nlet _DialogTrigger = DialogTrigger as (props: SpectrumDialogTriggerProps) => JSX.Element;\nexport {_DialogTrigger as DialogTrigger};\n\nfunction PopoverTrigger({state, targetRef, trigger, content, hideArrow, ...props}) {\n let triggerRef = useRef<HTMLElement>();\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'dialog'}, state, triggerRef);\n\n let triggerPropsWithRef = {\n ...triggerProps,\n ref: targetRef ? undefined : triggerRef\n };\n\n let overlay = (\n <Popover\n {...props}\n hideArrow={hideArrow}\n triggerRef={targetRef || triggerRef}\n state={state}>\n {typeof content === 'function' ? content(state.close) : content}\n </Popover>\n );\n\n return (\n <DialogTriggerBase\n type=\"popover\"\n state={state}\n triggerProps={triggerPropsWithRef}\n dialogProps={overlayProps}\n trigger={trigger}\n overlay={overlay} />\n );\n}\n\ninterface SpectrumDialogTriggerBase {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n state: OverlayTriggerState,\n isDismissable?: boolean,\n dialogProps?: SpectrumDialogProps | {},\n triggerProps?: any,\n overlay: ReactElement,\n trigger: ReactElement\n}\n\nfunction DialogTriggerBase({type, state, isDismissable, dialogProps = {}, triggerProps = {}, overlay, trigger}: SpectrumDialogTriggerBase) {\n let context = {\n type,\n onClose: state.close,\n isDismissable,\n ...dialogProps\n };\n\n return (\n <Fragment>\n <PressResponder\n {...triggerProps}\n onPress={state.toggle}\n isPressed={state.isOpen && type !== 'modal' && type !== 'fullscreen' && type !== 'fullscreenTakeover'}>\n {trigger}\n </PressResponder>\n <DialogContext.Provider value={context}>\n {overlay}\n </DialogContext.Provider>\n </Fragment>\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {Modal} from '@react-spectrum/overlays';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDialogContainerProps} from '@react-types/dialog';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\n\n/**\n * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding\n * it in a modal. Useful in cases where there is no trigger element\n * or when the trigger unmounts while the dialog is open.\n */\nexport function DialogContainer(props: SpectrumDialogContainerProps) {\n let {\n children,\n type = 'modal',\n onDismiss,\n isDismissable,\n isKeyboardDismissDisabled\n } = props;\n\n let childArray = React.Children.toArray(children);\n if (childArray.length > 1) {\n throw new Error('Only a single child can be passed to DialogContainer.');\n }\n\n let lastChild = useRef<ReactElement>(null);\n let child = React.isValidElement(childArray[0]) ? childArray[0] : null;\n if (child) {\n lastChild.current = child;\n }\n\n let context = {\n type,\n onClose: onDismiss,\n isDismissable\n };\n\n let state = useOverlayTriggerState({\n isOpen: !!child,\n onOpenChange: isOpen => {\n if (!isOpen) {\n onDismiss();\n }\n }\n });\n\n return (\n <Modal\n state={state}\n type={type}\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogContext.Provider value={context}>\n {lastChild.current}\n </DialogContext.Provider>\n </Modal>\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {useContext} from 'react';\n\nexport interface DialogContainerValue {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useContext(DialogContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n type: context.type,\n dismiss() {\n context.onClose();\n }\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;ACVD;;;;;;;;;;CAUC;;;ACVD;;;;;;;;;;CAUC;AAUM,MAAM,4CAAgB,CAAA,GAAA,YAAI,EAAE,cAAkC;;;;;;AEpBrE,4BAAiB;IAAG,SAAS,CAAC,KAAK,CAAC;IAClC,WAAW,CAAC,KAAK,CAAC;AACpB;;;;ACFA,4BAAiB;IAAG,SAAS,CAAC,MAAM,CAAC;IACnC,WAAW,CAAC,UAAU,CAAC;AACzB;;;;ACFA,4BAAiB;IAAG,SAAS,CAAC,QAAQ,CAAC;IACrC,WAAW,CAAC,SAAS,CAAC;AACxB;;;;ACFA,4BAAiB;IAAG,SAAS,CAAC,QAAQ,CAAC;IACrC,WAAW,CAAC,GAAG,CAAC;AAClB;;;;ACFA,4BAAiB;IAAG,SAAS,CAAC,WAAW,CAAC;IACxC,WAAW,CAAC,SAAS,CAAC;AACxB;;;;ACFA,4BAAiB;IAAG,SAAS,CAAC,UAAU,CAAC;IACvC,WAAW,CAAC,QAAQ,CAAC;AACvB;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,OAAO,CAAC;IACtC,SAAS,CAAC,KAAK,CAAC;AAClB;;;;ACFA,4BAAiB;IAAG,SAA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C1D,IAAI,QAAQ;IACZ,IAAI,MAAM,QAAQ,WAChB,QAAQ,SAAS,KAAK,CAAA,GAAA,YAAI,EAAE;SACvB,kBAAI,CAAA,GAAA,YAAI,EAAE,eAAe,WAC9B,QAAQ;IAGV,IAAI,SAAS,UAAU,WACrB,aAAa;IAGf,IAAI,UAAU;cACZ;QACA,SAAS;uBACT;IACF;IAEA,IAAI,QAAQ,CAAA,GAAA,6BAAqB,EAAE;QACjC,QAAQ,CAAC,CAAC;QACV,cAAc,CAAA;YACZ,IAAI,CAAC,QACH;QAEJ;IACF;IAEA,qBACE,gCAAC,CAAA,GAAA,YAAI;QACH,OAAO;QACP,MAAM;QACN,eAAe;QACf,2BAA2B;qBAC3B,gCAAC,CAAA,GAAA,yCAAY,EAAE;QAAS,OAAO;OAC5B;AAIT;;;AC9EA;;;;;;;;;;CAUC;;AAUM,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAY;IACrC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,OAAO;QACL,MAAM,QAAQ;QACd;YACE,QAAQ;QACV;IACF;AACF;;","sources":["packages/@react-spectrum/dialog/src/index.ts","packages/@react-spectrum/dialog/src/AlertDialog.tsx","packages/@react-spectrum/dialog/src/Dialog.tsx","packages/@react-spectrum/dialog/src/context.ts","packages/@react-spectrum/dialog/src/*.js","packages/@react-spectrum/dialog/intl/ar-AE.json","packages/@react-spectrum/dialog/intl/bg-BG.json","packages/@react-spectrum/dialog/intl/cs-CZ.json","packages/@react-spectrum/dialog/intl/da-DK.json","packages/@react-spectrum/dialog/intl/de-DE.json","packages/@react-spectrum/dialog/intl/el-GR.json","packages/@react-spectrum/dialog/intl/en-US.json","packages/@react-spectrum/dialog/intl/es-ES.json","packages/@react-spectrum/dialog/intl/et-EE.json","packages/@react-spectrum/dialog/intl/fi-FI.json","packages/@react-spectrum/dialog/intl/fr-FR.json","packages/@react-spectrum/dialog/intl/he-IL.json","packages/@react-spectrum/dialog/intl/hr-HR.json","packages/@react-spectrum/dialog/intl/hu-HU.json","packages/@react-spectrum/dialog/intl/it-IT.json","packages/@react-spectrum/dialog/intl/ja-JP.json","packages/@react-spectrum/dialog/intl/ko-KR.json","packages/@react-spectrum/dialog/intl/lt-LT.json","packages/@react-spectrum/dialog/intl/lv-LV.json","packages/@react-spectrum/dialog/intl/nb-NO.json","packages/@react-spectrum/dialog/intl/nl-NL.json","packages/@react-spectrum/dialog/intl/pl-PL.json","packages/@react-spectrum/dialog/intl/pt-BR.json","packages/@react-spectrum/dialog/intl/pt-PT.json","packages/@react-spectrum/dialog/intl/ro-RO.json","packages/@react-spectrum/dialog/intl/ru-RU.json","packages/@react-spectrum/dialog/intl/sk-SK.json","packages/@react-spectrum/dialog/intl/sl-SI.json","packages/@react-spectrum/dialog/intl/sr-SP.json","packages/@react-spectrum/dialog/intl/sv-SE.json","packages/@react-spectrum/dialog/intl/tr-TR.json","packages/@react-spectrum/dialog/intl/uk-UA.json","packages/@react-spectrum/dialog/intl/zh-CN.json","packages/@react-spectrum/dialog/intl/zh-TW.json","packages/@adobe/spectrum-css-temp/components/dialog/vars.css","packages/@react-spectrum/dialog/src/DialogTrigger.tsx","packages/@react-spectrum/dialog/src/DialogContainer.tsx","packages/@react-spectrum/dialog/src/useDialogContainer.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 './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","/*\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);\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","/*\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);\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef();\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","/*\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 React, {HTMLAttributes} from 'react';\n\nexport interface DialogContextValue extends HTMLAttributes<HTMLElement> {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n isDismissable?: boolean,\n onClose: () => void\n}\n\nexport const DialogContext = React.createContext<DialogContextValue>(null);\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"alert\": \"تنبيه\",\n \"dismiss\": \"تجاهل\"\n}\n","{\n \"alert\": \"Сигнал\",\n \"dismiss\": \"Отхвърляне\"\n}\n","{\n \"alert\": \"Výstraha\",\n \"dismiss\": \"Odstranit\"\n}\n","{\n \"alert\": \"Advarsel\",\n \"dismiss\": \"Luk\"\n}\n","{\n \"alert\": \"Warnhinweis\",\n \"dismiss\": \"Schließen\"\n}\n","{\n \"alert\": \"Ειδοποίηση\",\n \"dismiss\": \"Απόρριψη\"\n}\n","{\n \"dismiss\": \"Dismiss\",\n \"alert\": \"Alert\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Descartar\"\n}\n","{\n \"alert\": \"Teade\",\n \"dismiss\": \"Lõpeta\"\n}\n","{\n \"alert\": \"Hälytys\",\n \"dismiss\": \"Hylkää\"\n}\n","{\n \"alert\": \"Alerte\",\n \"dismiss\": \"Rejeter\"\n}\n","{\n \"alert\": \"התראה\",\n \"dismiss\": \"התעלם\"\n}\n","{\n \"alert\": \"Upozorenje\",\n \"dismiss\": \"Odbaci\"\n}\n","{\n \"alert\": \"Figyelmeztetés\",\n \"dismiss\": \"Elutasítás\"\n}\n","{\n \"alert\": \"Avviso\",\n \"dismiss\": \"Ignora\"\n}\n","{\n \"alert\": \"アラート\",\n \"dismiss\": \"閉じる\"\n}\n","{\n \"alert\": \"경고\",\n \"dismiss\": \"무시\"\n}\n","{\n \"alert\": \"Įspėjimas\",\n \"dismiss\": \"Atmesti\"\n}\n","{\n \"alert\": \"Brīdinājums\",\n \"dismiss\": \"Nerādīt\"\n}\n","{\n \"alert\": \"Varsel\",\n \"dismiss\": \"Lukk\"\n}\n","{\n \"alert\": \"Melding\",\n \"dismiss\": \"Negeren\"\n}\n","{\n \"alert\": \"Ostrzeżenie\",\n \"dismiss\": \"Zignoruj\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Descartar\"\n}\n","{\n \"alert\": \"Alerta\",\n \"dismiss\": \"Dispensar\"\n}\n","{\n \"alert\": \"Alertă\",\n \"dismiss\": \"Revocare\"\n}\n","{\n \"alert\": \"Предупреждение\",\n \"dismiss\": \"Пропустить\"\n}\n","{\n \"alert\": \"Upozornenie\",\n \"dismiss\": \"Zrušiť\"\n}\n","{\n \"alert\": \"Opozorilo\",\n \"dismiss\": \"Opusti\"\n}\n","{\n \"alert\": \"Upozorenje\",\n \"dismiss\": \"Odbaci\"\n}\n","{\n \"alert\": \"Varning\",\n \"dismiss\": \"Avvisa\"\n}\n","{\n \"alert\": \"Uyarı\",\n \"dismiss\": \"Kapat\"\n}\n","{\n \"alert\": \"Сигнал тривоги\",\n \"dismiss\": \"Скасувати\"\n}\n","{\n \"alert\": \"警报\",\n \"dismiss\": \"取消\"\n}\n","{\n \"alert\": \"警示\",\n \"dismiss\": \"關閉\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {Modal, Popover, Tray} from '@react-spectrum/overlays';\nimport {OverlayTriggerState, useOverlayTriggerState} from '@react-stately/overlays';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {Fragment, ReactElement, useEffect, useRef} from 'react';\nimport {SpectrumDialogClose, SpectrumDialogProps, SpectrumDialogTriggerProps} from '@react-types/dialog';\nimport {useIsMobileDevice} from '@react-spectrum/utils';\nimport {useOverlayTrigger} from '@react-aria/overlays';\n\nfunction DialogTrigger(props: SpectrumDialogTriggerProps) {\n let {\n children,\n type = 'modal',\n mobileType = type === 'popover' ? 'modal' : type,\n hideArrow,\n targetRef,\n isDismissable,\n isKeyboardDismissDisabled,\n ...positionProps\n } = props;\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('DialogTrigger must have exactly 2 children');\n }\n // if a function is passed as the second child, it won't appear in toArray\n let [trigger, content] = children as [ReactElement, SpectrumDialogClose];\n\n // On small devices, show a modal or tray instead of a popover.\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // handle cases where desktop popovers need a close button for the mobile modal view\n if (type !== 'modal' && mobileType === 'modal') {\n isDismissable = true;\n }\n\n type = mobileType;\n }\n\n let state = useOverlayTriggerState(props);\n let wasOpen = useRef(false);\n useEffect(() => {\n wasOpen.current = state.isOpen;\n }, [state.isOpen]);\n\n let isExiting = useRef(false);\n let onExiting = () => isExiting.current = true;\n let onExited = () => isExiting.current = false;\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n if ((wasOpen.current || isExiting.current) && type !== 'popover' && type !== 'tray') {\n console.warn('A DialogTrigger unmounted while open. This is likely due to being placed within a trigger that unmounts or inside a conditional. Consider using a DialogContainer instead.');\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (type === 'popover') {\n return (\n <PopoverTrigger\n {...positionProps}\n state={state}\n targetRef={targetRef}\n trigger={trigger}\n content={content}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n hideArrow={hideArrow} />\n );\n }\n\n let renderOverlay = () => {\n switch (type) {\n case 'fullscreen':\n case 'fullscreenTakeover':\n case 'modal':\n return (\n <Modal\n state={state}\n isDismissable={type === 'modal' ? isDismissable : false}\n type={type}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n onExiting={onExiting}\n onExited={onExited}>\n {typeof content === 'function' ? content(state.close) : content}\n </Modal>\n );\n case 'tray':\n return (\n <Tray\n state={state}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n {typeof content === 'function' ? content(state.close) : content}\n </Tray>\n );\n }\n };\n\n return (\n <DialogTriggerBase\n type={type}\n state={state}\n isDismissable={isDismissable}\n trigger={trigger}\n overlay={renderOverlay()} />\n );\n}\n\n// Support DialogTrigger inside components using CollectionBuilder.\nDialogTrigger.getCollectionNode = function* (props: SpectrumDialogTriggerProps) {\n // @ts-ignore - seems like types are wrong. Function children work fine.\n let [trigger] = React.Children.toArray(props.children);\n let [, content] = props.children as [ReactElement, SpectrumDialogClose];\n yield {\n element: trigger,\n wrapper: (element) => (\n <DialogTrigger key={element.key} {...props}>\n {element}\n {content}\n </DialogTrigger>\n )\n };\n};\n\n/**\n * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's\n * open state with the trigger's press state. Additionally, it allows you to customize the type and\n * positioning of the Dialog.\n */\n\n// We don't want getCollectionNode to show up in the type definition\nlet _DialogTrigger = DialogTrigger as (props: SpectrumDialogTriggerProps) => JSX.Element;\nexport {_DialogTrigger as DialogTrigger};\n\nfunction PopoverTrigger({state, targetRef, trigger, content, hideArrow, ...props}) {\n let triggerRef = useRef<HTMLElement>();\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'dialog'}, state, triggerRef);\n\n let triggerPropsWithRef = {\n ...triggerProps,\n ref: targetRef ? undefined : triggerRef\n };\n\n let overlay = (\n <Popover\n {...props}\n hideArrow={hideArrow}\n triggerRef={targetRef || triggerRef}\n state={state}>\n {typeof content === 'function' ? content(state.close) : content}\n </Popover>\n );\n\n return (\n <DialogTriggerBase\n type=\"popover\"\n state={state}\n triggerProps={triggerPropsWithRef}\n dialogProps={overlayProps}\n trigger={trigger}\n overlay={overlay} />\n );\n}\n\ninterface SpectrumDialogTriggerBase {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n state: OverlayTriggerState,\n isDismissable?: boolean,\n dialogProps?: SpectrumDialogProps | {},\n triggerProps?: any,\n overlay: ReactElement,\n trigger: ReactElement\n}\n\nfunction DialogTriggerBase({type, state, isDismissable, dialogProps = {}, triggerProps = {}, overlay, trigger}: SpectrumDialogTriggerBase) {\n let context = {\n type,\n onClose: state.close,\n isDismissable,\n ...dialogProps\n };\n\n return (\n <Fragment>\n <PressResponder\n {...triggerProps}\n onPress={state.toggle}\n isPressed={state.isOpen && type !== 'modal' && type !== 'fullscreen' && type !== 'fullscreenTakeover'}>\n {trigger}\n </PressResponder>\n <DialogContext.Provider value={context}>\n {overlay}\n </DialogContext.Provider>\n </Fragment>\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {Modal} from '@react-spectrum/overlays';\nimport React, {ReactElement, useState} from 'react';\nimport {SpectrumDialogContainerProps} from '@react-types/dialog';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\n\n/**\n * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding\n * it in a modal. Useful in cases where there is no trigger element\n * or when the trigger unmounts while the dialog is open.\n */\nexport function DialogContainer(props: SpectrumDialogContainerProps) {\n let {\n children,\n type = 'modal',\n onDismiss,\n isDismissable,\n isKeyboardDismissDisabled\n } = props;\n\n let childArray = React.Children.toArray(children);\n if (childArray.length > 1) {\n throw new Error('Only a single child can be passed to DialogContainer.');\n }\n\n let [lastChild, setLastChild] = useState<ReactElement | null>(null);\n\n // React.Children.toArray mutates the children, and we need them to be stable\n // between renders so that the lastChild comparison works.\n let child = null;\n if (Array.isArray(children)) {\n child = children.find(React.isValidElement);\n } else if (React.isValidElement(children)) {\n child = children;\n }\n\n if (child && child !== lastChild) {\n setLastChild(child);\n }\n\n let context = {\n type,\n onClose: onDismiss,\n isDismissable\n };\n\n let state = useOverlayTriggerState({\n isOpen: !!child,\n onOpenChange: isOpen => {\n if (!isOpen) {\n onDismiss();\n }\n }\n });\n\n return (\n <Modal\n state={state}\n type={type}\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogContext.Provider value={context}>\n {lastChild}\n </DialogContext.Provider>\n </Modal>\n );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DialogContext} from './context';\nimport {useContext} from 'react';\n\nexport interface DialogContainerValue {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useContext(DialogContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n type: context.type,\n dismiss() {\n context.onClose();\n }\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -20,7 +20,7 @@ export let DialogTrigger: (props: SpectrumDialogTriggerProps) => JSX.Element;
20
20
  * it in a modal. Useful in cases where there is no trigger element
21
21
  * or when the trigger unmounts while the dialog is open.
22
22
  */
23
- export function DialogContainer(props: SpectrumDialogContainerProps): JSX.Element;
23
+ export function DialogContainer(props: SpectrumDialogContainerProps): React.JSX.Element;
24
24
  export interface DialogContainerValue {
25
25
  type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover';
26
26
  dismiss(): void;
@@ -1 +1 @@
1
- {"mappings":";;AC0GA;;;GAGG;AACH,OAAA,IAAI,0IAAkC,CAAC;ACEvC;;GAEG;AACH,OAAA,IAAI,oJAAsC,CAAC;ACmB3C;;;;GAIG;AAGH,OAAA,IAAI,uBAA0C,0BAA0B,KAAK,WAAW,CAAC;AC3HzF;;;;GAIG;AACH,gCAAgC,KAAK,EAAE,4BAA4B,eA8ClE;ACtDD;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":";;ACmHA;;;GAGG;AACH,OAAA,IAAI,0IAAkC,CAAC;ACPvC;;GAEG;AACH,OAAA,IAAI,oJAAsC,CAAC;ACoB3C;;;;GAIG;AAGH,OAAA,IAAI,uBAA0C,0BAA0B,KAAK,WAAW,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/dialog",
3
- "version": "3.7.1",
3
+ "version": "3.8.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,27 +36,27 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/dialog": "^3.5.1",
40
- "@react-aria/focus": "^3.12.0",
41
- "@react-aria/i18n": "^3.7.1",
42
- "@react-aria/interactions": "^3.15.0",
43
- "@react-aria/overlays": "^3.14.0",
44
- "@react-aria/utils": "^3.16.0",
45
- "@react-spectrum/button": "^3.12.1",
46
- "@react-spectrum/buttongroup": "^3.6.1",
47
- "@react-spectrum/divider": "^3.5.1",
48
- "@react-spectrum/layout": "^3.5.1",
49
- "@react-spectrum/overlays": "^5.1.0",
50
- "@react-spectrum/text": "^3.4.1",
51
- "@react-spectrum/utils": "^3.9.1",
52
- "@react-spectrum/view": "^3.5.1",
53
- "@react-stately/overlays": "^3.5.1",
54
- "@react-stately/utils": "^3.6.0",
55
- "@react-types/button": "^3.7.2",
56
- "@react-types/dialog": "^3.5.1",
57
- "@react-types/shared": "^3.18.0",
58
- "@spectrum-icons/ui": "^3.5.1",
59
- "@swc/helpers": "^0.4.14"
39
+ "@react-aria/dialog": "^3.5.3",
40
+ "@react-aria/focus": "^3.13.0",
41
+ "@react-aria/i18n": "^3.8.0",
42
+ "@react-aria/interactions": "^3.16.0",
43
+ "@react-aria/overlays": "^3.15.0",
44
+ "@react-aria/utils": "^3.18.0",
45
+ "@react-spectrum/button": "^3.12.3",
46
+ "@react-spectrum/buttongroup": "^3.6.3",
47
+ "@react-spectrum/divider": "^3.5.3",
48
+ "@react-spectrum/layout": "^3.5.3",
49
+ "@react-spectrum/overlays": "^5.2.0",
50
+ "@react-spectrum/text": "^3.4.3",
51
+ "@react-spectrum/utils": "^3.10.0",
52
+ "@react-spectrum/view": "^3.6.0",
53
+ "@react-stately/overlays": "^3.6.0",
54
+ "@react-stately/utils": "^3.7.0",
55
+ "@react-types/button": "^3.7.3",
56
+ "@react-types/dialog": "^3.5.3",
57
+ "@react-types/shared": "^3.18.1",
58
+ "@spectrum-icons/ui": "^3.5.3",
59
+ "@swc/helpers": "^0.5.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@adobe/spectrum-css-temp": "3.0.0-alpha.1",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "9d1ba9bd8ebcd63bf3495ade16d349bcb71795ce"
73
+ "gitHead": "504e40e0a50c1b20ed0fb3ba9561a263b6d5565e"
74
74
  }
package/src/Dialog.tsx CHANGED
@@ -11,7 +11,15 @@
11
11
  */
12
12
 
13
13
  import {ActionButton} from '@react-spectrum/button';
14
- import {classNames, SlotProvider, unwrapDOMRef, useDOMRef, useHasChild, useStyleProps} from '@react-spectrum/utils';
14
+ import {
15
+ classNames,
16
+ SlotProvider,
17
+ unwrapDOMRef,
18
+ useDOMRef,
19
+ useHasChild,
20
+ useSlotProps,
21
+ useStyleProps
22
+ } from '@react-spectrum/utils';
15
23
  import CrossLarge from '@spectrum-icons/ui/CrossLarge';
16
24
  import {DialogContext, DialogContextValue} from './context';
17
25
  import {DOMRef} from '@react-types/shared';
@@ -34,6 +42,7 @@ let sizeMap = {
34
42
  };
35
43
 
36
44
  function Dialog(props: SpectrumDialogProps, ref: DOMRef) {
45
+ props = useSlotProps(props, 'dialog');
37
46
  let {
38
47
  type = 'modal',
39
48
  ...contextProps
@@ -12,7 +12,7 @@
12
12
 
13
13
  import {DialogContext} from './context';
14
14
  import {Modal} from '@react-spectrum/overlays';
15
- import React, {ReactElement, useRef} from 'react';
15
+ import React, {ReactElement, useState} from 'react';
16
16
  import {SpectrumDialogContainerProps} from '@react-types/dialog';
17
17
  import {useOverlayTriggerState} from '@react-stately/overlays';
18
18
 
@@ -35,10 +35,19 @@ export function DialogContainer(props: SpectrumDialogContainerProps) {
35
35
  throw new Error('Only a single child can be passed to DialogContainer.');
36
36
  }
37
37
 
38
- let lastChild = useRef<ReactElement>(null);
39
- let child = React.isValidElement(childArray[0]) ? childArray[0] : null;
40
- if (child) {
41
- lastChild.current = child;
38
+ let [lastChild, setLastChild] = useState<ReactElement | null>(null);
39
+
40
+ // React.Children.toArray mutates the children, and we need them to be stable
41
+ // between renders so that the lastChild comparison works.
42
+ let child = null;
43
+ if (Array.isArray(children)) {
44
+ child = children.find(React.isValidElement);
45
+ } else if (React.isValidElement(children)) {
46
+ child = children;
47
+ }
48
+
49
+ if (child && child !== lastChild) {
50
+ setLastChild(child);
42
51
  }
43
52
 
44
53
  let context = {
@@ -63,7 +72,7 @@ export function DialogContainer(props: SpectrumDialogContainerProps) {
63
72
  isDismissable={isDismissable}
64
73
  isKeyboardDismissDisabled={isKeyboardDismissDisabled}>
65
74
  <DialogContext.Provider value={context}>
66
- {lastChild.current}
75
+ {lastChild}
67
76
  </DialogContext.Provider>
68
77
  </Modal>
69
78
  );
@@ -119,6 +119,7 @@ function DialogTrigger(props: SpectrumDialogTriggerProps) {
119
119
 
120
120
  // Support DialogTrigger inside components using CollectionBuilder.
121
121
  DialogTrigger.getCollectionNode = function* (props: SpectrumDialogTriggerProps) {
122
+ // @ts-ignore - seems like types are wrong. Function children work fine.
122
123
  let [trigger] = React.Children.toArray(props.children);
123
124
  let [, content] = props.children as [ReactElement, SpectrumDialogClose];
124
125
  yield {