@fluentui/react-dialog 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.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/CHANGELOG.md +48 -16
- package/README.md +12 -0
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/index.js.map +1 -1
- package/lib/components/Dialog/renderDialog.js +2 -2
- package/lib/components/Dialog/renderDialog.js.map +1 -1
- package/lib/components/Dialog/useDialog.js.map +1 -1
- package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
- package/lib/components/DialogActions/DialogActions.js.map +1 -1
- package/lib/components/DialogActions/DialogActions.module.css +47 -0
- package/lib/components/DialogActions/DialogActions.types.js.map +1 -1
- package/lib/components/DialogActions/index.js.map +1 -1
- package/lib/components/DialogActions/renderDialogActions.js +2 -2
- package/lib/components/DialogActions/renderDialogActions.js.map +1 -1
- package/lib/components/DialogActions/useDialogActions.js.map +1 -1
- package/lib/components/DialogActions/useDialogActionsStyles.styles.css.js +9 -0
- package/lib/components/DialogActions/useDialogActionsStyles.styles.css.js.map +1 -0
- package/lib/components/DialogActions/useDialogActionsStyles.styles.raw.css.js +9 -0
- package/lib/components/DialogActions/useDialogActionsStyles.styles.raw.css.js.map +1 -0
- package/lib/components/DialogActions/useDialogActionsStyles.styles.raw.js.map +1 -1
- package/lib/components/DialogBackdropMotion.js.map +1 -1
- package/lib/components/DialogBody/DialogBody.js.map +1 -1
- package/lib/components/DialogBody/DialogBody.module.css +19 -0
- package/lib/components/DialogBody/DialogBody.types.js.map +1 -1
- package/lib/components/DialogBody/index.js.map +1 -1
- package/lib/components/DialogBody/renderDialogBody.js +2 -2
- package/lib/components/DialogBody/renderDialogBody.js.map +1 -1
- package/lib/components/DialogBody/useDialogBody.js.map +1 -1
- package/lib/components/DialogBody/useDialogBodyStyles.styles.css.js +9 -0
- package/lib/components/DialogBody/useDialogBodyStyles.styles.css.js.map +1 -0
- package/lib/components/DialogBody/useDialogBodyStyles.styles.raw.css.js +9 -0
- package/lib/components/DialogBody/useDialogBodyStyles.styles.raw.css.js.map +1 -0
- package/lib/components/DialogBody/useDialogBodyStyles.styles.raw.js.map +1 -1
- package/lib/components/DialogContent/DialogContent.js.map +1 -1
- package/lib/components/DialogContent/DialogContent.module.css +20 -0
- package/lib/components/DialogContent/DialogContent.types.js.map +1 -1
- package/lib/components/DialogContent/index.js.map +1 -1
- package/lib/components/DialogContent/renderDialogContent.js +2 -2
- package/lib/components/DialogContent/renderDialogContent.js.map +1 -1
- package/lib/components/DialogContent/useDialogContent.js.map +1 -1
- package/lib/components/DialogContent/useDialogContentStyles.styles.css.js +9 -0
- package/lib/components/DialogContent/useDialogContentStyles.styles.css.js.map +1 -0
- package/lib/components/DialogContent/useDialogContentStyles.styles.raw.css.js +9 -0
- package/lib/components/DialogContent/useDialogContentStyles.styles.raw.css.js.map +1 -0
- package/lib/components/DialogContent/useDialogContentStyles.styles.raw.js.map +1 -1
- package/lib/components/DialogSurface/DialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/DialogSurface.module.css +70 -0
- package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -1
- package/lib/components/DialogSurface/index.js.map +1 -1
- package/lib/components/DialogSurface/renderDialogSurface.js +2 -2
- package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurfaceStyles.styles.css.js +15 -0
- package/lib/components/DialogSurface/useDialogSurfaceStyles.styles.css.js.map +1 -0
- package/lib/components/DialogSurface/useDialogSurfaceStyles.styles.raw.css.js +15 -0
- package/lib/components/DialogSurface/useDialogSurfaceStyles.styles.raw.css.js.map +1 -0
- package/lib/components/DialogSurface/useDialogSurfaceStyles.styles.raw.js.map +1 -1
- package/lib/components/DialogSurfaceMotion.js.map +1 -1
- package/lib/components/DialogTitle/DialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/DialogTitle.module.css +64 -0
- package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -1
- package/lib/components/DialogTitle/index.js.map +1 -1
- package/lib/components/DialogTitle/renderDialogTitle.js +2 -2
- package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitleStyles.styles.css.js +14 -0
- package/lib/components/DialogTitle/useDialogTitleStyles.styles.css.js.map +1 -0
- package/lib/components/DialogTitle/useDialogTitleStyles.styles.raw.css.js +14 -0
- package/lib/components/DialogTitle/useDialogTitleStyles.styles.raw.css.js.map +1 -0
- package/lib/components/DialogTitle/useDialogTitleStyles.styles.raw.js.map +1 -1
- package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -1
- package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
- package/lib/components/DialogTrigger/index.js.map +1 -1
- package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
- package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib/contexts/constants.js.map +1 -1
- package/lib/contexts/dialogBackdropContext.js.map +1 -1
- package/lib/contexts/dialogContext.js.map +1 -1
- package/lib/contexts/dialogSurfaceContext.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/useDisableBodyScroll.js +2 -2
- package/lib/utils/useDisableBodyScroll.js.map +1 -1
- package/lib/utils/useDisableBodyScroll.module.css +11 -0
- package/lib/utils/useDisableBodyScroll.styles.css.js +3 -0
- package/lib/utils/useDisableBodyScroll.styles.css.js.map +1 -0
- package/lib/utils/useDisableBodyScroll.styles.raw.css.js +3 -0
- package/lib/utils/useDisableBodyScroll.styles.raw.css.js.map +1 -0
- package/lib/utils/useDisableBodyScroll.styles.raw.js.map +1 -1
- package/lib/utils/useFocusFirstElement.js.map +1 -1
- package/lib-commonjs/Dialog.cjs +5 -5
- package/lib-commonjs/DialogActions.cjs +6 -6
- package/lib-commonjs/DialogBody.cjs +6 -6
- package/lib-commonjs/DialogContent.cjs +6 -6
- package/lib-commonjs/DialogSurface.cjs +7 -7
- package/lib-commonjs/DialogTitle.cjs +7 -7
- package/lib-commonjs/DialogTrigger.cjs +4 -4
- package/lib-commonjs/components/Dialog/Dialog.cjs.map +1 -1
- package/lib-commonjs/components/Dialog/Dialog.types.cjs.map +1 -1
- package/lib-commonjs/components/Dialog/index.cjs +5 -5
- package/lib-commonjs/components/Dialog/index.cjs.map +1 -1
- package/lib-commonjs/components/Dialog/renderDialog.cjs.map +1 -1
- package/lib-commonjs/components/Dialog/useDialog.cjs.map +1 -1
- package/lib-commonjs/components/Dialog/useDialogContextValues.cjs.map +1 -1
- package/lib-commonjs/components/DialogActions/DialogActions.cjs.map +1 -1
- package/lib-commonjs/components/DialogActions/DialogActions.module.css +47 -0
- package/lib-commonjs/components/DialogActions/DialogActions.types.cjs.map +1 -1
- package/lib-commonjs/components/DialogActions/index.cjs +6 -6
- package/lib-commonjs/components/DialogActions/index.cjs.map +1 -1
- package/lib-commonjs/components/DialogActions/renderDialogActions.cjs.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActions.cjs.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogBackdropMotion.cjs.map +1 -1
- package/lib-commonjs/components/DialogBody/DialogBody.cjs.map +1 -1
- package/lib-commonjs/components/DialogBody/DialogBody.module.css +19 -0
- package/lib-commonjs/components/DialogBody/DialogBody.types.cjs.map +1 -1
- package/lib-commonjs/components/DialogBody/index.cjs +6 -6
- package/lib-commonjs/components/DialogBody/index.cjs.map +1 -1
- package/lib-commonjs/components/DialogBody/renderDialogBody.cjs.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBody.cjs.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogContent/DialogContent.cjs.map +1 -1
- package/lib-commonjs/components/DialogContent/DialogContent.module.css +20 -0
- package/lib-commonjs/components/DialogContent/DialogContent.types.cjs.map +1 -1
- package/lib-commonjs/components/DialogContent/index.cjs +6 -6
- package/lib-commonjs/components/DialogContent/index.cjs.map +1 -1
- package/lib-commonjs/components/DialogContent/renderDialogContent.cjs.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContent.cjs.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.cjs.map +1 -1
- package/lib-commonjs/components/DialogSurface/DialogSurface.module.css +70 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.types.cjs.map +1 -1
- package/lib-commonjs/components/DialogSurface/index.cjs +7 -7
- package/lib-commonjs/components/DialogSurface/index.cjs.map +1 -1
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.cjs.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurface.cjs.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.cjs.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.css.cjs +34 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.raw.css.cjs +34 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogSurfaceMotion.cjs.map +1 -1
- package/lib-commonjs/components/DialogTitle/DialogTitle.cjs.map +1 -1
- package/lib-commonjs/components/DialogTitle/DialogTitle.module.css +64 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.types.cjs.map +1 -1
- package/lib-commonjs/components/DialogTitle/index.cjs +7 -7
- package/lib-commonjs/components/DialogTitle/index.cjs.map +1 -1
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.cjs.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitle.cjs.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.cjs +4 -4
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.css.cjs +36 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.raw.cjs +4 -4
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.raw.css.cjs +36 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.cjs.map +1 -1
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.cjs.map +1 -1
- package/lib-commonjs/components/DialogTrigger/index.cjs +4 -4
- package/lib-commonjs/components/DialogTrigger/index.cjs.map +1 -1
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.cjs.map +1 -1
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.cjs.map +1 -1
- package/lib-commonjs/contexts/constants.cjs +7 -7
- package/lib-commonjs/contexts/constants.cjs.map +1 -1
- package/lib-commonjs/contexts/dialogBackdropContext.cjs +4 -4
- package/lib-commonjs/contexts/dialogBackdropContext.cjs.map +1 -1
- package/lib-commonjs/contexts/dialogContext.cjs +4 -4
- package/lib-commonjs/contexts/dialogContext.cjs.map +1 -1
- package/lib-commonjs/contexts/dialogSurfaceContext.cjs +4 -4
- package/lib-commonjs/contexts/dialogSurfaceContext.cjs.map +1 -1
- package/lib-commonjs/contexts/index.cjs +16 -16
- package/lib-commonjs/contexts/index.cjs.map +1 -1
- package/lib-commonjs/index.cjs +43 -43
- package/lib-commonjs/index.cjs.map +1 -1
- package/lib-commonjs/utils/index.cjs +3 -3
- package/lib-commonjs/utils/index.cjs.map +1 -1
- package/lib-commonjs/utils/useDisableBodyScroll.cjs +2 -2
- package/lib-commonjs/utils/useDisableBodyScroll.cjs.map +1 -1
- package/lib-commonjs/utils/useDisableBodyScroll.module.css +11 -0
- package/lib-commonjs/utils/useDisableBodyScroll.styles.cjs +3 -3
- package/lib-commonjs/utils/useDisableBodyScroll.styles.cjs.map +1 -1
- package/lib-commonjs/utils/useDisableBodyScroll.styles.css.cjs +22 -0
- package/lib-commonjs/utils/useDisableBodyScroll.styles.css.cjs.map +1 -0
- package/lib-commonjs/utils/useDisableBodyScroll.styles.raw.cjs +3 -3
- package/lib-commonjs/utils/useDisableBodyScroll.styles.raw.cjs.map +1 -1
- package/lib-commonjs/utils/useDisableBodyScroll.styles.raw.css.cjs +22 -0
- package/lib-commonjs/utils/useDisableBodyScroll.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/utils/useFocusFirstElement.cjs.map +1 -1
- package/package.json +19 -19
- package/dist/metadata/api/api-root.json +0 -1
- package/dist/metadata/index.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DialogTrigger/index.ts"],"sourcesContent":["export { DialogTrigger } from './DialogTrigger';\nexport type {\n DialogTriggerAction,\n DialogTriggerChildProps,\n DialogTriggerProps,\n DialogTriggerState,\n} from './DialogTrigger.types';\nexport { renderDialogTrigger_unstable } from './renderDialogTrigger';\nexport { useDialogTrigger_unstable } from './useDialogTrigger';\n"],"names":["DialogTrigger","renderDialogTrigger_unstable","useDialogTrigger_unstable"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAkB;AAOhD,SAASC,4BAA4B,QAAQ,2BAAwB;AACrE,SAASC,yBAAyB,QAAQ,wBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DialogTrigger/renderDialogTrigger.tsx"],"sourcesContent":["import type { DialogTriggerState } from './DialogTrigger.types';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderDialogTrigger_unstable = (state: DialogTriggerState): JSXElement | null => state.children;\n"],"names":["renderDialogTrigger_unstable","state","children"],"mappings":"AAGA;;;;CAIC,GACD,OAAO,MAAMA,+BAA+B,CAACC,QAAiDA,MAAMC,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DialogTrigger/useDialogTrigger.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n getReactElementRef,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { DialogTriggerProps, DialogTriggerState } from './DialogTrigger.types';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */\nexport const useDialogTrigger_unstable = (props: DialogTriggerProps): DialogTriggerState => {\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n\n const { children, disableButtonEnhancement = false, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const { triggerAttributes } = useModalAttributes();\n\n const handleClick = useEventCallback(\n (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open',\n });\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n ref: getReactElementRef<HTMLAnchorElement>(child),\n onClick: handleClick,\n ...triggerAttributes,\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"names":["applyTriggerPropsToChildren","getTriggerChild","getReactElementRef","useEventCallback","useDialogContext_unstable","useDialogSurfaceContext_unstable","useARIAButtonProps","useModalAttributes","useDialogTrigger_unstable","props","isInsideSurfaceDialog","children","disableButtonEnhancement","action","child","requestOpenChange","ctx","triggerAttributes","handleClick","event","onClick","isDefaultPrevented","type","open","triggerChildProps","ref","ariaButtonTriggerChildProps"],"mappings":"AAAA;AAGA,SACEA,2BAA2B,EAC3BC,eAAe,EACfC,kBAAkB,EAClBC,gBAAgB,QACX,4BAA4B;AAEnC,SAASC,yBAAyB,EAAEC,gCAAgC,QAAQ,0BAAiB;AAC7F,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7D;;;;;CAKC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxC,MAAMC,wBAAwBL;IAE9B,MAAM,EAAEM,QAAQ,EAAEC,2BAA2B,KAAK,EAAEC,SAASH,wBAAwB,UAAU,MAAM,EAAE,GAAGD;IAE1G,MAAMK,QAAQb,gBAAgBU;IAE9B,MAAMI,oBAAoBX,0BAA0BY,CAAAA,MAAOA,IAAID,iBAAiB;IAChF,MAAM,EAAEE,iBAAiB,EAAE,GAAGV;IAE9B,MAAMW,cAAcf,iBAClB,CAACgB;YACCL,sBAAAA;QAAAA,kBAAAA,6BAAAA,uBAAAA,CAAAA,eAAAA,MAAOL,KAAK,EAACW,OAAO,cAApBN,2CAAAA,0BAAAA,cAAuBK;QACvB,IAAI,CAACA,MAAME,kBAAkB,IAAI;YAC/BN,kBAAkB;gBAChBI;gBACAG,MAAM;gBACNC,MAAMV,WAAW;YACnB;QACF;IACF;IAGF,MAAMW,oBAAoB;WACrBV,kBAAAA,4BAAAA,MAAOL,KAAK,AAAf;QACAgB,KAAKvB,mBAAsCY;QAC3CM,SAASF;QACT,GAAGD,iBAAiB;IACtB;IAEA,MAAMS,8BAA8BpB,mBAClCQ,CAAAA,kBAAAA,4BAAAA,MAAOQ,IAAI,MAAK,YAAYR,CAAAA,kBAAAA,4BAAAA,MAAOQ,IAAI,MAAK,MAAMR,MAAMQ,IAAI,GAAG,OAC/D;QACE,GAAGE,iBAAiB;QACpBF,MAAM;IACR;IAGF,OAAO;QACLX,UAAUX,4BACRW,UACAC,2BAA2BY,oBAAoBE;IAEnD;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/constants.ts"],"sourcesContent":["export const DIALOG_MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';\nexport const DIALOG_MEDIA_QUERY_SHORT_SCREEN = '@media screen and (max-height: 359px)';\nexport const SURFACE_PADDING = '24px';\nexport const DIALOG_GAP = '8px';\nexport const SURFACE_BORDER_WIDTH = '1px';\nexport const DIALOG_FULLSCREEN_DIALOG_SCROLLBAR_OFFSET = '4px';\n"],"names":["DIALOG_MEDIA_QUERY_BREAKPOINT_SELECTOR","DIALOG_MEDIA_QUERY_SHORT_SCREEN","SURFACE_PADDING","DIALOG_GAP","SURFACE_BORDER_WIDTH","DIALOG_FULLSCREEN_DIALOG_SCROLLBAR_OFFSET"],"mappings":"AAAA,OAAO,MAAMA,yCAAyC,uCAAuC;AAC7F,OAAO,MAAMC,kCAAkC,wCAAwC;AACvF,OAAO,MAAMC,kBAAkB,OAAO;AACtC,OAAO,MAAMC,aAAa,MAAM;AAChC,OAAO,MAAMC,uBAAuB,MAAM;AAC1C,OAAO,MAAMC,4CAA4C,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/dialogBackdropContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nexport type DialogBackdropContextValue = boolean;\n\nexport const DialogBackdropContext = React.createContext<DialogBackdropContextValue | undefined>(undefined);\n\nexport const DialogBackdropProvider = DialogBackdropContext.Provider;\n\nexport const useDialogBackdropContext_unstable = (): DialogBackdropContextValue | undefined => {\n return React.useContext(DialogBackdropContext);\n};\n"],"names":["React","DialogBackdropContext","createContext","undefined","DialogBackdropProvider","Provider","useDialogBackdropContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,wBAAwBD,MAAME,aAAa,CAAyCC,WAAW;AAE5G,OAAO,MAAMC,yBAAyBH,sBAAsBI,QAAQ,CAAC;AAErE,OAAO,MAAMC,oCAAoC;IAC/C,OAAON,MAAMO,UAAU,CAACN;AAC1B,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/dialogContext.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { DialogSurfaceElement } from '../DialogSurface';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport type { DialogModalType, DialogOpenChangeData } from '../Dialog';\nimport type { useModalAttributes } from '@fluentui/react-tabster';\n\nexport type DialogContextValue = {\n open: boolean;\n inertTrapFocus: boolean;\n dialogTitleId?: string;\n isNestedDialog: boolean;\n dialogRef: React.Ref<DialogSurfaceElement | null>;\n unmountOnClose?: boolean;\n modalType: DialogModalType;\n /**\n * Requests dialog main component to update it's internal open state\n */\n requestOpenChange: (data: DialogOpenChangeData) => void;\n} & Partial<ReturnType<typeof useModalAttributes>>;\n\nconst defaultContextValue: DialogContextValue = {\n open: false,\n inertTrapFocus: false,\n modalType: 'modal',\n isNestedDialog: false,\n unmountOnClose: true,\n dialogRef: { current: null },\n requestOpenChange() {\n /* noop */\n },\n};\n\n// Contexts should default to undefined\nexport const DialogContext: Context<DialogContextValue | undefined> = createContext<DialogContextValue | undefined>(\n undefined,\n);\n\nexport const DialogProvider = DialogContext.Provider;\nexport const useDialogContext_unstable = <T>(selector: ContextSelector<DialogContextValue, T>): T =>\n useContextSelector(DialogContext, (ctx = defaultContextValue) => selector(ctx));\n"],"names":["createContext","useContextSelector","defaultContextValue","open","inertTrapFocus","modalType","isNestedDialog","unmountOnClose","dialogRef","current","requestOpenChange","DialogContext","undefined","DialogProvider","Provider","useDialogContext_unstable","selector","ctx"],"mappings":"AAAA;AAGA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AAoBrF,MAAMC,sBAA0C;IAC9CC,MAAM;IACNC,gBAAgB;IAChBC,WAAW;IACXC,gBAAgB;IAChBC,gBAAgB;IAChBC,WAAW;QAAEC,SAAS;IAAK;IAC3BC;IACE,QAAQ,GACV;AACF;AAEA,uCAAuC;AACvC,OAAO,MAAMC,gBAAyDX,cACpEY,WACA;AAEF,OAAO,MAAMC,iBAAiBF,cAAcG,QAAQ,CAAC;AACrD,OAAO,MAAMC,4BAA4B,CAAIC,WAC3Cf,mBAAmBU,eAAe,CAACM,MAAMf,mBAAmB,GAAKc,SAASC,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/dialogSurfaceContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nexport type DialogSurfaceContextValue = boolean;\n\nconst defaultContextValue: DialogSurfaceContextValue = false;\n\nexport const DialogSurfaceContext = React.createContext<DialogSurfaceContextValue | undefined>(undefined);\n\nexport const DialogSurfaceProvider = DialogSurfaceContext.Provider;\n\nexport const useDialogSurfaceContext_unstable = (): DialogSurfaceContextValue =>\n React.useContext(DialogSurfaceContext) ?? defaultContextValue;\n"],"names":["React","defaultContextValue","DialogSurfaceContext","createContext","undefined","DialogSurfaceProvider","Provider","useDialogSurfaceContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,MAAMC,sBAAiD;AAEvD,OAAO,MAAMC,uBAAuBF,MAAMG,aAAa,CAAwCC,WAAW;AAE1G,OAAO,MAAMC,wBAAwBH,qBAAqBI,QAAQ,CAAC;AAEnE,OAAO,MAAMC,mCAAmC;QAC9CP;YAAAA,oBAAAA,MAAMQ,UAAU,CAACN,mCAAjBF,+BAAAA,oBAA0CC;EAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/index.ts"],"sourcesContent":["export {\n DIALOG_GAP,\n DIALOG_FULLSCREEN_DIALOG_SCROLLBAR_OFFSET,\n DIALOG_MEDIA_QUERY_BREAKPOINT_SELECTOR,\n DIALOG_MEDIA_QUERY_SHORT_SCREEN,\n SURFACE_BORDER_WIDTH,\n SURFACE_PADDING,\n} from './constants';\nexport type { DialogContextValue } from './dialogContext';\nexport { DialogContext, DialogProvider, useDialogContext_unstable } from './dialogContext';\nexport type { DialogSurfaceContextValue } from './dialogSurfaceContext';\nexport type { DialogBackdropContextValue } from './dialogBackdropContext';\nexport { DialogSurfaceContext, DialogSurfaceProvider, useDialogSurfaceContext_unstable } from './dialogSurfaceContext';\nexport {\n DialogBackdropContext,\n DialogBackdropProvider,\n useDialogBackdropContext_unstable,\n} from './dialogBackdropContext';\n"],"names":["DIALOG_GAP","DIALOG_FULLSCREEN_DIALOG_SCROLLBAR_OFFSET","DIALOG_MEDIA_QUERY_BREAKPOINT_SELECTOR","DIALOG_MEDIA_QUERY_SHORT_SCREEN","SURFACE_BORDER_WIDTH","SURFACE_PADDING","DialogContext","DialogProvider","useDialogContext_unstable","DialogSurfaceContext","DialogSurfaceProvider","useDialogSurfaceContext_unstable","DialogBackdropContext","DialogBackdropProvider","useDialogBackdropContext_unstable"],"mappings":"AAAA,SACEA,UAAU,EACVC,yCAAyC,EACzCC,sCAAsC,EACtCC,+BAA+B,EAC/BC,oBAAoB,EACpBC,eAAe,QACV,iBAAc;AAErB,SAASC,aAAa,EAAEC,cAAc,EAAEC,yBAAyB,QAAQ,qBAAkB;AAG3F,SAASC,oBAAoB,EAAEC,qBAAqB,EAAEC,gCAAgC,QAAQ,4BAAyB;AACvH,SACEC,qBAAqB,EACrBC,sBAAsB,EACtBC,iCAAiC,QAC5B,6BAA0B"}
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export { useDisableBodyScroll } from './useDisableBodyScroll';\nexport { useFocusFirstElement } from './useFocusFirstElement';\n"],"names":["useDisableBodyScroll","useFocusFirstElement"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,4BAAyB;AAC9D,SAASC,oBAAoB,QAAQ,4BAAyB"}
|
|
@@ -11,14 +11,14 @@ import { useBodyNoScrollStyles, useHTMLNoScrollStyles } from "./useDisableBodySc
|
|
|
11
11
|
const bodyNoScrollStyles = useBodyNoScrollStyles();
|
|
12
12
|
const { targetDocument } = useFluent_unstable();
|
|
13
13
|
const disableBodyScroll = React.useCallback(()=>{
|
|
14
|
+
var _ref;
|
|
14
15
|
var _targetDocument_defaultView;
|
|
15
16
|
if (!targetDocument) {
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
18
|
-
var _targetDocument_defaultView_innerHeight;
|
|
19
19
|
const isHorizontalScrollbarVisible = // When the window is a fractional height, `innerHeight` always rounds down but `clientHeight` rounds either up or down depending on the value.
|
|
20
20
|
// To properly compare the body clientHeight to the window innerHeight, manually round down the fractional value to match innerHeight's calculation.
|
|
21
|
-
Math.floor(targetDocument.body.getBoundingClientRect().height) > ((
|
|
21
|
+
Math.floor(targetDocument.body.getBoundingClientRect().height) > ((_ref = (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.innerHeight) !== null && _ref !== void 0 ? _ref : 0);
|
|
22
22
|
if (!isHorizontalScrollbarVisible) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/utils/useDisableBodyScroll.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useBodyNoScrollStyles, useHTMLNoScrollStyles } from './useDisableBodyScroll.styles';\n\n/**\n * A React *hook* that disables body scrolling through `overflowY: hidden` CSS property\n *\n * @internal\n */\nexport function useDisableBodyScroll(): {\n disableBodyScroll: () => void;\n enableBodyScroll: () => void;\n} {\n const htmlNoScrollStyles = useHTMLNoScrollStyles();\n const bodyNoScrollStyles = useBodyNoScrollStyles();\n const { targetDocument } = useFluent_unstable();\n\n const disableBodyScroll = React.useCallback(() => {\n if (!targetDocument) {\n return;\n }\n const isHorizontalScrollbarVisible =\n // When the window is a fractional height, `innerHeight` always rounds down but `clientHeight` rounds either up or down depending on the value.\n // To properly compare the body clientHeight to the window innerHeight, manually round down the fractional value to match innerHeight's calculation.\n Math.floor(targetDocument.body.getBoundingClientRect().height) > (targetDocument.defaultView?.innerHeight ?? 0);\n if (!isHorizontalScrollbarVisible) {\n return;\n }\n targetDocument.documentElement.classList.add(htmlNoScrollStyles);\n targetDocument.body.classList.add(bodyNoScrollStyles);\n return;\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n const enableBodyScroll = React.useCallback(() => {\n if (!targetDocument) {\n return;\n }\n targetDocument.documentElement.classList.remove(htmlNoScrollStyles);\n targetDocument.body.classList.remove(bodyNoScrollStyles);\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n return {\n disableBodyScroll,\n enableBodyScroll,\n };\n}\n"],"names":["React","useFluent_unstable","useBodyNoScrollStyles","useHTMLNoScrollStyles","useDisableBodyScroll","htmlNoScrollStyles","bodyNoScrollStyles","targetDocument","disableBodyScroll","useCallback","isHorizontalScrollbarVisible","Math","floor","body","getBoundingClientRect","height","defaultView","innerHeight","documentElement","classList","add","enableBodyScroll","remove"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,kBAAkB,QAAQ,kCAAkC;AAErE,SAASC,qBAAqB,EAAEC,qBAAqB,QAAQ,mCAAgC;AAE7F;;;;CAIC,GACD,OAAO,SAASC;IAId,MAAMC,qBAAqBF;IAC3B,MAAMG,qBAAqBJ;IAC3B,MAAM,EAAEK,cAAc,EAAE,GAAGN;IAE3B,MAAMO,oBAAoBR,MAAMS,WAAW,CAAC;;YAO0BF;QANpE,IAAI,CAACA,gBAAgB;YACnB;QACF;QACA,MAAMG,+BACJ,+IAA+I;QAC/I,oJAAoJ;QACpJC,KAAKC,KAAK,CAACL,eAAeM,IAAI,CAACC,qBAAqB,GAAGC,MAAM,cAAKR,8BAAAA,eAAeS,WAAW,cAA1BT,kDAAAA,4BAA4BU,WAAW,uCAAI;QAC/G,IAAI,CAACP,8BAA8B;YACjC;QACF;QACAH,eAAeW,eAAe,CAACC,SAAS,CAACC,GAAG,CAACf;QAC7CE,eAAeM,IAAI,CAACM,SAAS,CAACC,GAAG,CAACd;QAClC;IACF,GAAG;QAACC;QAAgBF;QAAoBC;KAAmB;IAE3D,MAAMe,mBAAmBrB,MAAMS,WAAW,CAAC;QACzC,IAAI,CAACF,gBAAgB;YACnB;QACF;QACAA,eAAeW,eAAe,CAACC,SAAS,CAACG,MAAM,CAACjB;QAChDE,eAAeM,IAAI,CAACM,SAAS,CAACG,MAAM,CAAChB;IACvC,GAAG;QAACC;QAAgBF;QAAoBC;KAAmB;IAE3D,OAAO;QACLE;QACAa;IACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/useDisableBodyScroll.styles.css.ts"],"sourcesContent":["import styles from './useDisableBodyScroll.module.css';\n\nexport const useHTMLNoScrollStyles = (): string => styles.htmlNoScroll;\n\nexport const useBodyNoScrollStyles = (): string => styles.bodyNoScroll;\n"],"names":["styles","useHTMLNoScrollStyles","htmlNoScroll","useBodyNoScrollStyles","bodyNoScroll"],"mappings":"AAAA,OAAOA,YAAY,oCAAoC;AAEvD,OAAO,MAAMC,wBAAwB,IAAcD,OAAOE,YAAY,CAAC;AAEvE,OAAO,MAAMC,wBAAwB,IAAcH,OAAOI,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/useDisableBodyScroll.styles.css.ts"],"sourcesContent":["import styles from './useDisableBodyScroll.module.css';\n\nexport const useHTMLNoScrollStyles = (): string => styles.htmlNoScroll;\n\nexport const useBodyNoScrollStyles = (): string => styles.bodyNoScroll;\n"],"names":["styles","useHTMLNoScrollStyles","htmlNoScroll","useBodyNoScrollStyles","bodyNoScroll"],"mappings":"AAAA,OAAOA,YAAY,oCAAoC;AAEvD,OAAO,MAAMC,wBAAwB,IAAcD,OAAOE,YAAY,CAAC;AAEvE,OAAO,MAAMC,wBAAwB,IAAcH,OAAOI,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/utils/useDisableBodyScroll.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles } from '@griffel/react';\n\n// this style must be applied to the html element to disable scrolling\nexport const useHTMLNoScrollStyles = makeResetStyles({\n overflowY: ['hidden', 'clip'],\n scrollbarGutter: 'stable',\n});\n\nexport const useBodyNoScrollStyles = makeResetStyles({\n overflowY: 'hidden',\n});\n"],"names":["makeResetStyles","useHTMLNoScrollStyles","overflowY","scrollbarGutter","useBodyNoScrollStyles"],"mappings":"AAAA;AAEA,SAASA,eAAe,QAAQ,iBAAiB;AAEjD,sEAAsE;AACtE,OAAO,MAAMC,wBAAwBD,gBAAgB;IACnDE,WAAW;QAAC;QAAU;KAAO;IAC7BC,iBAAiB;AACnB,GAAG;AAEH,OAAO,MAAMC,wBAAwBJ,gBAAgB;IACnDE,WAAW;AACb,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/utils/useFocusFirstElement.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface';\nimport type { DialogModalType } from '../Dialog';\n\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(\n open: boolean,\n modalType: DialogModalType,\n): React.RefObject<DialogSurfaceElement | null> {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef<DialogSurfaceElement | null>(null);\n\n React.useEffect(() => {\n if (!open) {\n return;\n }\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n dialogRef.current?.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(/** #__DE-INDENT__ */ `\n @fluentui/react-dialog [useFocusFirstElement]:\n A Dialog should have at least one focusable element inside DialogSurface.\n Please add at least a close button either on \\`DialogTitle\\` action slot or inside \\`DialogActions\\`\n `);\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"],"names":["React","useFocusFinders","useFluent_unstable","useFocusFirstElement","open","modalType","findFirstFocusable","targetDocument","dialogRef","useRef","useEffect","element","current","focus","process","env","NODE_ENV","console","warn"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,kBAAkB,QAAQ,kCAAkC;AAIrE;;CAEC,GACD,OAAO,SAASC,qBACdC,IAAa,EACbC,SAA0B;IAE1B,MAAM,EAAEC,kBAAkB,EAAE,GAAGL;IAC/B,MAAM,EAAEM,cAAc,EAAE,GAAGL;IAC3B,MAAMM,YAAYR,MAAMS,MAAM,CAA8B;IAE5DT,MAAMU,SAAS,CAAC;QACd,IAAI,CAACN,MAAM;YACT;QACF;QACA,MAAMO,UAAUH,UAAUI,OAAO,IAAIN,mBAAmBE,UAAUI,OAAO;QACzE,IAAID,SAAS;YACXA,QAAQE,KAAK;QACf,OAAO;gBACLL;aAAAA,qBAAAA,UAAUI,OAAO,cAAjBJ,yCAAAA,mBAAmBK,KAAK,IAAI,qDAAqD;YACjF,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;gBAC1C,sCAAsC;gBACtCC,QAAQC,IAAI,CAAuB,CAAC;;oGAIpC,CAAC;YACH;QACF;IACF,GAAG;QAACZ;QAAoBF;QAAMC;QAAWE;KAAe;IAExD,OAAOC;AACT"}
|
package/lib-commonjs/Dialog.cjs
CHANGED
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Dialog
|
|
12
|
+
get Dialog () {
|
|
13
13
|
return _index.Dialog;
|
|
14
14
|
},
|
|
15
|
-
renderDialog_unstable
|
|
15
|
+
get renderDialog_unstable () {
|
|
16
16
|
return _index.renderDialog_unstable;
|
|
17
17
|
},
|
|
18
|
-
useDialogContextValues_unstable
|
|
18
|
+
get useDialogContextValues_unstable () {
|
|
19
19
|
return _index.useDialogContextValues_unstable;
|
|
20
20
|
},
|
|
21
|
-
useDialog_unstable
|
|
21
|
+
get useDialog_unstable () {
|
|
22
22
|
return _index.useDialog_unstable;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
DialogActions
|
|
12
|
+
get DialogActions () {
|
|
13
13
|
return _index.DialogActions;
|
|
14
14
|
},
|
|
15
|
-
dialogActionsClassNames
|
|
15
|
+
get dialogActionsClassNames () {
|
|
16
16
|
return _index.dialogActionsClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderDialogActions_unstable
|
|
18
|
+
get renderDialogActions_unstable () {
|
|
19
19
|
return _index.renderDialogActions_unstable;
|
|
20
20
|
},
|
|
21
|
-
useDialogActionsStyles_unstable
|
|
21
|
+
get useDialogActionsStyles_unstable () {
|
|
22
22
|
return _index.useDialogActionsStyles_unstable;
|
|
23
23
|
},
|
|
24
|
-
useDialogActions_unstable
|
|
24
|
+
get useDialogActions_unstable () {
|
|
25
25
|
return _index.useDialogActions_unstable;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
DialogBody
|
|
12
|
+
get DialogBody () {
|
|
13
13
|
return _index.DialogBody;
|
|
14
14
|
},
|
|
15
|
-
dialogBodyClassNames
|
|
15
|
+
get dialogBodyClassNames () {
|
|
16
16
|
return _index.dialogBodyClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderDialogBody_unstable
|
|
18
|
+
get renderDialogBody_unstable () {
|
|
19
19
|
return _index.renderDialogBody_unstable;
|
|
20
20
|
},
|
|
21
|
-
useDialogBodyStyles_unstable
|
|
21
|
+
get useDialogBodyStyles_unstable () {
|
|
22
22
|
return _index.useDialogBodyStyles_unstable;
|
|
23
23
|
},
|
|
24
|
-
useDialogBody_unstable
|
|
24
|
+
get useDialogBody_unstable () {
|
|
25
25
|
return _index.useDialogBody_unstable;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
DialogContent
|
|
12
|
+
get DialogContent () {
|
|
13
13
|
return _index.DialogContent;
|
|
14
14
|
},
|
|
15
|
-
dialogContentClassNames
|
|
15
|
+
get dialogContentClassNames () {
|
|
16
16
|
return _index.dialogContentClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderDialogContent_unstable
|
|
18
|
+
get renderDialogContent_unstable () {
|
|
19
19
|
return _index.renderDialogContent_unstable;
|
|
20
20
|
},
|
|
21
|
-
useDialogContentStyles_unstable
|
|
21
|
+
get useDialogContentStyles_unstable () {
|
|
22
22
|
return _index.useDialogContentStyles_unstable;
|
|
23
23
|
},
|
|
24
|
-
useDialogContent_unstable
|
|
24
|
+
get useDialogContent_unstable () {
|
|
25
25
|
return _index.useDialogContent_unstable;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
DialogSurface
|
|
12
|
+
get DialogSurface () {
|
|
13
13
|
return _index.DialogSurface;
|
|
14
14
|
},
|
|
15
|
-
dialogSurfaceClassNames
|
|
15
|
+
get dialogSurfaceClassNames () {
|
|
16
16
|
return _index.dialogSurfaceClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderDialogSurface_unstable
|
|
18
|
+
get renderDialogSurface_unstable () {
|
|
19
19
|
return _index.renderDialogSurface_unstable;
|
|
20
20
|
},
|
|
21
|
-
useDialogSurfaceContextValues_unstable
|
|
21
|
+
get useDialogSurfaceContextValues_unstable () {
|
|
22
22
|
return _index.useDialogSurfaceContextValues_unstable;
|
|
23
23
|
},
|
|
24
|
-
useDialogSurfaceStyles_unstable
|
|
24
|
+
get useDialogSurfaceStyles_unstable () {
|
|
25
25
|
return _index.useDialogSurfaceStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useDialogSurface_unstable
|
|
27
|
+
get useDialogSurface_unstable () {
|
|
28
28
|
return _index.useDialogSurface_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
DialogTitle
|
|
12
|
+
get DialogTitle () {
|
|
13
13
|
return _index.DialogTitle;
|
|
14
14
|
},
|
|
15
|
-
dialogTitleClassNames
|
|
15
|
+
get dialogTitleClassNames () {
|
|
16
16
|
return _index.dialogTitleClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderDialogTitle_unstable
|
|
18
|
+
get renderDialogTitle_unstable () {
|
|
19
19
|
return _index.renderDialogTitle_unstable;
|
|
20
20
|
},
|
|
21
|
-
useDialogTitleInternalStyles
|
|
21
|
+
get useDialogTitleInternalStyles () {
|
|
22
22
|
return _index.useDialogTitleInternalStyles;
|
|
23
23
|
},
|
|
24
|
-
useDialogTitleStyles_unstable
|
|
24
|
+
get useDialogTitleStyles_unstable () {
|
|
25
25
|
return _index.useDialogTitleStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useDialogTitle_unstable
|
|
27
|
+
get useDialogTitle_unstable () {
|
|
28
28
|
return _index.useDialogTitle_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
DialogTrigger
|
|
12
|
+
get DialogTrigger () {
|
|
13
13
|
return _index.DialogTrigger;
|
|
14
14
|
},
|
|
15
|
-
renderDialogTrigger_unstable
|
|
15
|
+
get renderDialogTrigger_unstable () {
|
|
16
16
|
return _index.renderDialogTrigger_unstable;
|
|
17
17
|
},
|
|
18
|
-
useDialogTrigger_unstable
|
|
18
|
+
get useDialogTrigger_unstable () {
|
|
19
19
|
return _index.useDialogTrigger_unstable;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDialog_unstable } from './useDialog';\nimport { renderDialog_unstable } from './renderDialog';\nimport type { DialogProps } from './Dialog.types';\nimport { useDialogContextValues_unstable } from './useDialogContextValues';\n\n/**\n * The `Dialog` root level component serves as an interface for interaction with all possible behaviors exposed.\n * It provides context down the hierarchy to `children` compound components to allow functionality.\n * This component expects to receive as children either a `DialogSurface` or a `DialogTrigger`\n * and a `DialogSurface` (or some component that will eventually render one of those compound components)\n * in this specific order\n */\nexport const Dialog: React.FC<DialogProps> = React.memo(props => {\n const state = useDialog_unstable(props);\n const contextValues = useDialogContextValues_unstable(state);\n\n return renderDialog_unstable(state, contextValues);\n});\n\nDialog.displayName = 'Dialog';\n"],"names":["React","useDialog_unstable","renderDialog_unstable","useDialogContextValues_unstable","Dialog","memo","props","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;2BACI,iBAAc;8BACX,oBAAiB;wCAEP,8BAA2B;AASpE,MAAMI,SAAAA,WAAAA,GAAgCJ,OAAMK,IAAI,CAACC,CAAAA;IACtD,MAAMC,YAAQN,6BAAAA,EAAmBK;IACjC,MAAME,oBAAgBL,uDAAAA,EAAgCI;IAEtD,WAAOL,mCAAAA,EAAsBK,OAAOC;AACtC,GAAG;AAEHJ,OAAOK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Dialog/Dialog.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ScaleParams } from '@fluentui/react-motion-components-preview';\nimport type { ComponentProps, ComponentState, JSXElement, Slot } from '@fluentui/react-utilities';\n\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface/DialogSurface.types';\n\nexport type DialogSlots = {\n /**\n * For more information refer to the [Motion docs page](https://react.fluentui.dev/?path=/docs/motion-motion-slot--docs).\n *\n */\n surfaceMotion: Slot<PresenceMotionSlotProps<ScaleParams>>;\n};\n\nexport type InternalDialogSlots = {\n surfaceMotion: NonNullable<Slot<PresenceMotionSlotProps<ScaleParams>>>;\n};\n\nexport type DialogOpenChangeEvent = DialogOpenChangeData['event'];\n\nexport type DialogOpenChangeData =\n | {\n type: 'escapeKeyDown';\n open: boolean;\n event: React.KeyboardEvent<DialogSurfaceElement>;\n }\n | {\n type: 'backdropClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n }\n | {\n type: 'triggerClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n };\n\nexport type DialogModalType = 'modal' | 'non-modal' | 'alert';\n\n/**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\nexport type DialogOpenChangeEventHandler = (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;\n\nexport type DialogContextValues = {\n dialog: DialogContextValue;\n /**\n * dialogSurface context is provided by Dialog as false\n * to ensure components inside Dialog but outside DialogSurface will consume this as false\n */\n dialogSurface: DialogSurfaceContextValue;\n};\n\nexport type DialogProps = ComponentProps<Partial<DialogSlots>> & {\n /**\n * Dialog variations.\n *\n * `modal`: When this type of dialog is open, the rest of the page is dimmed out and cannot be interacted with.\n * The tab sequence is kept within the dialog and moving the focus outside\n * the dialog will imply closing it. This is the default type of the component.\n *\n * `non-modal`: When a non-modal dialog is open, the rest of the page is not dimmed out\n * and users can interact with the rest of the page.\n * This also implies that the tab focus can move outside the dialog when it reaches the last focusable element.\n *\n * `alert`: is a special type of modal dialogs that interrupts the user's workflow\n * to communicate an important message or ask for a decision.\n * Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog,\n * and it cannot be dismissed through the dimmed background.\n *\n * @default modal\n */\n modalType?: DialogModalType;\n /**\n * Controls the open state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Default value for the uncontrolled open state of the dialog.\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onOpenChange?: DialogOpenChangeEventHandler;\n /**\n * Can contain two children including `DialogTrigger` and `DialogSurface`.\n * Alternatively can only contain `DialogSurface` if using trigger outside dialog, or controlling state.\n */\n children: [JSXElement, JSXElement] | JSXElement;\n /**\n * Enables standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n * where the focus trap involves setting outside elements inert.\n *\n * @default false\n */\n inertTrapFocus?: boolean;\n /**\n * Decides whether the dialog should be removed from the DOM tree when it is closed.\n * This can be useful when dealing with components that may contain state that should not\n * be reset when the dialog is closed.\n *\n * @default true\n */\n unmountOnClose?: boolean;\n};\n\nexport type DialogState = ComponentState<InternalDialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"],"names":[],"mappings":""}
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Dialog
|
|
12
|
+
get Dialog () {
|
|
13
13
|
return _Dialog.Dialog;
|
|
14
14
|
},
|
|
15
|
-
renderDialog_unstable
|
|
15
|
+
get renderDialog_unstable () {
|
|
16
16
|
return _renderDialog.renderDialog_unstable;
|
|
17
17
|
},
|
|
18
|
-
useDialogContextValues_unstable
|
|
18
|
+
get useDialogContextValues_unstable () {
|
|
19
19
|
return _useDialogContextValues.useDialogContextValues_unstable;
|
|
20
20
|
},
|
|
21
|
-
useDialog_unstable
|
|
21
|
+
get useDialog_unstable () {
|
|
22
22
|
return _useDialog.useDialog_unstable;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Dialog/index.ts"],"sourcesContent":["export { Dialog } from './Dialog';\nexport type {\n DialogContextValues,\n DialogModalType,\n DialogOpenChangeData,\n DialogOpenChangeEvent,\n DialogOpenChangeEventHandler,\n DialogProps,\n DialogSlots,\n DialogState,\n InternalDialogSlots,\n} from './Dialog.types';\nexport { renderDialog_unstable } from './renderDialog';\nexport { useDialog_unstable } from './useDialog';\nexport { useDialogContextValues_unstable } from './useDialogContextValues';\n"],"names":["Dialog","renderDialog_unstable","useDialog_unstable","useDialogContextValues_unstable"],"mappings":";;;;;;;;;;;;eAASA,cAAM;;;eAYNC,mCAAqB;;;eAErBE,uDAA+B;;;eAD/BD,6BAAkB;;;wBAbJ,cAAW;8BAYI,oBAAiB;2BACpB,iBAAc;wCACD,8BAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Dialog/renderDialog.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { MotionRefForwarder } from '@fluentui/react-motion';\nimport { DialogProvider, DialogSurfaceProvider } from '../../contexts';\nimport type { DialogState, DialogContextValues, InternalDialogSlots } from './Dialog.types';\n\n/**\n * Render the final JSX of Dialog\n */\nexport const renderDialog_unstable = (state: DialogState, contextValues: DialogContextValues): JSXElement => {\n assertSlots<InternalDialogSlots>(state);\n\n return (\n <DialogProvider value={contextValues.dialog}>\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n {state.trigger}\n {state.content && (\n <state.surfaceMotion>\n <MotionRefForwarder>\n {/* Casting here as content should be equivalent to <DialogSurface/> */}\n {/* FIXME: content should not be ReactNode it should be ReactElement instead. */}\n {state.content as React.ReactElement}\n </MotionRefForwarder>\n </state.surfaceMotion>\n )}\n </DialogSurfaceProvider>\n </DialogProvider>\n );\n};\n"],"names":["assertSlots","React","MotionRefForwarder","DialogProvider","DialogSurfaceProvider","renderDialog_unstable","state","contextValues","value","dialog","dialogSurface","trigger","content","surfaceMotion"],"mappings":";;;;+BAcaK;;;;;;;;gCAbb,gDAAiD,GAEjD,SAASL,WAAW,QAAQ,4BAA4B;iEAEjC,QAAQ;6BAEI,yBAAyB;uBACN,0BAAiB;AAMhE,8BAA8B,CAACM,OAAoBC;QACxDP,2BAAAA,EAAiCM;IAEjC,OAAA,WAAA,OACE,eAAA,EAACH,qBAAAA,EAAAA;QAAeK,OAAOD,cAAcE,MAAM;kBACzC,WAAA,OAAA,gBAAA,EAACL,4BAAAA,EAAAA;YAAsBI,OAAOD,cAAcG,aAAa;;gBACtDJ,MAAMK,OAAO;gBACbL,MAAMM,OAAO,IAAA,WAAA,OACZ,eAAA,EAACN,MAAMO,aAAa,EAAA;8BAClB,WAAA,OAAA,eAAA,EAACX,+BAAAA,EAAAA;kCAGEI,MAAMM,OAAO;;;;;;AAO5B,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Dialog/useDialog.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { useControllableState, useEventCallback, useId } from '@fluentui/react-utilities';\n\nimport { useFocusFirstElement } from '../../utils';\nimport { DialogContext } from '../../contexts';\nimport { DialogSurfaceMotion } from '../DialogSurfaceMotion';\nimport type { DialogOpenChangeData, DialogProps, DialogState } from './Dialog.types';\n\n/**\n * Create the state required to render Dialog.\n *\n * The returned state can be modified with hooks such as useDialogStyles_unstable,\n * before being passed to renderDialog_unstable.\n *\n * @param props - props from this instance of Dialog\n */\nexport const useDialog_unstable = (props: DialogProps): DialogState => {\n const { children, modalType = 'modal', onOpenChange, inertTrapFocus = false, unmountOnClose = true } = props;\n\n const dialogTitleId = useId('dialog-title-');\n\n const [trigger, content] = childrenToTriggerAndContent(children);\n\n const [open, setOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false,\n });\n\n const requestOpenChange = useEventCallback((data: DialogOpenChangeData) => {\n onOpenChange?.(data.event, data);\n\n // if user prevents default then do not change state value\n // otherwise updates state value and trigger reference to the element that caused the opening\n if (!data.event.isDefaultPrevented()) {\n setOpen(data.open);\n }\n });\n\n const dialogRef = useFocusFirstElement(open, modalType);\n\n const { modalAttributes, triggerAttributes } = useModalAttributes({\n trapFocus: modalType !== 'non-modal',\n legacyTrapFocus: !inertTrapFocus,\n });\n\n const isNestedDialog = useHasParentContext(DialogContext);\n\n return {\n components: {\n surfaceMotion: DialogSurfaceMotion,\n },\n inertTrapFocus,\n open,\n modalType,\n content,\n trigger,\n requestOpenChange,\n dialogTitleId,\n isNestedDialog,\n unmountOnClose,\n dialogRef,\n modalAttributes,\n triggerAttributes,\n surfaceMotion: presenceMotionSlot(props.surfaceMotion, {\n elementType: DialogSurfaceMotion,\n defaultProps: {\n visible: open,\n appear: unmountOnClose,\n unmountOnExit: unmountOnClose,\n },\n }),\n };\n};\n\n/**\n * Extracts trigger and content from children\n */\nfunction childrenToTriggerAndContent(\n children: React.ReactNode,\n): readonly [trigger: React.ReactNode, content: React.ReactNode] {\n const childrenArray = React.Children.toArray(children) as React.ReactElement[];\n if (process.env.NODE_ENV !== 'production') {\n if (childrenArray.length !== 1 && childrenArray.length !== 2) {\n // eslint-disable-next-line no-console\n console.warn(/* #__DE-INDENT__ */ `\n @fluentui/react-dialog [useDialog]:\n Dialog must contain at least one child <DialogSurface/>,\n and at most two children <DialogTrigger/> <DialogSurface/> (in this order).\n `);\n }\n }\n switch (childrenArray.length) {\n // case where there's a trigger followed by content\n case 2:\n return childrenArray as [trigger: React.ReactNode, content: React.ReactNode];\n // case where there's only content\n case 1:\n return [undefined, childrenArray[0]];\n // unknown case\n default:\n return [undefined, undefined];\n }\n}\n"],"names":["React","useHasParentContext","useModalAttributes","presenceMotionSlot","useControllableState","useEventCallback","useId","useFocusFirstElement","DialogContext","DialogSurfaceMotion","useDialog_unstable","props","children","modalType","onOpenChange","inertTrapFocus","unmountOnClose","dialogTitleId","trigger","content","childrenToTriggerAndContent","open","setOpen","state","defaultState","defaultOpen","initialState","requestOpenChange","data","event","isDefaultPrevented","dialogRef","modalAttributes","triggerAttributes","trapFocus","legacyTrapFocus","isNestedDialog","components","surfaceMotion","elementType","defaultProps","visible","appear","unmountOnExit","childrenArray","Children","toArray","process","env","NODE_ENV","length","console","warn","undefined"],"mappings":"AAAA;;;;;+BAsBaU;;;;;;;iEApBU,QAAQ;sCAEK,mCAAmC;8BACpC,0BAA0B;6BAC1B,yBAAyB;gCACE,4BAA4B;uBAErD,uBAAc;wBACrB,0BAAiB;qCACX,4BAAyB;AAWtD,2BAA2B,CAACC;IACjC,MAAM,EAAEC,QAAQ,EAAEC,YAAY,OAAO,EAAEC,YAAY,EAAEC,iBAAiB,KAAK,EAAEC,iBAAiB,IAAI,EAAE,GAAGL;IAEvG,MAAMM,oBAAgBX,qBAAAA,EAAM;IAE5B,MAAM,CAACY,SAASC,QAAQ,GAAGC,4BAA4BR;IAEvD,MAAM,CAACS,MAAMC,QAAQ,OAAGlB,oCAAAA,EAAqB;QAC3CmB,OAAOZ,MAAMU,IAAI;QACjBG,cAAcb,MAAMc,WAAW;QAC/BC,cAAc;IAChB;IAEA,MAAMC,wBAAoBtB,gCAAAA,EAAiB,CAACuB;QAC1Cd,iBAAAA,QAAAA,iBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,aAAec,KAAKC,KAAK,EAAED;QAE3B,0DAA0D;QAC1D,6FAA6F;QAC7F,IAAI,CAACA,KAAKC,KAAK,CAACC,kBAAkB,IAAI;YACpCR,QAAQM,KAAKP,IAAI;QACnB;IACF;IAEA,MAAMU,gBAAYxB,2BAAAA,EAAqBc,MAAMR;IAE7C,MAAM,EAAEmB,eAAe,EAAEC,iBAAiB,EAAE,OAAG/B,gCAAAA,EAAmB;QAChEgC,WAAWrB,cAAc;QACzBsB,iBAAiB,CAACpB;IACpB;IAEA,MAAMqB,qBAAiBnC,yCAAAA,EAAoBO,qBAAAA;IAE3C,OAAO;QACL6B,YAAY;YACVC,eAAe7B,wCAAAA;QACjB;QACAM;QACAM;QACAR;QACAM;QACAD;QACAS;QACAV;QACAmB;QACApB;QACAe;QACAC;QACAC;QACAK,mBAAenC,+BAAAA,EAAmBQ,MAAM2B,aAAa,EAAE;YACrDC,aAAa9B,wCAAAA;YACb+B,cAAc;gBACZC,SAASpB;gBACTqB,QAAQ1B;gBACR2B,eAAe3B;YACjB;QACF;IACF;AACF,EAAE;AAEF;;CAEC,GACD,SAASI,4BACPR,QAAyB;IAEzB,MAAMgC,gBAAgB5C,OAAM6C,QAAQ,CAACC,OAAO,CAAClC;IAC7C,IAAImC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIL,cAAcM,MAAM,KAAK,KAAKN,cAAcM,MAAM,KAAK,GAAG;YAC5D,sCAAsC;YACtCC,QAAQC,IAAI,CAAsB,CAAC;;2EAInC,CAAC;QACH;IACF;IACA,OAAQR,cAAcM,MAAM;QAC1B,mDAAmD;QACnD,KAAK;YACH,OAAON;QACT,kCAAkC;QAClC,KAAK;YACH,OAAO;gBAACS;gBAAWT,aAAa,CAAC,EAAE;aAAC;QACtC,eAAe;QACf;YACE,OAAO;gBAACS;gBAAWA;aAAU;IACjC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Dialog/useDialogContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogContextValues, DialogState } from './Dialog.types';\n\nexport function useDialogContextValues_unstable(state: DialogState): DialogContextValues {\n const {\n modalType,\n open,\n dialogRef,\n dialogTitleId,\n isNestedDialog,\n inertTrapFocus,\n requestOpenChange,\n modalAttributes,\n triggerAttributes,\n unmountOnClose,\n } = state;\n\n const dialog = React.useMemo<DialogContextValue>(\n () => ({\n open,\n modalType,\n dialogRef,\n dialogTitleId,\n isNestedDialog,\n inertTrapFocus,\n modalAttributes,\n triggerAttributes,\n unmountOnClose,\n requestOpenChange,\n }),\n [\n open,\n modalType,\n dialogRef,\n dialogTitleId,\n isNestedDialog,\n inertTrapFocus,\n modalAttributes,\n triggerAttributes,\n unmountOnClose,\n requestOpenChange,\n ],\n );\n\n const dialogSurface: DialogSurfaceContextValue = false;\n\n return { dialog, dialogSurface };\n}\n"],"names":["React","useDialogContextValues_unstable","state","modalType","open","dialogRef","dialogTitleId","isNestedDialog","inertTrapFocus","requestOpenChange","modalAttributes","triggerAttributes","unmountOnClose","dialog","useMemo","dialogSurface"],"mappings":"AAAA;;;;;+BAMgBC;;;;;;;iEAJO,QAAQ;AAIxB,yCAAyCC,KAAkB;IAChE,MAAM,EACJC,SAAS,EACTC,IAAI,EACJC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,iBAAiB,EACjBC,eAAe,EACfC,iBAAiB,EACjBC,cAAc,EACf,GAAGV;IAEJ,MAAMW,SAASb,OAAMc,OAAO,CAC1B,IAAO,CAAA;YACLV;YACAD;YACAE;YACAC;YACAC;YACAC;YACAE;YACAC;YACAC;YACAH;SACF,CAAA,EACA;QACEL;QACAD;QACAE;QACAC;QACAC;QACAC;QACAE;QACAC;QACAC;QACAH;KACD;IAGH,MAAMM,gBAA2C;IAEjD,OAAO;QAAEF;QAAQE;IAAc;AACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DialogActions/DialogActions.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDialogActions_unstable } from './useDialogActions';\nimport { renderDialogActions_unstable } from './renderDialogActions';\nimport { useDialogActionsStyles_unstable } from './useDialogActionsStyles.styles';\nimport type { DialogActionsProps } from './DialogActions.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * `DialogActions` is a container for the actions of the dialog.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogActions: ForwardRefComponent<DialogActionsProps> = React.forwardRef((props, ref) => {\n const state = useDialogActions_unstable(props, ref);\n\n useDialogActionsStyles_unstable(state);\n\n useCustomStyleHook_unstable('useDialogActionsStyles_unstable')(state);\n\n return renderDialogActions_unstable(state);\n});\n\nDialogActions.displayName = 'DialogActions';\n"],"names":["React","useDialogActions_unstable","renderDialogActions_unstable","useDialogActionsStyles_unstable","useCustomStyleHook_unstable","DialogActions","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;kCACW,wBAAqB;qCAClB,2BAAwB;8CACrB,qCAAkC;qCAGtC,kCAAkC;AAMvE,MAAMK,gBAAAA,WAAAA,GAAyDL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,YAAQR,2CAAAA,EAA0BM,OAAOC;QAE/CL,6DAAAA,EAAgCM;QAEhCL,gDAAAA,EAA4B,mCAAmCK;IAE/D,WAAOP,iDAAAA,EAA6BO;AACtC,GAAG;AAEHJ,cAAcK,WAAW,GAAG"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@layer fluentui {
|
|
2
|
+
.root {
|
|
3
|
+
gap: var(--spacingHorizontalS);
|
|
4
|
+
height: fit-content;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
display: flex;
|
|
7
|
+
grid-row-start: 3;
|
|
8
|
+
grid-row-end: 3;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.start {
|
|
12
|
+
justify-self: start;
|
|
13
|
+
grid-column-start: 1;
|
|
14
|
+
grid-column-end: 2;
|
|
15
|
+
@media screen and (max-width: 480px) {
|
|
16
|
+
grid-column-end: 4;
|
|
17
|
+
grid-row-start: 3;
|
|
18
|
+
grid-row-end: auto;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.end {
|
|
23
|
+
justify-self: end;
|
|
24
|
+
grid-column-start: 2;
|
|
25
|
+
grid-column-end: 4;
|
|
26
|
+
@media screen and (max-width: 480px) {
|
|
27
|
+
grid-column-start: 1;
|
|
28
|
+
grid-row-start: 4;
|
|
29
|
+
grid-row-end: auto;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.fluid:where(.start) {
|
|
34
|
+
grid-column-end: 4;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.fluid:where(.end) {
|
|
38
|
+
grid-column-start: 1;
|
|
39
|
+
}
|
|
40
|
+
/* Griffel emits media rules after the position rules. */
|
|
41
|
+
@media screen and (max-width: 480px) {
|
|
42
|
+
.root {
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
justify-self: stretch;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|