@fluentui/react-dialog 9.0.0-beta.10
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.json +527 -0
- package/CHANGELOG.md +199 -0
- package/LICENSE +15 -0
- package/README.md +5 -0
- package/Spec.md +537 -0
- package/assets/AlertDialogKeyboardInteraction.png +0 -0
- package/assets/AlertDialogMouseInteraction.png +0 -0
- package/assets/ModalDialogKeyboardInteraction.png +0 -0
- package/assets/ModalDialogMouseInteraction.png +0 -0
- package/assets/NonModalDialogKeyboardInteraction.png +0 -0
- package/assets/NonModalDialogMouseInteraction.png +0 -0
- package/dist/index.d.ts +451 -0
- package/lib/Dialog.js +2 -0
- package/lib/Dialog.js.map +1 -0
- package/lib/DialogActions.js +2 -0
- package/lib/DialogActions.js.map +1 -0
- package/lib/DialogBody.js +2 -0
- package/lib/DialogBody.js.map +1 -0
- package/lib/DialogContent.js +2 -0
- package/lib/DialogContent.js.map +1 -0
- package/lib/DialogSurface.js +2 -0
- package/lib/DialogSurface.js.map +1 -0
- package/lib/DialogTitle.js +2 -0
- package/lib/DialogTitle.js.map +1 -0
- package/lib/DialogTrigger.js +2 -0
- package/lib/DialogTrigger.js.map +1 -0
- package/lib/components/Dialog/Dialog.js +19 -0
- package/lib/components/Dialog/Dialog.js.map +1 -0
- package/lib/components/Dialog/Dialog.types.js +2 -0
- package/lib/components/Dialog/Dialog.types.js.map +1 -0
- package/lib/components/Dialog/index.js +5 -0
- package/lib/components/Dialog/index.js.map +1 -0
- package/lib/components/Dialog/renderDialog.js +18 -0
- package/lib/components/Dialog/renderDialog.js.map +1 -0
- package/lib/components/Dialog/useDialog.js +87 -0
- package/lib/components/Dialog/useDialog.js.map +1 -0
- package/lib/components/Dialog/useDialogContextValues.js +31 -0
- package/lib/components/Dialog/useDialogContextValues.js.map +1 -0
- package/lib/components/DialogActions/DialogActions.js +16 -0
- package/lib/components/DialogActions/DialogActions.js.map +1 -0
- package/lib/components/DialogActions/DialogActions.types.js +2 -0
- package/lib/components/DialogActions/DialogActions.types.js.map +1 -0
- package/lib/components/DialogActions/index.js +6 -0
- package/lib/components/DialogActions/index.js.map +1 -0
- package/lib/components/DialogActions/renderDialogActions.js +16 -0
- package/lib/components/DialogActions/renderDialogActions.js.map +1 -0
- package/lib/components/DialogActions/useDialogActions.js +27 -0
- package/lib/components/DialogActions/useDialogActions.js.map +1 -0
- package/lib/components/DialogActions/useDialogActionsStyles.js +49 -0
- package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -0
- package/lib/components/DialogBody/DialogBody.js +16 -0
- package/lib/components/DialogBody/DialogBody.js.map +1 -0
- package/lib/components/DialogBody/DialogBody.types.js +2 -0
- package/lib/components/DialogBody/DialogBody.types.js.map +1 -0
- package/lib/components/DialogBody/index.js +6 -0
- package/lib/components/DialogBody/index.js.map +1 -0
- package/lib/components/DialogBody/renderDialogBody.js +16 -0
- package/lib/components/DialogBody/renderDialogBody.js.map +1 -0
- package/lib/components/DialogBody/useDialogBody.js +25 -0
- package/lib/components/DialogBody/useDialogBody.js.map +1 -0
- package/lib/components/DialogBody/useDialogBodyStyles.js +50 -0
- package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -0
- package/lib/components/DialogContent/DialogContent.js +16 -0
- package/lib/components/DialogContent/DialogContent.js.map +1 -0
- package/lib/components/DialogContent/DialogContent.types.js +2 -0
- package/lib/components/DialogContent/DialogContent.types.js.map +1 -0
- package/lib/components/DialogContent/index.js +6 -0
- package/lib/components/DialogContent/index.js.map +1 -0
- package/lib/components/DialogContent/renderDialogContent.js +15 -0
- package/lib/components/DialogContent/renderDialogContent.js.map +1 -0
- package/lib/components/DialogContent/useDialogContent.js +28 -0
- package/lib/components/DialogContent/useDialogContent.js.map +1 -0
- package/lib/components/DialogContent/useDialogContentStyles.js +40 -0
- package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -0
- package/lib/components/DialogSurface/DialogSurface.js +18 -0
- package/lib/components/DialogSurface/DialogSurface.js.map +1 -0
- package/lib/components/DialogSurface/DialogSurface.types.js +2 -0
- package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -0
- package/lib/components/DialogSurface/index.js +6 -0
- package/lib/components/DialogSurface/index.js.map +1 -0
- package/lib/components/DialogSurface/renderDialogSurface.js +20 -0
- package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -0
- package/lib/components/DialogSurface/useDialogSurface.js +158 -0
- package/lib/components/DialogSurface/useDialogSurface.js.map +1 -0
- package/lib/components/DialogSurface/useDialogSurfaceContextValues.js +7 -0
- package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -0
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js +95 -0
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
- package/lib/components/DialogTitle/DialogTitle.js +16 -0
- package/lib/components/DialogTitle/DialogTitle.js.map +1 -0
- package/lib/components/DialogTitle/DialogTitle.types.js +2 -0
- package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -0
- package/lib/components/DialogTitle/index.js +6 -0
- package/lib/components/DialogTitle/index.js.map +1 -0
- package/lib/components/DialogTitle/renderDialogTitle.js +16 -0
- package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -0
- package/lib/components/DialogTitle/useDialogTitle.js +48 -0
- package/lib/components/DialogTitle/useDialogTitle.js.map +1 -0
- package/lib/components/DialogTitle/useDialogTitleStyles.js +116 -0
- package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -0
- package/lib/components/DialogTrigger/DialogTrigger.js +20 -0
- package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -0
- package/lib/components/DialogTrigger/DialogTrigger.types.js +2 -0
- package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -0
- package/lib/components/DialogTrigger/index.js +5 -0
- package/lib/components/DialogTrigger/index.js.map +1 -0
- package/lib/components/DialogTrigger/renderDialogTrigger.js +7 -0
- package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -0
- package/lib/components/DialogTrigger/useDialogTrigger.js +48 -0
- package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -0
- package/lib/contexts/constants.js +11 -0
- package/lib/contexts/constants.js.map +1 -0
- package/lib/contexts/dialogContext.js +19 -0
- package/lib/contexts/dialogContext.js.map +1 -0
- package/lib/contexts/dialogSurfaceContext.js +10 -0
- package/lib/contexts/dialogSurfaceContext.js.map +1 -0
- package/lib/contexts/index.js +4 -0
- package/lib/contexts/index.js.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/index.js +6 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/isEscapeKeyDown.js +12 -0
- package/lib/utils/isEscapeKeyDown.js.map +1 -0
- package/lib/utils/isHTMLDialogElement.js +4 -0
- package/lib/utils/isHTMLDialogElement.js.map +1 -0
- package/lib/utils/useControlNativeDialogOpenState.js +20 -0
- package/lib/utils/useControlNativeDialogOpenState.js.map +1 -0
- package/lib/utils/useDisableBodyScroll.js +60 -0
- package/lib/utils/useDisableBodyScroll.js.map +1 -0
- package/lib/utils/useFocusFirstElement.js +41 -0
- package/lib/utils/useFocusFirstElement.js.map +1 -0
- package/lib-commonjs/Dialog.js +10 -0
- package/lib-commonjs/Dialog.js.map +1 -0
- package/lib-commonjs/DialogActions.js +10 -0
- package/lib-commonjs/DialogActions.js.map +1 -0
- package/lib-commonjs/DialogBody.js +10 -0
- package/lib-commonjs/DialogBody.js.map +1 -0
- package/lib-commonjs/DialogContent.js +10 -0
- package/lib-commonjs/DialogContent.js.map +1 -0
- package/lib-commonjs/DialogSurface.js +10 -0
- package/lib-commonjs/DialogSurface.js.map +1 -0
- package/lib-commonjs/DialogTitle.js +10 -0
- package/lib-commonjs/DialogTitle.js.map +1 -0
- package/lib-commonjs/DialogTrigger.js +10 -0
- package/lib-commonjs/DialogTrigger.js.map +1 -0
- package/lib-commonjs/components/Dialog/Dialog.js +30 -0
- package/lib-commonjs/components/Dialog/Dialog.js.map +1 -0
- package/lib-commonjs/components/Dialog/Dialog.types.js +6 -0
- package/lib-commonjs/components/Dialog/Dialog.types.js.map +1 -0
- package/lib-commonjs/components/Dialog/index.js +16 -0
- package/lib-commonjs/components/Dialog/index.js.map +1 -0
- package/lib-commonjs/components/Dialog/renderDialog.js +29 -0
- package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -0
- package/lib-commonjs/components/Dialog/useDialog.js +101 -0
- package/lib-commonjs/components/Dialog/useDialog.js.map +1 -0
- package/lib-commonjs/components/Dialog/useDialogContextValues.js +40 -0
- package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -0
- package/lib-commonjs/components/DialogActions/DialogActions.js +27 -0
- package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -0
- package/lib-commonjs/components/DialogActions/DialogActions.types.js +6 -0
- package/lib-commonjs/components/DialogActions/DialogActions.types.js.map +1 -0
- package/lib-commonjs/components/DialogActions/index.js +18 -0
- package/lib-commonjs/components/DialogActions/index.js.map +1 -0
- package/lib-commonjs/components/DialogActions/renderDialogActions.js +27 -0
- package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -0
- package/lib-commonjs/components/DialogActions/useDialogActions.js +37 -0
- package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -0
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js +60 -0
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -0
- package/lib-commonjs/components/DialogBody/DialogBody.js +27 -0
- package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -0
- package/lib-commonjs/components/DialogBody/DialogBody.types.js +6 -0
- package/lib-commonjs/components/DialogBody/DialogBody.types.js.map +1 -0
- package/lib-commonjs/components/DialogBody/index.js +18 -0
- package/lib-commonjs/components/DialogBody/index.js.map +1 -0
- package/lib-commonjs/components/DialogBody/renderDialogBody.js +27 -0
- package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -0
- package/lib-commonjs/components/DialogBody/useDialogBody.js +35 -0
- package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -0
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +61 -0
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -0
- package/lib-commonjs/components/DialogContent/DialogContent.js +27 -0
- package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -0
- package/lib-commonjs/components/DialogContent/DialogContent.types.js +6 -0
- package/lib-commonjs/components/DialogContent/DialogContent.types.js.map +1 -0
- package/lib-commonjs/components/DialogContent/index.js +18 -0
- package/lib-commonjs/components/DialogContent/index.js.map +1 -0
- package/lib-commonjs/components/DialogContent/renderDialogContent.js +26 -0
- package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -0
- package/lib-commonjs/components/DialogContent/useDialogContent.js +39 -0
- package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -0
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +52 -0
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.js +30 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.types.js +6 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.types.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/index.js +18 -0
- package/lib-commonjs/components/DialogSurface/index.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +33 -0
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js +171 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js +16 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +107 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.js +27 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.types.js +6 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.types.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/index.js +18 -0
- package/lib-commonjs/components/DialogTitle/index.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +27 -0
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js +64 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +129 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.js +31 -0
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js +6 -0
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/index.js +16 -0
- package/lib-commonjs/components/DialogTrigger/index.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js +16 -0
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +62 -0
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -0
- package/lib-commonjs/contexts/constants.js +17 -0
- package/lib-commonjs/contexts/constants.js.map +1 -0
- package/lib-commonjs/contexts/dialogContext.js +30 -0
- package/lib-commonjs/contexts/dialogContext.js.map +1 -0
- package/lib-commonjs/contexts/dialogSurfaceContext.js +21 -0
- package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -0
- package/lib-commonjs/contexts/index.js +14 -0
- package/lib-commonjs/contexts/index.js.map +1 -0
- package/lib-commonjs/index.js +214 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/utils/index.js +18 -0
- package/lib-commonjs/utils/index.js.map +1 -0
- package/lib-commonjs/utils/isEscapeKeyDown.js +23 -0
- package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -0
- package/lib-commonjs/utils/isHTMLDialogElement.js +13 -0
- package/lib-commonjs/utils/isHTMLDialogElement.js.map +1 -0
- package/lib-commonjs/utils/useControlNativeDialogOpenState.js +31 -0
- package/lib-commonjs/utils/useControlNativeDialogOpenState.js.map +1 -0
- package/lib-commonjs/utils/useDisableBodyScroll.js +73 -0
- package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -0
- package/lib-commonjs/utils/useFocusFirstElement.js +54 -0
- package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
+
|
|
9
|
+
tslib_1.__exportStar(require("./DialogContent"), exports);
|
|
10
|
+
|
|
11
|
+
tslib_1.__exportStar(require("./DialogContent.types"), exports);
|
|
12
|
+
|
|
13
|
+
tslib_1.__exportStar(require("./renderDialogContent"), exports);
|
|
14
|
+
|
|
15
|
+
tslib_1.__exportStar(require("./useDialogContent"), exports);
|
|
16
|
+
|
|
17
|
+
tslib_1.__exportStar(require("./useDialogContentStyles"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogContent';\nexport * from './DialogContent.types';\nexport * from './renderDialogContent';\nexport * from './useDialogContent';\nexport * from './useDialogContentStyles';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderDialogContent_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
+
/**
|
|
12
|
+
* Render the final JSX of DialogContent
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const renderDialogContent_unstable = state => {
|
|
17
|
+
const {
|
|
18
|
+
slots,
|
|
19
|
+
slotProps
|
|
20
|
+
} = react_utilities_1.getSlots(state);
|
|
21
|
+
return React.createElement(slots.root, { ...slotProps.root
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.renderDialogContent_unstable = renderDialogContent_unstable;
|
|
26
|
+
//# sourceMappingURL=renderDialogContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA8B;EACxE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA6B,KAA7B,CAA7B;EAEA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogContentState, DialogContentSlots } from './DialogContent.types';\n\n/**\n * Render the final JSX of DialogContent\n */\nexport const renderDialogContent_unstable = (state: DialogContentState) => {\n const { slots, slotProps } = getSlots<DialogContentSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogContent_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
9
|
+
|
|
10
|
+
const contexts_1 = /*#__PURE__*/require("../../contexts");
|
|
11
|
+
/**
|
|
12
|
+
* Create the state required to render DialogBody.
|
|
13
|
+
*
|
|
14
|
+
* The returned state can be modified with hooks such as useDialogBodyStyles_unstable,
|
|
15
|
+
* before being passed to renderDialogBody_unstable.
|
|
16
|
+
*
|
|
17
|
+
* @param props - props from this instance of DialogBody
|
|
18
|
+
* @param ref - reference to root HTMLElement of DialogBody
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const useDialogContent_unstable = (props, ref) => {
|
|
23
|
+
var _a;
|
|
24
|
+
|
|
25
|
+
const dialogContentId = contexts_1.useDialogContext_unstable(ctx => ctx.dialogContentId);
|
|
26
|
+
return {
|
|
27
|
+
components: {
|
|
28
|
+
root: 'div'
|
|
29
|
+
},
|
|
30
|
+
root: react_utilities_1.getNativeElementProps((_a = props.as) !== null && _a !== void 0 ? _a : 'div', {
|
|
31
|
+
ref,
|
|
32
|
+
id: dialogContentId,
|
|
33
|
+
...props
|
|
34
|
+
})
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.useDialogContent_unstable = useDialogContent_unstable;
|
|
39
|
+
//# sourceMappingURL=useDialogContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContent.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;EACtB,MAAM,eAAe,GAAG,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,eAArC,CAAxB;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,KAAlC,EAAyC;MAC7C,GAD6C;MAE7C,EAAE,EAAE,eAFyC;MAG7C,GAAG;IAH0C,CAAzC;EAJD,CAAP;AAUD,CAfM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { DialogContentProps, DialogContentState } from './DialogContent.types';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogContent_unstable = (\n props: DialogContentProps,\n ref: React.Ref<HTMLElement>,\n): DialogContentState => {\n const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps(props.as ?? 'div', {\n ref,\n id: dialogContentId,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogContentStyles_unstable = exports.dialogContentClassNames = void 0;
|
|
7
|
+
|
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
|
+
|
|
10
|
+
const constants_1 = /*#__PURE__*/require("../../contexts/constants");
|
|
11
|
+
|
|
12
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
13
|
+
|
|
14
|
+
exports.dialogContentClassNames = {
|
|
15
|
+
root: 'fui-DialogContent'
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Styles for the root slot
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
22
|
+
"root": {
|
|
23
|
+
"a9b677": "fly5x3f",
|
|
24
|
+
"Bqenvij": "f1l02sjl",
|
|
25
|
+
"Bmxbyg5": "f5zp4f",
|
|
26
|
+
"sshi5w": "f1nxs5xn",
|
|
27
|
+
"B7ck84d": "f1ewtqcl",
|
|
28
|
+
"Ijaq50": "f6owso0",
|
|
29
|
+
"Br312pm": "fupswjn",
|
|
30
|
+
"nk6f5a": "foucsne",
|
|
31
|
+
"Bw0ie65": "f1ka72gx",
|
|
32
|
+
"Bahqtrf": "fk6fouc",
|
|
33
|
+
"Be2twd7": "fkhj508",
|
|
34
|
+
"Bhrd7zp": "figsok6",
|
|
35
|
+
"Bg96gwp": "f1i3iumi"
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
"d": [".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f5zp4f{overflow-y:auto;}", ".f1nxs5xn{min-height:32px;}", ".f1ewtqcl{box-sizing:border-box;}", ".f6owso0{grid-row-start:body;}", ".fupswjn{grid-column-start:body;}", ".foucsne{grid-row-end:body;}", ".f1ka72gx{grid-column-end:body;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Apply styling to the DialogContent slots based on the state
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
const useDialogContentStyles_unstable = state => {
|
|
46
|
+
const styles = useStyles();
|
|
47
|
+
state.root.className = react_1.mergeClasses(exports.dialogContentClassNames.root, styles.root, state.root.className);
|
|
48
|
+
return state;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.useDialogContentStyles_unstable = useDialogContentStyles_unstable;
|
|
52
|
+
//# sourceMappingURL=useDialogContentStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContentStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,WAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAEa,OAAA,CAAA,uBAAA,GAA8D;EACzE,IAAI,EAAE;AADmE,CAA9D;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAYA;;AAEG;;;AACI,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,uBAAA,CAAwB,IAArC,EAA2C,MAAM,CAAC,IAAlD,EAAwD,KAAK,CAAC,IAAN,CAAW,SAAnE,CAAvB;EACA,OAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogContentSlots, DialogContentState } from './DialogContent.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { CONTENT_GRID_AREA } from '../../contexts/constants';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const dialogContentClassNames: SlotClassNames<DialogContentSlots> = {\n root: 'fui-DialogContent',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n overflowY: 'auto',\n minHeight: '32px',\n boxSizing: 'border-box',\n ...shorthands.gridArea(CONTENT_GRID_AREA),\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Apply styling to the DialogContent slots based on the state\n */\nexport const useDialogContentStyles_unstable = (state: DialogContentState): DialogContentState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogContentClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DialogSurface = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const useDialogSurface_1 = /*#__PURE__*/require("./useDialogSurface");
|
|
11
|
+
|
|
12
|
+
const renderDialogSurface_1 = /*#__PURE__*/require("./renderDialogSurface");
|
|
13
|
+
|
|
14
|
+
const useDialogSurfaceStyles_1 = /*#__PURE__*/require("./useDialogSurfaceStyles");
|
|
15
|
+
|
|
16
|
+
const useDialogSurfaceContextValues_1 = /*#__PURE__*/require("./useDialogSurfaceContextValues");
|
|
17
|
+
/**
|
|
18
|
+
* DialogSurface component represents the visual part of a `Dialog` as a whole,
|
|
19
|
+
* it contains everything that should be visible.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
exports.DialogSurface = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
24
|
+
const state = useDialogSurface_1.useDialogSurface_unstable(props, ref);
|
|
25
|
+
const contextValues = useDialogSurfaceContextValues_1.useDialogSurfaceContextValues_unstable(state);
|
|
26
|
+
useDialogSurfaceStyles_1.useDialogSurfaceStyles_unstable(state);
|
|
27
|
+
return renderDialogSurface_1.renderDialogSurface_unstable(state, contextValues);
|
|
28
|
+
});
|
|
29
|
+
exports.DialogSurface.displayName = 'DialogSurface';
|
|
30
|
+
//# sourceMappingURL=DialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/DialogSurface.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AAGA,MAAA,+BAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;AAEA;;;AAGG;;;AACU,OAAA,CAAA,aAAA,gBAAyD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,EAAiC,GAAjC,CAAd;EACA,MAAM,aAAa,GAAG,+BAAA,CAAA,sCAAA,CAAuC,KAAvC,CAAtB;EAEA,wBAAA,CAAA,+BAAA,CAAgC,KAAhC;EACA,OAAO,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,EAAoC,aAApC,CAAP;AACD,CANqE,CAAzD;AAQb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { useDialogSurface_unstable } from './useDialogSurface';\nimport { renderDialogSurface_unstable } from './renderDialogSurface';\nimport { useDialogSurfaceStyles_unstable } from './useDialogSurfaceStyles';\nimport type { DialogSurfaceProps } from './DialogSurface.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useDialogSurfaceContextValues_unstable } from './useDialogSurfaceContextValues';\n\n/**\n * DialogSurface component represents the visual part of a `Dialog` as a whole,\n * it contains everything that should be visible.\n */\nexport const DialogSurface: ForwardRefComponent<DialogSurfaceProps> = React.forwardRef((props, ref) => {\n const state = useDialogSurface_unstable(props, ref);\n const contextValues = useDialogSurfaceContextValues_unstable(state);\n\n useDialogSurfaceStyles_unstable(state);\n return renderDialogSurface_unstable(state, contextValues);\n});\n\nDialogSurface.displayName = 'DialogSurface';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
+
|
|
9
|
+
tslib_1.__exportStar(require("./DialogSurface"), exports);
|
|
10
|
+
|
|
11
|
+
tslib_1.__exportStar(require("./DialogSurface.types"), exports);
|
|
12
|
+
|
|
13
|
+
tslib_1.__exportStar(require("./renderDialogSurface"), exports);
|
|
14
|
+
|
|
15
|
+
tslib_1.__exportStar(require("./useDialogSurface"), exports);
|
|
16
|
+
|
|
17
|
+
tslib_1.__exportStar(require("./useDialogSurfaceStyles"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogSurface';\nexport * from './DialogSurface.types';\nexport * from './renderDialogSurface';\nexport * from './useDialogSurface';\nexport * from './useDialogSurfaceStyles';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderDialogSurface_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
+
|
|
12
|
+
const contexts_1 = /*#__PURE__*/require("../../contexts");
|
|
13
|
+
|
|
14
|
+
const react_portal_1 = /*#__PURE__*/require("@fluentui/react-portal");
|
|
15
|
+
/**
|
|
16
|
+
* Render the final JSX of DialogSurface
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const renderDialogSurface_unstable = (state, contextValues) => {
|
|
21
|
+
const {
|
|
22
|
+
slots,
|
|
23
|
+
slotProps
|
|
24
|
+
} = react_utilities_1.getSlots(state);
|
|
25
|
+
return React.createElement(react_portal_1.Portal, null, slots.backdrop && React.createElement(slots.backdrop, { ...slotProps.backdrop
|
|
26
|
+
}), React.createElement(contexts_1.DialogSurfaceProvider, {
|
|
27
|
+
value: contextValues.dialogSurface
|
|
28
|
+
}, React.createElement(slots.root, { ...slotProps.root
|
|
29
|
+
})));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.renderDialogSurface_unstable = renderDialogSurface_unstable;
|
|
33
|
+
//# sourceMappingURL=renderDialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,UAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,4BAA4B,GAAG,CAAC,KAAD,EAA4B,aAA5B,KAAyE;EACnH,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA6B,KAA7B,CAA7B;EAEA,OACE,KAAA,CAAA,aAAA,CAAC,cAAA,CAAA,MAAD,EAAO,IAAP,EACG,KAAK,CAAC,QAAN,IAAkB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;EAAf,CAAf,CADrB,EAEE,KAAA,CAAA,aAAA,CAAC,UAAA,CAAA,qBAAD,EAAsB;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAAtB,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADF,CAFF,CADF;AAQD,CAXM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\nimport { DialogSurfaceProvider } from '../../contexts';\nimport { Portal } from '@fluentui/react-portal';\n\n/**\n * Render the final JSX of DialogSurface\n */\nexport const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {\n const { slots, slotProps } = getSlots<DialogSurfaceSlots>(state);\n\n return (\n <Portal>\n {slots.backdrop && <slots.backdrop {...slotProps.backdrop} />}\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <slots.root {...slotProps.root} />\n </DialogSurfaceProvider>\n </Portal>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogSurface_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
9
|
+
|
|
10
|
+
const contexts_1 = /*#__PURE__*/require("../../contexts");
|
|
11
|
+
|
|
12
|
+
const utils_1 = /*#__PURE__*/require("../../utils");
|
|
13
|
+
|
|
14
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
15
|
+
/**
|
|
16
|
+
* Create the state required to render DialogSurface.
|
|
17
|
+
*
|
|
18
|
+
* The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,
|
|
19
|
+
* before being passed to renderDialogSurface_unstable.
|
|
20
|
+
*
|
|
21
|
+
* @param props - props from this instance of DialogSurface
|
|
22
|
+
* @param ref - reference to root HTMLElement of DialogSurface
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const useDialogSurface_unstable = (props, ref) => {
|
|
27
|
+
const {
|
|
28
|
+
backdrop,
|
|
29
|
+
as
|
|
30
|
+
} = props;
|
|
31
|
+
const isNativeDialog = as === 'dialog' || as === undefined;
|
|
32
|
+
const modalType = contexts_1.useDialogContext_unstable(ctx => ctx.modalType);
|
|
33
|
+
const dialogRef = contexts_1.useDialogContext_unstable(ctx => ctx.dialogRef);
|
|
34
|
+
const open = contexts_1.useDialogContext_unstable(ctx => ctx.open);
|
|
35
|
+
const requestOpenChange = contexts_1.useDialogContext_unstable(ctx => ctx.requestOpenChange);
|
|
36
|
+
const dialogTitleID = contexts_1.useDialogContext_unstable(ctx => ctx.dialogTitleId);
|
|
37
|
+
const dialogContentId = contexts_1.useDialogContext_unstable(ctx => ctx.dialogContentId);
|
|
38
|
+
const handleNativeClick = react_utilities_1.useEventCallback(event => {
|
|
39
|
+
var _a;
|
|
40
|
+
|
|
41
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
42
|
+
|
|
43
|
+
if (modalType === 'alert' || event.target !== event.currentTarget) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const {
|
|
48
|
+
clientX,
|
|
49
|
+
clientY
|
|
50
|
+
} = event;
|
|
51
|
+
const {
|
|
52
|
+
top,
|
|
53
|
+
left,
|
|
54
|
+
width,
|
|
55
|
+
height
|
|
56
|
+
} = event.currentTarget.getBoundingClientRect();
|
|
57
|
+
const isBackdropClick = top > clientY || clientY > top + height || left > clientX || clientX > left + width;
|
|
58
|
+
|
|
59
|
+
if (isBackdropClick) {
|
|
60
|
+
requestOpenChange({
|
|
61
|
+
event,
|
|
62
|
+
open: false,
|
|
63
|
+
type: 'backdropClick'
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const handleNativeCancel = react_utilities_1.useEventCallback(event => {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
|
|
70
|
+
(_b = (_a = props).onCancel) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
71
|
+
|
|
72
|
+
if (event.currentTarget !== event.target) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (modalType !== 'alert') {
|
|
77
|
+
requestOpenChange({
|
|
78
|
+
event,
|
|
79
|
+
open: false,
|
|
80
|
+
type: 'dialogCancel'
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
});
|
|
86
|
+
const handleNativeClose = react_utilities_1.useEventCallback(event => {
|
|
87
|
+
var _a, _b;
|
|
88
|
+
|
|
89
|
+
(_b = (_a = props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a, event); // Ensure dialog remains open if force closed by close event
|
|
90
|
+
|
|
91
|
+
if (event.currentTarget.open !== open) {
|
|
92
|
+
if (open) {
|
|
93
|
+
if (modalType === 'non-modal') {
|
|
94
|
+
event.currentTarget.show();
|
|
95
|
+
} else {
|
|
96
|
+
event.currentTarget.showModal();
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
event.currentTarget.close();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const handledBackdropClick = react_utilities_1.useEventCallback(event => {
|
|
104
|
+
var _a, _b;
|
|
105
|
+
|
|
106
|
+
if (react_utilities_1.isResolvedShorthand(props.backdrop)) {
|
|
107
|
+
(_b = (_a = props.backdrop).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (modalType === 'modal' && !event.isDefaultPrevented()) {
|
|
111
|
+
requestOpenChange({
|
|
112
|
+
event,
|
|
113
|
+
open: false,
|
|
114
|
+
type: 'backdropClick'
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const handleKeyDown = react_utilities_1.useEventCallback(event => {
|
|
119
|
+
var _a;
|
|
120
|
+
|
|
121
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
122
|
+
|
|
123
|
+
if (utils_1.isEscapeKeyDismiss(event, modalType)) {
|
|
124
|
+
requestOpenChange({
|
|
125
|
+
event,
|
|
126
|
+
open: false,
|
|
127
|
+
type: 'escapeKeyDown'
|
|
128
|
+
}); // stop propagation to avoid conflicting with other elements that listen for `Escape`
|
|
129
|
+
// e,g: nested Dialog, Popover, Menu and Tooltip
|
|
130
|
+
|
|
131
|
+
event.stopPropagation();
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
const {
|
|
135
|
+
modalAttributes
|
|
136
|
+
} = react_tabster_1.useModalAttributes({
|
|
137
|
+
trapFocus: modalType !== 'non-modal'
|
|
138
|
+
});
|
|
139
|
+
return {
|
|
140
|
+
components: {
|
|
141
|
+
backdrop: 'div',
|
|
142
|
+
root: 'dialog'
|
|
143
|
+
},
|
|
144
|
+
backdrop: react_utilities_1.resolveShorthand(backdrop, {
|
|
145
|
+
required: !isNativeDialog && open && modalType !== 'non-modal',
|
|
146
|
+
defaultProps: {
|
|
147
|
+
'aria-hidden': 'true',
|
|
148
|
+
onClick: handledBackdropClick
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
151
|
+
root: react_utilities_1.getNativeElementProps(as !== null && as !== void 0 ? as : 'dialog', { ...(isNativeDialog ? {
|
|
152
|
+
role: modalType === 'alert' ? 'alertdialog' : undefined,
|
|
153
|
+
onClose: handleNativeClose,
|
|
154
|
+
onClick: handleNativeClick,
|
|
155
|
+
onCancel: handleNativeCancel
|
|
156
|
+
} : {
|
|
157
|
+
'aria-modal': modalType !== 'non-modal',
|
|
158
|
+
role: modalType === 'alert' ? 'alertdialog' : 'dialog'
|
|
159
|
+
}),
|
|
160
|
+
...props,
|
|
161
|
+
...modalAttributes,
|
|
162
|
+
onKeyDown: handleKeyDown,
|
|
163
|
+
'aria-describedby': dialogContentId,
|
|
164
|
+
'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,
|
|
165
|
+
ref: react_utilities_1.useMergedRefs(ref, dialogRef)
|
|
166
|
+
})
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
exports.useDialogSurface_unstable = useDialogSurface_unstable;
|
|
171
|
+
//# sourceMappingURL=useDialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurface.ts"],"names":[],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n resolveShorthand,\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n} from '@fluentui/react-utilities';\nimport type {\n DialogSurfaceElement,\n DialogSurfaceElementIntersection,\n DialogSurfaceProps,\n DialogSurfaceState,\n} from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { isEscapeKeyDismiss, HTMLDialogElementProps } from '../../utils';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */\nexport const useDialogSurface_unstable = (\n props: DialogSurfaceProps,\n ref: React.Ref<DialogSurfaceElement>,\n): DialogSurfaceState => {\n const { backdrop, as } = props;\n const isNativeDialog = as === 'dialog' || as === undefined;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);\n const open = useDialogContext_unstable(ctx => ctx.open);\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);\n const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);\n\n const handleNativeClick = useEventCallback((event: React.MouseEvent<DialogSurfaceElementIntersection>) => {\n props.onClick?.(event);\n if (modalType === 'alert' || event.target !== event.currentTarget) {\n return;\n }\n const { clientX, clientY } = event;\n const { top, left, width, height } = event.currentTarget.getBoundingClientRect();\n const isBackdropClick = top > clientY || clientY > top + height || left > clientX || clientX > left + width;\n if (isBackdropClick) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleNativeCancel = useEventCallback((event: React.SyntheticEvent<DialogSurfaceElementIntersection>) => {\n (props as HTMLDialogElementProps).onCancel?.(event);\n if (event.currentTarget !== event.target) {\n return;\n }\n if (modalType !== 'alert') {\n requestOpenChange({\n event,\n open: false,\n type: 'dialogCancel',\n });\n }\n event.preventDefault();\n });\n\n const handleNativeClose = useEventCallback((event: React.SyntheticEvent<DialogSurfaceElementIntersection>) => {\n (props as HTMLDialogElementProps).onClose?.(event);\n // Ensure dialog remains open if force closed by close event\n if (event.currentTarget.open !== open) {\n if (open) {\n if (modalType === 'non-modal') {\n event.currentTarget.show();\n } else {\n event.currentTarget.showModal();\n }\n } else {\n event.currentTarget.close();\n }\n }\n });\n\n const handledBackdropClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n if (isResolvedShorthand(props.backdrop)) {\n props.backdrop.onClick?.(event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleKeyDown = useEventCallback((event: React.KeyboardEvent<DialogSurfaceElementIntersection>) => {\n props.onKeyDown?.(event);\n\n if (isEscapeKeyDismiss(event, modalType)) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown',\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n\n const { modalAttributes } = useModalAttributes({ trapFocus: modalType !== 'non-modal' });\n\n return {\n components: {\n backdrop: 'div',\n root: 'dialog',\n },\n backdrop: resolveShorthand(backdrop, {\n required: !isNativeDialog && open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n onClick: handledBackdropClick,\n },\n }),\n root: getNativeElementProps(as ?? 'dialog', {\n ...(isNativeDialog\n ? {\n role: modalType === 'alert' ? 'alertdialog' : undefined,\n onClose: handleNativeClose,\n onClick: handleNativeClick,\n onCancel: handleNativeCancel,\n }\n : {\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n }),\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n 'aria-describedby': dialogContentId,\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ref: useMergedRefs(ref, dialogRef),\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogSurfaceContextValues_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
function useDialogSurfaceContextValues_unstable(state) {
|
|
9
|
+
const dialogSurface = true;
|
|
10
|
+
return {
|
|
11
|
+
dialogSurface
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.useDialogSurfaceContextValues_unstable = useDialogSurfaceContextValues_unstable;
|
|
16
|
+
//# sourceMappingURL=useDialogSurfaceContextValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceContextValues.ts"],"names":[],"mappings":";;;;;;;AAGA,SAAgB,sCAAhB,CAAuD,KAAvD,EAAgF;EAC9E,MAAM,aAAa,GAA8B,IAAjD;EAEA,OAAO;IAAE;EAAF,CAAP;AACD;;AAJD,OAAA,CAAA,sCAAA,GAAA,sCAAA","sourcesContent":["import type { DialogSurfaceContextValues, DialogSurfaceState } from './DialogSurface.types';\nimport type { DialogSurfaceContextValue } from '../../contexts';\n\nexport function useDialogSurfaceContextValues_unstable(state: DialogSurfaceState): DialogSurfaceContextValues {\n const dialogSurface: DialogSurfaceContextValue = true;\n\n return { dialogSurface };\n}\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogSurfaceStyles_unstable = exports.dialogSurfaceClassNames = void 0;
|
|
7
|
+
|
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
|
+
|
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
11
|
+
|
|
12
|
+
const contexts_1 = /*#__PURE__*/require("../../contexts");
|
|
13
|
+
|
|
14
|
+
exports.dialogSurfaceClassNames = {
|
|
15
|
+
root: 'fui-DialogSurface',
|
|
16
|
+
backdrop: 'fui-DialogSurface__backdrop'
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Styles for the root slot
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
23
|
+
"root": {
|
|
24
|
+
"mc9l5x": "ftgm304",
|
|
25
|
+
"famaaq": "f1c515w",
|
|
26
|
+
"Bcdw1i0": "f1bitti",
|
|
27
|
+
"Bhzewxz": "f15twtuk",
|
|
28
|
+
"j35jbq": ["f1e31b4d", "f1vgc2s3"],
|
|
29
|
+
"B5kzvoi": "f1yab3r1",
|
|
30
|
+
"oyh7mz": ["f1vgc2s3", "f1e31b4d"],
|
|
31
|
+
"z8tnut": "fuq56rw",
|
|
32
|
+
"z189sj": ["f15kemlc", "fdgang7"],
|
|
33
|
+
"Byoj8tv": "fl2zwns",
|
|
34
|
+
"uwmqm3": ["fdgang7", "f15kemlc"],
|
|
35
|
+
"B6of3ja": "fgr6219",
|
|
36
|
+
"t21cq0": ["f1ujusj6", "fcgxt0o"],
|
|
37
|
+
"jrapky": "f10jk5vf",
|
|
38
|
+
"Frg6f3": ["fcgxt0o", "f1ujusj6"],
|
|
39
|
+
"icvyot": "fzkkow9",
|
|
40
|
+
"vrafjx": ["fcdblym", "fjik90z"],
|
|
41
|
+
"oivjwe": "fg706s2",
|
|
42
|
+
"wvpqe5": ["fjik90z", "fcdblym"],
|
|
43
|
+
"B68tc82": "f1ln0qer",
|
|
44
|
+
"Bmxbyg5": "fa2wlxz",
|
|
45
|
+
"fshzfu": "f120kxnn",
|
|
46
|
+
"qhf8xq": "f19dog8a",
|
|
47
|
+
"a9b677": "fly5x3f",
|
|
48
|
+
"Bqenvij": "f3052tw",
|
|
49
|
+
"B2u0y6b": "fvgz9i8",
|
|
50
|
+
"Bxyxcbc": "f6a9g1z",
|
|
51
|
+
"B7ck84d": "f1ewtqcl",
|
|
52
|
+
"E5pizo": "f10nrhrw",
|
|
53
|
+
"De3pzq": "fxugw4r",
|
|
54
|
+
"sj55zd": "f19n0e5",
|
|
55
|
+
"B4j52fo": "f5ogflp",
|
|
56
|
+
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
|
57
|
+
"Bn0qgzm": "f1f09k3d",
|
|
58
|
+
"ibv6hh": ["finvdd3", "f1hqa2wf"],
|
|
59
|
+
"g2u3we": "fghlq4f",
|
|
60
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
|
61
|
+
"B9xav0g": "fb073pr",
|
|
62
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
|
63
|
+
"Bbmb7ep": ["f1erghxr", "f1ehz9de"],
|
|
64
|
+
"Beyfa6y": ["f1ehz9de", "f1erghxr"],
|
|
65
|
+
"B7oj6ja": ["f1spoy8", "fmb70yw"],
|
|
66
|
+
"Btl43ni": ["fmb70yw", "f1spoy8"],
|
|
67
|
+
"B5xtmjs": "ff54dml"
|
|
68
|
+
},
|
|
69
|
+
"backdrop": {
|
|
70
|
+
"qhf8xq": "f19dog8a",
|
|
71
|
+
"De3pzq": "fju19wo",
|
|
72
|
+
"Bhzewxz": "f113wtx2",
|
|
73
|
+
"j35jbq": ["f10k790i", "f1xynx9j"],
|
|
74
|
+
"B5kzvoi": "f5gq2j6",
|
|
75
|
+
"oyh7mz": ["f1xynx9j", "f10k790i"]
|
|
76
|
+
},
|
|
77
|
+
"nestedDialogBackdrop": {
|
|
78
|
+
"De3pzq": "f3rmtva"
|
|
79
|
+
},
|
|
80
|
+
"nestedNativeDialogBackdrop": {
|
|
81
|
+
"fshzfu": "foe20jx"
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
"d": [".ftgm304{display:block;}", ".f1c515w{-webkit-user-select:unset;-moz-user-select:unset;-ms-user-select:unset;user-select:unset;}", ".f1bitti{visibility:unset;}", ".f15twtuk{top:0;}", ".f1e31b4d{right:0;}", ".f1vgc2s3{left:0;}", ".f1yab3r1{bottom:0;}", ".fuq56rw{padding-top:24px;}", ".f15kemlc{padding-right:24px;}", ".fdgang7{padding-left:24px;}", ".fl2zwns{padding-bottom:24px;}", ".fgr6219{margin-top:auto;}", ".f1ujusj6{margin-right:auto;}", ".fcgxt0o{margin-left:auto;}", ".f10jk5vf{margin-bottom:auto;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1ln0qer{overflow-x:unset;}", ".fa2wlxz{overflow-y:unset;}", ".f120kxnn::backdrop{background-color:rgba(0, 0, 0, 0.4);}", ".f19dog8a{position:fixed;}", ".fly5x3f{width:100%;}", ".f3052tw{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;}", ".fvgz9i8{max-width:600px;}", ".f6a9g1z{max-height:100vh;}", ".f1ewtqcl{box-sizing:border-box;}", ".f10nrhrw{box-shadow:var(--shadow64);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1erghxr{border-bottom-right-radius:8px;}", ".f1ehz9de{border-bottom-left-radius:8px;}", ".f1spoy8{border-top-right-radius:8px;}", ".fmb70yw{border-top-left-radius:8px;}", ".fju19wo{background-color:rgba(0, 0, 0, 0.4);}", ".f113wtx2{top:0px;}", ".f10k790i{right:0px;}", ".f1xynx9j{left:0px;}", ".f5gq2j6{bottom:0px;}", ".f3rmtva{background-color:transparent;}", ".foe20jx::backdrop{background-color:transparent;}"],
|
|
85
|
+
"m": [["@media screen and (max-width: 480px){.ff54dml{max-width:100vw;}}", {
|
|
86
|
+
"m": "screen and (max-width: 480px)"
|
|
87
|
+
}]]
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Apply styling to the DialogSurface slots based on the state
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
const useDialogSurfaceStyles_unstable = state => {
|
|
95
|
+
const styles = useStyles();
|
|
96
|
+
const isNestedDialog = contexts_1.useDialogContext_unstable(ctx => ctx.isNestedDialog);
|
|
97
|
+
state.root.className = react_1.mergeClasses(exports.dialogSurfaceClassNames.root, styles.root, isNestedDialog && styles.nestedNativeDialogBackdrop, state.root.className);
|
|
98
|
+
|
|
99
|
+
if (state.backdrop) {
|
|
100
|
+
state.backdrop.className = react_1.mergeClasses(exports.dialogSurfaceClassNames.backdrop, styles.backdrop, isNestedDialog && styles.nestedDialogBackdrop, state.backdrop.className);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return state;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
exports.useDialogSurfaceStyles_unstable = useDialogSurfaceStyles_unstable;
|
|
107
|
+
//# sourceMappingURL=useDialogSurfaceStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAEA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AASa,OAAA,CAAA,uBAAA,GAA8D;EACzE,IAAI,EAAE,mBADmE;EAEzE,QAAQ,EAAE;AAF+D,CAA9D;AAKb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA,EAAlB;AA4CA;;AAEG;;;AACI,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,cAAc,GAAG,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,cAArC,CAAvB;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,uBAAA,CAAwB,IADH,EAErB,MAAM,CAAC,IAFc,EAGrB,cAAc,IAAI,MAAM,CAAC,0BAHJ,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;;EAMA,IAAI,KAAK,CAAC,QAAV,EAAoB;IAClB,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,OAAA,CAAA,YAAA,CACzB,OAAA,CAAA,uBAAA,CAAwB,QADC,EAEzB,MAAM,CAAC,QAFkB,EAGzB,cAAc,IAAI,MAAM,CAAC,oBAHA,EAIzB,KAAK,CAAC,QAAN,CAAe,SAJU,CAA3B;EAMD;;EACD,OAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n SURFACE_BORDER_RADIUS,\n SURFACE_BORDER_WIDTH,\n SURFACE_PADDING,\n useDialogContext_unstable,\n} from '../../contexts';\nimport type { DialogSurfaceSlots, DialogSurfaceState } from './DialogSurface.types';\n\nexport const dialogSurfaceClassNames: SlotClassNames<DialogSurfaceSlots> = {\n root: 'fui-DialogSurface',\n backdrop: 'fui-DialogSurface__backdrop',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'block',\n userSelect: 'unset',\n visibility: 'unset',\n ...shorthands.inset(0),\n ...shorthands.padding(0),\n ...shorthands.padding(SURFACE_PADDING),\n ...shorthands.margin('auto'),\n ...shorthands.borderStyle('none'),\n ...shorthands.overflow('unset'),\n '&::backdrop': {\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n },\n position: 'fixed',\n width: '100%',\n height: 'fit-content',\n maxWidth: '600px',\n maxHeight: '100vh',\n boxSizing: 'border-box',\n boxShadow: tokens.shadow64,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n ...shorthands.border(SURFACE_BORDER_WIDTH, 'solid', tokens.colorTransparentStroke),\n ...shorthands.borderRadius(SURFACE_BORDER_RADIUS),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n maxWidth: '100vw',\n },\n },\n backdrop: {\n position: 'fixed',\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n ...shorthands.inset('0px'),\n },\n nestedDialogBackdrop: {\n backgroundColor: 'transparent',\n },\n nestedNativeDialogBackdrop: {\n '&::backdrop': {\n backgroundColor: 'transparent',\n },\n },\n});\n\n/**\n * Apply styling to the DialogSurface slots based on the state\n */\nexport const useDialogSurfaceStyles_unstable = (state: DialogSurfaceState): DialogSurfaceState => {\n const styles = useStyles();\n const isNestedDialog = useDialogContext_unstable(ctx => ctx.isNestedDialog);\n\n state.root.className = mergeClasses(\n dialogSurfaceClassNames.root,\n styles.root,\n isNestedDialog && styles.nestedNativeDialogBackdrop,\n state.root.className,\n );\n if (state.backdrop) {\n state.backdrop.className = mergeClasses(\n dialogSurfaceClassNames.backdrop,\n styles.backdrop,\n isNestedDialog && styles.nestedDialogBackdrop,\n state.backdrop.className,\n );\n }\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DialogTitle = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const useDialogTitle_1 = /*#__PURE__*/require("./useDialogTitle");
|
|
11
|
+
|
|
12
|
+
const renderDialogTitle_1 = /*#__PURE__*/require("./renderDialogTitle");
|
|
13
|
+
|
|
14
|
+
const useDialogTitleStyles_1 = /*#__PURE__*/require("./useDialogTitleStyles");
|
|
15
|
+
/**
|
|
16
|
+
* The `DialogTitle` component expects to have a title/header
|
|
17
|
+
* and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.DialogTitle = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
22
|
+
const state = useDialogTitle_1.useDialogTitle_unstable(props, ref);
|
|
23
|
+
useDialogTitleStyles_1.useDialogTitleStyles_unstable(state);
|
|
24
|
+
return renderDialogTitle_1.renderDialogTitle_unstable(state);
|
|
25
|
+
});
|
|
26
|
+
exports.DialogTitle.displayName = 'DialogTitle';
|
|
27
|
+
//# sourceMappingURL=DialogTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTitle/DialogTitle.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,WAAA,gBAAqD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChG,MAAM,KAAK,GAAG,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,EAA+B,GAA/B,CAAd;EAEA,sBAAA,CAAA,6BAAA,CAA8B,KAA9B;EACA,OAAO,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAP;AACD,CALiE,CAArD;AAOb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport { useDialogTitle_unstable } from './useDialogTitle';\nimport { renderDialogTitle_unstable } from './renderDialogTitle';\nimport { useDialogTitleStyles_unstable } from './useDialogTitleStyles';\nimport type { DialogTitleProps } from './DialogTitle.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogTitle` component expects to have a title/header\n * and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.\n */\nexport const DialogTitle: ForwardRefComponent<DialogTitleProps> = React.forwardRef((props, ref) => {\n const state = useDialogTitle_unstable(props, ref);\n\n useDialogTitleStyles_unstable(state);\n return renderDialogTitle_unstable(state);\n});\n\nDialogTitle.displayName = 'DialogTitle';\n"],"sourceRoot":"../src/"}
|