@fluentui/react-dialog 9.0.0-beta.7 → 9.0.0-beta.9
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 +189 -5
- package/CHANGELOG.md +44 -6
- package/Spec.md +44 -25
- package/dist/index.d.ts +99 -55
- package/lib/Dialog.js.map +1 -1
- package/lib/DialogActions.js.map +1 -1
- package/lib/DialogBody.js.map +1 -1
- package/lib/DialogContent.js +2 -0
- package/lib/DialogContent.js.map +1 -0
- package/lib/DialogSurface.js.map +1 -1
- package/lib/DialogTitle.js.map +1 -1
- package/lib/DialogTrigger.js.map +1 -1
- package/lib/components/Dialog/Dialog.js +0 -2
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/index.js +0 -1
- package/lib/components/Dialog/index.js.map +1 -1
- package/lib/components/Dialog/renderDialog.js +2 -10
- package/lib/components/Dialog/renderDialog.js.map +1 -1
- package/lib/components/Dialog/useDialog.js +19 -129
- package/lib/components/Dialog/useDialog.js.map +1 -1
- package/lib/components/Dialog/useDialogContextValues.js +4 -4
- package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
- package/lib/components/DialogActions/DialogActions.js.map +1 -1
- package/lib/components/DialogActions/DialogActions.types.js.map +1 -1
- package/lib/components/DialogActions/index.js.map +1 -1
- package/lib/components/DialogActions/renderDialogActions.js.map +1 -1
- package/lib/components/DialogActions/useDialogActions.js.map +1 -1
- package/lib/components/DialogActions/useDialogActionsStyles.js +3 -5
- package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -1
- package/lib/components/DialogBody/DialogBody.js.map +1 -1
- package/lib/components/DialogBody/DialogBody.types.js.map +1 -1
- package/lib/components/DialogBody/index.js.map +1 -1
- package/lib/components/DialogBody/renderDialogBody.js.map +1 -1
- package/lib/components/DialogBody/useDialogBody.js.map +1 -1
- package/lib/components/DialogBody/useDialogBodyStyles.js +5 -5
- package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -1
- package/lib/components/DialogContent/DialogContent.js +15 -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 +16 -0
- package/lib/components/DialogContent/renderDialogContent.js.map +1 -0
- package/lib/components/DialogContent/useDialogContent.js +27 -0
- package/lib/components/DialogContent/useDialogContent.js.map +1 -0
- package/lib/components/DialogContent/useDialogContentStyles.js +26 -0
- package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -0
- package/lib/components/DialogSurface/DialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -1
- package/lib/components/DialogSurface/index.js.map +1 -1
- package/lib/components/DialogSurface/renderDialogSurface.js +4 -2
- package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurface.js +120 -21
- package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js +57 -7
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
- package/lib/components/DialogTitle/DialogTitle.js +2 -3
- package/lib/components/DialogTitle/DialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -1
- package/lib/components/DialogTitle/index.js.map +1 -1
- package/lib/components/DialogTitle/renderDialogTitle.js +2 -5
- package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitle.js +15 -9
- package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitleStyles.js +61 -54
- package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
- package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -1
- package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
- package/lib/components/DialogTrigger/index.js.map +1 -1
- package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
- package/lib/components/DialogTrigger/useDialogTrigger.js +3 -22
- package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib/contexts/constants.js +1 -1
- package/lib/contexts/constants.js.map +1 -1
- package/lib/contexts/dialogContext.js +2 -4
- package/lib/contexts/dialogContext.js.map +1 -1
- package/lib/contexts/dialogSurfaceContext.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/index.js +4 -3
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/isEscapeKeyDown.js +5 -4
- package/lib/utils/isEscapeKeyDown.js.map +1 -1
- 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.map +1 -1
- package/lib-commonjs/DialogActions.js.map +1 -1
- package/lib-commonjs/DialogBody.js.map +1 -1
- package/lib-commonjs/DialogContent.js +10 -0
- package/lib-commonjs/DialogContent.js.map +1 -0
- package/lib-commonjs/DialogSurface.js.map +1 -1
- package/lib-commonjs/DialogTitle.js.map +1 -1
- package/lib-commonjs/DialogTrigger.js.map +1 -1
- package/lib-commonjs/components/Dialog/Dialog.js +0 -3
- package/lib-commonjs/components/Dialog/Dialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/index.js +0 -2
- package/lib-commonjs/components/Dialog/index.js.map +1 -1
- package/lib-commonjs/components/Dialog/renderDialog.js +2 -12
- package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/useDialog.js +18 -128
- package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/useDialogContextValues.js +4 -4
- package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
- package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogActions/index.js.map +1 -1
- package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js +3 -6
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -1
- package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogBody/index.js.map +1 -1
- package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +4 -5
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -1
- package/lib-commonjs/components/DialogContent/DialogContent.js +26 -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 +27 -0
- package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -0
- package/lib-commonjs/components/DialogContent/useDialogContent.js +37 -0
- package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -0
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +36 -0
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/index.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +5 -2
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js +120 -21
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +57 -6
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/DialogTitle.js +2 -3
- package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/index.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +2 -6
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js +18 -10
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +62 -56
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/index.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +4 -24
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib-commonjs/contexts/constants.js +2 -2
- package/lib-commonjs/contexts/constants.js.map +1 -1
- package/lib-commonjs/contexts/dialogContext.js +2 -4
- package/lib-commonjs/contexts/dialogContext.js.map +1 -1
- package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js +34 -13
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +5 -3
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/isEscapeKeyDown.js +5 -4
- package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -1
- 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 +15 -16
- package/dist/tsdoc-metadata.json +0 -11
- package/lib/components/Dialog/useDialogStyles.js +0 -41
- package/lib/components/Dialog/useDialogStyles.js.map +0 -1
- package/lib/utils/isTargetDisabled.js +0 -14
- package/lib/utils/isTargetDisabled.js.map +0 -1
- package/lib/utils/localShorthands.js +0 -9
- package/lib/utils/localShorthands.js.map +0 -1
- package/lib/utils/normalizeDefaultPrevented.js +0 -11
- package/lib/utils/normalizeDefaultPrevented.js.map +0 -1
- package/lib-commonjs/components/Dialog/useDialogStyles.js +0 -53
- package/lib-commonjs/components/Dialog/useDialogStyles.js.map +0 -1
- package/lib-commonjs/utils/isTargetDisabled.js +0 -23
- package/lib-commonjs/utils/isTargetDisabled.js.map +0 -1
- package/lib-commonjs/utils/localShorthands.js +0 -18
- package/lib-commonjs/utils/localShorthands.js.map +0 -1
- package/lib-commonjs/utils/normalizeDefaultPrevented.js +0 -20
- package/lib-commonjs/utils/normalizeDefaultPrevented.js.map +0 -1
|
@@ -3,21 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useDialogTitleStyles_unstable = exports.dialogTitleClassNames = void 0;
|
|
6
|
+
exports.useDialogTitleStyles_unstable = exports.useDialogTitleInternalStyles = exports.dialogTitleClassNames = void 0;
|
|
7
7
|
|
|
8
8
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
9
|
|
|
10
|
-
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
11
|
-
|
|
12
10
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
13
11
|
|
|
14
|
-
const localShorthands_1 = /*#__PURE__*/require("../../utils/localShorthands");
|
|
15
|
-
|
|
16
12
|
const constants_1 = /*#__PURE__*/require("../../contexts/constants");
|
|
17
13
|
|
|
14
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
15
|
+
|
|
18
16
|
exports.dialogTitleClassNames = {
|
|
19
17
|
root: 'fui-DialogTitle',
|
|
20
|
-
|
|
18
|
+
action: 'fui-DialogTitle__action'
|
|
21
19
|
};
|
|
22
20
|
/**
|
|
23
21
|
* Styles for the root slot
|
|
@@ -30,61 +28,40 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
30
28
|
"Bhrd7zp": "fl43uef",
|
|
31
29
|
"Bg96gwp": "f106mvju",
|
|
32
30
|
"Ijaq50": "faq1aip",
|
|
33
|
-
"nk6f5a": "fv2srd9",
|
|
34
31
|
"Br312pm": "f1m489tg",
|
|
32
|
+
"nk6f5a": "fv2srd9",
|
|
35
33
|
"Bw0ie65": "f1tz6hh8"
|
|
36
34
|
},
|
|
37
|
-
"rootWithoutCloseButton": {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"qhf8xq": "f10pi13n",
|
|
41
|
-
"Bg96gwp": "fez10in",
|
|
42
|
-
"Bceei9c": "f1k6fduh",
|
|
43
|
-
"qb2dma": "f9h729m",
|
|
44
|
-
"Ijaq50": "f1hysmiz",
|
|
35
|
+
"rootWithoutCloseButton": {
|
|
36
|
+
"Ijaq50": "faq1aip",
|
|
37
|
+
"Br312pm": "f1m489tg",
|
|
45
38
|
"nk6f5a": "f11nczdl",
|
|
46
|
-
"Br312pm": "f1379kmu",
|
|
47
39
|
"Bw0ie65": "f98d4vj"
|
|
48
40
|
},
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
"G4c1lw": ["f1s68zmt", "f17qorvy"],
|
|
68
|
-
"B7295ny": ["fcxw5no", "f1klxzyg"],
|
|
69
|
-
"Bfl2641": ["f1klxzyg", "fcxw5no"],
|
|
70
|
-
"Bc850wg": ["f8h35c5", "f41fp59"],
|
|
71
|
-
"Bwbif6r": ["f41fp59", "f8h35c5"],
|
|
72
|
-
"Bc7x9ep": "f89yr8c",
|
|
73
|
-
"Btolfwl": ["f3vokhu", "fgoym2l"],
|
|
74
|
-
"nuwgkz": "f1b662q1",
|
|
75
|
-
"iduwum": ["fgoym2l", "f3vokhu"],
|
|
76
|
-
"zp4aim": "fn1y60j",
|
|
77
|
-
"Br8g1vq": "f197ac7e",
|
|
78
|
-
"s8cxrh": ["f1yd45vn", "f1w8wcpf"],
|
|
79
|
-
"dw1usy": ["f1w8wcpf", "f1yd45vn"]
|
|
80
|
-
},
|
|
81
|
-
"resetButton": {
|
|
41
|
+
"action": {
|
|
42
|
+
"Ijaq50": "f1hysmiz",
|
|
43
|
+
"Br312pm": "f1379kmu",
|
|
44
|
+
"nk6f5a": "f11nczdl",
|
|
45
|
+
"Bw0ie65": "f98d4vj"
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
"d": [".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f106mvju{line-height:var(--lineHeightBase500);}", ".faq1aip{grid-row-start:title;}", ".f1m489tg{grid-column-start:title;}", ".fv2srd9{grid-row-end:title;}", ".f1tz6hh8{grid-column-end:title;}", ".f11nczdl{grid-row-end:close-button;}", ".f98d4vj{grid-column-end:close-button;}", ".f1hysmiz{grid-row-start:close-button;}", ".f1379kmu{grid-column-start:close-button;}"]
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Styles to be applied on internal elements used by default action on non-modal Dialog
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
exports.useDialogTitleInternalStyles = /*#__PURE__*/react_1.__styles({
|
|
57
|
+
"button": {
|
|
58
|
+
"qhf8xq": "f10pi13n",
|
|
82
59
|
"B7ck84d": "f1e4lqlz",
|
|
83
60
|
"De3pzq": "f1u2r49w",
|
|
84
61
|
"sj55zd": "f1ym3bx4",
|
|
85
62
|
"Bahqtrf": "f1mo0ibp",
|
|
86
63
|
"Be2twd7": "fjoy568",
|
|
87
|
-
"Bg96gwp": "
|
|
64
|
+
"Bg96gwp": "fez10in",
|
|
88
65
|
"B68tc82": "f1mtd64y",
|
|
89
66
|
"Bmxbyg5": "f1y7q3j9",
|
|
90
67
|
"z8tnut": "f1g0x7ka",
|
|
@@ -96,10 +73,40 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
96
73
|
"oivjwe": "f1h8hb77",
|
|
97
74
|
"wvpqe5": ["f1deefiw", "f1n71otn"],
|
|
98
75
|
"Bv0vk6g": "f37px4s",
|
|
99
|
-
"fsow6f": "fgusgyc"
|
|
76
|
+
"fsow6f": "fgusgyc",
|
|
77
|
+
"Brovlpu": "ftqa4ok",
|
|
78
|
+
"B486eqv": "f2hkw1w",
|
|
79
|
+
"r6j8yp": "f9sgzds",
|
|
80
|
+
"w235jp": ["fut1j4r", "fkf1fqv"],
|
|
81
|
+
"Bjm0d8m": "f1t0sa4d",
|
|
82
|
+
"jwfw70": ["fkf1fqv", "fut1j4r"],
|
|
83
|
+
"Boz55fv": "f1m3tk81",
|
|
84
|
+
"pmqz9c": "f1pr2mxm",
|
|
85
|
+
"Bl9sb7i": "f29vp72",
|
|
86
|
+
"h4jxiv": "f1b5h9zn",
|
|
87
|
+
"E4x6tl": "f1ltau7e",
|
|
88
|
+
"B9c4r0f": ["f18ihh6m", "fzaptb5"],
|
|
89
|
+
"Bstwoin": "f1or3dzb",
|
|
90
|
+
"Bflkndj": ["fzaptb5", "f18ihh6m"],
|
|
91
|
+
"h1egvf": "fciubpk",
|
|
92
|
+
"vw8w2h": ["fzvtil0", "f1e7tdtt"],
|
|
93
|
+
"Bbpctgi": "f14oz5ke",
|
|
94
|
+
"Dyu7ee": ["f1e7tdtt", "fzvtil0"],
|
|
95
|
+
"gnkc5c": ["f1clxaxy", "f1pefego"],
|
|
96
|
+
"Bw9c0us": ["f1pefego", "f1clxaxy"],
|
|
97
|
+
"B9ptage": ["f1e14n0d", "f19um3kx"],
|
|
98
|
+
"c7u8z9": ["f19um3kx", "f1e14n0d"],
|
|
99
|
+
"Bgf7pbm": "f1a5bpr6",
|
|
100
|
+
"Btw8xqj": ["fjsutlp", "f1fz4ffz"],
|
|
101
|
+
"B6j1cfa": "f11bfvwp",
|
|
102
|
+
"B3wlxu": ["f1fz4ffz", "fjsutlp"],
|
|
103
|
+
"Beastro": "f1hebwof",
|
|
104
|
+
"Bhizb9d": "f19pyrw2",
|
|
105
|
+
"B2fkz8r": ["fjebp7m", "f1m6puf8"],
|
|
106
|
+
"B0gbj9w": ["f1m6puf8", "fjebp7m"]
|
|
100
107
|
}
|
|
101
108
|
}, {
|
|
102
|
-
"d": [".
|
|
109
|
+
"d": [".f10pi13n{position:relative;}", ".f1e4lqlz{box-sizing:content-box;}", ".f1u2r49w{background-color:inherit;}", ".f1ym3bx4{color:inherit;}", ".f1mo0ibp{font-family:inherit;}", ".fjoy568{font-size:inherit;}", ".fez10in{line-height:0;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f37px4s{-webkit-appearance:button;}", ".fgusgyc{text-align:unset;}", ".f9sgzds.fui-focus-visible{border-top-color:transparent;}", ".fut1j4r.fui-focus-visible{border-right-color:transparent;}", ".fkf1fqv.fui-focus-visible{border-left-color:transparent;}", ".f1t0sa4d.fui-focus-visible{border-bottom-color:transparent;}", ".f1m3tk81.fui-focus-visible::after{content:\"\";}", ".f1pr2mxm.fui-focus-visible::after{position:absolute;}", ".f29vp72.fui-focus-visible::after{pointer-events:none;}", ".f1b5h9zn.fui-focus-visible::after{z-index:1;}", ".f1ltau7e.fui-focus-visible::after{border-top-style:solid;}", ".f18ihh6m.fui-focus-visible::after{border-right-style:solid;}", ".fzaptb5.fui-focus-visible::after{border-left-style:solid;}", ".f1or3dzb.fui-focus-visible::after{border-bottom-style:solid;}", ".fciubpk.fui-focus-visible::after{border-top-width:2px;}", ".fzvtil0.fui-focus-visible::after{border-right-width:2px;}", ".f1e7tdtt.fui-focus-visible::after{border-left-width:2px;}", ".f14oz5ke.fui-focus-visible::after{border-bottom-width:2px;}", ".f1clxaxy.fui-focus-visible::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1pefego.fui-focus-visible::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1e14n0d.fui-focus-visible::after{border-top-right-radius:var(--borderRadiusMedium);}", ".f19um3kx.fui-focus-visible::after{border-top-left-radius:var(--borderRadiusMedium);}", ".f1a5bpr6.fui-focus-visible::after{border-top-color:var(--colorStrokeFocus2);}", ".fjsutlp.fui-focus-visible::after{border-right-color:var(--colorStrokeFocus2);}", ".f1fz4ffz.fui-focus-visible::after{border-left-color:var(--colorStrokeFocus2);}", ".f11bfvwp.fui-focus-visible::after{border-bottom-color:var(--colorStrokeFocus2);}", ".f1hebwof.fui-focus-visible::after{top:-2px;}", ".f19pyrw2.fui-focus-visible::after{bottom:-2px;}", ".fjebp7m.fui-focus-visible::after{left:-2px;}", ".f1m6puf8.fui-focus-visible::after{right:-2px;}"],
|
|
103
110
|
"f": [".ftqa4ok:focus{outline-style:none;}"],
|
|
104
111
|
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
105
112
|
});
|
|
@@ -107,13 +114,12 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
107
114
|
* Apply styling to the DialogTitle slots based on the state
|
|
108
115
|
*/
|
|
109
116
|
|
|
110
|
-
|
|
111
117
|
const useDialogTitleStyles_unstable = state => {
|
|
112
118
|
const styles = useStyles();
|
|
113
|
-
state.root.className = react_1.mergeClasses(exports.dialogTitleClassNames.root, styles.root,
|
|
119
|
+
state.root.className = react_1.mergeClasses(exports.dialogTitleClassNames.root, styles.root, !state.action && styles.rootWithoutCloseButton, state.root.className);
|
|
114
120
|
|
|
115
|
-
if (state.
|
|
116
|
-
state.
|
|
121
|
+
if (state.action) {
|
|
122
|
+
state.action.className = react_1.mergeClasses(exports.dialogTitleClassNames.action, styles.action, state.action.className);
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
return state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/DialogTitle/useDialogTitleStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitleStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,0B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AM,CAAC,MAAlD,EAA0D,KAAK,CAAC,MAAN,CAAa,SAAvE,CAAzB;EACD;;EACD,OAAO,KAAP;AACD,CAZM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogTitleSlots, DialogTitleState } from './DialogTitle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { TITLE_ACTION_GRID_AREA, TITLE_GRID_AREA } from '../../contexts/constants';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\n\nexport const dialogTitleClassNames: SlotClassNames<DialogTitleSlots> = {\n root: 'fui-DialogTitle',\n action: 'fui-DialogTitle__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.subtitle1,\n ...shorthands.gridArea(TITLE_GRID_AREA),\n },\n rootWithoutCloseButton: {\n ...shorthands.gridArea(TITLE_GRID_AREA, TITLE_GRID_AREA, TITLE_ACTION_GRID_AREA, TITLE_ACTION_GRID_AREA),\n },\n action: {\n ...shorthands.gridArea(TITLE_ACTION_GRID_AREA),\n },\n});\n\n/**\n * Styles to be applied on internal elements used by default action on non-modal Dialog\n * @internal\n */\nexport const useDialogTitleInternalStyles = makeStyles({\n button: {\n position: 'relative',\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 0,\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n ...createFocusOutlineStyle(),\n },\n});\n\n/**\n * Apply styling to the DialogTitle slots based on the state\n */\nexport const useDialogTitleStyles_unstable = (state: DialogTitleState): DialogTitleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogTitleClassNames.root,\n styles.root,\n !state.action && styles.rootWithoutCloseButton,\n state.root.className,\n );\n if (state.action) {\n state.action.className = mergeClasses(dialogTitleClassNames.action, styles.action, state.action.className);\n }\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/DialogTrigger/DialogTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;;;;;;;;AASG;;;AACI,MAAM,aAAa,GAA0D,KAAK,IAAG;EAC1F,MAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,CAAd;EAEA,OAAO,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb;AAMb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B;AACA,OAAA,CAAA,aAAA,CAAc,wBAAd,GAAyC,IAAzC","sourcesContent":["import * as React from 'react';\nimport { useDialogTrigger_unstable } from './useDialogTrigger';\nimport { renderDialogTrigger_unstable } from './renderDialogTrigger';\nimport type { DialogTriggerProps } from './DialogTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will open or close a `Dialog`.\n * This component should only accept one child.\n *\n * In case the trigger is used outside `Dialog` component\n * it'll still provide basic ARIA related attributes\n * to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,\n * in that case the user must provide a `controlled state`\n */\nexport const DialogTrigger: React.FC<DialogTriggerProps> & FluentTriggerComponent = props => {\n const state = useDialogTrigger_unstable(props);\n\n return renderDialogTrigger_unstable(state);\n};\n\nDialogTrigger.displayName = 'DialogTrigger';\nDialogTrigger.isFluentTriggerComponent = true;\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;;;;;;;;AASG;;;AACI,MAAM,aAAa,GAA0D,KAAK,IAAG;EAC1F,MAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,CAAd;EAEA,OAAO,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb;AAMb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B;AACA,OAAA,CAAA,aAAA,CAAc,wBAAd,GAAyC,IAAzC","sourcesContent":["import * as React from 'react';\nimport { useDialogTrigger_unstable } from './useDialogTrigger';\nimport { renderDialogTrigger_unstable } from './renderDialogTrigger';\nimport type { DialogTriggerProps } from './DialogTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will open or close a `Dialog`.\n * This component should only accept one child.\n *\n * In case the trigger is used outside `Dialog` component\n * it'll still provide basic ARIA related attributes\n * to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,\n * in that case the user must provide a `controlled state`\n */\nexport const DialogTrigger: React.FC<DialogTriggerProps> & FluentTriggerComponent = props => {\n const state = useDialogTrigger_unstable(props);\n\n return renderDialogTrigger_unstable(state);\n};\n\nDialogTrigger.displayName = 'DialogTrigger';\nDialogTrigger.isFluentTriggerComponent = true;\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/DialogTrigger/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","sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/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","sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/DialogTrigger/renderDialogTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;;;AAIG;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA+B,KAAK,CAAC,QAA1E;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import type { DialogTriggerState } from './DialogTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderDialogTrigger_unstable = (state: DialogTriggerState) => state.children;\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/renderDialogTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;;;AAIG;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA+B,KAAK,CAAC,QAA1E;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import type { DialogTriggerState } from './DialogTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderDialogTrigger_unstable = (state: DialogTriggerState) => state.children;\n"],"sourceRoot":"../src/"}
|
|
@@ -9,13 +9,11 @@ const React = /*#__PURE__*/require("react");
|
|
|
9
9
|
|
|
10
10
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
11
11
|
|
|
12
|
-
const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
|
|
13
|
-
|
|
14
12
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
15
13
|
|
|
16
|
-
const utils_1 = /*#__PURE__*/require("../../utils");
|
|
17
|
-
|
|
18
14
|
const contexts_1 = /*#__PURE__*/require("../../contexts");
|
|
15
|
+
|
|
16
|
+
const react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
|
|
19
17
|
/**
|
|
20
18
|
* Create the state required to render DialogTrigger.
|
|
21
19
|
* Clones the only child component and adds necessary event handling behaviours to open a popup Dialog
|
|
@@ -38,10 +36,6 @@ const useDialogTrigger_unstable = props => {
|
|
|
38
36
|
const handleClick = react_utilities_1.useEventCallback(event => {
|
|
39
37
|
var _a, _b;
|
|
40
38
|
|
|
41
|
-
if (utils_1.isTargetDisabled(event)) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
39
|
(_b = child === null || child === void 0 ? void 0 : (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
46
40
|
|
|
47
41
|
if (!event.isDefaultPrevented()) {
|
|
@@ -52,27 +46,13 @@ const useDialogTrigger_unstable = props => {
|
|
|
52
46
|
});
|
|
53
47
|
}
|
|
54
48
|
});
|
|
55
|
-
const handleKeyDown = react_utilities_1.useEventCallback(event => {
|
|
56
|
-
var _a, _b;
|
|
57
|
-
|
|
58
|
-
if (utils_1.isTargetDisabled(event)) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
(_b = child === null || child === void 0 ? void 0 : (_a = child.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
63
|
-
|
|
64
|
-
if (!event.isDefaultPrevented() && (event.key === keyboard_keys_1.Enter || event.key === keyboard_keys_1.Space)) {
|
|
65
|
-
event.currentTarget.click();
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
49
|
return {
|
|
69
|
-
children: react_utilities_1.applyTriggerPropsToChildren(children, {
|
|
50
|
+
children: react_utilities_1.applyTriggerPropsToChildren(children, react_aria_1.useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', { ...(child === null || child === void 0 ? void 0 : child.props),
|
|
70
51
|
'aria-haspopup': action === 'close' ? undefined : 'dialog',
|
|
71
52
|
ref: child === null || child === void 0 ? void 0 : child.ref,
|
|
72
53
|
onClick: handleClick,
|
|
73
|
-
onKeyDown: handleKeyDown,
|
|
74
54
|
...triggerAttributes
|
|
75
|
-
})
|
|
55
|
+
}))
|
|
76
56
|
};
|
|
77
57
|
};
|
|
78
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/DialogTrigger/useDialogTrigger.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/useDialogTrigger.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,UAAA,gBAAA,OA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AAE,IAAP,MAAgB,QAAhB,IAA4B,CAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,IAAP,MAAgB,GAA5C,GAAkD,KAAK,CAAC,IAAxD,GAA+D,KAAlF,EAAyF,EACvF,IAAG,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAV,CADuF;MAEvF,iBAAiB,MAAM,KAAK,OAAX,GAAqB,SAArB,GAAiC,QAFqC;MAGvF,GAAG,EAAE,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,GAH2E;MAIvF,OAAO,EAAE,WAJ8E;MAKvF,GAAG;IALoF,CAAzF,CAFQ;EADL,CAAP;AAYD,CApCM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { DialogTriggerChildProps, DialogTriggerProps, DialogTriggerState } from './DialogTrigger.types';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */\nexport const useDialogTrigger_unstable = (props: DialogTriggerProps): DialogTriggerState => {\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n\n const { children, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = React.isValidElement(children) ? getTriggerChild<DialogTriggerChildProps>(children) : undefined;\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n\n const { triggerAttributes } = useModalAttributes();\n\n const handleClick = useEventCallback(\n (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open',\n });\n }\n },\n );\n\n return {\n children: applyTriggerPropsToChildren<DialogTriggerChildProps>(\n children,\n useARIAButtonProps(child?.type === 'button' || child?.type === 'a' ? child.type : 'div', {\n ...child?.props,\n 'aria-haspopup': action === 'close' ? undefined : 'dialog',\n ref: child?.ref as React.Ref<never>,\n onClick: handleClick,\n ...triggerAttributes,\n }),\n ),\n };\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.BODY_GRID_AREA = exports.
|
|
6
|
+
exports.BODY_GRID_AREA = exports.TITLE_ACTION_GRID_AREA = exports.TITLE_GRID_AREA = exports.ACTIONS_END_GRID_AREA = exports.ACTIONS_START_GRID_AREA = exports.SURFACE_BORDER_WIDTH = exports.SURFACE_BORDER_RADIUS = exports.DIALOG_GAP = exports.SURFACE_PADDING = exports.MEDIA_QUERY_BREAKPOINT_SELECTOR = void 0;
|
|
7
7
|
exports.MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';
|
|
8
8
|
exports.SURFACE_PADDING = '24px';
|
|
9
9
|
exports.DIALOG_GAP = '8px';
|
|
@@ -12,6 +12,6 @@ exports.SURFACE_BORDER_WIDTH = '1px';
|
|
|
12
12
|
exports.ACTIONS_START_GRID_AREA = 'actions-start';
|
|
13
13
|
exports.ACTIONS_END_GRID_AREA = 'actions-end';
|
|
14
14
|
exports.TITLE_GRID_AREA = 'title';
|
|
15
|
-
exports.
|
|
15
|
+
exports.TITLE_ACTION_GRID_AREA = 'close-button';
|
|
16
16
|
exports.BODY_GRID_AREA = 'body';
|
|
17
17
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["contexts/constants.ts"],"names":[],"mappings":";;;;;;AAAa,OAAA,CAAA,+BAAA,GAAkC,sCAAlC;AACA,OAAA,CAAA,eAAA,GAAkB,MAAlB;AACA,OAAA,CAAA,UAAA,GAAa,KAAb;AACA,OAAA,CAAA,qBAAA,GAAwB,KAAxB;AACA,OAAA,CAAA,oBAAA,GAAuB,KAAvB;AAEA,OAAA,CAAA,uBAAA,GAA0B,eAA1B;AACA,OAAA,CAAA,qBAAA,GAAwB,aAAxB;AACA,OAAA,CAAA,eAAA,GAAkB,OAAlB;AACA,OAAA,CAAA,sBAAA,GAAyB,cAAzB;AACA,OAAA,CAAA,cAAA,GAAiB,MAAjB","sourcesContent":["export const MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';\nexport const SURFACE_PADDING = '24px';\nexport const DIALOG_GAP = '8px';\nexport const SURFACE_BORDER_RADIUS = '8px';\nexport const SURFACE_BORDER_WIDTH = '1px';\n\nexport const ACTIONS_START_GRID_AREA = 'actions-start';\nexport const ACTIONS_END_GRID_AREA = 'actions-end';\nexport const TITLE_GRID_AREA = 'title';\nexport const
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/contexts/constants.ts"],"names":[],"mappings":";;;;;;AAAa,OAAA,CAAA,+BAAA,GAAkC,sCAAlC;AACA,OAAA,CAAA,eAAA,GAAkB,MAAlB;AACA,OAAA,CAAA,UAAA,GAAa,KAAb;AACA,OAAA,CAAA,qBAAA,GAAwB,KAAxB;AACA,OAAA,CAAA,oBAAA,GAAuB,KAAvB;AAEA,OAAA,CAAA,uBAAA,GAA0B,eAA1B;AACA,OAAA,CAAA,qBAAA,GAAwB,aAAxB;AACA,OAAA,CAAA,eAAA,GAAkB,OAAlB;AACA,OAAA,CAAA,sBAAA,GAAyB,cAAzB;AACA,OAAA,CAAA,cAAA,GAAiB,MAAjB","sourcesContent":["export const MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';\nexport const SURFACE_PADDING = '24px';\nexport const DIALOG_GAP = '8px';\nexport const SURFACE_BORDER_RADIUS = '8px';\nexport const SURFACE_BORDER_WIDTH = '1px';\n\nexport const ACTIONS_START_GRID_AREA = 'actions-start';\nexport const ACTIONS_END_GRID_AREA = 'actions-end';\nexport const TITLE_GRID_AREA = 'title';\nexport const TITLE_ACTION_GRID_AREA = 'close-button';\nexport const BODY_GRID_AREA = 'body';\n"],"sourceRoot":"../src/"}
|
|
@@ -10,10 +10,8 @@ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-s
|
|
|
10
10
|
const defaultContextValue = {
|
|
11
11
|
open: false,
|
|
12
12
|
modalType: 'modal',
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
contentRef: {
|
|
13
|
+
isNestedDialog: false,
|
|
14
|
+
dialogRef: {
|
|
17
15
|
current: null
|
|
18
16
|
},
|
|
19
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["contexts/dialogContext.ts"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/contexts/dialogContext.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAkBA,MAAM,mBAAmB,GAAuB;EAC9C,IAAI,EAAE,KADwC;EAE9C,SAAS,EAAE,OAFmC;EAG9C,cAAc,EAAE,KAH8B;EAI9C,SAAS,EAAE;IAAE,OAAO,EAAE;EAAX,CAJmC;;EAK9C,iBAAiB,GAAA;IACf;EACD;;AAP6C,CAAhD,C,CAUA;;AACa,OAAA,CAAA,aAAA,gBAAyD,wBAAA,CAAA,aAAA,CACpE,SADoE,CAAzD;AAIA,OAAA,CAAA,cAAA,GAAiB,OAAA,CAAA,aAAA,CAAc,QAA/B;;AACN,MAAM,yBAAyB,GAAO,QAAJ,IACvC,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,aAAnB,EAAkC,CAAC,GAAG,GAAG,mBAAP,KAA+B,QAAQ,CAAC,GAAD,CAAzE,CADK;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { createContext, ContextSelector, useContextSelector } from '@fluentui/react-context-selector';\nimport { DialogSurfaceElement } from '../DialogSurface';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { DialogModalType, DialogOpenChangeData } from '../Dialog';\n\nexport type DialogContextValue = {\n open: boolean;\n dialogBodyID?: string;\n dialogTitleID?: string;\n isNestedDialog: boolean;\n dialogRef: React.Ref<DialogSurfaceElement>;\n modalType: DialogModalType;\n /**\n * Requests dialog main component to update it's internal open state\n */\n requestOpenChange: (data: DialogOpenChangeData) => void;\n};\n\nconst defaultContextValue: DialogContextValue = {\n open: false,\n modalType: 'modal',\n isNestedDialog: false,\n dialogRef: { current: null },\n requestOpenChange() {\n /* noop */\n },\n};\n\n// Contexts should default to undefined\nexport const DialogContext: Context<DialogContextValue | undefined> = createContext<DialogContextValue | undefined>(\n undefined,\n);\n\nexport const DialogProvider = DialogContext.Provider;\nexport const useDialogContext_unstable = <T>(selector: ContextSelector<DialogContextValue, T>): T =>\n useContextSelector(DialogContext, (ctx = defaultContextValue) => selector(ctx));\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["contexts/dialogSurfaceContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAIA,MAAM,mBAAmB,GAA8B,KAAvD;AAEa,OAAA,CAAA,oBAAA,gBAAuB,OAAA,CAAA,aAAA,CAAqD,SAArD,CAAvB;AAEA,OAAA,CAAA,qBAAA,GAAwB,OAAA,CAAA,oBAAA,CAAqB,QAA7C;;AAEN,MAAM,gCAAgC,GAAG,MAAK;EAAA,IAAA,EAAA;;EAAC,OAAA,CAAA,EAAA,GAAA,OAAA,CAAA,UAAA,CAAW,OAAA,CAAA,oBAAX,CAAA,MAAgC,IAAhC,IAAgC,EAAA,KAAA,KAAA,CAAhC,GAAgC,EAAhC,GAAoC,mBAApC;AAAuD,CAAtG;;AAAM,OAAA,CAAA,gCAAA,GAAgC,gCAAhC","sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type DialogSurfaceContextValue = boolean;\n\nconst defaultContextValue: DialogSurfaceContextValue = false;\n\nexport const DialogSurfaceContext = createContext<DialogSurfaceContextValue | undefined>(undefined);\n\nexport const DialogSurfaceProvider = DialogSurfaceContext.Provider;\n\nexport const useDialogSurfaceContext_unstable = () => useContext(DialogSurfaceContext) ?? defaultContextValue;\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/contexts/dialogSurfaceContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAIA,MAAM,mBAAmB,GAA8B,KAAvD;AAEa,OAAA,CAAA,oBAAA,gBAAuB,OAAA,CAAA,aAAA,CAAqD,SAArD,CAAvB;AAEA,OAAA,CAAA,qBAAA,GAAwB,OAAA,CAAA,oBAAA,CAAqB,QAA7C;;AAEN,MAAM,gCAAgC,GAAG,MAAK;EAAA,IAAA,EAAA;;EAAC,OAAA,CAAA,EAAA,GAAA,OAAA,CAAA,UAAA,CAAW,OAAA,CAAA,oBAAX,CAAA,MAAgC,IAAhC,IAAgC,EAAA,KAAA,KAAA,CAAhC,GAAgC,EAAhC,GAAoC,mBAApC;AAAuD,CAAtG;;AAAM,OAAA,CAAA,gCAAA,GAAgC,gCAAhC","sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type DialogSurfaceContextValue = boolean;\n\nconst defaultContextValue: DialogSurfaceContextValue = false;\n\nexport const DialogSurfaceContext = createContext<DialogSurfaceContextValue | undefined>(undefined);\n\nexport const DialogSurfaceProvider = DialogSurfaceContext.Provider;\n\nexport const useDialogSurfaceContext_unstable = () => useContext(DialogSurfaceContext) ?? defaultContextValue;\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["contexts/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './constants';\nexport * from './dialogContext';\nexport * from './dialogSurfaceContext';\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/contexts/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './constants';\nexport * from './dialogContext';\nexport * from './dialogSurfaceContext';\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.renderDialogSurface_unstable = exports.useDialogSurfaceStyles_unstable = exports.useDialogSurface_unstable = exports.dialogSurfaceClassNames = exports.DialogSurface = exports.renderDialogTitle_unstable = exports.useDialogTitleStyles_unstable = exports.useDialogTitle_unstable = exports.dialogTitleClassNames = exports.DialogTitle = exports.renderDialogBody_unstable = exports.useDialogBodyStyles_unstable = exports.useDialogBody_unstable = exports.dialogBodyClassNames = exports.DialogBody = exports.renderDialogActions_unstable = exports.useDialogActionsStyles_unstable = exports.useDialogActions_unstable = exports.dialogActionsClassNames = exports.DialogActions = exports.renderDialogTrigger_unstable = exports.useDialogTrigger_unstable = exports.DialogTrigger = exports.useDialog_unstable = exports.
|
|
6
|
+
exports.renderDialogContent_unstable = exports.useDialogContentStyles_unstable = exports.useDialogContent_unstable = exports.dialogContentClassNames = exports.DialogContent = exports.renderDialogSurface_unstable = exports.useDialogSurfaceStyles_unstable = exports.useDialogSurface_unstable = exports.dialogSurfaceClassNames = exports.DialogSurface = exports.renderDialogTitle_unstable = exports.useDialogTitleStyles_unstable = exports.useDialogTitle_unstable = exports.dialogTitleClassNames = exports.DialogTitle = exports.renderDialogBody_unstable = exports.useDialogBodyStyles_unstable = exports.useDialogBody_unstable = exports.dialogBodyClassNames = exports.DialogBody = exports.renderDialogActions_unstable = exports.useDialogActionsStyles_unstable = exports.useDialogActions_unstable = exports.dialogActionsClassNames = exports.DialogActions = exports.renderDialogTrigger_unstable = exports.useDialogTrigger_unstable = exports.DialogTrigger = exports.useDialog_unstable = exports.renderDialog_unstable = exports.Dialog = void 0;
|
|
7
7
|
|
|
8
8
|
var Dialog_1 = /*#__PURE__*/require("./Dialog");
|
|
9
9
|
|
|
@@ -13,24 +13,12 @@ Object.defineProperty(exports, "Dialog", {
|
|
|
13
13
|
return Dialog_1.Dialog;
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
Object.defineProperty(exports, "dialogClassNames", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return Dialog_1.dialogClassNames;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
16
|
Object.defineProperty(exports, "renderDialog_unstable", {
|
|
23
17
|
enumerable: true,
|
|
24
18
|
get: function () {
|
|
25
19
|
return Dialog_1.renderDialog_unstable;
|
|
26
20
|
}
|
|
27
21
|
});
|
|
28
|
-
Object.defineProperty(exports, "useDialogStyles_unstable", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () {
|
|
31
|
-
return Dialog_1.useDialogStyles_unstable;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
22
|
Object.defineProperty(exports, "useDialog_unstable", {
|
|
35
23
|
enumerable: true,
|
|
36
24
|
get: function () {
|
|
@@ -190,4 +178,37 @@ Object.defineProperty(exports, "renderDialogSurface_unstable", {
|
|
|
190
178
|
return DialogSurface_1.renderDialogSurface_unstable;
|
|
191
179
|
}
|
|
192
180
|
});
|
|
181
|
+
|
|
182
|
+
var DialogContent_1 = /*#__PURE__*/require("./DialogContent");
|
|
183
|
+
|
|
184
|
+
Object.defineProperty(exports, "DialogContent", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function () {
|
|
187
|
+
return DialogContent_1.DialogContent;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(exports, "dialogContentClassNames", {
|
|
191
|
+
enumerable: true,
|
|
192
|
+
get: function () {
|
|
193
|
+
return DialogContent_1.dialogContentClassNames;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(exports, "useDialogContent_unstable", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
get: function () {
|
|
199
|
+
return DialogContent_1.useDialogContent_unstable;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(exports, "useDialogContentStyles_unstable", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
get: function () {
|
|
205
|
+
return DialogContent_1.useDialogContentStyles_unstable;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(exports, "renderDialogContent_unstable", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () {
|
|
211
|
+
return DialogContent_1.renderDialogContent_unstable;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
193
214
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,QAAA,gBAAA,OAAA,CAAA,UAAA,CAAA;;
|
|
1
|
+
{"version":3,"sources":["packages/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AAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,+BAAA;EAA+B;AAA/B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,8BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,4BAAA;EAA4B;AAA5B,CAAA","sourcesContent":["export { Dialog, renderDialog_unstable, useDialog_unstable } from './Dialog';\nexport type {\n DialogSlots,\n DialogProps,\n DialogState,\n DialogOpenChangeData,\n DialogOpenChangeEvent,\n DialogOpenChangeEventHandler,\n} from './Dialog';\n\nexport { DialogTrigger, useDialogTrigger_unstable, renderDialogTrigger_unstable } from './DialogTrigger';\nexport type {\n DialogTriggerProps,\n DialogTriggerChildProps,\n DialogTriggerState,\n DialogTriggerAction,\n} from './DialogTrigger';\n\nexport {\n DialogActions,\n dialogActionsClassNames,\n useDialogActions_unstable,\n useDialogActionsStyles_unstable,\n renderDialogActions_unstable,\n} from './DialogActions';\nexport type {\n DialogActionsProps,\n DialogActionsSlots,\n DialogActionsState,\n DialogActionsPosition,\n} from './DialogActions';\n\nexport {\n DialogBody,\n dialogBodyClassNames,\n useDialogBody_unstable,\n useDialogBodyStyles_unstable,\n renderDialogBody_unstable,\n} from './DialogBody';\nexport type { DialogBodyProps, DialogBodySlots, DialogBodyState } from './DialogBody';\n\nexport {\n DialogTitle,\n dialogTitleClassNames,\n useDialogTitle_unstable,\n useDialogTitleStyles_unstable,\n renderDialogTitle_unstable,\n} from './DialogTitle';\nexport type { DialogTitleProps, DialogTitleSlots, DialogTitleState } from './DialogTitle';\n\nexport {\n DialogSurface,\n dialogSurfaceClassNames,\n useDialogSurface_unstable,\n useDialogSurfaceStyles_unstable,\n renderDialogSurface_unstable,\n} from './DialogSurface';\nexport type { DialogSurfaceProps, DialogSurfaceSlots, DialogSurfaceState, DialogSurfaceElement } from './DialogSurface';\n\nexport {\n DialogContent,\n dialogContentClassNames,\n useDialogContent_unstable,\n useDialogContentStyles_unstable,\n renderDialogContent_unstable,\n} from './DialogContent';\nexport type { DialogContentProps, DialogContentSlots, DialogContentState } from './DialogContent';\n"],"sourceRoot":"../src/"}
|
|
@@ -8,9 +8,11 @@ const tslib_1 = /*#__PURE__*/require("tslib");
|
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./isEscapeKeyDown"), exports);
|
|
10
10
|
|
|
11
|
-
tslib_1.__exportStar(require("./
|
|
11
|
+
tslib_1.__exportStar(require("./useDisableBodyScroll"), exports);
|
|
12
12
|
|
|
13
|
-
tslib_1.__exportStar(require("./
|
|
13
|
+
tslib_1.__exportStar(require("./useFocusFirstElement"), exports);
|
|
14
14
|
|
|
15
|
-
tslib_1.__exportStar(require("./
|
|
15
|
+
tslib_1.__exportStar(require("./isHTMLDialogElement"), exports);
|
|
16
|
+
|
|
17
|
+
tslib_1.__exportStar(require("./useControlNativeDialogOpenState"), exports);
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["utils/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/utils/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './isEscapeKeyDown';\nexport * from './useDisableBodyScroll';\nexport * from './useFocusFirstElement';\nexport * from './isHTMLDialogElement';\nexport * from './useControlNativeDialogOpenState';\n"],"sourceRoot":"../src/"}
|
|
@@ -7,15 +7,16 @@ exports.isEscapeKeyDismiss = void 0;
|
|
|
7
7
|
|
|
8
8
|
const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const isHTMLDialogElement_1 = /*#__PURE__*/require("./isHTMLDialogElement");
|
|
11
11
|
/**
|
|
12
12
|
* Checks if keydown event is a proper Escape key dismiss
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
function isEscapeKeyDismiss(event,
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
function isEscapeKeyDismiss(event, modalType) {
|
|
17
|
+
return event.key === keyboard_keys_1.Escape && ( // `non-modal` should always have Escape key handling
|
|
18
|
+
// `modal` should only be handled in the case of non native dialog
|
|
19
|
+
modalType === 'non-modal' || !isHTMLDialogElement_1.isHTMLDialogElement(event.currentTarget) && modalType === 'modal') && !event.isDefaultPrevented();
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
exports.isEscapeKeyDismiss = isEscapeKeyDismiss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["utils/isEscapeKeyDown.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/utils/isEscapeKeyDown.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAGA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAEA;;AAEG;;;AACH,SAAgB,kBAAhB,CACE,KADF,EAEE,SAFF,EAE4B;EAE1B,OACE,KAAK,CAAC,GAAN,KAAc,eAAA,CAAA,MAAd,MACA;EACA;EACC,SAAS,KAAK,WAAd,IAA8B,CAAC,qBAAA,CAAA,mBAAA,CAAoB,KAAK,CAAC,aAA1B,CAAD,IAA6C,SAAS,KAAK,OAH1F,KAIA,CAAC,KAAK,CAAC,kBAAN,EALH;AAOD;;AAXD,OAAA,CAAA,kBAAA,GAAA,kBAAA","sourcesContent":["import * as React from 'react';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { DialogModalType } from '../components/Dialog/Dialog.types';\nimport { DialogSurfaceElement } from '../DialogSurface';\nimport { isHTMLDialogElement } from './isHTMLDialogElement';\n\n/**\n * Checks if keydown event is a proper Escape key dismiss\n */\nexport function isEscapeKeyDismiss(\n event: React.KeyboardEvent<DialogSurfaceElement>,\n modalType: DialogModalType,\n): boolean {\n return (\n event.key === Escape &&\n // `non-modal` should always have Escape key handling\n // `modal` should only be handled in the case of non native dialog\n (modalType === 'non-modal' || (!isHTMLDialogElement(event.currentTarget) && modalType === 'modal')) &&\n !event.isDefaultPrevented()\n );\n}\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isHTMLDialogElement = void 0;
|
|
7
|
+
|
|
8
|
+
function isHTMLDialogElement(element) {
|
|
9
|
+
return Boolean(element && 'open' in element && 'show' in element && 'showModal' in element && 'close' in element);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.isHTMLDialogElement = isHTMLDialogElement;
|
|
13
|
+
//# sourceMappingURL=isHTMLDialogElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-dialog/src/utils/isHTMLDialogElement.ts"],"names":[],"mappings":";;;;;;;AAEA,SAAgB,mBAAhB,CAAoC,OAApC,EAAgE;EAC9D,OAAO,OAAO,CAAC,OAAO,IAAI,UAAU,OAArB,IAAgC,UAAU,OAA1C,IAAqD,eAAe,OAApE,IAA+E,WAAW,OAA3F,CAAd;AACD;;AAFD,OAAA,CAAA,mBAAA,GAAA,mBAAA","sourcesContent":["import * as React from 'react';\n\nexport function isHTMLDialogElement(element?: HTMLElement | null): element is HTMLDialogElement {\n return Boolean(element && 'open' in element && 'show' in element && 'showModal' in element && 'close' in element);\n}\n\n/**\n * adds additional types which are missing from current version of react\n * @internal\n */\nexport type HTMLDialogElementProps = JSX.IntrinsicElements['dialog'] & {\n /**\n * The close event is fired on a <dialog> when it has been closed.\n */\n onClose?: (event: React.SyntheticEvent) => void;\n /**\n * The cancel event fires on a <dialog> when\n * the user instructs the browser that they wish to dismiss the current open dialog.\n * For example, the browser might fire this event when the user presses the Esc\n * key.\n */\n onCancel?: (event: React.SyntheticEvent) => void;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useControlNativeDialogOpenState = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const isHTMLDialogElement_1 = /*#__PURE__*/require("./isHTMLDialogElement");
|
|
11
|
+
|
|
12
|
+
function useControlNativeDialogOpenState(open, modalType) {
|
|
13
|
+
const dialogSurfaceRef = React.useRef(null);
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
if (isHTMLDialogElement_1.isHTMLDialogElement(dialogSurfaceRef.current) && dialogSurfaceRef.current.open !== open) {
|
|
16
|
+
if (open) {
|
|
17
|
+
if (modalType === 'non-modal') {
|
|
18
|
+
dialogSurfaceRef.current.show();
|
|
19
|
+
} else {
|
|
20
|
+
dialogSurfaceRef.current.showModal();
|
|
21
|
+
}
|
|
22
|
+
} else {
|
|
23
|
+
dialogSurfaceRef.current.close();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}, [open, modalType]);
|
|
27
|
+
return dialogSurfaceRef;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.useControlNativeDialogOpenState = useControlNativeDialogOpenState;
|
|
31
|
+
//# sourceMappingURL=useControlNativeDialogOpenState.js.map
|