@fluentui/react-dialog 9.1.5 → 9.1.6
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 +66 -1
- package/CHANGELOG.md +17 -2
- package/lib/components/Dialog/Dialog.js +0 -1
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/Dialog/renderDialog.js +0 -1
- package/lib/components/Dialog/renderDialog.js.map +1 -1
- package/lib/components/Dialog/useDialog.js +2 -8
- package/lib/components/Dialog/useDialog.js.map +1 -1
- package/lib/components/Dialog/useDialogContextValues.js +0 -1
- package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
- package/lib/components/DialogActions/DialogActions.js +0 -1
- package/lib/components/DialogActions/DialogActions.js.map +1 -1
- package/lib/components/DialogActions/renderDialogActions.js +4 -4
- package/lib/components/DialogActions/renderDialogActions.js.map +1 -1
- package/lib/components/DialogActions/useDialogActions.js +0 -1
- package/lib/components/DialogActions/useDialogActions.js.map +1 -1
- package/lib/components/DialogActions/useDialogActionsStyles.js +24 -27
- package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -1
- package/lib/components/DialogBody/DialogBody.js +0 -1
- package/lib/components/DialogBody/DialogBody.js.map +1 -1
- package/lib/components/DialogBody/renderDialogBody.js +4 -4
- package/lib/components/DialogBody/renderDialogBody.js.map +1 -1
- package/lib/components/DialogBody/useDialogBody.js +0 -2
- package/lib/components/DialogBody/useDialogBody.js.map +1 -1
- package/lib/components/DialogBody/useDialogBodyStyles.js +23 -26
- package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -1
- package/lib/components/DialogContent/DialogContent.js +0 -1
- package/lib/components/DialogContent/DialogContent.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 +0 -2
- package/lib/components/DialogContent/useDialogContent.js.map +1 -1
- package/lib/components/DialogContent/useDialogContentStyles.js +15 -18
- package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -1
- package/lib/components/DialogSurface/DialogSurface.js +0 -1
- package/lib/components/DialogSurface/DialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/renderDialogSurface.js +4 -3
- package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurface.js +2 -7
- package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js +92 -97
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
- package/lib/components/DialogTitle/DialogTitle.js +0 -1
- package/lib/components/DialogTitle/DialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/renderDialogTitle.js +4 -3
- package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitle.js +0 -1
- package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitleStyles.js +74 -80
- package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
- package/lib/components/DialogTrigger/DialogTrigger.js +2 -3
- package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -1
- package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
- package/lib/components/DialogTrigger/useDialogTrigger.js +4 -5
- package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib/contexts/dialogContext.js +2 -4
- package/lib/contexts/dialogContext.js.map +1 -1
- package/lib/contexts/dialogSurfaceContext.js +0 -1
- package/lib/contexts/dialogSurfaceContext.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/isEscapeKeyDown.js +0 -1
- package/lib/utils/isEscapeKeyDown.js.map +1 -1
- package/lib/utils/useDisableBodyScroll.js +0 -9
- package/lib/utils/useDisableBodyScroll.js.map +1 -1
- package/lib/utils/useFocusFirstElement.js +0 -5
- package/lib/utils/useFocusFirstElement.js.map +1 -1
- package/lib-commonjs/Dialog.js +0 -2
- package/lib-commonjs/Dialog.js.map +1 -1
- package/lib-commonjs/DialogActions.js +0 -2
- package/lib-commonjs/DialogActions.js.map +1 -1
- package/lib-commonjs/DialogBody.js +0 -2
- package/lib-commonjs/DialogBody.js.map +1 -1
- package/lib-commonjs/DialogContent.js +0 -2
- package/lib-commonjs/DialogContent.js.map +1 -1
- package/lib-commonjs/DialogSurface.js +0 -2
- package/lib-commonjs/DialogSurface.js.map +1 -1
- package/lib-commonjs/DialogTitle.js +0 -2
- package/lib-commonjs/DialogTitle.js.map +1 -1
- package/lib-commonjs/DialogTrigger.js +0 -2
- package/lib-commonjs/DialogTrigger.js.map +1 -1
- package/lib-commonjs/components/Dialog/Dialog.js +0 -6
- package/lib-commonjs/components/Dialog/Dialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/Dialog.types.js.map +1 -1
- package/lib-commonjs/components/Dialog/index.js +0 -5
- package/lib-commonjs/components/Dialog/index.js.map +1 -1
- package/lib-commonjs/components/Dialog/renderDialog.js +0 -5
- package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/useDialog.js +2 -15
- package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/useDialogContextValues.js +0 -3
- package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
- package/lib-commonjs/components/DialogActions/DialogActions.js +0 -6
- package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogActions/DialogActions.types.js.map +1 -1
- package/lib-commonjs/components/DialogActions/index.js +0 -6
- package/lib-commonjs/components/DialogActions/index.js.map +1 -1
- package/lib-commonjs/components/DialogActions/renderDialogActions.js +4 -8
- package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActions.js +0 -4
- package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js +24 -31
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -1
- package/lib-commonjs/components/DialogBody/DialogBody.js +0 -6
- package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogBody/DialogBody.types.js.map +1 -1
- package/lib-commonjs/components/DialogBody/index.js +0 -6
- package/lib-commonjs/components/DialogBody/index.js.map +1 -1
- package/lib-commonjs/components/DialogBody/renderDialogBody.js +4 -8
- package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBody.js +0 -5
- package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +23 -30
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -1
- package/lib-commonjs/components/DialogContent/DialogContent.js +0 -6
- package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -1
- package/lib-commonjs/components/DialogContent/DialogContent.types.js.map +1 -1
- package/lib-commonjs/components/DialogContent/index.js +0 -6
- package/lib-commonjs/components/DialogContent/index.js.map +1 -1
- package/lib-commonjs/components/DialogContent/renderDialogContent.js +2 -6
- package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContent.js +0 -5
- package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +15 -23
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/DialogSurface.js +0 -7
- package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/DialogSurface.types.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/index.js +0 -6
- package/lib-commonjs/components/DialogSurface/index.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +4 -9
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js +2 -13
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js +0 -2
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +92 -103
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/DialogTitle.js +0 -6
- package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/DialogTitle.types.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/index.js +0 -6
- package/lib-commonjs/components/DialogTitle/index.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +4 -7
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js +0 -10
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +74 -86
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.js +2 -7
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/index.js +0 -5
- package/lib-commonjs/components/DialogTrigger/index.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js +0 -2
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +4 -11
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib-commonjs/contexts/constants.js.map +1 -1
- package/lib-commonjs/contexts/dialogContext.js +2 -8
- package/lib-commonjs/contexts/dialogContext.js.map +1 -1
- package/lib-commonjs/contexts/dialogSurfaceContext.js +0 -5
- package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js +0 -4
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js +0 -14
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -4
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/isEscapeKeyDown.js +0 -4
- package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -1
- package/lib-commonjs/utils/useDisableBodyScroll.js +0 -14
- package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -1
- package/lib-commonjs/utils/useFocusFirstElement.js +0 -10
- package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -1
- package/package.json +9 -9
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useDialogSurface_unstable = void 0;
|
|
7
|
-
|
|
8
7
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
9
|
-
|
|
10
8
|
const contexts_1 = /*#__PURE__*/require("../../contexts");
|
|
11
|
-
|
|
12
9
|
const utils_1 = /*#__PURE__*/require("../../utils");
|
|
13
|
-
|
|
14
10
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
15
11
|
/**
|
|
16
12
|
* Create the state required to render DialogSurface.
|
|
@@ -21,8 +17,6 @@ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
|
21
17
|
* @param props - props from this instance of DialogSurface
|
|
22
18
|
* @param ref - reference to root HTMLElement of DialogSurface
|
|
23
19
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
20
|
const useDialogSurface_unstable = (props, ref) => {
|
|
27
21
|
const {
|
|
28
22
|
backdrop,
|
|
@@ -35,11 +29,9 @@ const useDialogSurface_unstable = (props, ref) => {
|
|
|
35
29
|
const dialogTitleID = contexts_1.useDialogContext_unstable(ctx => ctx.dialogTitleId);
|
|
36
30
|
const handledBackdropClick = react_utilities_1.useEventCallback(event => {
|
|
37
31
|
var _a, _b;
|
|
38
|
-
|
|
39
32
|
if (react_utilities_1.isResolvedShorthand(props.backdrop)) {
|
|
40
33
|
(_b = (_a = props.backdrop).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
41
34
|
}
|
|
42
|
-
|
|
43
35
|
if (modalType === 'modal' && !event.isDefaultPrevented()) {
|
|
44
36
|
requestOpenChange({
|
|
45
37
|
event,
|
|
@@ -50,17 +42,15 @@ const useDialogSurface_unstable = (props, ref) => {
|
|
|
50
42
|
});
|
|
51
43
|
const handleKeyDown = react_utilities_1.useEventCallback(event => {
|
|
52
44
|
var _a;
|
|
53
|
-
|
|
54
45
|
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
55
|
-
|
|
56
46
|
if (utils_1.isEscapeKeyDismiss(event, modalType)) {
|
|
57
47
|
requestOpenChange({
|
|
58
48
|
event,
|
|
59
49
|
open: false,
|
|
60
50
|
type: 'escapeKeyDown'
|
|
61
|
-
});
|
|
51
|
+
});
|
|
52
|
+
// stop propagation to avoid conflicting with other elements that listen for `Escape`
|
|
62
53
|
// e,g: nested Dialog, Popover, Menu and Tooltip
|
|
63
|
-
|
|
64
54
|
event.stopPropagation();
|
|
65
55
|
}
|
|
66
56
|
});
|
|
@@ -93,6 +83,5 @@ const useDialogSurface_unstable = (props, ref) => {
|
|
|
93
83
|
})
|
|
94
84
|
};
|
|
95
85
|
};
|
|
96
|
-
|
|
97
86
|
exports.useDialogSurface_unstable = useDialogSurface_unstable;
|
|
98
87
|
//# sourceMappingURL=useDialogSurface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":";;;;;;AACA;AAaA;AACA;AACA;AAEA;;;;;;;;;AASO,MAAMA,yBAAyB,GAAG,CACvCC,KAAyB,EACzBC,GAAoC,KACd;EACtB,MAAM;IAAEC,QAAQ;IAAEC;EAAE,CAAE,GAAGH,KAAK;EAC9B,MAAMI,SAAS,GAAGC,oCAAyB,CAACC,GAAG,IAAIA,GAAG,CAACF,SAAS,CAAC;EACjE,MAAMG,SAAS,GAAGF,oCAAyB,CAACC,GAAG,IAAIA,GAAG,CAACC,SAAS,CAAC;EACjE,MAAMC,IAAI,GAAGH,oCAAyB,CAACC,GAAG,IAAIA,GAAG,CAACE,IAAI,CAAC;EACvD,MAAMC,iBAAiB,GAAGJ,oCAAyB,CAACC,GAAG,IAAIA,GAAG,CAACG,iBAAiB,CAAC;EACjF,MAAMC,aAAa,GAAGL,oCAAyB,CAACC,GAAG,IAAIA,GAAG,CAACK,aAAa,CAAC;EAEzE,MAAMC,oBAAoB,GAAGC,kCAAgB,CAAEC,KAAuC,IAAI;;IACxF,IAAID,qCAAmB,CAACb,KAAK,CAACE,QAAQ,CAAC,EAAE;MACvC,iBAAK,CAACA,QAAQ,EAACa,OAAO,mDAAGD,KAAK,CAAC;;IAEjC,IAAIV,SAAS,KAAK,OAAO,IAAI,CAACU,KAAK,CAACE,kBAAkB,EAAE,EAAE;MACxDP,iBAAiB,CAAC;QAChBK,KAAK;QACLN,IAAI,EAAE,KAAK;QACXS,IAAI,EAAE;OACP,CAAC;;EAEN,CAAC,CAAC;EAEF,MAAMC,aAAa,GAAGL,kCAAgB,CAAEC,KAA4D,IAAI;;IACtG,WAAK,CAACK,SAAS,+CAAfnB,KAAK,EAAac,KAAK,CAAC;IAExB,IAAIM,0BAAkB,CAACN,KAAK,EAAEV,SAAS,CAAC,EAAE;MACxCK,iBAAiB,CAAC;QAChBK,KAAK;QACLN,IAAI,EAAE,KAAK;QACXS,IAAI,EAAE;OACP,CAAC;MACF;MACA;MACAH,KAAK,CAACO,eAAe,EAAE;;EAE3B,CAAC,CAAC;EAEF,MAAM;IAAEC;EAAe,CAAE,GAAGC,kCAAkB,CAAC;IAAEC,SAAS,EAAEpB,SAAS,KAAK;EAAW,CAAE,CAAC;EAExF,OAAO;IACLqB,UAAU,EAAE;MACVvB,QAAQ,EAAE,KAAK;MACfwB,IAAI,EAAE;KACP;IACDxB,QAAQ,EAAEW,kCAAgB,CAACX,QAAQ,EAAE;MACnCyB,QAAQ,EAAEnB,IAAI,IAAIJ,SAAS,KAAK,WAAW;MAC3CwB,YAAY,EAAE;QACZ,aAAa,EAAE,MAAM;QACrBb,OAAO,EAAEH;;KAEZ,CAAC;IACFc,IAAI,EAAEb,uCAAqB,CAACV,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAI,KAAK,EAAE;MACvC0B,QAAQ,EAAE,CAAC,CAAC;MACZ,YAAY,EAAEzB,SAAS,KAAK,WAAW;MACvC0B,IAAI,EAAE1B,SAAS,KAAK,OAAO,GAAG,aAAa,GAAG,QAAQ;MACtD,iBAAiB,EAAEJ,KAAK,CAAC,YAAY,CAAC,GAAG+B,SAAS,GAAGrB,aAAa;MAClE,GAAGV,KAAK;MACR,GAAGsB,eAAe;MAClBH,SAAS,EAAED,aAAa;MACxBjB,GAAG,EAAEY,+BAAa,CAACZ,GAAG,EAAEM,SAAS;KAClC;GACF;AACH,CAAC;AAhEYyB,iCAAyB","names":["useDialogSurface_unstable","props","ref","backdrop","as","modalType","contexts_1","ctx","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","react_utilities_1","event","onClick","isDefaultPrevented","type","handleKeyDown","onKeyDown","utils_1","stopPropagation","modalAttributes","react_tabster_1","trapFocus","components","root","required","defaultProps","tabIndex","role","undefined","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurface.ts"],"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 } from '../../utils';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n\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 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\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: 'div',\n },\n backdrop: resolveShorthand(backdrop, {\n required: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n onClick: handledBackdropClick,\n },\n }),\n root: getNativeElementProps(as ?? 'div', {\n tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n ref: useMergedRefs(ref, dialogRef),\n }),\n };\n};\n"]}
|
|
@@ -4,13 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useDialogSurfaceContextValues_unstable = void 0;
|
|
7
|
-
|
|
8
7
|
function useDialogSurfaceContextValues_unstable(state) {
|
|
9
8
|
const dialogSurface = true;
|
|
10
9
|
return {
|
|
11
10
|
dialogSurface
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
exports.useDialogSurfaceContextValues_unstable = useDialogSurfaceContextValues_unstable;
|
|
16
14
|
//# sourceMappingURL=useDialogSurfaceContextValues.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAGA,SAAgBA,sCAAsC,CAACC,KAAyB;EAC9E,MAAMC,aAAa,GAA8B,IAAI;EAErD,OAAO;IAAEA;EAAa,CAAE;AAC1B;AAJAC","names":["useDialogSurfaceContextValues_unstable","state","dialogSurface","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceContextValues.ts"],"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"]}
|
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useDialogSurfaceStyles_unstable = exports.dialogSurfaceClassNames = void 0;
|
|
7
|
-
|
|
8
7
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
|
-
|
|
10
8
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
11
|
-
|
|
12
9
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
13
|
-
|
|
14
10
|
const contexts_1 = /*#__PURE__*/require("../../contexts");
|
|
15
|
-
|
|
16
11
|
exports.dialogSurfaceClassNames = {
|
|
17
12
|
root: 'fui-DialogSurface',
|
|
18
13
|
backdrop: 'fui-DialogSurface__backdrop'
|
|
@@ -20,124 +15,118 @@ exports.dialogSurfaceClassNames = {
|
|
|
20
15
|
/**
|
|
21
16
|
* Styles for the root slot
|
|
22
17
|
*/
|
|
23
|
-
|
|
24
18
|
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
19
|
+
focusOutline: {
|
|
20
|
+
Brovlpu: "ftqa4ok",
|
|
21
|
+
B486eqv: "f2hkw1w",
|
|
22
|
+
B8q5s1w: "f8hki3x",
|
|
23
|
+
Bci5o5g: ["f1d2448m", "ffh67wi"],
|
|
24
|
+
n8qw10: "f1bjia2o",
|
|
25
|
+
Bdrgwmp: ["ffh67wi", "f1d2448m"],
|
|
26
|
+
Bm4h7ae: "f15bsgw9",
|
|
27
|
+
B7ys5i9: "f14e48fq",
|
|
28
|
+
Busjfv9: "f18yb2kv",
|
|
29
|
+
Bhk32uz: "fd6o370",
|
|
30
|
+
Bf4ptjt: "fh1cnn4",
|
|
31
|
+
kclons: ["fy7oxxb", "f184ne2d"],
|
|
32
|
+
Bhdgwq3: "fpukqih",
|
|
33
|
+
Blkhhs4: ["f184ne2d", "fy7oxxb"],
|
|
34
|
+
Bqtpl0w: "frrh606",
|
|
35
|
+
clg4pj: ["f1v5zibi", "fo2hd23"],
|
|
36
|
+
hgwjuy: "ful5kiu",
|
|
37
|
+
Bonggc9: ["fo2hd23", "f1v5zibi"],
|
|
38
|
+
B1tsrr9: ["f1jqcqds", "ftffrms"],
|
|
39
|
+
Dah5zi: ["ftffrms", "f1jqcqds"],
|
|
40
|
+
Bkh64rk: ["f2e7qr6", "fsr1zz6"],
|
|
41
|
+
qqdqy8: ["fsr1zz6", "f2e7qr6"],
|
|
42
|
+
B6dhp37: "f1dvezut",
|
|
43
|
+
i03rao: ["fd0oaoj", "f1cwg4i8"],
|
|
44
|
+
Boxcth7: "fjvm52t",
|
|
45
|
+
Bsom6fd: ["f1cwg4i8", "fd0oaoj"],
|
|
46
|
+
J0r882: "fdiulkx",
|
|
47
|
+
Bjwuhne: "f1yalx80",
|
|
48
|
+
Ghsupd: ["fq22d5a", "f1jw7pan"],
|
|
49
|
+
Bule8hv: ["f1jw7pan", "fq22d5a"]
|
|
56
50
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
51
|
+
root: {
|
|
52
|
+
mc9l5x: "ftgm304",
|
|
53
|
+
famaaq: "f1c515w",
|
|
54
|
+
Bcdw1i0: "f1bitti",
|
|
55
|
+
Bhzewxz: "f15twtuk",
|
|
56
|
+
j35jbq: ["f1e31b4d", "f1vgc2s3"],
|
|
57
|
+
B5kzvoi: "f1yab3r1",
|
|
58
|
+
oyh7mz: ["f1vgc2s3", "f1e31b4d"],
|
|
59
|
+
z8tnut: "fuq56rw",
|
|
60
|
+
z189sj: ["f15kemlc", "fdgang7"],
|
|
61
|
+
Byoj8tv: "fl2zwns",
|
|
62
|
+
uwmqm3: ["fdgang7", "f15kemlc"],
|
|
63
|
+
B6of3ja: "fgr6219",
|
|
64
|
+
t21cq0: ["f1ujusj6", "fcgxt0o"],
|
|
65
|
+
jrapky: "f10jk5vf",
|
|
66
|
+
Frg6f3: ["fcgxt0o", "f1ujusj6"],
|
|
67
|
+
icvyot: "fzkkow9",
|
|
68
|
+
vrafjx: ["fcdblym", "fjik90z"],
|
|
69
|
+
oivjwe: "fg706s2",
|
|
70
|
+
wvpqe5: ["fjik90z", "fcdblym"],
|
|
71
|
+
B68tc82: "f1ln0qer",
|
|
72
|
+
Bmxbyg5: "fa2wlxz",
|
|
73
|
+
fshzfu: "f120kxnn",
|
|
74
|
+
qhf8xq: "f19dog8a",
|
|
75
|
+
a9b677: "fly5x3f",
|
|
76
|
+
Bqenvij: "f3052tw",
|
|
77
|
+
B2u0y6b: "fvgz9i8",
|
|
78
|
+
Bxyxcbc: "f6a9g1z",
|
|
79
|
+
B7ck84d: "f1ewtqcl",
|
|
80
|
+
E5pizo: "f10nrhrw",
|
|
81
|
+
De3pzq: "fxugw4r",
|
|
82
|
+
sj55zd: "f19n0e5",
|
|
83
|
+
B4j52fo: "f5ogflp",
|
|
84
|
+
Bekrc4i: ["f1hqa2wf", "finvdd3"],
|
|
85
|
+
Bn0qgzm: "f1f09k3d",
|
|
86
|
+
ibv6hh: ["finvdd3", "f1hqa2wf"],
|
|
87
|
+
g2u3we: "fghlq4f",
|
|
88
|
+
h3c5rm: ["f1gn591s", "fjscplz"],
|
|
89
|
+
B9xav0g: "fb073pr",
|
|
90
|
+
zhjwy3: ["fjscplz", "f1gn591s"],
|
|
91
|
+
Bbmb7ep: ["f1erghxr", "f1ehz9de"],
|
|
92
|
+
Beyfa6y: ["f1ehz9de", "f1erghxr"],
|
|
93
|
+
B7oj6ja: ["f1spoy8", "fmb70yw"],
|
|
94
|
+
Btl43ni: ["fmb70yw", "f1spoy8"],
|
|
95
|
+
B5xtmjs: "ff54dml"
|
|
102
96
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
97
|
+
backdrop: {
|
|
98
|
+
qhf8xq: "f19dog8a",
|
|
99
|
+
De3pzq: "fju19wo",
|
|
100
|
+
Bhzewxz: "f113wtx2",
|
|
101
|
+
j35jbq: ["f10k790i", "f1xynx9j"],
|
|
102
|
+
B5kzvoi: "f5gq2j6",
|
|
103
|
+
oyh7mz: ["f1xynx9j", "f10k790i"]
|
|
110
104
|
},
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
nestedDialogBackdrop: {
|
|
106
|
+
De3pzq: "f3rmtva"
|
|
113
107
|
},
|
|
114
|
-
|
|
115
|
-
|
|
108
|
+
nestedNativeDialogBackdrop: {
|
|
109
|
+
fshzfu: "foe20jx"
|
|
116
110
|
}
|
|
117
111
|
}, {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
112
|
+
f: [".ftqa4ok:focus{outline-style:none;}"],
|
|
113
|
+
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
|
114
|
+
d: [".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}", ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}", ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}", ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}", ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}", ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}", ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}", ".fd6o370[data-fui-focus-visible]::after{z-index:1;}", ".fh1cnn4[data-fui-focus-visible]::after{border-top-style:solid;}", ".fy7oxxb[data-fui-focus-visible]::after{border-right-style:solid;}", ".f184ne2d[data-fui-focus-visible]::after{border-left-style:solid;}", ".fpukqih[data-fui-focus-visible]::after{border-bottom-style:solid;}", ".frrh606[data-fui-focus-visible]::after{border-top-width:2px;}", ".f1v5zibi[data-fui-focus-visible]::after{border-right-width:2px;}", ".fo2hd23[data-fui-focus-visible]::after{border-left-width:2px;}", ".ful5kiu[data-fui-focus-visible]::after{border-bottom-width:2px;}", ".f1jqcqds[data-fui-focus-visible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".ftffrms[data-fui-focus-visible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f2e7qr6[data-fui-focus-visible]::after{border-top-right-radius:var(--borderRadiusMedium);}", ".fsr1zz6[data-fui-focus-visible]::after{border-top-left-radius:var(--borderRadiusMedium);}", ".f1dvezut[data-fui-focus-visible]::after{border-top-color:var(--colorStrokeFocus2);}", ".fd0oaoj[data-fui-focus-visible]::after{border-right-color:var(--colorStrokeFocus2);}", ".f1cwg4i8[data-fui-focus-visible]::after{border-left-color:var(--colorStrokeFocus2);}", ".fjvm52t[data-fui-focus-visible]::after{border-bottom-color:var(--colorStrokeFocus2);}", ".fdiulkx[data-fui-focus-visible]::after{top:-2px;}", ".f1yalx80[data-fui-focus-visible]::after{bottom:-2px;}", ".fq22d5a[data-fui-focus-visible]::after{left:-2px;}", ".f1jw7pan[data-fui-focus-visible]::after{right:-2px;}", ".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;}"],
|
|
115
|
+
m: [["@media screen and (max-width: 480px){.ff54dml{max-width:100vw;}}", {
|
|
116
|
+
m: "screen and (max-width: 480px)"
|
|
123
117
|
}]]
|
|
124
118
|
});
|
|
125
119
|
/**
|
|
126
120
|
* Apply styling to the DialogSurface slots based on the state
|
|
127
121
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
122
|
const useDialogSurfaceStyles_unstable = state => {
|
|
131
123
|
const styles = useStyles();
|
|
132
124
|
const isNestedDialog = contexts_1.useDialogContext_unstable(ctx => ctx.isNestedDialog);
|
|
133
125
|
state.root.className = react_1.mergeClasses(exports.dialogSurfaceClassNames.root, styles.root, styles.focusOutline, isNestedDialog && styles.nestedNativeDialogBackdrop, state.root.className);
|
|
134
|
-
|
|
135
126
|
if (state.backdrop) {
|
|
136
127
|
state.backdrop.className = react_1.mergeClasses(exports.dialogSurfaceClassNames.backdrop, styles.backdrop, isNestedDialog && styles.nestedDialogBackdrop, state.backdrop.className);
|
|
137
128
|
}
|
|
138
|
-
|
|
139
129
|
return state;
|
|
140
130
|
};
|
|
141
|
-
|
|
142
131
|
exports.useDialogSurfaceStyles_unstable = useDialogSurfaceStyles_unstable;
|
|
143
132
|
//# sourceMappingURL=useDialogSurfaceStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AAEA;AACA;AACA;AASaA,+BAAuB,GAAuC;EACzEC,IAAI,EAAE,mBAAmB;EACzBC,QAAQ,EAAE;CACX;AAED;;;AAGA,MAAMC,SAAS,gBAAGC,gBAAU;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;EAAA;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;EAAA;EAAA;IAAA;EAAA;AAAA,EA2C1B;AAEF;;;AAGO,MAAMC,+BAA+B,GAAIC,KAAyB,IAAwB;EAC/F,MAAMC,MAAM,GAAGJ,SAAS,EAAE;EAC1B,MAAMK,cAAc,GAAGC,oCAAyB,CAACC,GAAG,IAAIA,GAAG,CAACF,cAAc,CAAC;EAE3EF,KAAK,CAACL,IAAI,CAACU,SAAS,GAAGP,oBAAY,CACjCJ,+BAAuB,CAACC,IAAI,EAC5BM,MAAM,CAACN,IAAI,EACXM,MAAM,CAACK,YAAY,EACnBJ,cAAc,IAAID,MAAM,CAACM,0BAA0B,EACnDP,KAAK,CAACL,IAAI,CAACU,SAAS,CACrB;EACD,IAAIL,KAAK,CAACJ,QAAQ,EAAE;IAClBI,KAAK,CAACJ,QAAQ,CAACS,SAAS,GAAGP,oBAAY,CACrCJ,+BAAuB,CAACE,QAAQ,EAChCK,MAAM,CAACL,QAAQ,EACfM,cAAc,IAAID,MAAM,CAACO,oBAAoB,EAC7CR,KAAK,CAACJ,QAAQ,CAACS,SAAS,CACzB;;EAEH,OAAOL,KAAK;AACd,CAAC;AApBYN,uCAA+B","names":["exports","root","backdrop","useStyles","react_1","useDialogSurfaceStyles_unstable","state","styles","isNestedDialog","contexts_1","ctx","className","focusOutline","nestedNativeDialogBackdrop","nestedDialogBackdrop"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\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 focusOutline: createFocusOutlineStyle(),\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 styles.focusOutline,\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"]}
|
|
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DialogTitle = void 0;
|
|
7
|
-
|
|
8
7
|
const React = /*#__PURE__*/require("react");
|
|
9
|
-
|
|
10
8
|
const useDialogTitle_1 = /*#__PURE__*/require("./useDialogTitle");
|
|
11
|
-
|
|
12
9
|
const renderDialogTitle_1 = /*#__PURE__*/require("./renderDialogTitle");
|
|
13
|
-
|
|
14
10
|
const useDialogTitleStyles_1 = /*#__PURE__*/require("./useDialogTitleStyles");
|
|
15
11
|
/**
|
|
16
12
|
* The `DialogTitle` component expects to have a title/header
|
|
17
13
|
* and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.
|
|
18
14
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
15
|
exports.DialogTitle = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
22
16
|
const state = useDialogTitle_1.useDialogTitle_unstable(props, ref);
|
|
23
17
|
useDialogTitleStyles_1.useDialogTitleStyles_unstable(state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;;AAIaA,mBAAW,gBAA0CC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGC,wCAAuB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEjDG,oDAA6B,CAACF,KAAK,CAAC;EACpC,OAAOG,8CAA0B,CAACH,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEFL,mBAAW,CAACS,WAAW,GAAG,aAAa","names":["exports","React","forwardRef","props","ref","state","useDialogTitle_1","useDialogTitleStyles_1","renderDialogTitle_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTitle/DialogTitle.tsx"],"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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
|
@@ -3,16 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
-
|
|
9
7
|
tslib_1.__exportStar(require("./DialogTitle"), exports);
|
|
10
|
-
|
|
11
8
|
tslib_1.__exportStar(require("./DialogTitle.types"), exports);
|
|
12
|
-
|
|
13
9
|
tslib_1.__exportStar(require("./renderDialogTitle"), exports);
|
|
14
|
-
|
|
15
10
|
tslib_1.__exportStar(require("./useDialogTitle"), exports);
|
|
16
|
-
|
|
17
11
|
tslib_1.__exportStar(require("./useDialogTitleStyles"), exports);
|
|
18
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTitle/index.ts"],"
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTitle/index.ts"],"sourcesContent":["export * from './DialogTitle';\nexport * from './DialogTitle.types';\nexport * from './renderDialogTitle';\nexport * from './useDialogTitle';\nexport * from './useDialogTitleStyles';\n"]}
|
|
@@ -4,24 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.renderDialogTitle_unstable = void 0;
|
|
7
|
-
|
|
8
7
|
const React = /*#__PURE__*/require("react");
|
|
9
|
-
|
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
9
|
/**
|
|
12
10
|
* Render the final JSX of DialogTitle
|
|
13
11
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
12
|
const renderDialogTitle_unstable = state => {
|
|
17
13
|
const {
|
|
18
14
|
slots,
|
|
19
15
|
slotProps
|
|
20
16
|
} = react_utilities_1.getSlots(state);
|
|
21
|
-
return React.createElement(React.Fragment, null, React.createElement(slots.root, {
|
|
22
|
-
|
|
17
|
+
return React.createElement(React.Fragment, null, React.createElement(slots.root, {
|
|
18
|
+
...slotProps.root
|
|
19
|
+
}, slotProps.root.children), slots.action && React.createElement(slots.action, {
|
|
20
|
+
...slotProps.action
|
|
23
21
|
}));
|
|
24
22
|
};
|
|
25
|
-
|
|
26
23
|
exports.renderDialogTitle_unstable = renderDialogTitle_unstable;
|
|
27
24
|
//# sourceMappingURL=renderDialogTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;AAGO,MAAMA,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAmBH,KAAK,CAAC;EAE9D,OACEI,0CACEA,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAAGH,SAAS,CAACG,IAAI,CAACC,QAAQ,CAAc,EACrEL,KAAK,CAACM,MAAM,IAAIH,oBAACH,KAAK,CAACM,MAAM;IAAA,GAAKL,SAAS,CAACK;EAAM,EAAI,CACtD;AAEP,CAAC;AATYC,kCAA0B","names":["renderDialogTitle_unstable","state","slots","slotProps","react_utilities_1","React","root","children","action","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTitle/renderDialogTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogTitleState, DialogTitleSlots } from './DialogTitle.types';\n\n/**\n * Render the final JSX of DialogTitle\n */\nexport const renderDialogTitle_unstable = (state: DialogTitleState) => {\n const { slots, slotProps } = getSlots<DialogTitleSlots>(state);\n\n return (\n <>\n <slots.root {...slotProps.root}>{slotProps.root.children}</slots.root>\n {slots.action && <slots.action {...slotProps.action} />}\n </>\n );\n};\n"]}
|
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useDialogTitle_unstable = void 0;
|
|
7
|
-
|
|
8
7
|
const React = /*#__PURE__*/require("react");
|
|
9
|
-
|
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
-
|
|
12
9
|
const dialogContext_1 = /*#__PURE__*/require("../../contexts/dialogContext");
|
|
13
|
-
|
|
14
10
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
|
15
|
-
|
|
16
11
|
const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
17
|
-
|
|
18
12
|
const DialogTrigger_1 = /*#__PURE__*/require("../DialogTrigger/DialogTrigger");
|
|
19
|
-
|
|
20
13
|
const useDialogTitleStyles_1 = /*#__PURE__*/require("./useDialogTitleStyles");
|
|
21
14
|
/**
|
|
22
15
|
* Create the state required to render DialogTitle.
|
|
@@ -27,8 +20,6 @@ const useDialogTitleStyles_1 = /*#__PURE__*/require("./useDialogTitleStyles");
|
|
|
27
20
|
* @param props - props from this instance of DialogTitle
|
|
28
21
|
* @param ref - reference to root HTMLElement of DialogTitle
|
|
29
22
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
23
|
const useDialogTitle_unstable = (props, ref) => {
|
|
33
24
|
const {
|
|
34
25
|
as,
|
|
@@ -60,6 +51,5 @@ const useDialogTitle_unstable = (props, ref) => {
|
|
|
60
51
|
})
|
|
61
52
|
};
|
|
62
53
|
};
|
|
63
|
-
|
|
64
54
|
exports.useDialogTitle_unstable = useDialogTitle_unstable;
|
|
65
55
|
//# sourceMappingURL=useDialogTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASO,MAAMA,uBAAuB,GAAG,CAACC,KAAuB,EAAEC,GAA2B,KAAsB;EAChH,MAAM;IAAEC,EAAE;IAAEC;EAAM,CAAE,GAAGH,KAAK;EAC5B,MAAMI,SAAS,GAAGC,yCAAyB,CAACC,GAAG,IAAIA,GAAG,CAACF,SAAS,CAAC;EACjE,MAAMG,cAAc,GAAGC,mDAA4B,EAAE;EAErD,OAAO;IACLC,UAAU,EAAE;MACVC,IAAI,EAAE,KAAK;MACXP,MAAM,EAAE;KACT;IACDO,IAAI,EAAEC,uCAAqB,CAACT,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAI,KAAK,EAAE;MACvCD,GAAG;MACHW,EAAE,EAAEP,yCAAyB,CAACC,GAAG,IAAIA,GAAG,CAACO,aAAa,CAAC;MACvD,GAAGb;KACJ,CAAC;IACFG,MAAM,EAAEW,kCAAgB,CAACX,MAAM,EAAE;MAC/BY,QAAQ,EAAEX,SAAS,KAAK,WAAW;MACnCY,YAAY,EAAE;QACZC,QAAQ,EACNC,oBAACC,6BAAa;UAACC,wBAAwB;UAACjB,MAAM,EAAC;QAAO,GACpDe;UACEG,SAAS,EAAEd,cAAc,CAACe,MAAM;UAAA,cAErB;QAAO,GAElBJ,oBAACK,8BAAgB,OAAG,CACb;;KAIhB;GACF;AACH,CAAC;AAhCYC,+BAAuB","names":["useDialogTitle_unstable","props","ref","as","action","modalType","dialogContext_1","ctx","internalStyles","useDialogTitleStyles_1","components","root","react_utilities_1","id","dialogTitleId","react_utilities_2","required","defaultProps","children","React","DialogTrigger_1","disableButtonEnhancement","className","button","react_icons_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogTitleProps, DialogTitleState } from './DialogTitle.types';\nimport { useDialogContext_unstable } from '../../contexts/dialogContext';\nimport { Dismiss24Regular } from '@fluentui/react-icons';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { DialogTrigger } from '../DialogTrigger/DialogTrigger';\nimport { useDialogTitleInternalStyles } from './useDialogTitleStyles';\n\n/**\n * Create the state required to render DialogTitle.\n *\n * The returned state can be modified with hooks such as useDialogTitleStyles_unstable,\n * before being passed to renderDialogTitle_unstable.\n *\n * @param props - props from this instance of DialogTitle\n * @param ref - reference to root HTMLElement of DialogTitle\n */\nexport const useDialogTitle_unstable = (props: DialogTitleProps, ref: React.Ref<HTMLElement>): DialogTitleState => {\n const { as, action } = props;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const internalStyles = useDialogTitleInternalStyles();\n\n return {\n components: {\n root: 'div',\n action: 'div',\n },\n root: getNativeElementProps(as ?? 'div', {\n ref,\n id: useDialogContext_unstable(ctx => ctx.dialogTitleId),\n ...props,\n }),\n action: resolveShorthand(action, {\n required: modalType === 'non-modal',\n defaultProps: {\n children: (\n <DialogTrigger disableButtonEnhancement action=\"close\">\n <button\n className={internalStyles.button}\n // TODO: find a better way to add internal labels\n aria-label=\"close\"\n >\n <Dismiss24Regular />\n </button>\n </DialogTrigger>\n ),\n },\n }),\n };\n};\n"]}
|