@fluentui/react-dialog 9.1.1 → 9.1.2
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 +54 -1
- package/CHANGELOG.md +16 -2
- package/dist/index.d.ts +0 -1
- package/lib/components/Dialog/useDialog.js +0 -1
- package/lib/components/Dialog/useDialog.js.map +1 -1
- package/lib/components/Dialog/useDialogContextValues.js +0 -2
- package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
- package/lib/components/DialogContent/useDialogContent.js +0 -3
- package/lib/components/DialogContent/useDialogContent.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurface.js +0 -2
- package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib/components/DialogTrigger/useDialogTrigger.js +2 -1
- package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib/contexts/dialogContext.js.map +1 -1
- package/lib-amd/Dialog.js +6 -0
- package/lib-amd/Dialog.js.map +1 -0
- package/lib-amd/DialogActions.js +6 -0
- package/lib-amd/DialogActions.js.map +1 -0
- package/lib-amd/DialogBody.js +6 -0
- package/lib-amd/DialogBody.js.map +1 -0
- package/lib-amd/DialogContent.js +6 -0
- package/lib-amd/DialogContent.js.map +1 -0
- package/lib-amd/DialogSurface.js +6 -0
- package/lib-amd/DialogSurface.js.map +1 -0
- package/lib-amd/DialogTitle.js +6 -0
- package/lib-amd/DialogTitle.js.map +1 -0
- package/lib-amd/DialogTrigger.js +6 -0
- package/lib-amd/DialogTrigger.js.map +1 -0
- package/lib-amd/components/Dialog/Dialog.js +19 -0
- package/lib-amd/components/Dialog/Dialog.js.map +1 -0
- package/lib-amd/components/Dialog/Dialog.types.js +5 -0
- package/lib-amd/components/Dialog/Dialog.types.js.map +1 -0
- package/lib-amd/components/Dialog/index.js +9 -0
- package/lib-amd/components/Dialog/index.js.map +1 -0
- package/lib-amd/components/Dialog/renderDialog.js +17 -0
- package/lib-amd/components/Dialog/renderDialog.js.map +1 -0
- package/lib-amd/components/Dialog/useDialog.js +77 -0
- package/lib-amd/components/Dialog/useDialog.js.map +1 -0
- package/lib-amd/components/Dialog/useDialogContextValues.js +24 -0
- package/lib-amd/components/Dialog/useDialogContextValues.js.map +1 -0
- package/lib-amd/components/DialogActions/DialogActions.js +16 -0
- package/lib-amd/components/DialogActions/DialogActions.js.map +1 -0
- package/lib-amd/components/DialogActions/DialogActions.types.js +5 -0
- package/lib-amd/components/DialogActions/DialogActions.types.js.map +1 -0
- package/lib-amd/components/DialogActions/index.js +10 -0
- package/lib-amd/components/DialogActions/index.js.map +1 -0
- package/lib-amd/components/DialogActions/renderDialogActions.js +15 -0
- package/lib-amd/components/DialogActions/renderDialogActions.js.map +1 -0
- package/lib-amd/components/DialogActions/useDialogActions.js +26 -0
- package/lib-amd/components/DialogActions/useDialogActions.js.map +1 -0
- package/lib-amd/components/DialogActions/useDialogActionsStyles.js +27 -0
- package/lib-amd/components/DialogActions/useDialogActionsStyles.js.map +1 -0
- package/lib-amd/components/DialogBody/DialogBody.js +16 -0
- package/lib-amd/components/DialogBody/DialogBody.js.map +1 -0
- package/lib-amd/components/DialogBody/DialogBody.types.js +5 -0
- package/lib-amd/components/DialogBody/DialogBody.types.js.map +1 -0
- package/lib-amd/components/DialogBody/index.js +10 -0
- package/lib-amd/components/DialogBody/index.js.map +1 -0
- package/lib-amd/components/DialogBody/renderDialogBody.js +15 -0
- package/lib-amd/components/DialogBody/renderDialogBody.js.map +1 -0
- package/lib-amd/components/DialogBody/useDialogBody.js +25 -0
- package/lib-amd/components/DialogBody/useDialogBody.js.map +1 -0
- package/lib-amd/components/DialogBody/useDialogBodyStyles.js +31 -0
- package/lib-amd/components/DialogBody/useDialogBodyStyles.js.map +1 -0
- package/lib-amd/components/DialogContent/DialogContent.js +16 -0
- package/lib-amd/components/DialogContent/DialogContent.js.map +1 -0
- package/lib-amd/components/DialogContent/DialogContent.types.js +5 -0
- package/lib-amd/components/DialogContent/DialogContent.types.js.map +1 -0
- package/lib-amd/components/DialogContent/index.js +10 -0
- package/lib-amd/components/DialogContent/index.js.map +1 -0
- package/lib-amd/components/DialogContent/renderDialogContent.js +14 -0
- package/lib-amd/components/DialogContent/renderDialogContent.js.map +1 -0
- package/lib-amd/components/DialogContent/useDialogContent.js +25 -0
- package/lib-amd/components/DialogContent/useDialogContent.js.map +1 -0
- package/lib-amd/components/DialogContent/useDialogContentStyles.js +24 -0
- package/lib-amd/components/DialogContent/useDialogContentStyles.js.map +1 -0
- package/lib-amd/components/DialogSurface/DialogSurface.js +17 -0
- package/lib-amd/components/DialogSurface/DialogSurface.js.map +1 -0
- package/lib-amd/components/DialogSurface/DialogSurface.types.js +5 -0
- package/lib-amd/components/DialogSurface/DialogSurface.types.js.map +1 -0
- package/lib-amd/components/DialogSurface/index.js +10 -0
- package/lib-amd/components/DialogSurface/index.js.map +1 -0
- package/lib-amd/components/DialogSurface/renderDialogSurface.js +17 -0
- package/lib-amd/components/DialogSurface/renderDialogSurface.js.map +1 -0
- package/lib-amd/components/DialogSurface/useDialogSurface.js +66 -0
- package/lib-amd/components/DialogSurface/useDialogSurface.js.map +1 -0
- package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js +11 -0
- package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -0
- package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js +44 -0
- package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
- package/lib-amd/components/DialogTitle/DialogTitle.js +16 -0
- package/lib-amd/components/DialogTitle/DialogTitle.js.map +1 -0
- package/lib-amd/components/DialogTitle/DialogTitle.types.js +5 -0
- package/lib-amd/components/DialogTitle/DialogTitle.types.js.map +1 -0
- package/lib-amd/components/DialogTitle/index.js +10 -0
- package/lib-amd/components/DialogTitle/index.js.map +1 -0
- package/lib-amd/components/DialogTitle/renderDialogTitle.js +16 -0
- package/lib-amd/components/DialogTitle/renderDialogTitle.js.map +1 -0
- package/lib-amd/components/DialogTitle/useDialogTitle.js +36 -0
- package/lib-amd/components/DialogTitle/useDialogTitle.js.map +1 -0
- package/lib-amd/components/DialogTitle/useDialogTitleStyles.js +37 -0
- package/lib-amd/components/DialogTitle/useDialogTitleStyles.js.map +1 -0
- package/lib-amd/components/DialogTrigger/DialogTrigger.js +24 -0
- package/lib-amd/components/DialogTrigger/DialogTrigger.js.map +1 -0
- package/lib-amd/components/DialogTrigger/DialogTrigger.types.js +5 -0
- package/lib-amd/components/DialogTrigger/DialogTrigger.types.js.map +1 -0
- package/lib-amd/components/DialogTrigger/index.js +9 -0
- package/lib-amd/components/DialogTrigger/index.js.map +1 -0
- package/lib-amd/components/DialogTrigger/renderDialogTrigger.js +13 -0
- package/lib-amd/components/DialogTrigger/renderDialogTrigger.js.map +1 -0
- package/lib-amd/components/DialogTrigger/useDialogTrigger.js +37 -0
- package/lib-amd/components/DialogTrigger/useDialogTrigger.js.map +1 -0
- package/lib-amd/contexts/constants.js +16 -0
- package/lib-amd/contexts/constants.js.map +1 -0
- package/lib-amd/contexts/dialogContext.js +25 -0
- package/lib-amd/contexts/dialogContext.js.map +1 -0
- package/lib-amd/contexts/dialogSurfaceContext.js +11 -0
- package/lib-amd/contexts/dialogSurfaceContext.js.map +1 -0
- package/lib-amd/contexts/index.js +8 -0
- package/lib-amd/contexts/index.js.map +1 -0
- package/lib-amd/index.js +37 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-amd/utils/index.js +8 -0
- package/lib-amd/utils/index.js.map +1 -0
- package/lib-amd/utils/isEscapeKeyDown.js +13 -0
- package/lib-amd/utils/isEscapeKeyDown.js.map +1 -0
- package/lib-amd/utils/useDisableBodyScroll.js +52 -0
- package/lib-amd/utils/useDisableBodyScroll.js.map +1 -0
- package/lib-amd/utils/useFocusFirstElement.js +38 -0
- package/lib-amd/utils/useFocusFirstElement.js.map +1 -0
- package/lib-commonjs/components/Dialog/useDialog.js +0 -1
- package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
- package/lib-commonjs/components/Dialog/useDialogContextValues.js +0 -2
- package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContent.js +0 -4
- package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js +0 -2
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +2 -1
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib-commonjs/contexts/dialogContext.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogActions.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogActions/DialogActions.tsx"],"names":[],"mappings":";;;;IAOA;;;OAGG;IACU,QAAA,aAAa,GAA4C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChG,IAAM,KAAK,GAAG,4CAAyB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEpD,wDAA+B,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,kDAA4B,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import * as React from 'react';\nimport { useDialogActions_unstable } from './useDialogActions';\nimport { renderDialogActions_unstable } from './renderDialogActions';\nimport { useDialogActionsStyles_unstable } from './useDialogActionsStyles';\nimport type { DialogActionsProps } from './DialogActions.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * `DialogActions` is a container for the actions of the dialog.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogActions: ForwardRefComponent<DialogActionsProps> = React.forwardRef((props, ref) => {\n const state = useDialogActions_unstable(props, ref);\n\n useDialogActionsStyles_unstable(state);\n return renderDialogActions_unstable(state);\n});\n\nDialogActions.displayName = 'DialogActions';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogActions.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogActions/DialogActions.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogActionsSlots = {\n root: Slot<'div'>;\n};\n\nexport type DialogActionsPosition = 'start' | 'end';\n\n/**\n * DialogActions Props\n */\nexport type DialogActionsProps = ComponentProps<DialogActionsSlots> & {\n /**\n * defines the position on the dialog grid of the actions\n * @default 'end'\n */\n position?: DialogActionsPosition;\n};\n\n/**\n * State used in rendering DialogActions\n */\nexport type DialogActionsState = ComponentState<DialogActionsSlots> & {\n position: DialogActionsPosition;\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./DialogActions", "./DialogActions.types", "./renderDialogActions", "./useDialogActions", "./useDialogActionsStyles"], function (require, exports, tslib_1, DialogActions_1, DialogActions_types_1, renderDialogActions_1, useDialogActions_1, useDialogActionsStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(DialogActions_1, exports);
|
|
5
|
+
tslib_1.__exportStar(DialogActions_types_1, exports);
|
|
6
|
+
tslib_1.__exportStar(renderDialogActions_1, exports);
|
|
7
|
+
tslib_1.__exportStar(useDialogActions_1, exports);
|
|
8
|
+
tslib_1.__exportStar(useDialogActionsStyles_1, exports);
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogActions/index.ts"],"names":[],"mappings":";;;IAAA,+CAAgC;IAChC,qDAAsC;IACtC,qDAAsC;IACtC,kDAAmC;IACnC,wDAAyC","sourcesContent":["export * from './DialogActions';\nexport * from './DialogActions.types';\nexport * from './renderDialogActions';\nexport * from './useDialogActions';\nexport * from './useDialogActionsStyles';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.renderDialogActions_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Render the final JSX of DialogActions
|
|
7
|
+
*/
|
|
8
|
+
var renderDialogActions_unstable = function (state) {
|
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
+
// TODO Add additional slots in the appropriate place
|
|
11
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root));
|
|
12
|
+
};
|
|
13
|
+
exports.renderDialogActions_unstable = renderDialogActions_unstable;
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=renderDialogActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderDialogActions.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogActions/renderDialogActions.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,4BAA4B,GAAG,UAAC,KAAyB;QAC9D,IAAA,KAAuB,0BAAQ,CAAqB,KAAK,CAAC,EAAxD,KAAK,WAAA,EAAE,SAAS,eAAwC,CAAC;QAEjE,qDAAqD;QACrD,OAAO,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CAAC;IAC5C,CAAC,CAAC;IALW,QAAA,4BAA4B,gCAKvC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogActionsState, DialogActionsSlots } from './DialogActions.types';\n\n/**\n * Render the final JSX of DialogActions\n */\nexport const renderDialogActions_unstable = (state: DialogActionsState) => {\n const { slots, slotProps } = getSlots<DialogActionsSlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDialogActions_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render DialogActions.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useDialogActionsStyles_unstable,
|
|
9
|
+
* before being passed to renderDialogActions_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of DialogActions
|
|
12
|
+
* @param ref - reference to root HTMLElement of DialogActions
|
|
13
|
+
*/
|
|
14
|
+
var useDialogActions_unstable = function (props, ref) {
|
|
15
|
+
var _a = props.position, position = _a === void 0 ? 'end' : _a;
|
|
16
|
+
return {
|
|
17
|
+
components: {
|
|
18
|
+
root: 'div',
|
|
19
|
+
},
|
|
20
|
+
root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref }, props)),
|
|
21
|
+
position: position,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.useDialogActions_unstable = useDialogActions_unstable;
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=useDialogActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogActions.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogActions/useDialogActions.ts"],"names":[],"mappings":";;;;IAIA;;;;;;;;OAQG;IACI,IAAM,yBAAyB,GAAG,UACvC,KAAyB,EACzB,GAA2B;QAEnB,IAAA,KAAqB,KAAK,SAAV,EAAhB,QAAQ,mBAAG,KAAK,KAAA,CAAW;QACnC,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;aACZ;YACD,IAAI,EAAE,uCAAqB,CAAC,KAAK,qBAC/B,GAAG,KAAA,IACA,KAAK,EACR;YACF,QAAQ,UAAA;SACT,CAAC;IACJ,CAAC,CAAC;IAfW,QAAA,yBAAyB,6BAepC","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogActionsProps, DialogActionsState } from './DialogActions.types';\n\n/**\n * Create the state required to render DialogActions.\n *\n * The returned state can be modified with hooks such as useDialogActionsStyles_unstable,\n * before being passed to renderDialogActions_unstable.\n *\n * @param props - props from this instance of DialogActions\n * @param ref - reference to root HTMLElement of DialogActions\n */\nexport const useDialogActions_unstable = (\n props: DialogActionsProps,\n ref: React.Ref<HTMLElement>,\n): DialogActionsState => {\n const { position = 'end' } = props;\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n position,\n };\n};\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@griffel/react", "../../contexts/constants"], function (require, exports, tslib_1, react_1, constants_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
var _a;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.useDialogActionsStyles_unstable = exports.dialogActionsClassNames = void 0;
|
|
6
|
+
exports.dialogActionsClassNames = {
|
|
7
|
+
root: 'fui-DialogActions',
|
|
8
|
+
};
|
|
9
|
+
var useStyles = react_1.makeStyles({
|
|
10
|
+
root: tslib_1.__assign(tslib_1.__assign({ height: 'fit-content', boxSizing: 'border-box', display: 'flex' }, react_1.shorthands.gap(constants_1.DIALOG_GAP)), (_a = {}, _a[constants_1.MEDIA_QUERY_BREAKPOINT_SELECTOR] = {
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
justifySelf: 'stretch',
|
|
13
|
+
}, _a)),
|
|
14
|
+
gridPositionEnd: tslib_1.__assign({ justifySelf: 'end' }, react_1.shorthands.gridArea(constants_1.ACTIONS_END_GRID_AREA)),
|
|
15
|
+
gridPositionStart: tslib_1.__assign({ justifySelf: 'start' }, react_1.shorthands.gridArea(constants_1.ACTIONS_START_GRID_AREA)),
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Apply styling to the DialogActions slots based on the state
|
|
19
|
+
*/
|
|
20
|
+
var useDialogActionsStyles_unstable = function (state) {
|
|
21
|
+
var styles = useStyles();
|
|
22
|
+
state.root.className = react_1.mergeClasses(exports.dialogActionsClassNames.root, styles.root, state.position === 'start' && styles.gridPositionStart, state.position === 'end' && styles.gridPositionEnd, state.root.className);
|
|
23
|
+
return state;
|
|
24
|
+
};
|
|
25
|
+
exports.useDialogActionsStyles_unstable = useDialogActionsStyles_unstable;
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=useDialogActionsStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogActionsStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogActions/useDialogActionsStyles.ts"],"names":[],"mappings":";;;;;IAUa,QAAA,uBAAuB,GAAuC;QACzE,IAAI,EAAE,mBAAmB;KAC1B,CAAC;IAEF,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,sCACF,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,MAAM,IACZ,kBAAU,CAAC,GAAG,CAAC,sBAAU,CAAC,gBAC5B,2CAA+B,IAAG;YACjC,aAAa,EAAE,QAAQ;YACvB,WAAW,EAAE,SAAS;SACvB,MACF;QACD,eAAe,qBACb,WAAW,EAAE,KAAK,IACf,kBAAU,CAAC,QAAQ,CAAC,iCAAqB,CAAC,CAC9C;QACD,iBAAiB,qBACf,WAAW,EAAE,OAAO,IACjB,kBAAU,CAAC,QAAQ,CAAC,mCAAuB,CAAC,CAChD;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,+BAA+B,GAAG,UAAC,KAAyB;QACvE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,+BAAuB,CAAC,IAAI,EAC5B,MAAM,CAAC,IAAI,EACX,KAAK,CAAC,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC,iBAAiB,EACtD,KAAK,CAAC,QAAQ,KAAK,KAAK,IAAI,MAAM,CAAC,eAAe,EAClD,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QACF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAVW,QAAA,+BAA+B,mCAU1C","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogActionsSlots, DialogActionsState } from './DialogActions.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport {\n DIALOG_GAP,\n ACTIONS_END_GRID_AREA,\n ACTIONS_START_GRID_AREA,\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n} from '../../contexts/constants';\n\nexport const dialogActionsClassNames: SlotClassNames<DialogActionsSlots> = {\n root: 'fui-DialogActions',\n};\n\nconst useStyles = makeStyles({\n root: {\n height: 'fit-content',\n boxSizing: 'border-box',\n display: 'flex',\n ...shorthands.gap(DIALOG_GAP),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n flexDirection: 'column',\n justifySelf: 'stretch',\n },\n },\n gridPositionEnd: {\n justifySelf: 'end',\n ...shorthands.gridArea(ACTIONS_END_GRID_AREA),\n },\n gridPositionStart: {\n justifySelf: 'start',\n ...shorthands.gridArea(ACTIONS_START_GRID_AREA),\n },\n});\n\n/**\n * Apply styling to the DialogActions slots based on the state\n */\nexport const useDialogActionsStyles_unstable = (state: DialogActionsState): DialogActionsState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogActionsClassNames.root,\n styles.root,\n state.position === 'start' && styles.gridPositionStart,\n state.position === 'end' && styles.gridPositionEnd,\n state.root.className,\n );\n return state;\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
define(["require", "exports", "react", "./useDialogBody", "./renderDialogBody", "./useDialogBodyStyles"], function (require, exports, React, useDialogBody_1, renderDialogBody_1, useDialogBodyStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DialogBody = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* The `DialogBody` is a container where the content of the dialog is rendered.
|
|
7
|
+
* Apart from styling, this component does not have other behavior.
|
|
8
|
+
*/
|
|
9
|
+
exports.DialogBody = React.forwardRef(function (props, ref) {
|
|
10
|
+
var state = useDialogBody_1.useDialogBody_unstable(props, ref);
|
|
11
|
+
useDialogBodyStyles_1.useDialogBodyStyles_unstable(state);
|
|
12
|
+
return renderDialogBody_1.renderDialogBody_unstable(state);
|
|
13
|
+
});
|
|
14
|
+
exports.DialogBody.displayName = 'DialogBody';
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=DialogBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogBody.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogBody/DialogBody.tsx"],"names":[],"mappings":";;;;IAOA;;;OAGG;IACU,QAAA,UAAU,GAAyC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC1F,IAAM,KAAK,GAAG,sCAAsB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEjD,kDAA4B,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,4CAAyB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import * as React from 'react';\nimport { useDialogBody_unstable } from './useDialogBody';\nimport { renderDialogBody_unstable } from './renderDialogBody';\nimport { useDialogBodyStyles_unstable } from './useDialogBodyStyles';\nimport type { DialogBodyProps } from './DialogBody.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogBody` is a container where the content of the dialog is rendered.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogBody: ForwardRefComponent<DialogBodyProps> = React.forwardRef((props, ref) => {\n const state = useDialogBody_unstable(props, ref);\n\n useDialogBodyStyles_unstable(state);\n return renderDialogBody_unstable(state);\n});\n\nDialogBody.displayName = 'DialogBody';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogBody.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogBody/DialogBody.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogBodySlots = {\n root: Slot<'div'>;\n};\n\n/**\n * DialogBody Props\n */\nexport type DialogBodyProps = ComponentProps<DialogBodySlots> & {};\n\n/**\n * State used in rendering DialogBody\n */\nexport type DialogBodyState = ComponentState<DialogBodySlots>;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./DialogBody", "./DialogBody.types", "./renderDialogBody", "./useDialogBody", "./useDialogBodyStyles"], function (require, exports, tslib_1, DialogBody_1, DialogBody_types_1, renderDialogBody_1, useDialogBody_1, useDialogBodyStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(DialogBody_1, exports);
|
|
5
|
+
tslib_1.__exportStar(DialogBody_types_1, exports);
|
|
6
|
+
tslib_1.__exportStar(renderDialogBody_1, exports);
|
|
7
|
+
tslib_1.__exportStar(useDialogBody_1, exports);
|
|
8
|
+
tslib_1.__exportStar(useDialogBodyStyles_1, exports);
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogBody/index.ts"],"names":[],"mappings":";;;IAAA,4CAA6B;IAC7B,kDAAmC;IACnC,kDAAmC;IACnC,+CAAgC;IAChC,qDAAsC","sourcesContent":["export * from './DialogBody';\nexport * from './DialogBody.types';\nexport * from './renderDialogBody';\nexport * from './useDialogBody';\nexport * from './useDialogBodyStyles';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.renderDialogBody_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Render the final JSX of DialogBody
|
|
7
|
+
*/
|
|
8
|
+
var renderDialogBody_unstable = function (state) {
|
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
+
// TODO Add additional slots in the appropriate place
|
|
11
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root));
|
|
12
|
+
};
|
|
13
|
+
exports.renderDialogBody_unstable = renderDialogBody_unstable;
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=renderDialogBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderDialogBody.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogBody/renderDialogBody.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,yBAAyB,GAAG,UAAC,KAAsB;QACxD,IAAA,KAAuB,0BAAQ,CAAkB,KAAK,CAAC,EAArD,KAAK,WAAA,EAAE,SAAS,eAAqC,CAAC;QAE9D,qDAAqD;QACrD,OAAO,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CAAC;IAC5C,CAAC,CAAC;IALW,QAAA,yBAAyB,6BAKpC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogBodyState, DialogBodySlots } from './DialogBody.types';\n\n/**\n * Render the final JSX of DialogBody\n */\nexport const renderDialogBody_unstable = (state: DialogBodyState) => {\n const { slots, slotProps } = getSlots<DialogBodySlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDialogBody_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render DialogBody.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useDialogBodyStyles_unstable,
|
|
9
|
+
* before being passed to renderDialogBody_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of DialogBody
|
|
12
|
+
* @param ref - reference to root HTMLElement of DialogBody
|
|
13
|
+
*/
|
|
14
|
+
var useDialogBody_unstable = function (props, ref) {
|
|
15
|
+
var _a;
|
|
16
|
+
return {
|
|
17
|
+
components: {
|
|
18
|
+
root: 'div',
|
|
19
|
+
},
|
|
20
|
+
root: react_utilities_1.getNativeElementProps((_a = props.as) !== null && _a !== void 0 ? _a : 'div', tslib_1.__assign({ ref: ref }, props)),
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
exports.useDialogBody_unstable = useDialogBody_unstable;
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=useDialogBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogBody.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogBody/useDialogBody.ts"],"names":[],"mappings":";;;;IAIA;;;;;;;;OAQG;IACI,IAAM,sBAAsB,GAAG,UAAC,KAAsB,EAAE,GAA2B;;QACxF,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;aACZ;YACD,IAAI,EAAE,uCAAqB,CAAC,MAAA,KAAK,CAAC,EAAE,mCAAI,KAAK,qBAC3C,GAAG,KAAA,IACA,KAAK,EACR;SACH,CAAC;IACJ,CAAC,CAAC;IAVW,QAAA,sBAAsB,0BAUjC","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogBodyProps, DialogBodyState } from './DialogBody.types';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogBody_unstable = (props: DialogBodyProps, ref: React.Ref<HTMLElement>): DialogBodyState => {\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps(props.as ?? 'div', {\n ref,\n ...props,\n }),\n };\n};\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@griffel/react", "../../contexts"], function (require, exports, tslib_1, react_1, contexts_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
var _a;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.useDialogBodyStyles_unstable = exports.dialogBodyClassNames = void 0;
|
|
6
|
+
exports.dialogBodyClassNames = {
|
|
7
|
+
root: 'fui-DialogBody',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Styles for the root slot
|
|
11
|
+
*/
|
|
12
|
+
var useStyles = react_1.makeStyles({
|
|
13
|
+
root: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ display: 'grid', '&::backdrop': {
|
|
14
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
15
|
+
}, width: "100%", height: 'fit-content', maxWidth: '600px', maxHeight: "calc(100vh - 2 * " + contexts_1.SURFACE_PADDING + ")", boxSizing: 'border-box', gridTemplateRows: 'auto 1fr auto', gridTemplateColumns: '1fr 1fr auto', gridTemplateAreas: "\n \"" + contexts_1.TITLE_GRID_AREA + " " + contexts_1.TITLE_GRID_AREA + " " + contexts_1.TITLE_ACTION_GRID_AREA + "\"\n \"" + contexts_1.CONTENT_GRID_AREA + " " + contexts_1.CONTENT_GRID_AREA + " " + contexts_1.CONTENT_GRID_AREA + "\"\n \"" + contexts_1.ACTIONS_START_GRID_AREA + " " + contexts_1.ACTIONS_END_GRID_AREA + " " + contexts_1.ACTIONS_END_GRID_AREA + "\"\n " }, react_1.shorthands.overflow('unset')), react_1.shorthands.gap(contexts_1.DIALOG_GAP)), (_a = {}, _a[contexts_1.MEDIA_QUERY_BREAKPOINT_SELECTOR] = {
|
|
16
|
+
maxWidth: '100vw',
|
|
17
|
+
gridTemplateRows: 'auto 1fr auto auto',
|
|
18
|
+
gridTemplateAreas: "\n \"" + contexts_1.TITLE_GRID_AREA + " " + contexts_1.TITLE_GRID_AREA + " " + contexts_1.TITLE_ACTION_GRID_AREA + "\"\n \"" + contexts_1.CONTENT_GRID_AREA + " " + contexts_1.CONTENT_GRID_AREA + " " + contexts_1.CONTENT_GRID_AREA + "\"\n \"" + contexts_1.ACTIONS_START_GRID_AREA + " " + contexts_1.ACTIONS_START_GRID_AREA + " " + contexts_1.ACTIONS_START_GRID_AREA + "\"\n \"" + contexts_1.ACTIONS_END_GRID_AREA + " " + contexts_1.ACTIONS_END_GRID_AREA + " " + contexts_1.ACTIONS_END_GRID_AREA + "\"\n ",
|
|
19
|
+
}, _a)),
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Apply styling to the DialogBody slots based on the state
|
|
23
|
+
*/
|
|
24
|
+
var useDialogBodyStyles_unstable = function (state) {
|
|
25
|
+
var styles = useStyles();
|
|
26
|
+
state.root.className = react_1.mergeClasses(exports.dialogBodyClassNames.root, styles.root, state.root.className);
|
|
27
|
+
return state;
|
|
28
|
+
};
|
|
29
|
+
exports.useDialogBodyStyles_unstable = useDialogBodyStyles_unstable;
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=useDialogBodyStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogBodyStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogBody/useDialogBodyStyles.ts"],"names":[],"mappings":";;;;;IAca,QAAA,oBAAoB,GAAoC;QACnE,IAAI,EAAE,gBAAgB;KACvB,CAAC;IAEF;;OAEG;IACH,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,uDACF,OAAO,EAAE,MAAM,EACf,aAAa,EAAE;gBACb,eAAe,EAAE,oBAAoB;aACtC,EACD,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,sBAAoB,0BAAe,MAAG,EACjD,SAAS,EAAE,YAAY,EACvB,gBAAgB,EAAE,eAAe,EACjC,mBAAmB,EAAE,cAAc,EACnC,iBAAiB,EAAE,aAChB,0BAAe,SAAI,0BAAe,SAAI,iCAAsB,kBAC5D,4BAAiB,SAAI,4BAAiB,SAAI,4BAAiB,kBAC3D,kCAAuB,SAAI,gCAAqB,SAAI,gCAAqB,aAC3E,IACE,kBAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,GAC5B,kBAAU,CAAC,GAAG,CAAC,qBAAU,CAAC,gBAC5B,0CAA+B,IAAG;YACjC,QAAQ,EAAE,OAAO;YACjB,gBAAgB,EAAE,oBAAoB;YACtC,iBAAiB,EAAE,iBACd,0BAAe,SAAI,0BAAe,SAAI,iCAAsB,sBAC5D,4BAAiB,SAAI,4BAAiB,SAAI,4BAAiB,sBAC3D,kCAAuB,SAAI,kCAAuB,SAAI,kCAAuB,sBAC7E,gCAAqB,SAAI,gCAAqB,SAAI,gCAAqB,eAC3E;SACF,MACF;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,4BAA4B,GAAG,UAAC,KAAsB;QACjE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,4BAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAElG,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IALW,QAAA,4BAA4B,gCAKvC","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogBodySlots, DialogBodyState } from './DialogBody.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport {\n ACTIONS_END_GRID_AREA,\n ACTIONS_START_GRID_AREA,\n CONTENT_GRID_AREA,\n DIALOG_GAP,\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n SURFACE_PADDING,\n TITLE_ACTION_GRID_AREA,\n TITLE_GRID_AREA,\n} from '../../contexts';\n\nexport const dialogBodyClassNames: SlotClassNames<DialogBodySlots> = {\n root: 'fui-DialogBody',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'grid',\n '&::backdrop': {\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n },\n width: `100%`,\n height: 'fit-content',\n maxWidth: '600px',\n maxHeight: `calc(100vh - 2 * ${SURFACE_PADDING})`,\n boxSizing: 'border-box',\n gridTemplateRows: 'auto 1fr auto',\n gridTemplateColumns: '1fr 1fr auto',\n gridTemplateAreas: `\n \"${TITLE_GRID_AREA} ${TITLE_GRID_AREA} ${TITLE_ACTION_GRID_AREA}\"\n \"${CONTENT_GRID_AREA} ${CONTENT_GRID_AREA} ${CONTENT_GRID_AREA}\"\n \"${ACTIONS_START_GRID_AREA} ${ACTIONS_END_GRID_AREA} ${ACTIONS_END_GRID_AREA}\"\n `,\n ...shorthands.overflow('unset'),\n ...shorthands.gap(DIALOG_GAP),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n maxWidth: '100vw',\n gridTemplateRows: 'auto 1fr auto auto',\n gridTemplateAreas: `\n \"${TITLE_GRID_AREA} ${TITLE_GRID_AREA} ${TITLE_ACTION_GRID_AREA}\"\n \"${CONTENT_GRID_AREA} ${CONTENT_GRID_AREA} ${CONTENT_GRID_AREA}\"\n \"${ACTIONS_START_GRID_AREA} ${ACTIONS_START_GRID_AREA} ${ACTIONS_START_GRID_AREA}\"\n \"${ACTIONS_END_GRID_AREA} ${ACTIONS_END_GRID_AREA} ${ACTIONS_END_GRID_AREA}\"\n `,\n },\n },\n});\n\n/**\n * Apply styling to the DialogBody slots based on the state\n */\nexport const useDialogBodyStyles_unstable = (state: DialogBodyState): DialogBodyState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogBodyClassNames.root, styles.root, state.root.className);\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
define(["require", "exports", "react", "./useDialogContent", "./renderDialogContent", "./useDialogContentStyles"], function (require, exports, React, useDialogContent_1, renderDialogContent_1, useDialogContentStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DialogContent = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* The `DialogContent` is a container where the content of the dialog is rendered.
|
|
7
|
+
* Apart from styling, this component does not have other behavior.
|
|
8
|
+
*/
|
|
9
|
+
exports.DialogContent = React.forwardRef(function (props, ref) {
|
|
10
|
+
var state = useDialogContent_1.useDialogContent_unstable(props, ref);
|
|
11
|
+
useDialogContentStyles_1.useDialogContentStyles_unstable(state);
|
|
12
|
+
return renderDialogContent_1.renderDialogContent_unstable(state);
|
|
13
|
+
});
|
|
14
|
+
exports.DialogContent.displayName = 'DialogContent';
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=DialogContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogContent.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogContent/DialogContent.tsx"],"names":[],"mappings":";;;;IAOA;;;OAGG;IACU,QAAA,aAAa,GAA4C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChG,IAAM,KAAK,GAAG,4CAAyB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEpD,wDAA+B,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,kDAA4B,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import * as React from 'react';\nimport { useDialogContent_unstable } from './useDialogContent';\nimport { renderDialogContent_unstable } from './renderDialogContent';\nimport { useDialogContentStyles_unstable } from './useDialogContentStyles';\nimport type { DialogContentProps } from './DialogContent.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogContent` is a container where the content of the dialog is rendered.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogContent: ForwardRefComponent<DialogContentProps> = React.forwardRef((props, ref) => {\n const state = useDialogContent_unstable(props, ref);\n\n useDialogContentStyles_unstable(state);\n return renderDialogContent_unstable(state);\n});\n\nDialogContent.displayName = 'DialogContent';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogContent.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogContent/DialogContent.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogContentSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * DialogContent Props\n */\nexport type DialogContentProps = ComponentProps<DialogContentSlots>;\n\n/**\n * State used in rendering DialogContent\n */\nexport type DialogContentState = ComponentState<DialogContentSlots>;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./DialogContent", "./DialogContent.types", "./renderDialogContent", "./useDialogContent", "./useDialogContentStyles"], function (require, exports, tslib_1, DialogContent_1, DialogContent_types_1, renderDialogContent_1, useDialogContent_1, useDialogContentStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(DialogContent_1, exports);
|
|
5
|
+
tslib_1.__exportStar(DialogContent_types_1, exports);
|
|
6
|
+
tslib_1.__exportStar(renderDialogContent_1, exports);
|
|
7
|
+
tslib_1.__exportStar(useDialogContent_1, exports);
|
|
8
|
+
tslib_1.__exportStar(useDialogContentStyles_1, exports);
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogContent/index.ts"],"names":[],"mappings":";;;IAAA,+CAAgC;IAChC,qDAAsC;IACtC,qDAAsC;IACtC,kDAAmC;IACnC,wDAAyC","sourcesContent":["export * from './DialogContent';\nexport * from './DialogContent.types';\nexport * from './renderDialogContent';\nexport * from './useDialogContent';\nexport * from './useDialogContentStyles';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.renderDialogContent_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Render the final JSX of DialogContent
|
|
7
|
+
*/
|
|
8
|
+
var renderDialogContent_unstable = function (state) {
|
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root));
|
|
11
|
+
};
|
|
12
|
+
exports.renderDialogContent_unstable = renderDialogContent_unstable;
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=renderDialogContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderDialogContent.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,4BAA4B,GAAG,UAAC,KAAyB;QAC9D,IAAA,KAAuB,0BAAQ,CAAqB,KAAK,CAAC,EAAxD,KAAK,WAAA,EAAE,SAAS,eAAwC,CAAC;QAEjE,OAAO,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CAAC;IAC5C,CAAC,CAAC;IAJW,QAAA,4BAA4B,gCAIvC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogContentState, DialogContentSlots } from './DialogContent.types';\n\n/**\n * Render the final JSX of DialogContent\n */\nexport const renderDialogContent_unstable = (state: DialogContentState) => {\n const { slots, slotProps } = getSlots<DialogContentSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDialogContent_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render DialogBody.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useDialogBodyStyles_unstable,
|
|
9
|
+
* before being passed to renderDialogBody_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of DialogBody
|
|
12
|
+
* @param ref - reference to root HTMLElement of DialogBody
|
|
13
|
+
*/
|
|
14
|
+
var useDialogContent_unstable = function (props, ref) {
|
|
15
|
+
var _a;
|
|
16
|
+
return {
|
|
17
|
+
components: {
|
|
18
|
+
root: 'div',
|
|
19
|
+
},
|
|
20
|
+
root: react_utilities_1.getNativeElementProps((_a = props.as) !== null && _a !== void 0 ? _a : 'div', tslib_1.__assign({ ref: ref }, props)),
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
exports.useDialogContent_unstable = useDialogContent_unstable;
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=useDialogContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogContent.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogContent/useDialogContent.ts"],"names":[],"mappings":";;;;IAIA;;;;;;;;OAQG;IACI,IAAM,yBAAyB,GAAG,UACvC,KAAyB,EACzB,GAA2B;;QAE3B,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;aACZ;YACD,IAAI,EAAE,uCAAqB,CAAC,MAAA,KAAK,CAAC,EAAE,mCAAI,KAAK,qBAC3C,GAAG,KAAA,IACA,KAAK,EACR;SACH,CAAC;IACJ,CAAC,CAAC;IAbW,QAAA,yBAAyB,6BAapC","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { DialogContentProps, DialogContentState } from './DialogContent.types';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogContent_unstable = (\n props: DialogContentProps,\n ref: React.Ref<HTMLElement>,\n): DialogContentState => {\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps(props.as ?? 'div', {\n ref,\n ...props,\n }),\n };\n};\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@griffel/react", "../../contexts/constants", "@fluentui/react-theme"], function (require, exports, tslib_1, react_1, constants_1, react_theme_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDialogContentStyles_unstable = exports.dialogContentClassNames = void 0;
|
|
5
|
+
exports.dialogContentClassNames = {
|
|
6
|
+
root: 'fui-DialogContent',
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Styles for the root slot
|
|
10
|
+
*/
|
|
11
|
+
var useStyles = react_1.makeStyles({
|
|
12
|
+
root: tslib_1.__assign(tslib_1.__assign({ width: '100%', height: '100%', overflowY: 'auto', minHeight: '32px', boxSizing: 'border-box' }, react_1.shorthands.gridArea(constants_1.CONTENT_GRID_AREA)), react_theme_1.typographyStyles.body1),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Apply styling to the DialogContent slots based on the state
|
|
16
|
+
*/
|
|
17
|
+
var useDialogContentStyles_unstable = function (state) {
|
|
18
|
+
var styles = useStyles();
|
|
19
|
+
state.root.className = react_1.mergeClasses(exports.dialogContentClassNames.root, styles.root, state.root.className);
|
|
20
|
+
return state;
|
|
21
|
+
};
|
|
22
|
+
exports.useDialogContentStyles_unstable = useDialogContentStyles_unstable;
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=useDialogContentStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogContentStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogContent/useDialogContentStyles.ts"],"names":[],"mappings":";;;;IAMa,QAAA,uBAAuB,GAAuC;QACzE,IAAI,EAAE,mBAAmB;KAC1B,CAAC;IAEF;;OAEG;IACH,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,sCACF,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,YAAY,IACpB,kBAAU,CAAC,QAAQ,CAAC,6BAAiB,CAAC,GACtC,8BAAgB,CAAC,KAAK,CAC1B;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,+BAA+B,GAAG,UAAC,KAAyB;QACvE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,+BAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrG,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAJW,QAAA,+BAA+B,mCAI1C","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogContentSlots, DialogContentState } from './DialogContent.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { CONTENT_GRID_AREA } from '../../contexts/constants';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const dialogContentClassNames: SlotClassNames<DialogContentSlots> = {\n root: 'fui-DialogContent',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n overflowY: 'auto',\n minHeight: '32px',\n boxSizing: 'border-box',\n ...shorthands.gridArea(CONTENT_GRID_AREA),\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Apply styling to the DialogContent slots based on the state\n */\nexport const useDialogContentStyles_unstable = (state: DialogContentState): DialogContentState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogContentClassNames.root, styles.root, state.root.className);\n return state;\n};\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
define(["require", "exports", "react", "./useDialogSurface", "./renderDialogSurface", "./useDialogSurfaceStyles", "./useDialogSurfaceContextValues"], function (require, exports, React, useDialogSurface_1, renderDialogSurface_1, useDialogSurfaceStyles_1, useDialogSurfaceContextValues_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DialogSurface = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* DialogSurface component represents the visual part of a `Dialog` as a whole,
|
|
7
|
+
* it contains everything that should be visible.
|
|
8
|
+
*/
|
|
9
|
+
exports.DialogSurface = React.forwardRef(function (props, ref) {
|
|
10
|
+
var state = useDialogSurface_1.useDialogSurface_unstable(props, ref);
|
|
11
|
+
var contextValues = useDialogSurfaceContextValues_1.useDialogSurfaceContextValues_unstable(state);
|
|
12
|
+
useDialogSurfaceStyles_1.useDialogSurfaceStyles_unstable(state);
|
|
13
|
+
return renderDialogSurface_1.renderDialogSurface_unstable(state, contextValues);
|
|
14
|
+
});
|
|
15
|
+
exports.DialogSurface.displayName = 'DialogSurface';
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=DialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogSurface.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/DialogSurface.tsx"],"names":[],"mappings":";;;;IAQA;;;OAGG;IACU,QAAA,aAAa,GAA4C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChG,IAAM,KAAK,GAAG,4CAAyB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACpD,IAAM,aAAa,GAAG,sEAAsC,CAAC,KAAK,CAAC,CAAC;QAEpE,wDAA+B,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,kDAA4B,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import * as React from 'react';\nimport { useDialogSurface_unstable } from './useDialogSurface';\nimport { renderDialogSurface_unstable } from './renderDialogSurface';\nimport { useDialogSurfaceStyles_unstable } from './useDialogSurfaceStyles';\nimport type { DialogSurfaceProps } from './DialogSurface.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useDialogSurfaceContextValues_unstable } from './useDialogSurfaceContextValues';\n\n/**\n * DialogSurface component represents the visual part of a `Dialog` as a whole,\n * it contains everything that should be visible.\n */\nexport const DialogSurface: ForwardRefComponent<DialogSurfaceProps> = React.forwardRef((props, ref) => {\n const state = useDialogSurface_unstable(props, ref);\n const contextValues = useDialogSurfaceContextValues_unstable(state);\n\n useDialogSurfaceStyles_unstable(state);\n return renderDialogSurface_unstable(state, contextValues);\n});\n\nDialogSurface.displayName = 'DialogSurface';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogSurface.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/DialogSurface.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { DialogSurfaceContextValue } from '../../contexts';\n\nexport type DialogSurfaceSlots = {\n /**\n * Dimmed background of dialog.\n * The default backdrop is rendered as a `<div>` with styling.\n * This slot expects a `<div>` element which will replace the default backdrop.\n * The backdrop should have `aria-hidden=\"true\"`.\n *\n * By default if `DialogSurface` is `<dialog>` element the backdrop is ignored,\n * since native `<dialog>` element supports [::backdrop](https://developer.mozilla.org/en-US/docs/Web/CSS/::backdrop)\n */\n backdrop?: Slot<'div'>;\n root: Slot<'div'>;\n};\n\n/**\n * Union between all possible semantic element that represent a DialogSurface\n */\nexport type DialogSurfaceElement = HTMLDialogElement | HTMLDivElement;\n\n/** @internal */\nexport type DialogSurfaceElementIntersection = HTMLDialogElement & HTMLDivElement;\n\n/**\n * DialogSurface Props\n *\n * Omits basic types from native `dialog` (`open`, `onCancel` and `onClose`)\n * to ensure `onOpenChange`, `open` and `defaultOpen` from `Dialog` is used instead\n */\nexport type DialogSurfaceProps = Omit<ComponentProps<DialogSurfaceSlots>, 'open' | 'onCancel' | 'onClose'>;\n\nexport type DialogSurfaceContextValues = {\n dialogSurface: DialogSurfaceContextValue;\n};\n\n/**\n * State used in rendering DialogSurface\n */\nexport type DialogSurfaceState = ComponentState<DialogSurfaceSlots>;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./DialogSurface", "./DialogSurface.types", "./renderDialogSurface", "./useDialogSurface", "./useDialogSurfaceStyles"], function (require, exports, tslib_1, DialogSurface_1, DialogSurface_types_1, renderDialogSurface_1, useDialogSurface_1, useDialogSurfaceStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(DialogSurface_1, exports);
|
|
5
|
+
tslib_1.__exportStar(DialogSurface_types_1, exports);
|
|
6
|
+
tslib_1.__exportStar(renderDialogSurface_1, exports);
|
|
7
|
+
tslib_1.__exportStar(useDialogSurface_1, exports);
|
|
8
|
+
tslib_1.__exportStar(useDialogSurfaceStyles_1, exports);
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/index.ts"],"names":[],"mappings":";;;IAAA,+CAAgC;IAChC,qDAAsC;IACtC,qDAAsC;IACtC,kDAAmC;IACnC,wDAAyC","sourcesContent":["export * from './DialogSurface';\nexport * from './DialogSurface.types';\nexport * from './renderDialogSurface';\nexport * from './useDialogSurface';\nexport * from './useDialogSurfaceStyles';\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "../../contexts", "@fluentui/react-portal"], function (require, exports, tslib_1, React, react_utilities_1, contexts_1, react_portal_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.renderDialogSurface_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Render the final JSX of DialogSurface
|
|
7
|
+
*/
|
|
8
|
+
var renderDialogSurface_unstable = function (state, contextValues) {
|
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
+
return (React.createElement(react_portal_1.Portal, null,
|
|
11
|
+
slots.backdrop && React.createElement(slots.backdrop, tslib_1.__assign({}, slotProps.backdrop)),
|
|
12
|
+
React.createElement(contexts_1.DialogSurfaceProvider, { value: contextValues.dialogSurface },
|
|
13
|
+
React.createElement(slots.root, tslib_1.__assign({}, slotProps.root)))));
|
|
14
|
+
};
|
|
15
|
+
exports.renderDialogSurface_unstable = renderDialogSurface_unstable;
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=renderDialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderDialogSurface.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx"],"names":[],"mappings":";;;;IAMA;;OAEG;IACI,IAAM,4BAA4B,GAAG,UAAC,KAAyB,EAAE,aAAyC;QACzG,IAAA,KAAuB,0BAAQ,CAAqB,KAAK,CAAC,EAAxD,KAAK,WAAA,EAAE,SAAS,eAAwC,CAAC;QAEjE,OAAO,CACL,oBAAC,qBAAM;YACJ,KAAK,CAAC,QAAQ,IAAI,oBAAC,KAAK,CAAC,QAAQ,uBAAK,SAAS,CAAC,QAAQ,EAAI;YAC7D,oBAAC,gCAAqB,IAAC,KAAK,EAAE,aAAa,CAAC,aAAa;gBACvD,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACZ,CACjB,CACV,CAAC;IACJ,CAAC,CAAC;IAXW,QAAA,4BAA4B,gCAWvC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\nimport { DialogSurfaceProvider } from '../../contexts';\nimport { Portal } from '@fluentui/react-portal';\n\n/**\n * Render the final JSX of DialogSurface\n */\nexport const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {\n const { slots, slotProps } = getSlots<DialogSurfaceSlots>(state);\n\n return (\n <Portal>\n {slots.backdrop && <slots.backdrop {...slotProps.backdrop} />}\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <slots.root {...slotProps.root} />\n </DialogSurfaceProvider>\n </Portal>\n );\n};\n"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities", "../../contexts", "../../utils", "@fluentui/react-tabster"], function (require, exports, tslib_1, react_utilities_1, contexts_1, utils_1, react_tabster_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDialogSurface_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render DialogSurface.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,
|
|
9
|
+
* before being passed to renderDialogSurface_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of DialogSurface
|
|
12
|
+
* @param ref - reference to root HTMLElement of DialogSurface
|
|
13
|
+
*/
|
|
14
|
+
var useDialogSurface_unstable = function (props, ref) {
|
|
15
|
+
var backdrop = props.backdrop, as = props.as;
|
|
16
|
+
var modalType = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.modalType; });
|
|
17
|
+
var dialogRef = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.dialogRef; });
|
|
18
|
+
var open = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.open; });
|
|
19
|
+
var requestOpenChange = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.requestOpenChange; });
|
|
20
|
+
var dialogTitleID = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.dialogTitleId; });
|
|
21
|
+
var handledBackdropClick = react_utilities_1.useEventCallback(function (event) {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
if (react_utilities_1.isResolvedShorthand(props.backdrop)) {
|
|
24
|
+
(_b = (_a = props.backdrop).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
25
|
+
}
|
|
26
|
+
if (modalType === 'modal' && !event.isDefaultPrevented()) {
|
|
27
|
+
requestOpenChange({
|
|
28
|
+
event: event,
|
|
29
|
+
open: false,
|
|
30
|
+
type: 'backdropClick',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
var handleKeyDown = react_utilities_1.useEventCallback(function (event) {
|
|
35
|
+
var _a;
|
|
36
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
37
|
+
if (utils_1.isEscapeKeyDismiss(event, modalType)) {
|
|
38
|
+
requestOpenChange({
|
|
39
|
+
event: event,
|
|
40
|
+
open: false,
|
|
41
|
+
type: 'escapeKeyDown',
|
|
42
|
+
});
|
|
43
|
+
// stop propagation to avoid conflicting with other elements that listen for `Escape`
|
|
44
|
+
// e,g: nested Dialog, Popover, Menu and Tooltip
|
|
45
|
+
event.stopPropagation();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var modalAttributes = react_tabster_1.useModalAttributes({ trapFocus: modalType !== 'non-modal' }).modalAttributes;
|
|
49
|
+
return {
|
|
50
|
+
components: {
|
|
51
|
+
backdrop: 'div',
|
|
52
|
+
root: 'div',
|
|
53
|
+
},
|
|
54
|
+
backdrop: react_utilities_1.resolveShorthand(backdrop, {
|
|
55
|
+
required: open && modalType !== 'non-modal',
|
|
56
|
+
defaultProps: {
|
|
57
|
+
'aria-hidden': 'true',
|
|
58
|
+
onClick: handledBackdropClick,
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
root: react_utilities_1.getNativeElementProps(as !== null && as !== void 0 ? as : 'div', tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ tabIndex: -1, 'aria-modal': modalType !== 'non-modal', role: modalType === 'alert' ? 'alertdialog' : 'dialog', 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID }, props), modalAttributes), { onKeyDown: handleKeyDown, ref: react_utilities_1.useMergedRefs(ref, dialogRef) })),
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
exports.useDialogSurface_unstable = useDialogSurface_unstable;
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=useDialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogSurface.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurface.ts"],"names":[],"mappings":";;;;IAkBA;;;;;;;;OAQG;IACI,IAAM,yBAAyB,GAAG,UACvC,KAAyB,EACzB,GAAoC;QAE5B,IAAA,QAAQ,GAAS,KAAK,SAAd,EAAE,EAAE,GAAK,KAAK,GAAV,CAAW;QAC/B,IAAM,SAAS,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,EAAb,CAAa,CAAC,CAAC;QAClE,IAAM,SAAS,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,EAAb,CAAa,CAAC,CAAC;QAClE,IAAM,IAAI,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAR,CAAQ,CAAC,CAAC;QACxD,IAAM,iBAAiB,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,iBAAiB,EAArB,CAAqB,CAAC,CAAC;QAClF,IAAM,aAAa,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,aAAa,EAAjB,CAAiB,CAAC,CAAC;QAE1E,IAAM,oBAAoB,GAAG,kCAAgB,CAAC,UAAC,KAAuC;;YACpF,IAAI,qCAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;gBACvC,MAAA,MAAA,KAAK,CAAC,QAAQ,EAAC,OAAO,mDAAG,KAAK,CAAC,CAAC;aACjC;YACD,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE;gBACxD,iBAAiB,CAAC;oBAChB,KAAK,OAAA;oBACL,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,eAAe;iBACtB,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;QAEH,IAAM,aAAa,GAAG,kCAAgB,CAAC,UAAC,KAA4D;;YAClG,MAAA,KAAK,CAAC,SAAS,+CAAf,KAAK,EAAa,KAAK,CAAC,CAAC;YAEzB,IAAI,0BAAkB,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE;gBACxC,iBAAiB,CAAC;oBAChB,KAAK,OAAA;oBACL,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,eAAe;iBACtB,CAAC,CAAC;gBACH,qFAAqF;gBACrF,gDAAgD;gBAChD,KAAK,CAAC,eAAe,EAAE,CAAC;aACzB;QACH,CAAC,CAAC,CAAC;QAEK,IAAA,eAAe,GAAK,kCAAkB,CAAC,EAAE,SAAS,EAAE,SAAS,KAAK,WAAW,EAAE,CAAC,gBAAjE,CAAkE;QAEzF,OAAO;YACL,UAAU,EAAE;gBACV,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,KAAK;aACZ;YACD,QAAQ,EAAE,kCAAgB,CAAC,QAAQ,EAAE;gBACnC,QAAQ,EAAE,IAAI,IAAI,SAAS,KAAK,WAAW;gBAC3C,YAAY,EAAE;oBACZ,aAAa,EAAE,MAAM;oBACrB,OAAO,EAAE,oBAAoB;iBAC9B;aACF,CAAC;YACF,IAAI,EAAE,uCAAqB,CAAC,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,KAAK,uDACrC,QAAQ,EAAE,CAAC,CAAC,EACZ,YAAY,EAAE,SAAS,KAAK,WAAW,EACvC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,EACtD,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,IAC/D,KAAK,GACL,eAAe,KAClB,SAAS,EAAE,aAAa,EACxB,GAAG,EAAE,+BAAa,CAAC,GAAG,EAAE,SAAS,CAAC,IAClC;SACH,CAAC;IACJ,CAAC,CAAC;IAhEW,QAAA,yBAAyB,6BAgEpC","sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n resolveShorthand,\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n} from '@fluentui/react-utilities';\nimport type {\n DialogSurfaceElement,\n DialogSurfaceElementIntersection,\n DialogSurfaceProps,\n DialogSurfaceState,\n} from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { isEscapeKeyDismiss } from '../../utils';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */\nexport const useDialogSurface_unstable = (\n props: DialogSurfaceProps,\n ref: React.Ref<DialogSurfaceElement>,\n): DialogSurfaceState => {\n const { backdrop, as } = props;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);\n const open = useDialogContext_unstable(ctx => ctx.open);\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);\n\n const handledBackdropClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n if (isResolvedShorthand(props.backdrop)) {\n props.backdrop.onClick?.(event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleKeyDown = useEventCallback((event: React.KeyboardEvent<DialogSurfaceElementIntersection>) => {\n props.onKeyDown?.(event);\n\n if (isEscapeKeyDismiss(event, modalType)) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown',\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n\n const { modalAttributes } = useModalAttributes({ trapFocus: modalType !== 'non-modal' });\n\n return {\n components: {\n backdrop: 'div',\n root: 'div',\n },\n backdrop: resolveShorthand(backdrop, {\n required: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n onClick: handledBackdropClick,\n },\n }),\n root: getNativeElementProps(as ?? 'div', {\n tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n ref: useMergedRefs(ref, dialogRef),\n }),\n };\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDialogSurfaceContextValues_unstable = void 0;
|
|
5
|
+
function useDialogSurfaceContextValues_unstable(state) {
|
|
6
|
+
var dialogSurface = true;
|
|
7
|
+
return { dialogSurface: dialogSurface };
|
|
8
|
+
}
|
|
9
|
+
exports.useDialogSurfaceContextValues_unstable = useDialogSurfaceContextValues_unstable;
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=useDialogSurfaceContextValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogSurfaceContextValues.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceContextValues.ts"],"names":[],"mappings":";;;;IAGA,SAAgB,sCAAsC,CAAC,KAAyB;QAC9E,IAAM,aAAa,GAA8B,IAAI,CAAC;QAEtD,OAAO,EAAE,aAAa,eAAA,EAAE,CAAC;IAC3B,CAAC;IAJD,wFAIC","sourcesContent":["import type { DialogSurfaceContextValues, DialogSurfaceState } from './DialogSurface.types';\nimport type { DialogSurfaceContextValue } from '../../contexts';\n\nexport function useDialogSurfaceContextValues_unstable(state: DialogSurfaceState): DialogSurfaceContextValues {\n const dialogSurface: DialogSurfaceContextValue = true;\n\n return { dialogSurface };\n}\n"]}
|