@fluentui/react-dialog 9.4.0 → 9.4.1
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/.swcrc +30 -0
- package/CHANGELOG.json +88 -1
- package/CHANGELOG.md +23 -2
- 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.map +1 -1
- 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.map +1 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/index.js.map +1 -1
- package/lib/components/Dialog/renderDialog.js.map +1 -1
- package/lib/components/Dialog/useDialog.js.map +1 -1
- package/lib/components/Dialog/useDialogContextValues.js +3 -3
- 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 +1 -3
- package/lib/components/DialogActions/renderDialogActions.js.map +1 -1
- package/lib/components/DialogActions/useDialogActions.js +1 -0
- package/lib/components/DialogActions/useDialogActions.js.map +1 -1
- 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 +1 -3
- package/lib/components/DialogBody/renderDialogBody.js.map +1 -1
- package/lib/components/DialogBody/useDialogBody.js +3 -2
- package/lib/components/DialogBody/useDialogBody.js.map +1 -1
- package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -1
- package/lib/components/DialogContent/DialogContent.js.map +1 -1
- package/lib/components/DialogContent/DialogContent.types.js.map +1 -1
- package/lib/components/DialogContent/index.js.map +1 -1
- package/lib/components/DialogContent/renderDialogContent.js +1 -3
- package/lib/components/DialogContent/renderDialogContent.js.map +1 -1
- package/lib/components/DialogContent/useDialogContent.js +3 -2
- package/lib/components/DialogContent/useDialogContent.js.map +1 -1
- package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -1
- 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 +2 -6
- package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurface.js +5 -4
- package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
- 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 +1 -5
- package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitle.js +2 -0
- package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
- package/lib/components/DialogTrigger/DialogTrigger.js +1 -0
- package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -1
- package/lib/components/DialogTrigger/DialogTrigger.types.js +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 +1 -2
- package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
- package/lib/components/DialogTrigger/useDialogTrigger.js +3 -2
- package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib/contexts/constants.js.map +1 -1
- package/lib/contexts/dialogContext.js +2 -2
- package/lib/contexts/dialogContext.js.map +1 -1
- package/lib/contexts/dialogSurfaceContext.js +2 -4
- package/lib/contexts/dialogSurfaceContext.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/isEscapeKeyDown.js +1 -0
- package/lib/utils/isEscapeKeyDown.js.map +1 -1
- package/lib/utils/useDisableBodyScroll.js +6 -5
- package/lib/utils/useDisableBodyScroll.js.map +1 -1
- package/lib/utils/useFocusFirstElement.js +4 -3
- package/lib/utils/useFocusFirstElement.js.map +1 -1
- package/lib-commonjs/Dialog.js +5 -4
- package/lib-commonjs/Dialog.js.map +1 -1
- package/lib-commonjs/DialogActions.js +5 -4
- package/lib-commonjs/DialogActions.js.map +1 -1
- package/lib-commonjs/DialogBody.js +5 -4
- package/lib-commonjs/DialogBody.js.map +1 -1
- package/lib-commonjs/DialogContent.js +5 -4
- package/lib-commonjs/DialogContent.js.map +1 -1
- package/lib-commonjs/DialogSurface.js +5 -4
- package/lib-commonjs/DialogSurface.js.map +1 -1
- package/lib-commonjs/DialogTitle.js +5 -4
- package/lib-commonjs/DialogTitle.js.map +1 -1
- package/lib-commonjs/DialogTrigger.js +5 -4
- package/lib-commonjs/DialogTrigger.js.map +1 -1
- package/lib-commonjs/components/Dialog/Dialog.js +16 -19
- package/lib-commonjs/components/Dialog/Dialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/Dialog.types.js +3 -2
- package/lib-commonjs/components/Dialog/Dialog.types.js.map +1 -1
- package/lib-commonjs/components/Dialog/index.js +8 -7
- package/lib-commonjs/components/Dialog/index.js.map +1 -1
- package/lib-commonjs/components/Dialog/renderDialog.js +17 -20
- package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/useDialog.js +78 -80
- package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/useDialogContextValues.js +25 -32
- package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
- package/lib-commonjs/components/DialogActions/DialogActions.js +19 -21
- package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogActions/DialogActions.types.js +3 -2
- package/lib-commonjs/components/DialogActions/DialogActions.types.js.map +1 -1
- package/lib-commonjs/components/DialogActions/index.js +9 -8
- package/lib-commonjs/components/DialogActions/index.js.map +1 -1
- package/lib-commonjs/components/DialogActions/renderDialogActions.js +14 -19
- package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActions.js +23 -31
- package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js +81 -52
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -1
- package/lib-commonjs/components/DialogBody/DialogBody.js +19 -21
- package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogBody/DialogBody.types.js +3 -2
- package/lib-commonjs/components/DialogBody/DialogBody.types.js.map +1 -1
- package/lib-commonjs/components/DialogBody/index.js +9 -8
- package/lib-commonjs/components/DialogBody/index.js.map +1 -1
- package/lib-commonjs/components/DialogBody/renderDialogBody.js +14 -19
- package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBody.js +21 -26
- package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +74 -44
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -1
- package/lib-commonjs/components/DialogContent/DialogContent.js +19 -21
- package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -1
- package/lib-commonjs/components/DialogContent/DialogContent.types.js +3 -2
- package/lib-commonjs/components/DialogContent/DialogContent.types.js.map +1 -1
- package/lib-commonjs/components/DialogContent/index.js +9 -8
- package/lib-commonjs/components/DialogContent/index.js.map +1 -1
- package/lib-commonjs/components/DialogContent/renderDialogContent.js +13 -18
- package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContent.js +21 -26
- package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +51 -35
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/DialogSurface.js +21 -23
- package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/DialogSurface.types.js +3 -2
- package/lib-commonjs/components/DialogSurface/DialogSurface.types.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/index.js +9 -8
- package/lib-commonjs/components/DialogSurface/index.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +17 -24
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js +75 -85
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js +11 -9
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +309 -123
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/DialogTitle.js +19 -21
- package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/DialogTitle.types.js +3 -2
- package/lib-commonjs/components/DialogTitle/DialogTitle.types.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/index.js +9 -8
- package/lib-commonjs/components/DialogTitle/index.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +13 -20
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js +43 -51
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +225 -107
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.js +15 -21
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js +5 -2
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/index.js +8 -7
- package/lib-commonjs/components/DialogTrigger/index.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js +10 -9
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +45 -53
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib-commonjs/contexts/constants.js +28 -12
- package/lib-commonjs/contexts/constants.js.map +1 -1
- package/lib-commonjs/contexts/dialogContext.js +28 -19
- package/lib-commonjs/contexts/dialogContext.js.map +1 -1
- package/lib-commonjs/contexts/dialogSurfaceContext.js +18 -11
- package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js +7 -6
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js +50 -197
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +7 -6
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/isEscapeKeyDown.js +11 -10
- package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -1
- package/lib-commonjs/utils/useDisableBodyScroll.js +45 -47
- package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -1
- package/lib-commonjs/utils/useFocusFirstElement.js +42 -37
- package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -1
- package/package.json +14 -13
- package/lib-amd/Dialog.js +0 -6
- package/lib-amd/Dialog.js.map +0 -1
- package/lib-amd/DialogActions.js +0 -6
- package/lib-amd/DialogActions.js.map +0 -1
- package/lib-amd/DialogBody.js +0 -6
- package/lib-amd/DialogBody.js.map +0 -1
- package/lib-amd/DialogContent.js +0 -6
- package/lib-amd/DialogContent.js.map +0 -1
- package/lib-amd/DialogSurface.js +0 -6
- package/lib-amd/DialogSurface.js.map +0 -1
- package/lib-amd/DialogTitle.js +0 -6
- package/lib-amd/DialogTitle.js.map +0 -1
- package/lib-amd/DialogTrigger.js +0 -6
- package/lib-amd/DialogTrigger.js.map +0 -1
- package/lib-amd/components/Dialog/Dialog.js +0 -19
- package/lib-amd/components/Dialog/Dialog.js.map +0 -1
- package/lib-amd/components/Dialog/Dialog.types.js +0 -5
- package/lib-amd/components/Dialog/Dialog.types.js.map +0 -1
- package/lib-amd/components/Dialog/index.js +0 -9
- package/lib-amd/components/Dialog/index.js.map +0 -1
- package/lib-amd/components/Dialog/renderDialog.js +0 -17
- package/lib-amd/components/Dialog/renderDialog.js.map +0 -1
- package/lib-amd/components/Dialog/useDialog.js +0 -78
- package/lib-amd/components/Dialog/useDialog.js.map +0 -1
- package/lib-amd/components/Dialog/useDialogContextValues.js +0 -25
- package/lib-amd/components/Dialog/useDialogContextValues.js.map +0 -1
- package/lib-amd/components/DialogActions/DialogActions.js +0 -18
- package/lib-amd/components/DialogActions/DialogActions.js.map +0 -1
- package/lib-amd/components/DialogActions/DialogActions.types.js +0 -5
- package/lib-amd/components/DialogActions/DialogActions.types.js.map +0 -1
- package/lib-amd/components/DialogActions/index.js +0 -10
- package/lib-amd/components/DialogActions/index.js.map +0 -1
- package/lib-amd/components/DialogActions/renderDialogActions.js +0 -15
- package/lib-amd/components/DialogActions/renderDialogActions.js.map +0 -1
- package/lib-amd/components/DialogActions/useDialogActions.js +0 -27
- package/lib-amd/components/DialogActions/useDialogActions.js.map +0 -1
- package/lib-amd/components/DialogActions/useDialogActionsStyles.js +0 -33
- package/lib-amd/components/DialogActions/useDialogActionsStyles.js.map +0 -1
- package/lib-amd/components/DialogBody/DialogBody.js +0 -18
- package/lib-amd/components/DialogBody/DialogBody.js.map +0 -1
- package/lib-amd/components/DialogBody/DialogBody.types.js +0 -5
- package/lib-amd/components/DialogBody/DialogBody.types.js.map +0 -1
- package/lib-amd/components/DialogBody/index.js +0 -10
- package/lib-amd/components/DialogBody/index.js.map +0 -1
- package/lib-amd/components/DialogBody/renderDialogBody.js +0 -15
- package/lib-amd/components/DialogBody/renderDialogBody.js.map +0 -1
- package/lib-amd/components/DialogBody/useDialogBody.js +0 -25
- package/lib-amd/components/DialogBody/useDialogBody.js.map +0 -1
- package/lib-amd/components/DialogBody/useDialogBodyStyles.js +0 -31
- package/lib-amd/components/DialogBody/useDialogBodyStyles.js.map +0 -1
- package/lib-amd/components/DialogContent/DialogContent.js +0 -18
- package/lib-amd/components/DialogContent/DialogContent.js.map +0 -1
- package/lib-amd/components/DialogContent/DialogContent.types.js +0 -5
- package/lib-amd/components/DialogContent/DialogContent.types.js.map +0 -1
- package/lib-amd/components/DialogContent/index.js +0 -10
- package/lib-amd/components/DialogContent/index.js.map +0 -1
- package/lib-amd/components/DialogContent/renderDialogContent.js +0 -14
- package/lib-amd/components/DialogContent/renderDialogContent.js.map +0 -1
- package/lib-amd/components/DialogContent/useDialogContent.js +0 -25
- package/lib-amd/components/DialogContent/useDialogContent.js.map +0 -1
- package/lib-amd/components/DialogContent/useDialogContentStyles.js +0 -24
- package/lib-amd/components/DialogContent/useDialogContentStyles.js.map +0 -1
- package/lib-amd/components/DialogSurface/DialogSurface.js +0 -19
- package/lib-amd/components/DialogSurface/DialogSurface.js.map +0 -1
- package/lib-amd/components/DialogSurface/DialogSurface.types.js +0 -5
- package/lib-amd/components/DialogSurface/DialogSurface.types.js.map +0 -1
- package/lib-amd/components/DialogSurface/index.js +0 -10
- package/lib-amd/components/DialogSurface/index.js.map +0 -1
- package/lib-amd/components/DialogSurface/renderDialogSurface.js +0 -17
- package/lib-amd/components/DialogSurface/renderDialogSurface.js.map +0 -1
- package/lib-amd/components/DialogSurface/useDialogSurface.js +0 -70
- package/lib-amd/components/DialogSurface/useDialogSurface.js.map +0 -1
- package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js +0 -11
- package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js.map +0 -1
- package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js +0 -44
- package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js.map +0 -1
- package/lib-amd/components/DialogTitle/DialogTitle.js +0 -18
- package/lib-amd/components/DialogTitle/DialogTitle.js.map +0 -1
- package/lib-amd/components/DialogTitle/DialogTitle.types.js +0 -5
- package/lib-amd/components/DialogTitle/DialogTitle.types.js.map +0 -1
- package/lib-amd/components/DialogTitle/index.js +0 -10
- package/lib-amd/components/DialogTitle/index.js.map +0 -1
- package/lib-amd/components/DialogTitle/renderDialogTitle.js +0 -16
- package/lib-amd/components/DialogTitle/renderDialogTitle.js.map +0 -1
- package/lib-amd/components/DialogTitle/useDialogTitle.js +0 -36
- package/lib-amd/components/DialogTitle/useDialogTitle.js.map +0 -1
- package/lib-amd/components/DialogTitle/useDialogTitleStyles.js +0 -37
- package/lib-amd/components/DialogTitle/useDialogTitleStyles.js.map +0 -1
- package/lib-amd/components/DialogTrigger/DialogTrigger.js +0 -24
- package/lib-amd/components/DialogTrigger/DialogTrigger.js.map +0 -1
- package/lib-amd/components/DialogTrigger/DialogTrigger.types.js +0 -5
- package/lib-amd/components/DialogTrigger/DialogTrigger.types.js.map +0 -1
- package/lib-amd/components/DialogTrigger/index.js +0 -9
- package/lib-amd/components/DialogTrigger/index.js.map +0 -1
- package/lib-amd/components/DialogTrigger/renderDialogTrigger.js +0 -13
- package/lib-amd/components/DialogTrigger/renderDialogTrigger.js.map +0 -1
- package/lib-amd/components/DialogTrigger/useDialogTrigger.js +0 -37
- package/lib-amd/components/DialogTrigger/useDialogTrigger.js.map +0 -1
- package/lib-amd/contexts/constants.js +0 -15
- package/lib-amd/contexts/constants.js.map +0 -1
- package/lib-amd/contexts/dialogContext.js +0 -26
- package/lib-amd/contexts/dialogContext.js.map +0 -1
- package/lib-amd/contexts/dialogSurfaceContext.js +0 -11
- package/lib-amd/contexts/dialogSurfaceContext.js.map +0 -1
- package/lib-amd/contexts/index.js +0 -8
- package/lib-amd/contexts/index.js.map +0 -1
- package/lib-amd/index.js +0 -37
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/utils/index.js +0 -8
- package/lib-amd/utils/index.js.map +0 -1
- package/lib-amd/utils/isEscapeKeyDown.js +0 -13
- package/lib-amd/utils/isEscapeKeyDown.js.map +0 -1
- package/lib-amd/utils/useDisableBodyScroll.js +0 -52
- package/lib-amd/utils/useDisableBodyScroll.js.map +0 -1
- package/lib-amd/utils/useFocusFirstElement.js +0 -38
- package/lib-amd/utils/useFocusFirstElement.js.map +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme", "../../contexts/constants", "@fluentui/react-tabster"], function (require, exports, tslib_1, react_1, react_theme_1, constants_1, react_tabster_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useDialogTitleStyles_unstable = exports.useDialogTitleInternalStyles = exports.dialogTitleClassNames = void 0;
|
|
5
|
-
exports.dialogTitleClassNames = {
|
|
6
|
-
root: 'fui-DialogTitle',
|
|
7
|
-
action: 'fui-DialogTitle__action',
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Styles for the root slot
|
|
11
|
-
*/
|
|
12
|
-
var useStyles = react_1.makeStyles({
|
|
13
|
-
root: tslib_1.__assign(tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle1), react_1.shorthands.gridArea(constants_1.TITLE_GRID_AREA)),
|
|
14
|
-
rootWithoutCloseButton: tslib_1.__assign({}, react_1.shorthands.gridArea(constants_1.TITLE_GRID_AREA, constants_1.TITLE_GRID_AREA, constants_1.TITLE_ACTION_GRID_AREA, constants_1.TITLE_ACTION_GRID_AREA)),
|
|
15
|
-
action: tslib_1.__assign({}, react_1.shorthands.gridArea(constants_1.TITLE_ACTION_GRID_AREA)),
|
|
16
|
-
});
|
|
17
|
-
/**
|
|
18
|
-
* Styles to be applied on internal elements used by default action on non-modal Dialog
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
exports.useDialogTitleInternalStyles = react_1.makeStyles({
|
|
22
|
-
button: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ position: 'relative', boxSizing: 'content-box', backgroundColor: 'inherit', color: 'inherit', fontFamily: 'inherit', fontSize: 'inherit', cursor: 'pointer', lineHeight: 0 }, react_1.shorthands.overflow('visible')), react_1.shorthands.padding(0)), react_1.shorthands.borderStyle('none')), { WebkitAppearance: 'button', textAlign: 'unset' }), react_tabster_1.createFocusOutlineStyle()),
|
|
23
|
-
});
|
|
24
|
-
/**
|
|
25
|
-
* Apply styling to the DialogTitle slots based on the state
|
|
26
|
-
*/
|
|
27
|
-
var useDialogTitleStyles_unstable = function (state) {
|
|
28
|
-
var styles = useStyles();
|
|
29
|
-
state.root.className = react_1.mergeClasses(exports.dialogTitleClassNames.root, styles.root, !state.action && styles.rootWithoutCloseButton, state.root.className);
|
|
30
|
-
if (state.action) {
|
|
31
|
-
state.action.className = react_1.mergeClasses(exports.dialogTitleClassNames.action, styles.action, state.action.className);
|
|
32
|
-
}
|
|
33
|
-
return state;
|
|
34
|
-
};
|
|
35
|
-
exports.useDialogTitleStyles_unstable = useDialogTitleStyles_unstable;
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=useDialogTitleStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDialogTitleStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitleStyles.ts"],"names":[],"mappings":";;;;IAOa,QAAA,qBAAqB,GAAqC;QACrE,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,yBAAyB;KAClC,CAAC;IAEF;;OAEG;IACH,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,wCACC,8BAAgB,CAAC,SAAS,GAC1B,kBAAU,CAAC,QAAQ,CAAC,2BAAe,CAAC,CACxC;QACD,sBAAsB,uBACjB,kBAAU,CAAC,QAAQ,CAAC,2BAAe,EAAE,2BAAe,EAAE,kCAAsB,EAAE,kCAAsB,CAAC,CACzG;QACD,MAAM,uBACD,kBAAU,CAAC,QAAQ,CAAC,kCAAsB,CAAC,CAC/C;KACF,CAAC,CAAC;IAEH;;;OAGG;IACU,QAAA,4BAA4B,GAAG,kBAAU,CAAC;QACrD,MAAM,yFACJ,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,CAAC,IACV,kBAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,GAC9B,kBAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GACrB,kBAAU,CAAC,WAAW,CAAC,MAAM,CAAC,KACjC,gBAAgB,EAAE,QAAQ,EAC1B,SAAS,EAAE,OAAO,KACf,uCAAuB,EAAE,CAC7B;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,6BAA6B,GAAG,UAAC,KAAuB;QACnE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,6BAAqB,CAAC,IAAI,EAC1B,MAAM,CAAC,IAAI,EACX,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,sBAAsB,EAC9C,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QACF,IAAI,KAAK,CAAC,MAAM,EAAE;YAChB,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,oBAAY,CAAC,6BAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SAC5G;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAZW,QAAA,6BAA6B,iCAYxC","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 cursor: 'pointer',\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"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "./useDialogTrigger", "./renderDialogTrigger"], function (require, exports, useDialogTrigger_1, renderDialogTrigger_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.DialogTrigger = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* A non-visual component that wraps its child
|
|
7
|
-
* and configures them to be the trigger that will open or close a `Dialog`.
|
|
8
|
-
* This component should only accept one child.
|
|
9
|
-
*
|
|
10
|
-
* In case the trigger is used outside `Dialog` component
|
|
11
|
-
* it'll still provide basic ARIA related attributes
|
|
12
|
-
* to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,
|
|
13
|
-
* in that case the user must provide a `controlled state`
|
|
14
|
-
*/
|
|
15
|
-
var DialogTrigger = function (props) {
|
|
16
|
-
var state = useDialogTrigger_1.useDialogTrigger_unstable(props);
|
|
17
|
-
return renderDialogTrigger_1.renderDialogTrigger_unstable(state);
|
|
18
|
-
};
|
|
19
|
-
exports.DialogTrigger = DialogTrigger;
|
|
20
|
-
exports.DialogTrigger.displayName = 'DialogTrigger';
|
|
21
|
-
// type casting here is required to ensure internal type FluentTriggerComponent is not leaked
|
|
22
|
-
exports.DialogTrigger.isFluentTriggerComponent = true;
|
|
23
|
-
});
|
|
24
|
-
//# sourceMappingURL=DialogTrigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTrigger.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.tsx"],"names":[],"mappings":";;;;IAMA;;;;;;;;;OASG;IACI,IAAM,aAAa,GAAiC,UAAA,KAAK;QAC9D,IAAM,KAAK,GAAG,4CAAyB,CAAC,KAAK,CAAC,CAAC;QAE/C,OAAO,kDAA4B,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC,CAAC;IAJW,QAAA,aAAa,iBAIxB;IAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC;IAC5C,6FAA6F;IAC5F,qBAAwC,CAAC,wBAAwB,GAAG,IAAI,CAAC","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> = props => {\n const state = useDialogTrigger_unstable(props);\n\n return renderDialogTrigger_unstable(state);\n};\n\nDialogTrigger.displayName = 'DialogTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(DialogTrigger as FluentTriggerComponent).isFluentTriggerComponent = true;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTrigger.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type DialogTriggerAction = 'open' | 'close';\n\nexport type DialogTriggerProps = TriggerProps<DialogTriggerChildProps> & {\n /**\n * Explicitly declare if the trigger is responsible for opening or\n * closing a Dialog visibility state.\n *\n * If `DialogTrigger` is outside `DialogSurface` then it'll be `open` by default\n *\n * If `DialogTrigger` is inside `DialogSurface` then it'll be `close` by default\n */\n action?: DialogTriggerAction;\n /**\n * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog\n */\nexport type DialogTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-haspopup'?: 'dialog';\n }\n>;\n\nexport type DialogTriggerState = {\n children: React.ReactElement | null;\n};\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./DialogTrigger", "./DialogTrigger.types", "./renderDialogTrigger", "./useDialogTrigger"], function (require, exports, tslib_1, DialogTrigger_1, DialogTrigger_types_1, renderDialogTrigger_1, useDialogTrigger_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(DialogTrigger_1, exports);
|
|
5
|
-
tslib_1.__exportStar(DialogTrigger_types_1, exports);
|
|
6
|
-
tslib_1.__exportStar(renderDialogTrigger_1, exports);
|
|
7
|
-
tslib_1.__exportStar(useDialogTrigger_1, exports);
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/index.ts"],"names":[],"mappings":";;;IAAA,+CAAgC;IAChC,qDAAsC;IACtC,qDAAsC;IACtC,kDAAmC","sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.renderDialogTrigger_unstable = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Render the final JSX of MenuTrigger
|
|
7
|
-
*
|
|
8
|
-
* Only renders children
|
|
9
|
-
*/
|
|
10
|
-
var renderDialogTrigger_unstable = function (state) { return state.children; };
|
|
11
|
-
exports.renderDialogTrigger_unstable = renderDialogTrigger_unstable;
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=renderDialogTrigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderDialogTrigger.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/renderDialogTrigger.tsx"],"names":[],"mappings":";;;;IAEA;;;;OAIG;IACI,IAAM,4BAA4B,GAAG,UAAC,KAAyB,IAAK,OAAA,KAAK,CAAC,QAAQ,EAAd,CAAc,CAAC;IAA7E,QAAA,4BAA4B,gCAAiD","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"]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-tabster", "@fluentui/react-utilities", "../../contexts", "@fluentui/react-aria"], function (require, exports, tslib_1, react_tabster_1, react_utilities_1, contexts_1, react_aria_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useDialogTrigger_unstable = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Create the state required to render DialogTrigger.
|
|
7
|
-
* Clones the only child component and adds necessary event handling behaviours to open a popup Dialog
|
|
8
|
-
*
|
|
9
|
-
* @param props - props from this instance of DialogTrigger
|
|
10
|
-
*/
|
|
11
|
-
var useDialogTrigger_unstable = function (props) {
|
|
12
|
-
var isInsideSurfaceDialog = contexts_1.useDialogSurfaceContext_unstable();
|
|
13
|
-
var children = props.children, _a = props.disableButtonEnhancement, disableButtonEnhancement = _a === void 0 ? false : _a, _b = props.action, action = _b === void 0 ? isInsideSurfaceDialog ? 'close' : 'open' : _b;
|
|
14
|
-
var child = react_utilities_1.getTriggerChild(children);
|
|
15
|
-
var requestOpenChange = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.requestOpenChange; });
|
|
16
|
-
var open = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.open; });
|
|
17
|
-
var triggerAttributes = react_tabster_1.useModalAttributes().triggerAttributes;
|
|
18
|
-
var handleClick = react_utilities_1.useEventCallback(function (event) {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
(_b = child === null || child === void 0 ? void 0 : (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
21
|
-
if (!event.isDefaultPrevented()) {
|
|
22
|
-
requestOpenChange({
|
|
23
|
-
event: event,
|
|
24
|
-
type: 'triggerClick',
|
|
25
|
-
open: action === 'open',
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
var triggerChildProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, child === null || child === void 0 ? void 0 : child.props), { 'aria-expanded': open, ref: child === null || child === void 0 ? void 0 : child.ref, onClick: handleClick }), triggerAttributes);
|
|
30
|
-
var ariaButtonTriggerChildProps = 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', tslib_1.__assign(tslib_1.__assign({}, triggerChildProps), { type: 'button' }));
|
|
31
|
-
return {
|
|
32
|
-
children: react_utilities_1.applyTriggerPropsToChildren(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps),
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
exports.useDialogTrigger_unstable = useDialogTrigger_unstable;
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=useDialogTrigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDialogTrigger.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/useDialogTrigger.ts"],"names":[],"mappings":";;;;IAOA;;;;;OAKG;IACI,IAAM,yBAAyB,GAAG,UAAC,KAAyB;QACjE,IAAM,qBAAqB,GAAG,2CAAgC,EAAE,CAAC;QAEzD,IAAA,QAAQ,GAA0F,KAAK,SAA/F,EAAE,KAAwF,KAAK,yBAA7D,EAAhC,wBAAwB,mBAAG,KAAK,KAAA,EAAE,KAAsD,KAAK,OAAV,EAAjD,MAAM,mBAAG,qBAAqB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,KAAA,CAAW;QAEhH,IAAM,KAAK,GAAG,iCAAe,CAAC,QAAQ,CAAC,CAAC;QAExC,IAAM,iBAAiB,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,iBAAiB,EAArB,CAAqB,CAAC,CAAC;QAClF,IAAM,IAAI,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAR,CAAQ,CAAC,CAAC;QAEhD,IAAA,iBAAiB,GAAK,kCAAkB,EAAE,kBAAzB,CAA0B;QAEnD,IAAM,WAAW,GAAG,kCAAgB,CAClC,UAAC,KAA+E;;YAC9E,MAAA,KAAK,aAAL,KAAK,6BAAL,KAAK,CAAE,KAAK,EAAC,OAAO,mDAAG,KAAK,CAAC,CAAC;YAC9B,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE;gBAC/B,iBAAiB,CAAC;oBAChB,KAAK,OAAA;oBACL,IAAI,EAAE,cAAc;oBACpB,IAAI,EAAE,MAAM,KAAK,MAAM;iBACxB,CAAC,CAAC;aACJ;QACH,CAAC,CACF,CAAC;QAEF,IAAM,iBAAiB,GAAG,uDACrB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,KACf,eAAe,EAAE,IAAI,EACrB,GAAG,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,EACf,OAAO,EAAE,WAAW,KACjB,iBAAiB,CACZ,CAAC;QAEX,IAAM,2BAA2B,GAAG,+BAAkB,CACpD,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,MAAK,QAAQ,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,MAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,wCAE/D,iBAAiB,KACpB,IAAI,EAAE,QAAQ,IAEjB,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,6CAA2B,CACnC,QAAQ,EACR,wBAAwB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,2BAA2B,CAC3E;SACF,CAAC;IACJ,CAAC,CAAC;IA/CW,QAAA,yBAAyB,6BA+CpC","sourcesContent":["import * as React from 'react';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport type { 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, disableButtonEnhancement = false, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const open = useDialogContext_unstable(ctx => ctx.open);\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 const triggerChildProps = {\n ...child?.props,\n 'aria-expanded': open,\n ref: child?.ref,\n onClick: handleClick,\n ...triggerAttributes,\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.CONTENT_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.DIALOG_GAP = exports.SURFACE_PADDING = exports.MEDIA_QUERY_BREAKPOINT_SELECTOR = void 0;
|
|
5
|
-
exports.MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';
|
|
6
|
-
exports.SURFACE_PADDING = '24px';
|
|
7
|
-
exports.DIALOG_GAP = '8px';
|
|
8
|
-
exports.SURFACE_BORDER_WIDTH = '1px';
|
|
9
|
-
exports.ACTIONS_START_GRID_AREA = 'actions-start';
|
|
10
|
-
exports.ACTIONS_END_GRID_AREA = 'actions-end';
|
|
11
|
-
exports.TITLE_GRID_AREA = 'title';
|
|
12
|
-
exports.TITLE_ACTION_GRID_AREA = 'close-button';
|
|
13
|
-
exports.CONTENT_GRID_AREA = 'body';
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/contexts/constants.ts"],"names":[],"mappings":";;;;IAAa,QAAA,+BAA+B,GAAG,sCAAsC,CAAC;IACzE,QAAA,eAAe,GAAG,MAAM,CAAC;IACzB,QAAA,UAAU,GAAG,KAAK,CAAC;IACnB,QAAA,oBAAoB,GAAG,KAAK,CAAC;IAE7B,QAAA,uBAAuB,GAAG,eAAe,CAAC;IAC1C,QAAA,qBAAqB,GAAG,aAAa,CAAC;IACtC,QAAA,eAAe,GAAG,OAAO,CAAC;IAC1B,QAAA,sBAAsB,GAAG,cAAc,CAAC;IACxC,QAAA,iBAAiB,GAAG,MAAM,CAAC","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_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 CONTENT_GRID_AREA = 'body';\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-context-selector"], function (require, exports, react_context_selector_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useDialogContext_unstable = exports.DialogProvider = exports.DialogContext = void 0;
|
|
5
|
-
var defaultContextValue = {
|
|
6
|
-
open: false,
|
|
7
|
-
inertTrapFocus: false,
|
|
8
|
-
modalType: 'modal',
|
|
9
|
-
isNestedDialog: false,
|
|
10
|
-
dialogRef: { current: null },
|
|
11
|
-
requestOpenChange: function () {
|
|
12
|
-
/* noop */
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
// Contexts should default to undefined
|
|
16
|
-
exports.DialogContext = react_context_selector_1.createContext(undefined);
|
|
17
|
-
exports.DialogProvider = exports.DialogContext.Provider;
|
|
18
|
-
var useDialogContext_unstable = function (selector) {
|
|
19
|
-
return react_context_selector_1.useContextSelector(exports.DialogContext, function (ctx) {
|
|
20
|
-
if (ctx === void 0) { ctx = defaultContextValue; }
|
|
21
|
-
return selector(ctx);
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
exports.useDialogContext_unstable = useDialogContext_unstable;
|
|
25
|
-
});
|
|
26
|
-
//# sourceMappingURL=dialogContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialogContext.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/contexts/dialogContext.ts"],"names":[],"mappings":";;;;IAmBA,IAAM,mBAAmB,GAAuB;QAC9C,IAAI,EAAE,KAAK;QACX,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,OAAO;QAClB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,iBAAiB;YACf,UAAU;QACZ,CAAC;KACF,CAAC;IAEF,uCAAuC;IAC1B,QAAA,aAAa,GAA4C,sCAAa,CACjF,SAAS,CACV,CAAC;IAEW,QAAA,cAAc,GAAG,qBAAa,CAAC,QAAQ,CAAC;IAC9C,IAAM,yBAAyB,GAAG,UAAI,QAAgD;QAC3F,OAAA,2CAAkB,CAAC,qBAAa,EAAE,UAAC,GAAyB;YAAzB,oBAAA,EAAA,yBAAyB;YAAK,OAAA,QAAQ,CAAC,GAAG,CAAC;QAAb,CAAa,CAAC;IAA/E,CAA+E,CAAC;IADrE,QAAA,yBAAyB,6BAC4C","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 inertTrapFocus: boolean;\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 inertTrapFocus: 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"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react"], function (require, exports, react_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useDialogSurfaceContext_unstable = exports.DialogSurfaceProvider = exports.DialogSurfaceContext = void 0;
|
|
5
|
-
var defaultContextValue = false;
|
|
6
|
-
exports.DialogSurfaceContext = react_1.createContext(undefined);
|
|
7
|
-
exports.DialogSurfaceProvider = exports.DialogSurfaceContext.Provider;
|
|
8
|
-
var useDialogSurfaceContext_unstable = function () { var _a; return (_a = react_1.useContext(exports.DialogSurfaceContext)) !== null && _a !== void 0 ? _a : defaultContextValue; };
|
|
9
|
-
exports.useDialogSurfaceContext_unstable = useDialogSurfaceContext_unstable;
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=dialogSurfaceContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialogSurfaceContext.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/contexts/dialogSurfaceContext.ts"],"names":[],"mappings":";;;;IAIA,IAAM,mBAAmB,GAA8B,KAAK,CAAC;IAEhD,QAAA,oBAAoB,GAAG,qBAAa,CAAwC,SAAS,CAAC,CAAC;IAEvF,QAAA,qBAAqB,GAAG,4BAAoB,CAAC,QAAQ,CAAC;IAE5D,IAAM,gCAAgC,GAAG,sBAAM,OAAA,MAAA,kBAAU,CAAC,4BAAoB,CAAC,mCAAI,mBAAmB,CAAA,EAAA,CAAC;IAAjG,QAAA,gCAAgC,oCAAiE","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"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./constants", "./dialogContext", "./dialogSurfaceContext"], function (require, exports, tslib_1, constants_1, dialogContext_1, dialogSurfaceContext_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(constants_1, exports);
|
|
5
|
-
tslib_1.__exportStar(dialogContext_1, exports);
|
|
6
|
-
tslib_1.__exportStar(dialogSurfaceContext_1, exports);
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/contexts/index.ts"],"names":[],"mappings":";;;IAAA,2CAA4B;IAC5B,+CAAgC;IAChC,sDAAuC","sourcesContent":["export * from './constants';\nexport * from './dialogContext';\nexport * from './dialogSurfaceContext';\n"]}
|
package/lib-amd/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "./Dialog", "./DialogTrigger", "./DialogActions", "./DialogBody", "./DialogTitle", "./DialogSurface", "./DialogContent"], function (require, exports, Dialog_1, DialogTrigger_1, DialogActions_1, DialogBody_1, DialogTitle_1, DialogSurface_1, DialogContent_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
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;
|
|
5
|
-
Object.defineProperty(exports, "Dialog", { enumerable: true, get: function () { return Dialog_1.Dialog; } });
|
|
6
|
-
Object.defineProperty(exports, "renderDialog_unstable", { enumerable: true, get: function () { return Dialog_1.renderDialog_unstable; } });
|
|
7
|
-
Object.defineProperty(exports, "useDialog_unstable", { enumerable: true, get: function () { return Dialog_1.useDialog_unstable; } });
|
|
8
|
-
Object.defineProperty(exports, "DialogTrigger", { enumerable: true, get: function () { return DialogTrigger_1.DialogTrigger; } });
|
|
9
|
-
Object.defineProperty(exports, "useDialogTrigger_unstable", { enumerable: true, get: function () { return DialogTrigger_1.useDialogTrigger_unstable; } });
|
|
10
|
-
Object.defineProperty(exports, "renderDialogTrigger_unstable", { enumerable: true, get: function () { return DialogTrigger_1.renderDialogTrigger_unstable; } });
|
|
11
|
-
Object.defineProperty(exports, "DialogActions", { enumerable: true, get: function () { return DialogActions_1.DialogActions; } });
|
|
12
|
-
Object.defineProperty(exports, "dialogActionsClassNames", { enumerable: true, get: function () { return DialogActions_1.dialogActionsClassNames; } });
|
|
13
|
-
Object.defineProperty(exports, "useDialogActions_unstable", { enumerable: true, get: function () { return DialogActions_1.useDialogActions_unstable; } });
|
|
14
|
-
Object.defineProperty(exports, "useDialogActionsStyles_unstable", { enumerable: true, get: function () { return DialogActions_1.useDialogActionsStyles_unstable; } });
|
|
15
|
-
Object.defineProperty(exports, "renderDialogActions_unstable", { enumerable: true, get: function () { return DialogActions_1.renderDialogActions_unstable; } });
|
|
16
|
-
Object.defineProperty(exports, "DialogBody", { enumerable: true, get: function () { return DialogBody_1.DialogBody; } });
|
|
17
|
-
Object.defineProperty(exports, "dialogBodyClassNames", { enumerable: true, get: function () { return DialogBody_1.dialogBodyClassNames; } });
|
|
18
|
-
Object.defineProperty(exports, "useDialogBody_unstable", { enumerable: true, get: function () { return DialogBody_1.useDialogBody_unstable; } });
|
|
19
|
-
Object.defineProperty(exports, "useDialogBodyStyles_unstable", { enumerable: true, get: function () { return DialogBody_1.useDialogBodyStyles_unstable; } });
|
|
20
|
-
Object.defineProperty(exports, "renderDialogBody_unstable", { enumerable: true, get: function () { return DialogBody_1.renderDialogBody_unstable; } });
|
|
21
|
-
Object.defineProperty(exports, "DialogTitle", { enumerable: true, get: function () { return DialogTitle_1.DialogTitle; } });
|
|
22
|
-
Object.defineProperty(exports, "dialogTitleClassNames", { enumerable: true, get: function () { return DialogTitle_1.dialogTitleClassNames; } });
|
|
23
|
-
Object.defineProperty(exports, "useDialogTitle_unstable", { enumerable: true, get: function () { return DialogTitle_1.useDialogTitle_unstable; } });
|
|
24
|
-
Object.defineProperty(exports, "useDialogTitleStyles_unstable", { enumerable: true, get: function () { return DialogTitle_1.useDialogTitleStyles_unstable; } });
|
|
25
|
-
Object.defineProperty(exports, "renderDialogTitle_unstable", { enumerable: true, get: function () { return DialogTitle_1.renderDialogTitle_unstable; } });
|
|
26
|
-
Object.defineProperty(exports, "DialogSurface", { enumerable: true, get: function () { return DialogSurface_1.DialogSurface; } });
|
|
27
|
-
Object.defineProperty(exports, "dialogSurfaceClassNames", { enumerable: true, get: function () { return DialogSurface_1.dialogSurfaceClassNames; } });
|
|
28
|
-
Object.defineProperty(exports, "useDialogSurface_unstable", { enumerable: true, get: function () { return DialogSurface_1.useDialogSurface_unstable; } });
|
|
29
|
-
Object.defineProperty(exports, "useDialogSurfaceStyles_unstable", { enumerable: true, get: function () { return DialogSurface_1.useDialogSurfaceStyles_unstable; } });
|
|
30
|
-
Object.defineProperty(exports, "renderDialogSurface_unstable", { enumerable: true, get: function () { return DialogSurface_1.renderDialogSurface_unstable; } });
|
|
31
|
-
Object.defineProperty(exports, "DialogContent", { enumerable: true, get: function () { return DialogContent_1.DialogContent; } });
|
|
32
|
-
Object.defineProperty(exports, "dialogContentClassNames", { enumerable: true, get: function () { return DialogContent_1.dialogContentClassNames; } });
|
|
33
|
-
Object.defineProperty(exports, "useDialogContent_unstable", { enumerable: true, get: function () { return DialogContent_1.useDialogContent_unstable; } });
|
|
34
|
-
Object.defineProperty(exports, "useDialogContentStyles_unstable", { enumerable: true, get: function () { return DialogContent_1.useDialogContentStyles_unstable; } });
|
|
35
|
-
Object.defineProperty(exports, "renderDialogContent_unstable", { enumerable: true, get: function () { return DialogContent_1.renderDialogContent_unstable; } });
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
package/lib-amd/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-dialog/src/index.ts"],"names":[],"mappings":";;;;IAAS,gGAAA,MAAM,OAAA;IAAE,+GAAA,qBAAqB,OAAA;IAAE,4GAAA,kBAAkB,OAAA;IAUjD,8GAAA,aAAa,OAAA;IAAE,0HAAA,yBAAyB,OAAA;IAAE,6HAAA,4BAA4B,OAAA;IAS7E,8GAAA,aAAa,OAAA;IACb,wHAAA,uBAAuB,OAAA;IACvB,0HAAA,yBAAyB,OAAA;IACzB,gIAAA,+BAA+B,OAAA;IAC/B,6HAAA,4BAA4B,OAAA;IAU5B,wGAAA,UAAU,OAAA;IACV,kHAAA,oBAAoB,OAAA;IACpB,oHAAA,sBAAsB,OAAA;IACtB,0HAAA,4BAA4B,OAAA;IAC5B,uHAAA,yBAAyB,OAAA;IAKzB,0GAAA,WAAW,OAAA;IACX,oHAAA,qBAAqB,OAAA;IACrB,sHAAA,uBAAuB,OAAA;IACvB,4HAAA,6BAA6B,OAAA;IAC7B,yHAAA,0BAA0B,OAAA;IAK1B,8GAAA,aAAa,OAAA;IACb,wHAAA,uBAAuB,OAAA;IACvB,0HAAA,yBAAyB,OAAA;IACzB,gIAAA,+BAA+B,OAAA;IAC/B,6HAAA,4BAA4B,OAAA;IAK5B,8GAAA,aAAa,OAAA;IACb,wHAAA,uBAAuB,OAAA;IACvB,0HAAA,yBAAyB,OAAA;IACzB,gIAAA,+BAA+B,OAAA;IAC/B,6HAAA,4BAA4B,OAAA","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"]}
|
package/lib-amd/utils/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./isEscapeKeyDown", "./useDisableBodyScroll", "./useFocusFirstElement"], function (require, exports, tslib_1, isEscapeKeyDown_1, useDisableBodyScroll_1, useFocusFirstElement_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(isEscapeKeyDown_1, exports);
|
|
5
|
-
tslib_1.__exportStar(useDisableBodyScroll_1, exports);
|
|
6
|
-
tslib_1.__exportStar(useFocusFirstElement_1, exports);
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/utils/index.ts"],"names":[],"mappings":";;;IAAA,iDAAkC;IAClC,sDAAuC;IACvC,sDAAuC","sourcesContent":["export * from './isEscapeKeyDown';\nexport * from './useDisableBodyScroll';\nexport * from './useFocusFirstElement';\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/keyboard-keys"], function (require, exports, keyboard_keys_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isEscapeKeyDismiss = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Checks if keydown event is a proper Escape key dismiss
|
|
7
|
-
*/
|
|
8
|
-
function isEscapeKeyDismiss(event, modalType) {
|
|
9
|
-
return event.key === keyboard_keys_1.Escape && modalType !== 'alert' && !event.isDefaultPrevented();
|
|
10
|
-
}
|
|
11
|
-
exports.isEscapeKeyDismiss = isEscapeKeyDismiss;
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=isEscapeKeyDown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isEscapeKeyDown.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/utils/isEscapeKeyDown.ts"],"names":[],"mappings":";;;;IAKA;;OAEG;IACH,SAAgB,kBAAkB,CAChC,KAAgD,EAChD,SAA0B;QAE1B,OAAO,KAAK,CAAC,GAAG,KAAK,sBAAM,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACtF,CAAC;IALD,gDAKC","sourcesContent":["import * as React from 'react';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { DialogModalType } from '../components/Dialog/Dialog.types';\nimport { DialogSurfaceElement } from '../DialogSurface';\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 event.key === Escape && modalType !== 'alert' && !event.isDefaultPrevented();\n}\n"]}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-shared-contexts", "react"], function (require, exports, react_shared_contexts_1, react_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.disableScroll = exports.useDisableBodyScroll = void 0;
|
|
5
|
-
var disableScrollElementProp = '__fluentDisableScrollElement';
|
|
6
|
-
/**
|
|
7
|
-
* hook that disables body scrolling through `overflow: hidden` CSS property
|
|
8
|
-
*/
|
|
9
|
-
function useDisableBodyScroll() {
|
|
10
|
-
var targetDocument = react_shared_contexts_1.useFluent_unstable().targetDocument;
|
|
11
|
-
return react_1.useCallback(function () {
|
|
12
|
-
if (targetDocument) {
|
|
13
|
-
return disableScroll(targetDocument.body);
|
|
14
|
-
}
|
|
15
|
-
}, [targetDocument]);
|
|
16
|
-
}
|
|
17
|
-
exports.useDisableBodyScroll = useDisableBodyScroll;
|
|
18
|
-
/**
|
|
19
|
-
* disables scrolling from a given element through `overflow: hidden` CSS property
|
|
20
|
-
* @param target - element to disable scrolling from
|
|
21
|
-
* @returns a method for enabling scrolling again
|
|
22
|
-
*/
|
|
23
|
-
function disableScroll(target) {
|
|
24
|
-
var _a, _b;
|
|
25
|
-
var clientWidth = target.ownerDocument.documentElement.clientWidth;
|
|
26
|
-
var innerWidth = (_b = (_a = target.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.innerWidth) !== null && _b !== void 0 ? _b : 0;
|
|
27
|
-
assertIsDisableScrollElement(target);
|
|
28
|
-
if (target[disableScrollElementProp].count === 0) {
|
|
29
|
-
target.style.overflow = 'hidden';
|
|
30
|
-
target.style.paddingRight = innerWidth - clientWidth + "px";
|
|
31
|
-
}
|
|
32
|
-
target[disableScrollElementProp].count++;
|
|
33
|
-
return function () {
|
|
34
|
-
target[disableScrollElementProp].count--;
|
|
35
|
-
if (target[disableScrollElementProp].count === 0) {
|
|
36
|
-
target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;
|
|
37
|
-
target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
exports.disableScroll = disableScroll;
|
|
42
|
-
function assertIsDisableScrollElement(element) {
|
|
43
|
-
var _a;
|
|
44
|
-
var _b;
|
|
45
|
-
(_a = (_b = element)[disableScrollElementProp]) !== null && _a !== void 0 ? _a : (_b[disableScrollElementProp] = {
|
|
46
|
-
count: 0,
|
|
47
|
-
previousOverflowStyle: element.style.overflow,
|
|
48
|
-
previousPaddingRightStyle: element.style.paddingRight,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=useDisableBodyScroll.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDisableBodyScroll.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/utils/useDisableBodyScroll.ts"],"names":[],"mappings":";;;;IAGA,IAAM,wBAAwB,GAAG,8BAAuC,CAAC;IAUzE;;OAEG;IACH,SAAgB,oBAAoB;QAC1B,IAAA,cAAc,GAAK,0CAAkB,EAAE,eAAzB,CAA0B;QAChD,OAAO,mBAAW,CAAC;YACjB,IAAI,cAAc,EAAE;gBAClB,OAAO,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;aAC3C;QACH,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IACvB,CAAC;IAPD,oDAOC;IAED;;;;OAIG;IACH,SAAgB,aAAa,CAAC,MAAmB;;QACvC,IAAA,WAAW,GAAK,MAAM,CAAC,aAAa,CAAC,eAAe,YAAzC,CAA0C;QAC7D,IAAM,UAAU,GAAG,MAAA,MAAA,MAAM,CAAC,aAAa,CAAC,WAAW,0CAAE,UAAU,mCAAI,CAAC,CAAC;QACrE,4BAA4B,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC,KAAK,KAAK,CAAC,EAAE;YAChD,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACjC,MAAM,CAAC,KAAK,CAAC,YAAY,GAAM,UAAU,GAAG,WAAW,OAAI,CAAC;SAC7D;QACD,MAAM,CAAC,wBAAwB,CAAC,CAAC,KAAK,EAAE,CAAC;QACzC,OAAO;YACL,MAAM,CAAC,wBAAwB,CAAC,CAAC,KAAK,EAAE,CAAC;YACzC,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC,KAAK,KAAK,CAAC,EAAE;gBAChD,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC,qBAAqB,CAAC;gBAC/E,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC,yBAAyB,CAAC;aACxF;QACH,CAAC,CAAC;IACJ,CAAC;IAhBD,sCAgBC;IAED,SAAS,4BAA4B,CAAC,OAAoB;;;QACxD,YAAC,OAAsC,EAAC,wBAAwB,wCAAxB,wBAAwB,IAAM;YACpE,KAAK,EAAE,CAAC;YACR,qBAAqB,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ;YAC7C,yBAAyB,EAAE,OAAO,CAAC,KAAK,CAAC,YAAY;SACtD,EAAC;IACJ,CAAC","sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nconst disableScrollElementProp = '__fluentDisableScrollElement' as const;\n\ntype FluentDisableScrollElement = HTMLElement & {\n [disableScrollElementProp]: {\n count: number;\n previousOverflowStyle: string;\n previousPaddingRightStyle: string;\n };\n};\n\n/**\n * hook that disables body scrolling through `overflow: hidden` CSS property\n */\nexport function useDisableBodyScroll() {\n const { targetDocument } = useFluent_unstable();\n return useCallback(() => {\n if (targetDocument) {\n return disableScroll(targetDocument.body);\n }\n }, [targetDocument]);\n}\n\n/**\n * disables scrolling from a given element through `overflow: hidden` CSS property\n * @param target - element to disable scrolling from\n * @returns a method for enabling scrolling again\n */\nexport function disableScroll(target: HTMLElement) {\n const { clientWidth } = target.ownerDocument.documentElement;\n const innerWidth = target.ownerDocument.defaultView?.innerWidth ?? 0;\n assertIsDisableScrollElement(target);\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = 'hidden';\n target.style.paddingRight = `${innerWidth - clientWidth}px`;\n }\n target[disableScrollElementProp].count++;\n return () => {\n target[disableScrollElementProp].count--;\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;\n target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;\n }\n };\n}\n\nfunction assertIsDisableScrollElement(element: HTMLElement): asserts element is FluentDisableScrollElement {\n (element as FluentDisableScrollElement)[disableScrollElementProp] ??= {\n count: 0,\n previousOverflowStyle: element.style.overflow,\n previousPaddingRightStyle: element.style.paddingRight,\n };\n}\n"]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react", "@fluentui/react-tabster", "@fluentui/react-shared-contexts"], function (require, exports, React, react_tabster_1, react_shared_contexts_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useFocusFirstElement = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Focus first element on content when dialog is opened,
|
|
7
|
-
*/
|
|
8
|
-
function useFocusFirstElement(open, modalType) {
|
|
9
|
-
var findFirstFocusable = react_tabster_1.useFocusFinders().findFirstFocusable;
|
|
10
|
-
var targetDocument = react_shared_contexts_1.useFluent_unstable().targetDocument;
|
|
11
|
-
var dialogRef = React.useRef(null);
|
|
12
|
-
var triggerRef = React.useRef();
|
|
13
|
-
React.useEffect(function () {
|
|
14
|
-
var _a, _b;
|
|
15
|
-
if (!open) {
|
|
16
|
-
return (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
17
|
-
}
|
|
18
|
-
triggerRef.current = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
|
|
19
|
-
var element = dialogRef.current && findFirstFocusable(dialogRef.current);
|
|
20
|
-
if (element) {
|
|
21
|
-
element.focus();
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
(_b = dialogRef.current) === null || _b === void 0 ? void 0 : _b.focus(); // https://github.com/microsoft/fluentui/issues/25150
|
|
25
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
26
|
-
// eslint-disable-next-line no-console
|
|
27
|
-
console.warn([
|
|
28
|
-
'@fluentui/react-dialog: a Dialog should have at least one focusable element inside DialogSurface.',
|
|
29
|
-
'Please add at least a close button either on `DialogTitle` action slot or inside `DialogActions`',
|
|
30
|
-
].join('\n'));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}, [findFirstFocusable, open, modalType, targetDocument]);
|
|
34
|
-
return dialogRef;
|
|
35
|
-
}
|
|
36
|
-
exports.useFocusFirstElement = useFocusFirstElement;
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=useFocusFirstElement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusFirstElement.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/utils/useFocusFirstElement.ts"],"names":[],"mappings":";;;;IAMA;;OAEG;IACH,SAAgB,oBAAoB,CAAC,IAAa,EAAE,SAA0B;QACpE,IAAA,kBAAkB,GAAK,+BAAe,EAAE,mBAAtB,CAAuB;QACzC,IAAA,cAAc,GAAK,0CAAkB,EAAE,eAAzB,CAA0B;QAChD,IAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAuB,IAAI,CAAC,CAAC;QAC3D,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,EAAe,CAAC;QAE/C,KAAK,CAAC,SAAS,CAAC;;YACd,IAAI,CAAC,IAAI,EAAE;gBACT,OAAO,MAAA,UAAU,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;aACpC;YACD,UAAU,CAAC,OAAO,GAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,aAAwC,CAAC;YAC9E,IAAM,OAAO,GAAG,SAAS,CAAC,OAAO,IAAI,kBAAkB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAC3E,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,KAAK,EAAE,CAAC;aACjB;iBAAM;gBACL,MAAA,SAAS,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC,CAAC,qDAAqD;gBACjF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;oBACzC,sCAAsC;oBACtC,OAAO,CAAC,IAAI,CACV;wBACE,mGAAmG;wBACnG,kGAAkG;qBACnG,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;iBACH;aACF;QACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;QAE1D,OAAO,SAAS,CAAC;IACnB,CAAC;IA7BD,oDA6BC","sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface';\nimport type { DialogModalType } from '../Dialog';\n\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(open: boolean, modalType: DialogModalType) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef<DialogSurfaceElement>(null);\n const triggerRef = React.useRef<HTMLElement>();\n\n React.useEffect(() => {\n if (!open) {\n return triggerRef.current?.focus();\n }\n triggerRef.current = targetDocument?.activeElement as HTMLElement | undefined;\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n dialogRef.current?.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n [\n '@fluentui/react-dialog: a Dialog should have at least one focusable element inside DialogSurface.',\n 'Please add at least a close button either on `DialogTitle` action slot or inside `DialogActions`',\n ].join('\\n'),\n );\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"]}
|