@react-spectrum/dialog 3.8.15 → 3.8.16
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/AlertDialog.main.js.map +1 -1
- package/dist/AlertDialog.module.js.map +1 -1
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.module.js.map +1 -1
- package/dist/DialogTrigger.main.js +0 -1
- package/dist/DialogTrigger.main.js.map +1 -1
- package/dist/DialogTrigger.mjs +0 -1
- package/dist/DialogTrigger.module.js +0 -1
- package/dist/DialogTrigger.module.js.map +1 -1
- package/dist/dialog_vars_css.main.js.map +1 -1
- package/dist/dialog_vars_css.module.js.map +1 -1
- package/package.json +22 -22
- package/src/DialogTrigger.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqBD;;CAEC,GACD,SAAS,kCAAY,KAA+B,EAAE,GAAW;IAC/D,IAAI,WACF,UAAU,KAAO,GAClB,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,uCAAY,MAAM,CAAC;IAElC,IAAI,WACF,OAAO,YACP,QAAQ,sBACR,kBAAkB,wBAClB,oBAAoB,eACpB,WAAW,mBACX,eAAe,SACf,KAAK,2BACL,uBAAuB,6BACvB,yBAAyB,YACzB,WAAW,KAAO,oBAClB,kBAAkB,KAAO,sBACzB,oBAAoB,KAAO,GAC3B,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,IAAI,iBAAiD;IACrD,IAAI,SAAS;QACX,IAAI,YAAY,gBACd,iBAAiB;aACZ,IAAI,YAAY,eACrB,iBAAiB;IAErB;IAEA,qBACE,0DAAC,CAAA,GAAA,gCAAK;QACJ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,CAAC;sBAEvC,0DAAC,CAAA,GAAA,mCAAM,wBACP,0DAAC,CAAA,GAAA,gCAAM,SAAG,yBACV,0DAAC,CAAA,GAAA,2CAAU;QAAE,OAAM;OAChB,6BACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,WAAW,oBAAoB;OAC9B,cAGJ,sCACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B,qCAGL,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/dialog/src/AlertDialog.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {Button} from '@react-spectrum/button';\nimport {ButtonGroup} from '@react-spectrum/buttongroup';\nimport {chain} from '@react-aria/utils';\nimport {classNames, useStyleProps} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {Dialog} from './Dialog';\nimport {DialogContext, DialogContextValue} from './context';\nimport {Divider} from '@react-spectrum/divider';\nimport {DOMRef} from '@react-types/shared';\nimport {Heading} from '@react-spectrum/text';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {forwardRef, useContext} from 'react';\nimport {SpectrumAlertDialogProps} from '@react-types/dialog';\nimport {SpectrumButtonProps} from '@react-types/button';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nfunction AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {\n let {\n onClose = () => {}\n } = useContext(DialogContext) || {} as DialogContextValue;\n\n let {\n variant,\n children,\n primaryActionLabel,\n secondaryActionLabel,\n cancelLabel,\n autoFocusButton,\n title,\n isPrimaryActionDisabled,\n isSecondaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n\n let confirmVariant: SpectrumButtonProps['variant'] = 'primary';\n if (variant) {\n if (variant === 'confirmation') {\n confirmVariant = 'cta';\n } else if (variant === 'destructive') {\n confirmVariant = 'negative';\n }\n }\n\n return (\n <Dialog\n UNSAFE_style={styleProps.style}\n UNSAFE_className={classNames(styles, {[`spectrum-Dialog--${variant}`]: variant}, styleProps.className)}\n isHidden={styleProps.hidden}\n size=\"M\"\n role=\"alertdialog\"\n ref={ref}>\n <Heading>{title}</Heading>\n {(variant === 'error' || variant === 'warning') &&\n <AlertMedium\n slot=\"typeIcon\"\n aria-label={stringFormatter.format('alert')} />\n }\n <Divider />\n <Content>{children}</Content>\n <ButtonGroup align=\"end\">\n {cancelLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onCancel())}\n autoFocus={autoFocusButton === 'cancel'}>\n {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n}\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nlet _AlertDialog = forwardRef(AlertDialog);\nexport {_AlertDialog as AlertDialog};\n"],"names":[],"version":3,"file":"AlertDialog.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqBD;;CAEC,GACD,SAAS,kCAAY,KAA+B,EAAE,GAAW;IAC/D,IAAI,WACF,UAAU,KAAO,GAClB,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAY,MAAM,CAAC;IAElC,IAAI,WACF,OAAO,YACP,QAAQ,sBACR,kBAAkB,wBAClB,oBAAoB,eACpB,WAAW,mBACX,eAAe,SACf,KAAK,2BACL,uBAAuB,6BACvB,yBAAyB,YACzB,WAAW,KAAO,oBAClB,kBAAkB,KAAO,sBACzB,oBAAoB,KAAO,GAC3B,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAEhE,IAAI,iBAAiD;IACrD,IAAI,SAAS;QACX,IAAI,YAAY,gBACd,iBAAiB;aACZ,IAAI,YAAY,eACrB,iBAAiB;IAErB;IAEA,qBACE,gCAAC,CAAA,GAAA,yCAAK;QACJ,cAAc,WAAW,KAAK;QAC9B,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;YAAC,CAAC,CAAC,iBAAiB,EAA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ChB,6BACC,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,WAAW,oBAAoB;OAC9B,cAGJ,sCACC,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B,qCAGL,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/dialog/src/AlertDialog.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {Button} from '@react-spectrum/button';\nimport {ButtonGroup} from '@react-spectrum/buttongroup';\nimport {chain} from '@react-aria/utils';\nimport {classNames, useStyleProps} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {Dialog} from './Dialog';\nimport {DialogContext, DialogContextValue} from './context';\nimport {Divider} from '@react-spectrum/divider';\nimport {DOMRef} from '@react-types/shared';\nimport {Heading} from '@react-spectrum/text';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {forwardRef, useContext} from 'react';\nimport {SpectrumAlertDialogProps} from '@react-types/dialog';\nimport {SpectrumButtonProps} from '@react-types/button';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nfunction AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {\n let {\n onClose = () => {}\n } = useContext(DialogContext) || {} as DialogContextValue;\n\n let {\n variant,\n children,\n primaryActionLabel,\n secondaryActionLabel,\n cancelLabel,\n autoFocusButton,\n title,\n isPrimaryActionDisabled,\n isSecondaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n\n let confirmVariant: SpectrumButtonProps['variant'] = 'primary';\n if (variant) {\n if (variant === 'confirmation') {\n confirmVariant = 'cta';\n } else if (variant === 'destructive') {\n confirmVariant = 'negative';\n }\n }\n\n return (\n <Dialog\n UNSAFE_style={styleProps.style}\n UNSAFE_className={classNames(styles, {[`spectrum-Dialog--${variant}`]: variant}, styleProps.className)}\n isHidden={styleProps.hidden}\n size=\"M\"\n role=\"alertdialog\"\n ref={ref}>\n <Heading>{title}</Heading>\n {(variant === 'error' || variant === 'warning') &&\n <AlertMedium\n slot=\"typeIcon\"\n aria-label={stringFormatter.format('alert')} />\n }\n <Divider />\n <Content>{children}</Content>\n <ButtonGroup align=\"end\">\n {cancelLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onCancel())}\n autoFocus={autoFocusButton === 'cancel'}>\n {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n}\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nlet _AlertDialog = forwardRef(AlertDialog);\nexport {_AlertDialog as AlertDialog};\n"],"names":[],"version":3,"file":"AlertDialog.module.js.map"}
|
package/dist/Dialog.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAyBD,IAAI,gCAAU;IACZ,GAAG;IACH,GAAG;IACH,GAAG;IACH,YAAY;IACZ,oBAAoB;AACtB;AAEA,SAAS,6BAAO,KAA0B,EAAE,GAAW;IACrD,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,QACF,OAAO,SACP,GAAG,cACJ,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,uCAAY,MAAM,CAAC;IAClC,IAAI,YACF,QAAQ,iBACR,gBAAgB,aAAa,aAAa,aAC1C,YAAY,aAAa,OAAO,QAChC,IAAI,EACJ,GAAG,YACJ,GAAG;IACJ,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,OAAO,SAAS,YAAa,QAAQ,MAAQ,QAAQ;IAErD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,UAAU,CAAA,GAAA,mBAAK,EAAE;IACrB,IAAI,cAAc,6BAAO,CAAC,KAAK,IAAI,6BAAO,CAAC,KAAK;IAChD,IAAI,eAAC,WAAW,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,gCAAQ,EAAE,CAAA,GAAA,gCAAS,EAAE,cAAc,QAAQ;IAE3E,IAAI,YAAY,CAAA,GAAA,qCAAU,EAAE,CAAC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tC,qBACE,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,WAAW;QACf,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,mBACA;YACE,CAAC,CAAC,iBAAiB,EAAE,aAAa,CAAC,EAAE;YACrC,gCAAgC;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,0DAAC,CAAA,GAAA,+BAAG;QAAE,KAAK;QAAS,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,uBAAuB;qBAClE,0DAAC,CAAA,GAAA,sCAAW;QAAE,OAAO;OAClB,WAEF,+BACC,0DAAC,CAAA,GAAA,uCAAW;QACV,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,8BAA8B;QACvD,SAAA;QACA,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS;qBACT,0DAAC,CAAA,GAAA,0DAAS;AAMtB;AAEA;;;CAGC,GACD,IAAI,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/dialog/src/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {\n classNames,\n SlotProvider,\n unwrapDOMRef,\n useDOMRef,\n useHasChild,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DialogContext, DialogContextValue} from './context';\nimport {DOMRef} from '@react-types/shared';\nimport {Grid} from '@react-spectrum/layout';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useMemo, useRef} from 'react';\nimport {SpectrumDialogProps} from '@react-types/dialog';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useDialog} from '@react-aria/dialog';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nlet sizeMap = {\n S: 'small',\n M: 'medium',\n L: 'large',\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nfunction Dialog(props: SpectrumDialogProps, ref: DOMRef) {\n props = useSlotProps(props, 'dialog');\n let {\n type = 'modal',\n ...contextProps\n } = useContext(DialogContext) || {} as DialogContextValue;\n let {\n children,\n isDismissable = contextProps.isDismissable,\n onDismiss = contextProps.onClose,\n size,\n ...otherProps\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef(null);\n let sizeVariant = sizeMap[type] || sizeMap[size];\n let {dialogProps, titleProps} = useDialog(mergeProps(contextProps, props), domRef);\n\n let hasHeader = useHasChild(`.${styles['spectrum-Dialog-header']}`, unwrapDOMRef(gridRef));\n let hasHeading = useHasChild(`.${styles['spectrum-Dialog-heading']}`, unwrapDOMRef(gridRef));\n let hasFooter = useHasChild(`.${styles['spectrum-Dialog-footer']}`, unwrapDOMRef(gridRef));\n let hasTypeIcon = useHasChild(`.${styles['spectrum-Dialog-typeIcon']}`, unwrapDOMRef(gridRef));\n\n let slots = useMemo(() => ({\n hero: {UNSAFE_className: styles['spectrum-Dialog-hero']},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-heading', {'spectrum-Dialog-heading--noHeader': !hasHeader, 'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon}), level: 2, ...titleProps},\n header: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-header', {'spectrum-Dialog-header--noHeading': !hasHeading, 'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon})},\n typeIcon: {UNSAFE_className: styles['spectrum-Dialog-typeIcon']},\n divider: {UNSAFE_className: styles['spectrum-Dialog-divider'], size: 'M'},\n content: {UNSAFE_className: styles['spectrum-Dialog-content']},\n footer: {UNSAFE_className: styles['spectrum-Dialog-footer']},\n buttonGroup: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-buttonGroup', {'spectrum-Dialog-buttonGroup--noFooter': !hasFooter}), align: 'end'}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [hasFooter, hasHeader, titleProps]);\n\n return (\n <section\n {...styleProps}\n {...dialogProps}\n className={classNames(\n styles,\n 'spectrum-Dialog',\n {\n [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,\n 'spectrum-Dialog--dismissable': isDismissable\n },\n styleProps.className\n )}\n ref={domRef}>\n <Grid ref={gridRef} UNSAFE_className={styles['spectrum-Dialog-grid']}>\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n {isDismissable &&\n <ActionButton\n UNSAFE_className={styles['spectrum-Dialog-closeButton']}\n isQuiet\n aria-label={stringFormatter.format('dismiss')}\n onPress={onDismiss}>\n <CrossLarge />\n </ActionButton>\n }\n </Grid>\n </section>\n );\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = React.forwardRef(Dialog);\nexport {_Dialog as Dialog};\n"],"names":[],"version":3,"file":"Dialog.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAyBD,IAAI,gCAAU;IACZ,GAAG;IACH,GAAG;IACH,GAAG;IACH,YAAY;IACZ,oBAAoB;AACtB;AAEA,SAAS,6BAAO,KAA0B,EAAE,GAAW;IACrD,QAAQ,CAAA,GAAA,mBAAW,EAAE,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AA,GAAA,gCAAS;AAMtB;AAEA;;;CAGC,GACD,IAAI,0DAAU,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/dialog/src/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {\n classNames,\n SlotProvider,\n unwrapDOMRef,\n useDOMRef,\n useHasChild,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DialogContext, DialogContextValue} from './context';\nimport {DOMRef} from '@react-types/shared';\nimport {Grid} from '@react-spectrum/layout';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useMemo, useRef} from 'react';\nimport {SpectrumDialogProps} from '@react-types/dialog';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useDialog} from '@react-aria/dialog';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nlet sizeMap = {\n S: 'small',\n M: 'medium',\n L: 'large',\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nfunction Dialog(props: SpectrumDialogProps, ref: DOMRef) {\n props = useSlotProps(props, 'dialog');\n let {\n type = 'modal',\n ...contextProps\n } = useContext(DialogContext) || {} as DialogContextValue;\n let {\n children,\n isDismissable = contextProps.isDismissable,\n onDismiss = contextProps.onClose,\n size,\n ...otherProps\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef(null);\n let sizeVariant = sizeMap[type] || sizeMap[size];\n let {dialogProps, titleProps} = useDialog(mergeProps(contextProps, props), domRef);\n\n let hasHeader = useHasChild(`.${styles['spectrum-Dialog-header']}`, unwrapDOMRef(gridRef));\n let hasHeading = useHasChild(`.${styles['spectrum-Dialog-heading']}`, unwrapDOMRef(gridRef));\n let hasFooter = useHasChild(`.${styles['spectrum-Dialog-footer']}`, unwrapDOMRef(gridRef));\n let hasTypeIcon = useHasChild(`.${styles['spectrum-Dialog-typeIcon']}`, unwrapDOMRef(gridRef));\n\n let slots = useMemo(() => ({\n hero: {UNSAFE_className: styles['spectrum-Dialog-hero']},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-heading', {'spectrum-Dialog-heading--noHeader': !hasHeader, 'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon}), level: 2, ...titleProps},\n header: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-header', {'spectrum-Dialog-header--noHeading': !hasHeading, 'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon})},\n typeIcon: {UNSAFE_className: styles['spectrum-Dialog-typeIcon']},\n divider: {UNSAFE_className: styles['spectrum-Dialog-divider'], size: 'M'},\n content: {UNSAFE_className: styles['spectrum-Dialog-content']},\n footer: {UNSAFE_className: styles['spectrum-Dialog-footer']},\n buttonGroup: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-buttonGroup', {'spectrum-Dialog-buttonGroup--noFooter': !hasFooter}), align: 'end'}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [hasFooter, hasHeader, titleProps]);\n\n return (\n <section\n {...styleProps}\n {...dialogProps}\n className={classNames(\n styles,\n 'spectrum-Dialog',\n {\n [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,\n 'spectrum-Dialog--dismissable': isDismissable\n },\n styleProps.className\n )}\n ref={domRef}>\n <Grid ref={gridRef} UNSAFE_className={styles['spectrum-Dialog-grid']}>\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n {isDismissable &&\n <ActionButton\n UNSAFE_className={styles['spectrum-Dialog-closeButton']}\n isQuiet\n aria-label={stringFormatter.format('dismiss')}\n onPress={onDismiss}>\n <CrossLarge />\n </ActionButton>\n }\n </Grid>\n </section>\n );\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = React.forwardRef(Dialog);\nexport {_Dialog as Dialog};\n"],"names":[],"version":3,"file":"Dialog.module.js.map"}
|
|
@@ -55,7 +55,6 @@ function $46e54a192dc519c9$var$DialogTrigger(props) {
|
|
|
55
55
|
let isExiting = (0, $7xftW$react.useRef)(false);
|
|
56
56
|
let onExiting = ()=>isExiting.current = true;
|
|
57
57
|
let onExited = ()=>isExiting.current = false;
|
|
58
|
-
// eslint-disable-next-line arrow-body-style
|
|
59
58
|
(0, $7xftW$react.useEffect)(()=>{
|
|
60
59
|
return ()=>{
|
|
61
60
|
if ((wasOpen.current || isExiting.current) && type !== 'popover' && type !== 'tray') 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.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAWD,SAAS,oCAAc,KAAiC;IACtD,IAAI,YACF,QAAQ,QACR,OAAO,qBACP,aAAa,SAAS,YAAY,UAAU,iBAC5C,SAAS,aACT,SAAS,iBACT,aAAa,6BACb,yBAAyB,EACzB,GAAG,eACJ,GAAG;IACJ,IAAI,CAAC,MAAM,OAAO,CAAC,aAAa,SAAS,MAAM,GAAG,GAChD,MAAM,IAAI,MAAM;IAElB,0EAA0E;IAC1E,IAAI,CAAC,SAAS,QAAQ,G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;;;;CAIC,GAED,oEAAoE;AACpE,IAAI,4CAAiB;AAGrB,SAAS,qCAAe,SAAC,KAAK,aAAE,SAAS,WAAE,OAAO,WAAE,OAAO,aAAE,SAAS,EAAE,GAAG,OAAM;IAC/E,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAe;IACrC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,0CAAgB,EAAE;QAAC,MAAM;IAAQ,GAAG,OAAO;IAE9E,IAAI,sBAAsB;QACxB,GAAG,YAAY;QACf,KAAK,YAAY,YAAY;IAC/B;IAEA,IAAI,wBACF,0DAAC,CAAA,GAAA,oCAAM;QACJ,GAAG,KAAK;QACT,WAAW;QACX,YAAY,aAAa;QACzB,OAAO;OACN,OAAO,YAAY,aAAa,QAAQ,MAAM,KAAK,IAAI;IAI5D,qBACE,0DAAC;QACC,MAAK;QACL,OAAO;QACP,cAAc;QACd,aAAa;QACb,SAAS;QACT,SAAS;;AAEf;AAYA,SAAS,wCAAkB,QAAC,IAAI,SAAE,KAAK,iBAAE,aAAa,eAAE,cAAc,CAAC,iBAAG,eAAe,CAAC,YAAG,OAAO,WAAE,OAAO,EAA4B;IACvI,IAAI,UAAU;cACZ;QACA,SAAS,MAAM,KAAK;uBACpB;QACA,GAAG,WAAW;IAChB;IAEA,qBACE,0DAAC,CAAA,GAAA,qBAAO,uBACN,0DAAC,CAAA,GAAA,2CAAa;QACX,GAAG,YAAY;QAChB,SAAS,MAAM,MAAM;QACrB,WAAW,MAAM,MAAM,IAAI,SAAS,WAAW,SAAS,gBAAgB,SAAS;OAChF,wBAEH,0DAAC,CAAA,GAAA,uCAAY,EAAE,QAAQ;QAAC,OAAO;OAC5B;AAIT","sources":["packages/@react-spectrum/dialog/src/DialogTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {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, JSX, 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 \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>(null);\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"],"names":[],"version":3,"file":"DialogTrigger.main.js.map"}
|
package/dist/DialogTrigger.mjs
CHANGED
|
@@ -45,7 +45,6 @@ function $c412c5ea680c1e4f$var$DialogTrigger(props) {
|
|
|
45
45
|
let isExiting = (0, $jYq0n$useRef)(false);
|
|
46
46
|
let onExiting = ()=>isExiting.current = true;
|
|
47
47
|
let onExited = ()=>isExiting.current = false;
|
|
48
|
-
// eslint-disable-next-line arrow-body-style
|
|
49
48
|
(0, $jYq0n$useEffect)(()=>{
|
|
50
49
|
return ()=>{
|
|
51
50
|
if ((wasOpen.current || isExiting.current) && type !== 'popover' && type !== 'tray') 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.');
|
|
@@ -45,7 +45,6 @@ function $c412c5ea680c1e4f$var$DialogTrigger(props) {
|
|
|
45
45
|
let isExiting = (0, $jYq0n$useRef)(false);
|
|
46
46
|
let onExiting = ()=>isExiting.current = true;
|
|
47
47
|
let onExited = ()=>isExiting.current = false;
|
|
48
|
-
// eslint-disable-next-line arrow-body-style
|
|
49
48
|
(0, $jYq0n$useEffect)(()=>{
|
|
50
49
|
return ()=>{
|
|
51
50
|
if ((wasOpen.current || isExiting.current) && type !== 'popover' && type !== 'tray') 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.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAWD,SAAS,oCAAc,KAAiC;IACtD,IAAI,YACF,QAAQ,QACR,OAAO,qBACP,aAAa,SAAS,YAAY,UAAU,iBAC5C,SAAS,aACT,SAAS,iBACT,aAAa,6BACb,yBAAyB,EACzB,GAAG,eACJ,GAAG;IACJ,IAAI,CAAC,MAAM,OAAO,CAAC,aAAa,SAAS,MAAM,GAAG,GAChD,MAAM,IAAI,MAAM;IAElB,0EAA0E;IAC1E,IAAI,CAAC,SAAS,QAAQ,GAAG;IAEzB,+DAA+D;IAC/D,IAAI,WAAW,CAAA,GAAA,wBAAgB;IAC/B,IAAI,UAAU;QACZ,oFAAoF;QACpF,IAAI,SAAS,WAAW,eAAe,SACrC,gBAAgB;QAGlB,OAAO;IACT;IAEA,IAAI,QAAQ,CAAA,GAAA,6BAAqB,EAAE;IACnC,IAAI,UAAU,CAAA,GAAA,aAAK,EAAE;IACrB,CAAA,GAAA,gBAAQ,EAAE;QACR,QAAQ,OAAO,GAAG,MAAM,MAAM;IAChC,GAAG;QAAC,MAAM,MAAM;KAAC;IAEjB,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,YAAY,IAAM,UAAU,OAAO,GAAG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QACzB,OAAO;OACN,OAAO,YAAY,aAAa,QAAQ,MAAM,KAAK,IAAI;IAI5D,qBACE,gCAAC;QACC,MAAK;QACL,OAAO;QACP,cAAc;QACd,aAAa;QACb,SAAS;QACT,SAAS;;AAEf;AAYA,SAAS,wCAAkB,QAAC,IAAI,SAAE,KAAK,iBAAE,aAAa,eAAE,cAAc,CAAC,iBAAG,eAAe,CAAC,YAAG,OAAO,WAAE,OAAO,EAA4B;IACvI,IAAI,UAAU;cACZ;QACA,SAAS,MAAM,KAAK;uBACpB;QACA,GAAG,WAAW;IAChB;IAEA,qBACE,gCAAC,CAAA,GAAA,eAAO,uBACN,gCAAC,CAAA,GAAA,qBAAa;QACX,GAAG,YAAY;QAChB,SAAS,MAAM,MAAM;QACrB,WAAW,MAAM,MAAM,IAAI,SAAS,WAAW,SAAS,gBAAgB,SAAS;OAChF,wBAEH,gCAAC,CAAA,GAAA,yCAAY,EAAE,QAAQ;QAAC,OAAO;OAC5B;AAIT","sources":["packages/@react-spectrum/dialog/src/DialogTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {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, JSX, 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 \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>(null);\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"],"names":[],"version":3,"file":"DialogTrigger.module.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAlDA,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,0CAAoC,CAAC,sBAAsB,CAAC;AAC5D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA4B,CAAC,cAAc,CAAC;AAC5C,4CAA4B,CAAC,cAAc,CAAC;AAC5C,4CAA+B,CAAC,iBA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CAAiC,CAAC,mBAAmB,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/dialog/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"dialog_vars_css.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAlDA,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,0CAAoC,CAAC,sBAAsB,CAAC;AAC5D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA4B,CAAC,cAAc,CAAC;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AAC,kCAAkC,CAAC;AACpF,4CAA6B,CAAC,eAAe,CAAC;AAC9C,4CAAiC,CAAC,mBAAmB,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/dialog/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"dialog_vars_css.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/dialog",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.16",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,24 +36,24 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/dialog": "^3.5.
|
|
40
|
-
"@react-aria/i18n": "^3.12.
|
|
41
|
-
"@react-aria/interactions": "^3.22.
|
|
42
|
-
"@react-aria/overlays": "^3.
|
|
43
|
-
"@react-aria/utils": "^3.
|
|
44
|
-
"@react-spectrum/button": "^3.16.
|
|
45
|
-
"@react-spectrum/buttongroup": "^3.6.
|
|
46
|
-
"@react-spectrum/divider": "^3.5.
|
|
47
|
-
"@react-spectrum/layout": "^3.6.
|
|
48
|
-
"@react-spectrum/overlays": "^5.
|
|
49
|
-
"@react-spectrum/text": "^3.5.
|
|
50
|
-
"@react-spectrum/utils": "^3.
|
|
51
|
-
"@react-spectrum/view": "^3.6.
|
|
52
|
-
"@react-stately/overlays": "^3.6.
|
|
53
|
-
"@react-types/button": "^3.10.
|
|
54
|
-
"@react-types/dialog": "^3.5.
|
|
55
|
-
"@react-types/shared": "^3.
|
|
56
|
-
"@spectrum-icons/ui": "^3.6.
|
|
39
|
+
"@react-aria/dialog": "^3.5.20",
|
|
40
|
+
"@react-aria/i18n": "^3.12.4",
|
|
41
|
+
"@react-aria/interactions": "^3.22.5",
|
|
42
|
+
"@react-aria/overlays": "^3.24.0",
|
|
43
|
+
"@react-aria/utils": "^3.26.0",
|
|
44
|
+
"@react-spectrum/button": "^3.16.9",
|
|
45
|
+
"@react-spectrum/buttongroup": "^3.6.17",
|
|
46
|
+
"@react-spectrum/divider": "^3.5.18",
|
|
47
|
+
"@react-spectrum/layout": "^3.6.10",
|
|
48
|
+
"@react-spectrum/overlays": "^5.7.0",
|
|
49
|
+
"@react-spectrum/text": "^3.5.10",
|
|
50
|
+
"@react-spectrum/utils": "^3.12.0",
|
|
51
|
+
"@react-spectrum/view": "^3.6.14",
|
|
52
|
+
"@react-stately/overlays": "^3.6.12",
|
|
53
|
+
"@react-types/button": "^3.10.1",
|
|
54
|
+
"@react-types/dialog": "^3.5.14",
|
|
55
|
+
"@react-types/shared": "^3.26.0",
|
|
56
|
+
"@spectrum-icons/ui": "^3.6.11",
|
|
57
57
|
"@swc/helpers": "^0.5.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@react-spectrum/provider": "^3.0.0",
|
|
65
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
|
|
66
|
-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
65
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
66
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
|
|
72
72
|
}
|
package/src/DialogTrigger.tsx
CHANGED
|
@@ -57,7 +57,7 @@ function DialogTrigger(props: SpectrumDialogTriggerProps) {
|
|
|
57
57
|
let onExiting = () => isExiting.current = true;
|
|
58
58
|
let onExited = () => isExiting.current = false;
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
return () => {
|
|
63
63
|
if ((wasOpen.current || isExiting.current) && type !== 'popover' && type !== 'tray') {
|