@fluentui/react-dialog 9.0.0-beta.7
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 +328 -0
- package/CHANGELOG.md +152 -0
- package/LICENSE +15 -0
- package/README.md +5 -0
- package/Spec.md +518 -0
- package/assets/AlertDialogKeyboardInteraction.png +0 -0
- package/assets/AlertDialogMouseInteraction.png +0 -0
- package/assets/ModalDialogKeyboardInteraction.png +0 -0
- package/assets/ModalDialogMouseInteraction.png +0 -0
- package/assets/NonModalDialogKeyboardInteraction.png +0 -0
- package/assets/NonModalDialogMouseInteraction.png +0 -0
- package/dist/index.d.ts +406 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/Dialog.js +2 -0
- package/lib/Dialog.js.map +1 -0
- package/lib/DialogActions.js +2 -0
- package/lib/DialogActions.js.map +1 -0
- package/lib/DialogBody.js +2 -0
- package/lib/DialogBody.js.map +1 -0
- package/lib/DialogSurface.js +2 -0
- package/lib/DialogSurface.js.map +1 -0
- package/lib/DialogTitle.js +2 -0
- package/lib/DialogTitle.js.map +1 -0
- package/lib/DialogTrigger.js +2 -0
- package/lib/DialogTrigger.js.map +1 -0
- package/lib/components/Dialog/Dialog.js +21 -0
- package/lib/components/Dialog/Dialog.js.map +1 -0
- package/lib/components/Dialog/Dialog.types.js +2 -0
- package/lib/components/Dialog/Dialog.types.js.map +1 -0
- package/lib/components/Dialog/index.js +6 -0
- package/lib/components/Dialog/index.js.map +1 -0
- package/lib/components/Dialog/renderDialog.js +26 -0
- package/lib/components/Dialog/renderDialog.js.map +1 -0
- package/lib/components/Dialog/useDialog.js +197 -0
- package/lib/components/Dialog/useDialog.js.map +1 -0
- package/lib/components/Dialog/useDialogContextValues.js +31 -0
- package/lib/components/Dialog/useDialogContextValues.js.map +1 -0
- package/lib/components/Dialog/useDialogStyles.js +41 -0
- package/lib/components/Dialog/useDialogStyles.js.map +1 -0
- package/lib/components/DialogActions/DialogActions.js +16 -0
- package/lib/components/DialogActions/DialogActions.js.map +1 -0
- package/lib/components/DialogActions/DialogActions.types.js +2 -0
- package/lib/components/DialogActions/DialogActions.types.js.map +1 -0
- package/lib/components/DialogActions/index.js +6 -0
- package/lib/components/DialogActions/index.js.map +1 -0
- package/lib/components/DialogActions/renderDialogActions.js +16 -0
- package/lib/components/DialogActions/renderDialogActions.js.map +1 -0
- package/lib/components/DialogActions/useDialogActions.js +27 -0
- package/lib/components/DialogActions/useDialogActions.js.map +1 -0
- package/lib/components/DialogActions/useDialogActionsStyles.js +51 -0
- package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -0
- package/lib/components/DialogBody/DialogBody.js +16 -0
- package/lib/components/DialogBody/DialogBody.js.map +1 -0
- package/lib/components/DialogBody/DialogBody.types.js +2 -0
- package/lib/components/DialogBody/DialogBody.types.js.map +1 -0
- package/lib/components/DialogBody/index.js +6 -0
- package/lib/components/DialogBody/index.js.map +1 -0
- package/lib/components/DialogBody/renderDialogBody.js +16 -0
- package/lib/components/DialogBody/renderDialogBody.js.map +1 -0
- package/lib/components/DialogBody/useDialogBody.js +25 -0
- package/lib/components/DialogBody/useDialogBody.js.map +1 -0
- package/lib/components/DialogBody/useDialogBodyStyles.js +42 -0
- package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -0
- package/lib/components/DialogSurface/DialogSurface.js +18 -0
- package/lib/components/DialogSurface/DialogSurface.js.map +1 -0
- package/lib/components/DialogSurface/DialogSurface.types.js +2 -0
- package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -0
- package/lib/components/DialogSurface/index.js +6 -0
- package/lib/components/DialogSurface/index.js.map +1 -0
- package/lib/components/DialogSurface/renderDialogSurface.js +18 -0
- package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -0
- package/lib/components/DialogSurface/useDialogSurface.js +59 -0
- package/lib/components/DialogSurface/useDialogSurface.js.map +1 -0
- package/lib/components/DialogSurface/useDialogSurfaceContextValues.js +7 -0
- package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -0
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js +78 -0
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
- package/lib/components/DialogTitle/DialogTitle.js +17 -0
- package/lib/components/DialogTitle/DialogTitle.js.map +1 -0
- package/lib/components/DialogTitle/DialogTitle.types.js +2 -0
- package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -0
- package/lib/components/DialogTitle/index.js +6 -0
- package/lib/components/DialogTitle/index.js.map +1 -0
- package/lib/components/DialogTitle/renderDialogTitle.js +19 -0
- package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -0
- package/lib/components/DialogTitle/useDialogTitle.js +42 -0
- package/lib/components/DialogTitle/useDialogTitle.js.map +1 -0
- package/lib/components/DialogTitle/useDialogTitleStyles.js +109 -0
- package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -0
- package/lib/components/DialogTrigger/DialogTrigger.js +20 -0
- package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -0
- package/lib/components/DialogTrigger/DialogTrigger.types.js +2 -0
- package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -0
- package/lib/components/DialogTrigger/index.js +5 -0
- package/lib/components/DialogTrigger/index.js.map +1 -0
- package/lib/components/DialogTrigger/renderDialogTrigger.js +7 -0
- package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -0
- package/lib/components/DialogTrigger/useDialogTrigger.js +65 -0
- package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -0
- package/lib/contexts/constants.js +11 -0
- package/lib/contexts/constants.js.map +1 -0
- package/lib/contexts/dialogContext.js +21 -0
- package/lib/contexts/dialogContext.js.map +1 -0
- package/lib/contexts/dialogSurfaceContext.js +10 -0
- package/lib/contexts/dialogSurfaceContext.js.map +1 -0
- package/lib/contexts/index.js +4 -0
- package/lib/contexts/index.js.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/index.js +5 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/isEscapeKeyDown.js +11 -0
- package/lib/utils/isEscapeKeyDown.js.map +1 -0
- package/lib/utils/isTargetDisabled.js +14 -0
- package/lib/utils/isTargetDisabled.js.map +1 -0
- package/lib/utils/localShorthands.js +9 -0
- package/lib/utils/localShorthands.js.map +1 -0
- package/lib/utils/normalizeDefaultPrevented.js +11 -0
- package/lib/utils/normalizeDefaultPrevented.js.map +1 -0
- package/lib-commonjs/Dialog.js +10 -0
- package/lib-commonjs/Dialog.js.map +1 -0
- package/lib-commonjs/DialogActions.js +10 -0
- package/lib-commonjs/DialogActions.js.map +1 -0
- package/lib-commonjs/DialogBody.js +10 -0
- package/lib-commonjs/DialogBody.js.map +1 -0
- package/lib-commonjs/DialogSurface.js +10 -0
- package/lib-commonjs/DialogSurface.js.map +1 -0
- package/lib-commonjs/DialogTitle.js +10 -0
- package/lib-commonjs/DialogTitle.js.map +1 -0
- package/lib-commonjs/DialogTrigger.js +10 -0
- package/lib-commonjs/DialogTrigger.js.map +1 -0
- package/lib-commonjs/components/Dialog/Dialog.js +33 -0
- package/lib-commonjs/components/Dialog/Dialog.js.map +1 -0
- package/lib-commonjs/components/Dialog/Dialog.types.js +6 -0
- package/lib-commonjs/components/Dialog/Dialog.types.js.map +1 -0
- package/lib-commonjs/components/Dialog/index.js +18 -0
- package/lib-commonjs/components/Dialog/index.js.map +1 -0
- package/lib-commonjs/components/Dialog/renderDialog.js +39 -0
- package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -0
- package/lib-commonjs/components/Dialog/useDialog.js +211 -0
- package/lib-commonjs/components/Dialog/useDialog.js.map +1 -0
- package/lib-commonjs/components/Dialog/useDialogContextValues.js +40 -0
- package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -0
- package/lib-commonjs/components/Dialog/useDialogStyles.js +53 -0
- package/lib-commonjs/components/Dialog/useDialogStyles.js.map +1 -0
- package/lib-commonjs/components/DialogActions/DialogActions.js +27 -0
- package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -0
- package/lib-commonjs/components/DialogActions/DialogActions.types.js +6 -0
- package/lib-commonjs/components/DialogActions/DialogActions.types.js.map +1 -0
- package/lib-commonjs/components/DialogActions/index.js +18 -0
- package/lib-commonjs/components/DialogActions/index.js.map +1 -0
- package/lib-commonjs/components/DialogActions/renderDialogActions.js +27 -0
- package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -0
- package/lib-commonjs/components/DialogActions/useDialogActions.js +37 -0
- package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -0
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js +63 -0
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -0
- package/lib-commonjs/components/DialogBody/DialogBody.js +27 -0
- package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -0
- package/lib-commonjs/components/DialogBody/DialogBody.types.js +6 -0
- package/lib-commonjs/components/DialogBody/DialogBody.types.js.map +1 -0
- package/lib-commonjs/components/DialogBody/index.js +18 -0
- package/lib-commonjs/components/DialogBody/index.js.map +1 -0
- package/lib-commonjs/components/DialogBody/renderDialogBody.js +27 -0
- package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -0
- package/lib-commonjs/components/DialogBody/useDialogBody.js +36 -0
- package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -0
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +55 -0
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.js +30 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.types.js +6 -0
- package/lib-commonjs/components/DialogSurface/DialogSurface.types.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/index.js +18 -0
- package/lib-commonjs/components/DialogSurface/index.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +30 -0
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js +72 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js +16 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +90 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.js +28 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.types.js +6 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.types.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/index.js +18 -0
- package/lib-commonjs/components/DialogTitle/index.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +31 -0
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js +56 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +123 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.js +31 -0
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js +6 -0
- package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/index.js +16 -0
- package/lib-commonjs/components/DialogTrigger/index.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js +16 -0
- package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -0
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +80 -0
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -0
- package/lib-commonjs/contexts/constants.js +17 -0
- package/lib-commonjs/contexts/constants.js.map +1 -0
- package/lib-commonjs/contexts/dialogContext.js +32 -0
- package/lib-commonjs/contexts/dialogContext.js.map +1 -0
- package/lib-commonjs/contexts/dialogSurfaceContext.js +21 -0
- package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -0
- package/lib-commonjs/contexts/index.js +14 -0
- package/lib-commonjs/contexts/index.js.map +1 -0
- package/lib-commonjs/index.js +193 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/utils/index.js +16 -0
- package/lib-commonjs/utils/index.js.map +1 -0
- package/lib-commonjs/utils/isEscapeKeyDown.js +22 -0
- package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -0
- package/lib-commonjs/utils/isTargetDisabled.js +23 -0
- package/lib-commonjs/utils/isTargetDisabled.js.map +1 -0
- package/lib-commonjs/utils/localShorthands.js +18 -0
- package/lib-commonjs/utils/localShorthands.js.map +1 -0
- package/lib-commonjs/utils/normalizeDefaultPrevented.js +20 -0
- package/lib-commonjs/utils/normalizeDefaultPrevented.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogSurface/renderDialogSurface.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,UAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,4BAA4B,GAAG,CAAC,KAAD,EAA4B,aAA5B,KAAyE;EACnH,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA6B,KAA7B,CAA7B;EAEA,OACE,KAAA,CAAA,aAAA,CAAC,UAAA,CAAA,qBAAD,EAAsB;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAAtB,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADF,CADF;AAKD,CARM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\nimport { DialogSurfaceProvider } from '../../contexts';\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 <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <slots.root {...slotProps.root} />\n </DialogSurfaceProvider>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogSurface_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
9
|
+
|
|
10
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
11
|
+
|
|
12
|
+
const contexts_1 = /*#__PURE__*/require("../../contexts");
|
|
13
|
+
|
|
14
|
+
const utils_1 = /*#__PURE__*/require("../../utils");
|
|
15
|
+
/**
|
|
16
|
+
* Create the state required to render DialogSurface.
|
|
17
|
+
*
|
|
18
|
+
* The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,
|
|
19
|
+
* before being passed to renderDialogSurface_unstable.
|
|
20
|
+
*
|
|
21
|
+
* @param props - props from this instance of DialogSurface
|
|
22
|
+
* @param ref - reference to root HTMLElement of DialogSurface
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const useDialogSurface_unstable = (props, ref) => {
|
|
27
|
+
const modalType = contexts_1.useDialogContext_unstable(ctx => ctx.modalType);
|
|
28
|
+
const {
|
|
29
|
+
as = 'div'
|
|
30
|
+
} = props;
|
|
31
|
+
const contentRef = contexts_1.useDialogContext_unstable(ctx => ctx.contentRef);
|
|
32
|
+
const dialogTitleID = contexts_1.useDialogContext_unstable(ctx => ctx.dialogTitleID);
|
|
33
|
+
const dialogBodyID = contexts_1.useDialogContext_unstable(ctx => ctx.dialogBodyID);
|
|
34
|
+
const requestOpenChange = contexts_1.useDialogContext_unstable(ctx => ctx.requestOpenChange);
|
|
35
|
+
const {
|
|
36
|
+
modalAttributes
|
|
37
|
+
} = react_tabster_1.useModalAttributes({
|
|
38
|
+
trapFocus: modalType !== 'non-modal'
|
|
39
|
+
});
|
|
40
|
+
const handleRootKeyDown = react_utilities_1.useEventCallback(event => {
|
|
41
|
+
var _a;
|
|
42
|
+
|
|
43
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
44
|
+
|
|
45
|
+
if (utils_1.isEscapeKeyDismiss(event, modalType)) {
|
|
46
|
+
requestOpenChange({
|
|
47
|
+
event,
|
|
48
|
+
open: false,
|
|
49
|
+
type: 'escapeKeyDown'
|
|
50
|
+
});
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
components: {
|
|
56
|
+
root: 'div'
|
|
57
|
+
},
|
|
58
|
+
root: react_utilities_1.getNativeElementProps(as, {
|
|
59
|
+
ref: react_utilities_1.useMergedRefs(ref, contentRef),
|
|
60
|
+
'aria-modal': modalType !== 'non-modal',
|
|
61
|
+
'aria-describedby': dialogBodyID,
|
|
62
|
+
'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,
|
|
63
|
+
role: modalType === 'alert' ? 'alertdialog' : 'dialog',
|
|
64
|
+
...props,
|
|
65
|
+
...modalAttributes,
|
|
66
|
+
onKeyDown: handleRootKeyDown
|
|
67
|
+
})
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
exports.useDialogSurface_unstable = useDialogSurface_unstable;
|
|
72
|
+
//# sourceMappingURL=useDialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogSurface/useDialogSurface.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAEA,MAAA,UAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,MAAM,SAAS,GAAG,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,SAArC,CAAlB;EACA,MAAM;IAAE,EAAE,GAAG;EAAP,IAAiB,KAAvB;EAEA,MAAM,UAAU,GAAG,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,UAArC,CAAnB;EACA,MAAM,aAAa,GAAG,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,aAArC,CAAtB;EACA,MAAM,YAAY,GAAG,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,YAArC,CAArB;EACA,MAAM,iBAAiB,GAAG,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,iBAArC,CAA1B;EAEA,MAAM;IAAE;EAAF,IAAsB,eAAA,CAAA,kBAAA,CAAmB;IAAE,SAAS,EAAE,SAAS,KAAK;EAA3B,CAAnB,CAA5B;EAEA,MAAM,iBAAiB,GAAG,iBAAA,CAAA,gBAAA,CAAkB,KAAD,IAA+C;;;IACxF,CAAA,EAAA,GAAA,KAAK,CAAC,SAAN,MAAe,IAAf,IAAe,EAAA,KAAA,KAAA,CAAf,GAAe,KAAA,CAAf,GAAe,EAAA,CAAA,IAAA,CAAf,KAAe,EAAG,KAAH,CAAf;;IACA,IAAI,OAAA,CAAA,kBAAA,CAAmB,KAAnB,EAA0B,SAA1B,CAAJ,EAA0C;MACxC,iBAAiB,CAAC;QAAE,KAAF;QAAS,IAAI,EAAE,KAAf;QAAsB,IAAI,EAAE;MAA5B,CAAD,CAAjB;MACA,KAAK,CAAC,cAAN;IACD;EACF,CANyB,CAA1B;EAQA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,EAAtB,EAA0B;MAC9B,GAAG,EAAE,iBAAA,CAAA,aAAA,CAAc,GAAd,EAAmB,UAAnB,CADyB;MAE9B,cAAc,SAAS,KAAK,WAFE;MAG9B,oBAAoB,YAHU;MAI9B,mBAAmB,KAAK,CAAC,YAAD,CAAL,GAAsB,SAAtB,GAAkC,aAJvB;MAK9B,IAAI,EAAE,SAAS,KAAK,OAAd,GAAwB,aAAxB,GAAwC,QALhB;MAM9B,GAAG,KAN2B;MAO9B,GAAG,eAP2B;MAQ9B,SAAS,EAAE;IARmB,CAA1B;EAJD,CAAP;AAeD,CArCM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport type { DialogSurfaceProps, DialogSurfaceState } from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { isEscapeKeyDismiss } from '../../utils';\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<HTMLElement>,\n): DialogSurfaceState => {\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const { as = 'div' } = props;\n\n const contentRef = useDialogContext_unstable(ctx => ctx.contentRef);\n const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleID);\n const dialogBodyID = useDialogContext_unstable(ctx => ctx.dialogBodyID);\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n\n const { modalAttributes } = useModalAttributes({ trapFocus: modalType !== 'non-modal' });\n\n const handleRootKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLDivElement>) => {\n props.onKeyDown?.(event);\n if (isEscapeKeyDismiss(event, modalType)) {\n requestOpenChange({ event, open: false, type: 'escapeKeyDown' });\n event.preventDefault();\n }\n });\n\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps(as, {\n ref: useMergedRefs(ref, contentRef),\n 'aria-modal': modalType !== 'non-modal',\n 'aria-describedby': dialogBodyID,\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n ...props,\n ...modalAttributes,\n onKeyDown: handleRootKeyDown,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogSurfaceContextValues_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
function useDialogSurfaceContextValues_unstable(state) {
|
|
9
|
+
const dialogSurface = true;
|
|
10
|
+
return {
|
|
11
|
+
dialogSurface
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.useDialogSurfaceContextValues_unstable = useDialogSurfaceContextValues_unstable;
|
|
16
|
+
//# sourceMappingURL=useDialogSurfaceContextValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogSurface/useDialogSurfaceContextValues.ts"],"names":[],"mappings":";;;;;;;AAGA,SAAgB,sCAAhB,CAAuD,KAAvD,EAAgF;EAC9E,MAAM,aAAa,GAA8B,IAAjD;EAEA,OAAO;IAAE;EAAF,CAAP;AACD;;AAJD,OAAA,CAAA,sCAAA,GAAA,sCAAA","sourcesContent":["import type { DialogSurfaceContextValues, DialogSurfaceState } from './DialogSurface.types';\nimport type { DialogSurfaceContextValue } from '../../contexts';\n\nexport function useDialogSurfaceContextValues_unstable(state: DialogSurfaceState): DialogSurfaceContextValues {\n const dialogSurface: DialogSurfaceContextValue = true;\n\n return { dialogSurface };\n}\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogSurfaceStyles_unstable = exports.dialogSurfaceClassNames = void 0;
|
|
7
|
+
|
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
|
+
|
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
11
|
+
|
|
12
|
+
const constants_1 = /*#__PURE__*/require("../../contexts/constants");
|
|
13
|
+
|
|
14
|
+
exports.dialogSurfaceClassNames = {
|
|
15
|
+
root: 'fui-DialogSurface'
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Styles for the root slot
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
22
|
+
"root": {
|
|
23
|
+
"qhf8xq": "f19dog8a",
|
|
24
|
+
"Bhzewxz": "f1i1t8d1",
|
|
25
|
+
"oyh7mz": ["f1ktbn1t", "ffenbu1"],
|
|
26
|
+
"Bz10aip": ["foouk8k", "fd9rb4b"],
|
|
27
|
+
"a9b677": "fly5x3f",
|
|
28
|
+
"Bqenvij": "f3052tw",
|
|
29
|
+
"B2u0y6b": "fvgz9i8",
|
|
30
|
+
"Bxyxcbc": "f6a9g1z",
|
|
31
|
+
"B7ck84d": "f1ewtqcl",
|
|
32
|
+
"E5pizo": "f10nrhrw",
|
|
33
|
+
"De3pzq": "fxugw4r",
|
|
34
|
+
"i8kkvl": "f4px1ci",
|
|
35
|
+
"Belr9w4": "fn67r4l",
|
|
36
|
+
"B4j52fo": "f5ogflp",
|
|
37
|
+
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
|
38
|
+
"Bn0qgzm": "f1f09k3d",
|
|
39
|
+
"ibv6hh": ["finvdd3", "f1hqa2wf"],
|
|
40
|
+
"icvyot": "fzkkow9",
|
|
41
|
+
"vrafjx": ["fcdblym", "fjik90z"],
|
|
42
|
+
"oivjwe": "fg706s2",
|
|
43
|
+
"wvpqe5": ["fjik90z", "fcdblym"],
|
|
44
|
+
"g2u3we": "fghlq4f",
|
|
45
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
|
46
|
+
"B9xav0g": "fb073pr",
|
|
47
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
|
48
|
+
"Bbmb7ep": ["f1erghxr", "f1ehz9de"],
|
|
49
|
+
"Beyfa6y": ["f1ehz9de", "f1erghxr"],
|
|
50
|
+
"B7oj6ja": ["f1spoy8", "fmb70yw"],
|
|
51
|
+
"Btl43ni": ["fmb70yw", "f1spoy8"],
|
|
52
|
+
"B6of3ja": "fgr6219",
|
|
53
|
+
"t21cq0": ["f1ujusj6", "fcgxt0o"],
|
|
54
|
+
"jrapky": "f10jk5vf",
|
|
55
|
+
"Frg6f3": ["fcgxt0o", "f1ujusj6"],
|
|
56
|
+
"mc9l5x": "f13qh94s",
|
|
57
|
+
"wkccdc": "f874eam",
|
|
58
|
+
"Budl1dq": "fjj47a5",
|
|
59
|
+
"zoa1oz": "f16o7v7l",
|
|
60
|
+
"z8tnut": "fuq56rw",
|
|
61
|
+
"z189sj": ["f15kemlc", "fdgang7"],
|
|
62
|
+
"Byoj8tv": "fl2zwns",
|
|
63
|
+
"uwmqm3": ["fdgang7", "f15kemlc"],
|
|
64
|
+
"B5xtmjs": "ff54dml",
|
|
65
|
+
"Bqu9lor": "f52bj20",
|
|
66
|
+
"B06wobe": "f1dangjo"
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
"d": [".f19dog8a{position:fixed;}", ".f1i1t8d1{top:50%;}", ".f1ktbn1t{left:50%;}", ".ffenbu1{right:50%;}", ".foouk8k{-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);}", ".fd9rb4b{-webkit-transform:translate(50%, -50%);-moz-transform:translate(50%, -50%);-ms-transform:translate(50%, -50%);transform:translate(50%, -50%);}", ".fly5x3f{width:100%;}", ".f3052tw{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;}", ".fvgz9i8{max-width:600px;}", ".f6a9g1z{max-height:100vh;}", ".f1ewtqcl{box-sizing:border-box;}", ".f10nrhrw{box-shadow:var(--shadow64);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1erghxr{border-bottom-right-radius:8px;}", ".f1ehz9de{border-bottom-left-radius:8px;}", ".f1spoy8{border-top-right-radius:8px;}", ".fmb70yw{border-top-left-radius:8px;}", ".fgr6219{margin-top:auto;}", ".f1ujusj6{margin-right:auto;}", ".fcgxt0o{margin-left:auto;}", ".f10jk5vf{margin-bottom:auto;}", ".f13qh94s{display:grid;}", ".f874eam{grid-template-rows:auto 1fr auto;}", ".fjj47a5{grid-template-columns:1fr 1fr auto;}", ".f16o7v7l{grid-template-areas:\"title title close-button\" \"body body body\" \"actions-start actions-end actions-end\";}", ".fuq56rw{padding-top:24px;}", ".f15kemlc{padding-right:24px;}", ".fdgang7{padding-left:24px;}", ".fl2zwns{padding-bottom:24px;}"],
|
|
70
|
+
"m": [["@media screen and (max-width: 480px){.ff54dml{max-width:100vw;}}", {
|
|
71
|
+
"m": "screen and (max-width: 480px)"
|
|
72
|
+
}], ["@media screen and (max-width: 480px){.f52bj20{grid-template-rows:auto 1fr auto auto;}}", {
|
|
73
|
+
"m": "screen and (max-width: 480px)"
|
|
74
|
+
}], ["@media screen and (max-width: 480px){.f1dangjo{grid-template-areas:\"title title close-button\" \"body body body\" \"actions-start actions-start actions-start\" \"actions-end actions-end actions-end\";}}", {
|
|
75
|
+
"m": "screen and (max-width: 480px)"
|
|
76
|
+
}]]
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* Apply styling to the DialogSurface slots based on the state
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
const useDialogSurfaceStyles_unstable = state => {
|
|
84
|
+
const styles = useStyles();
|
|
85
|
+
state.root.className = react_1.mergeClasses(exports.dialogSurfaceClassNames.root, styles.root, state.root.className);
|
|
86
|
+
return state;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
exports.useDialogSurfaceStyles_unstable = useDialogSurfaceStyles_unstable;
|
|
90
|
+
//# sourceMappingURL=useDialogSurfaceStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogSurface/useDialogSurfaceStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AAaa,OAAA,CAAA,uBAAA,GAA8D;EACzE,IAAI,EAAE;AADmE,CAA9D;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;AAAA,EAAlB;AAuCA;;AAEG;;;AACI,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,uBAAA,CAAwB,IAArC,EAA2C,MAAM,CAAC,IAAlD,EAAwD,KAAK,CAAC,IAAN,CAAW,SAAnE,CAAvB;EACA,OAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogSurfaceSlots, DialogSurfaceState } from './DialogSurface.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n TITLE_GRID_AREA,\n ACTIONS_END_GRID_AREA,\n ACTIONS_START_GRID_AREA,\n SURFACE_BORDER_RADIUS,\n SURFACE_BORDER_WIDTH,\n SURFACE_PADDING,\n DIALOG_GAP,\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n BODY_GRID_AREA,\n CLOSE_BUTTON_GRID_AREA,\n} from '../../contexts/constants';\n\nexport const dialogSurfaceClassNames: SlotClassNames<DialogSurfaceSlots> = {\n root: 'fui-DialogSurface',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'fixed',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: '100%',\n height: 'fit-content',\n maxWidth: '600px',\n maxHeight: '100vh',\n boxSizing: 'border-box',\n boxShadow: tokens.shadow64,\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.gap(DIALOG_GAP),\n ...shorthands.border(SURFACE_BORDER_WIDTH, 'solid', tokens.colorTransparentStroke),\n ...shorthands.borderRadius(SURFACE_BORDER_RADIUS),\n ...shorthands.margin('auto'),\n display: 'grid',\n gridTemplateRows: 'auto 1fr auto',\n gridTemplateColumns: '1fr 1fr auto',\n gridTemplateAreas: `\n \"${TITLE_GRID_AREA} ${TITLE_GRID_AREA} ${CLOSE_BUTTON_GRID_AREA}\"\n \"${BODY_GRID_AREA} ${BODY_GRID_AREA} ${BODY_GRID_AREA}\"\n \"${ACTIONS_START_GRID_AREA} ${ACTIONS_END_GRID_AREA} ${ACTIONS_END_GRID_AREA}\"\n `,\n ...shorthands.padding(SURFACE_PADDING),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n maxWidth: '100vw',\n gridTemplateRows: 'auto 1fr auto auto',\n gridTemplateAreas: `\n \"${TITLE_GRID_AREA} ${TITLE_GRID_AREA} ${CLOSE_BUTTON_GRID_AREA}\"\n \"${BODY_GRID_AREA} ${BODY_GRID_AREA} ${BODY_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 DialogSurface slots based on the state\n */\nexport const useDialogSurfaceStyles_unstable = (state: DialogSurfaceState): DialogSurfaceState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogSurfaceClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DialogTitle = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const useDialogTitle_1 = /*#__PURE__*/require("./useDialogTitle");
|
|
11
|
+
|
|
12
|
+
const renderDialogTitle_1 = /*#__PURE__*/require("./renderDialogTitle");
|
|
13
|
+
|
|
14
|
+
const useDialogTitleStyles_1 = /*#__PURE__*/require("./useDialogTitleStyles");
|
|
15
|
+
/**
|
|
16
|
+
* The `DialogTitle` component will expect to have a dialog title/header
|
|
17
|
+
* and will show the close (X icon) button if specified so.
|
|
18
|
+
* Apart from styling and presenting `closeButton`, this component does not have other behavior.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.DialogTitle = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
23
|
+
const state = useDialogTitle_1.useDialogTitle_unstable(props, ref);
|
|
24
|
+
useDialogTitleStyles_1.useDialogTitleStyles_unstable(state);
|
|
25
|
+
return renderDialogTitle_1.renderDialogTitle_unstable(state);
|
|
26
|
+
});
|
|
27
|
+
exports.DialogTitle.displayName = 'DialogTitle';
|
|
28
|
+
//# sourceMappingURL=DialogTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogTitle/DialogTitle.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAIA;;;;AAIG;;;AACU,OAAA,CAAA,WAAA,gBAAqD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChG,MAAM,KAAK,GAAG,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,EAA+B,GAA/B,CAAd;EAEA,sBAAA,CAAA,6BAAA,CAA8B,KAA9B;EACA,OAAO,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAP;AACD,CALiE,CAArD;AAOb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport { useDialogTitle_unstable } from './useDialogTitle';\nimport { renderDialogTitle_unstable } from './renderDialogTitle';\nimport { useDialogTitleStyles_unstable } from './useDialogTitleStyles';\nimport type { DialogTitleProps } from './DialogTitle.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogTitle` component will expect to have a dialog title/header\n * and will show the close (X icon) button if specified so.\n * Apart from styling and presenting `closeButton`, this component does not have other behavior.\n */\nexport const DialogTitle: ForwardRefComponent<DialogTitleProps> = React.forwardRef((props, ref) => {\n const state = useDialogTitle_unstable(props, ref);\n\n useDialogTitleStyles_unstable(state);\n return renderDialogTitle_unstable(state);\n});\n\nDialogTitle.displayName = 'DialogTitle';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
+
|
|
9
|
+
tslib_1.__exportStar(require("./DialogTitle"), exports);
|
|
10
|
+
|
|
11
|
+
tslib_1.__exportStar(require("./DialogTitle.types"), exports);
|
|
12
|
+
|
|
13
|
+
tslib_1.__exportStar(require("./renderDialogTitle"), exports);
|
|
14
|
+
|
|
15
|
+
tslib_1.__exportStar(require("./useDialogTitle"), exports);
|
|
16
|
+
|
|
17
|
+
tslib_1.__exportStar(require("./useDialogTitleStyles"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogTitle/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogTitle';\nexport * from './DialogTitle.types';\nexport * from './renderDialogTitle';\nexport * from './useDialogTitle';\nexport * from './useDialogTitleStyles';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderDialogTitle_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
+
|
|
12
|
+
const DialogTrigger_1 = /*#__PURE__*/require("../DialogTrigger");
|
|
13
|
+
/**
|
|
14
|
+
* Render the final JSX of DialogTitle
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const renderDialogTitle_unstable = state => {
|
|
19
|
+
const {
|
|
20
|
+
slots,
|
|
21
|
+
slotProps
|
|
22
|
+
} = react_utilities_1.getSlots(state);
|
|
23
|
+
return React.createElement(React.Fragment, null, React.createElement(slots.root, { ...slotProps.root
|
|
24
|
+
}, slotProps.root.children), slots.closeButton && React.createElement(DialogTrigger_1.DialogTrigger, {
|
|
25
|
+
action: "close"
|
|
26
|
+
}, React.createElement(slots.closeButton, { ...slotProps.closeButton
|
|
27
|
+
})));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.renderDialogTitle_unstable = renderDialogTitle_unstable;
|
|
31
|
+
//# sourceMappingURL=renderDialogTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogTitle/renderDialogTitle.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,eAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,0BAA0B,GAAI,KAAD,IAA4B;EACpE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA2B,KAA3B,CAA7B;EAEA,OACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EAAiC,SAAS,CAAC,IAAV,CAAe,QAAhD,CADF,EAEG,KAAK,CAAC,WAAN,IACC,KAAA,CAAA,aAAA,CAAC,eAAA,CAAA,aAAD,EAAc;IAAC,MAAM,EAAC;EAAR,CAAd,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,WAAP,EAAkB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAlB,CADF,CAHJ,CADF;AAUD,CAbM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogTitleState, DialogTitleSlots } from './DialogTitle.types';\nimport { DialogTrigger } from '../DialogTrigger';\n\n/**\n * Render the final JSX of DialogTitle\n */\nexport const renderDialogTitle_unstable = (state: DialogTitleState) => {\n const { slots, slotProps } = getSlots<DialogTitleSlots>(state);\n\n return (\n <>\n <slots.root {...slotProps.root}>{slotProps.root.children}</slots.root>\n {slots.closeButton && (\n <DialogTrigger action=\"close\">\n <slots.closeButton {...slotProps.closeButton} />\n </DialogTrigger>\n )}\n </>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogTitle_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
+
|
|
12
|
+
const react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
|
|
13
|
+
|
|
14
|
+
const dialogContext_1 = /*#__PURE__*/require("../../contexts/dialogContext");
|
|
15
|
+
|
|
16
|
+
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
|
17
|
+
/**
|
|
18
|
+
* Create the state required to render DialogTitle.
|
|
19
|
+
*
|
|
20
|
+
* The returned state can be modified with hooks such as useDialogTitleStyles_unstable,
|
|
21
|
+
* before being passed to renderDialogTitle_unstable.
|
|
22
|
+
*
|
|
23
|
+
* @param props - props from this instance of DialogTitle
|
|
24
|
+
* @param ref - reference to root HTMLElement of DialogTitle
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const useDialogTitle_unstable = (props, ref) => {
|
|
29
|
+
const {
|
|
30
|
+
as = 'div',
|
|
31
|
+
closeButton
|
|
32
|
+
} = props;
|
|
33
|
+
const modalType = dialogContext_1.useDialogContext_unstable(ctx => ctx.modalType);
|
|
34
|
+
return {
|
|
35
|
+
components: {
|
|
36
|
+
root: 'div',
|
|
37
|
+
closeButton: 'button'
|
|
38
|
+
},
|
|
39
|
+
root: react_utilities_1.getNativeElementProps(as, {
|
|
40
|
+
ref,
|
|
41
|
+
id: dialogContext_1.useDialogContext_unstable(ctx => ctx.dialogTitleID),
|
|
42
|
+
...props
|
|
43
|
+
}),
|
|
44
|
+
closeButton: react_aria_1.useARIAButtonShorthand(closeButton, {
|
|
45
|
+
required: modalType === 'non-modal',
|
|
46
|
+
defaultProps: {
|
|
47
|
+
type: 'button',
|
|
48
|
+
'aria-label': 'close',
|
|
49
|
+
children: React.createElement(react_icons_1.Dismiss24Regular, null)
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.useDialogTitle_unstable = useDialogTitle_unstable;
|
|
56
|
+
//# sourceMappingURL=useDialogTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogTitle/useDialogTitle.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,YAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,8BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;EAChH,MAAM;IAAE,EAAE,GAAG,KAAP;IAAc;EAAd,IAA8B,KAApC;EACA,MAAM,SAAS,GAAG,eAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,SAArC,CAAlB;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,WAAW,EAAE;IAFH,CADP;IAKL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,EAAtB,EAA0B;MAC9B,GAD8B;MAE9B,EAAE,EAAE,eAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,aAArC,CAF0B;MAG9B,GAAG;IAH2B,CAA1B,CALD;IAUL,WAAW,EAAE,YAAA,CAAA,sBAAA,CAAuB,WAAvB,EAAoC;MAC/C,QAAQ,EAAE,SAAS,KAAK,WADuB;MAE/C,YAAY,EAAE;QACZ,IAAI,EAAE,QADM;QAEZ,cAAc,OAFF;QAGZ,QAAQ,EAAE,KAAA,CAAA,aAAA,CAAC,aAAA,CAAA,gBAAD,EAAiB,IAAjB;MAHE;IAFiC,CAApC;EAVR,CAAP;AAmBD,CAvBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogTitleProps, DialogTitleState } from './DialogTitle.types';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { useDialogContext_unstable } from '../../contexts/dialogContext';\nimport { Dismiss24Regular } from '@fluentui/react-icons';\n\n/**\n * Create the state required to render DialogTitle.\n *\n * The returned state can be modified with hooks such as useDialogTitleStyles_unstable,\n * before being passed to renderDialogTitle_unstable.\n *\n * @param props - props from this instance of DialogTitle\n * @param ref - reference to root HTMLElement of DialogTitle\n */\nexport const useDialogTitle_unstable = (props: DialogTitleProps, ref: React.Ref<HTMLElement>): DialogTitleState => {\n const { as = 'div', closeButton } = props;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n\n return {\n components: {\n root: 'div',\n closeButton: 'button',\n },\n root: getNativeElementProps(as, {\n ref,\n id: useDialogContext_unstable(ctx => ctx.dialogTitleID),\n ...props,\n }),\n closeButton: useARIAButtonShorthand(closeButton, {\n required: modalType === 'non-modal',\n defaultProps: {\n type: 'button', // This is added because the default for type is 'submit'\n 'aria-label': 'close', // TODO: find a better way to add internal labels\n children: <Dismiss24Regular />,\n },\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDialogTitleStyles_unstable = exports.dialogTitleClassNames = void 0;
|
|
7
|
+
|
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
|
+
|
|
10
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
11
|
+
|
|
12
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
13
|
+
|
|
14
|
+
const localShorthands_1 = /*#__PURE__*/require("../../utils/localShorthands");
|
|
15
|
+
|
|
16
|
+
const constants_1 = /*#__PURE__*/require("../../contexts/constants");
|
|
17
|
+
|
|
18
|
+
exports.dialogTitleClassNames = {
|
|
19
|
+
root: 'fui-DialogTitle',
|
|
20
|
+
closeButton: 'fui-DialogTitle__closeButton'
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Styles for the root slot
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
27
|
+
"root": {
|
|
28
|
+
"Bahqtrf": "fk6fouc",
|
|
29
|
+
"Be2twd7": "f1pp30po",
|
|
30
|
+
"Bhrd7zp": "fl43uef",
|
|
31
|
+
"Bg96gwp": "f106mvju",
|
|
32
|
+
"Ijaq50": "faq1aip",
|
|
33
|
+
"nk6f5a": "fv2srd9",
|
|
34
|
+
"Br312pm": "f1m489tg",
|
|
35
|
+
"Bw0ie65": "f1tz6hh8"
|
|
36
|
+
},
|
|
37
|
+
"rootWithoutCloseButton": {},
|
|
38
|
+
"rootWithCloseButton": {},
|
|
39
|
+
"closeButton": {
|
|
40
|
+
"qhf8xq": "f10pi13n",
|
|
41
|
+
"Bg96gwp": "fez10in",
|
|
42
|
+
"Bceei9c": "f1k6fduh",
|
|
43
|
+
"qb2dma": "f9h729m",
|
|
44
|
+
"Ijaq50": "f1hysmiz",
|
|
45
|
+
"nk6f5a": "f11nczdl",
|
|
46
|
+
"Br312pm": "f1379kmu",
|
|
47
|
+
"Bw0ie65": "f98d4vj"
|
|
48
|
+
},
|
|
49
|
+
"closeButtonFocusIndicator": {
|
|
50
|
+
"Brovlpu": "ftqa4ok",
|
|
51
|
+
"B486eqv": "f2hkw1w",
|
|
52
|
+
"Bvjrn4i": "fvvvjju",
|
|
53
|
+
"Bfjx6ro": ["f1j42xvt", "ftiyk5j"],
|
|
54
|
+
"vkx7if": "f3za06g",
|
|
55
|
+
"Bhdpb9s": ["ftiyk5j", "f1j42xvt"],
|
|
56
|
+
"Bpou26a": "f1l3yytu",
|
|
57
|
+
"Bxui8rh": "fnfm6nw",
|
|
58
|
+
"v96tid": "f19m7vnf",
|
|
59
|
+
"cyjxpb": "f8p7r4r",
|
|
60
|
+
"Bn0no95": "f1iilt6f",
|
|
61
|
+
"B573luj": ["f2keu4t", "f14fcfgr"],
|
|
62
|
+
"B639bv6": "faptqjd",
|
|
63
|
+
"shdfye": ["f14fcfgr", "f2keu4t"],
|
|
64
|
+
"gekwd": "fhcdesm",
|
|
65
|
+
"Du8lva": ["f17qorvy", "f1s68zmt"],
|
|
66
|
+
"Bxo5kf0": "f1kaw87x",
|
|
67
|
+
"G4c1lw": ["f1s68zmt", "f17qorvy"],
|
|
68
|
+
"B7295ny": ["fcxw5no", "f1klxzyg"],
|
|
69
|
+
"Bfl2641": ["f1klxzyg", "fcxw5no"],
|
|
70
|
+
"Bc850wg": ["f8h35c5", "f41fp59"],
|
|
71
|
+
"Bwbif6r": ["f41fp59", "f8h35c5"],
|
|
72
|
+
"Bc7x9ep": "f89yr8c",
|
|
73
|
+
"Btolfwl": ["f3vokhu", "fgoym2l"],
|
|
74
|
+
"nuwgkz": "f1b662q1",
|
|
75
|
+
"iduwum": ["fgoym2l", "f3vokhu"],
|
|
76
|
+
"zp4aim": "fn1y60j",
|
|
77
|
+
"Br8g1vq": "f197ac7e",
|
|
78
|
+
"s8cxrh": ["f1yd45vn", "f1w8wcpf"],
|
|
79
|
+
"dw1usy": ["f1w8wcpf", "f1yd45vn"]
|
|
80
|
+
},
|
|
81
|
+
"resetButton": {
|
|
82
|
+
"B7ck84d": "f1e4lqlz",
|
|
83
|
+
"De3pzq": "f1u2r49w",
|
|
84
|
+
"sj55zd": "f1ym3bx4",
|
|
85
|
+
"Bahqtrf": "f1mo0ibp",
|
|
86
|
+
"Be2twd7": "fjoy568",
|
|
87
|
+
"Bg96gwp": "fytdu2e",
|
|
88
|
+
"B68tc82": "f1mtd64y",
|
|
89
|
+
"Bmxbyg5": "f1y7q3j9",
|
|
90
|
+
"z8tnut": "f1g0x7ka",
|
|
91
|
+
"z189sj": ["fhxju0i", "f1cnd47f"],
|
|
92
|
+
"Byoj8tv": "f1qch9an",
|
|
93
|
+
"uwmqm3": ["f1cnd47f", "fhxju0i"],
|
|
94
|
+
"icvyot": "f1ern45e",
|
|
95
|
+
"vrafjx": ["f1n71otn", "f1deefiw"],
|
|
96
|
+
"oivjwe": "f1h8hb77",
|
|
97
|
+
"wvpqe5": ["f1deefiw", "f1n71otn"],
|
|
98
|
+
"Bv0vk6g": "f37px4s",
|
|
99
|
+
"fsow6f": "fgusgyc"
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
"d": [".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f106mvju{line-height:var(--lineHeightBase500);}", ".faq1aip{grid-row-start:title;}", ".fv2srd9{grid-row-end:title;}", ".f1m489tg{grid-column-start:title;}", ".f1tz6hh8{grid-column-end:title;}", ".f10pi13n{position:relative;}", ".fez10in{line-height:0;}", ".f1k6fduh{cursor:pointer;}", ".f9h729m{-webkit-align-self:start;-ms-flex-item-align:start;align-self:start;}", ".f1hysmiz{grid-row-start:close-button;}", ".f11nczdl{grid-row-end:close-button;}", ".f1379kmu{grid-column-start:close-button;}", ".f98d4vj{grid-column-end:close-button;}", ".fui-FluentProvider .fvvvjju.fui-focus-visible{border-top-color:transparent;}", ".fui-FluentProvider .f1j42xvt.fui-focus-visible{border-right-color:transparent;}", ".fui-FluentProvider .ftiyk5j.fui-focus-visible{border-left-color:transparent;}", ".fui-FluentProvider .f3za06g.fui-focus-visible{border-bottom-color:transparent;}", ".fui-FluentProvider .f1l3yytu.fui-focus-visible::after{content:\"\";}", ".fui-FluentProvider .fnfm6nw.fui-focus-visible::after{position:absolute;}", ".fui-FluentProvider .f19m7vnf.fui-focus-visible::after{pointer-events:none;}", ".fui-FluentProvider .f8p7r4r.fui-focus-visible::after{z-index:1;}", ".fui-FluentProvider .f1iilt6f.fui-focus-visible::after{border-top-style:solid;}", ".fui-FluentProvider .f2keu4t.fui-focus-visible::after{border-right-style:solid;}", ".fui-FluentProvider .f14fcfgr.fui-focus-visible::after{border-left-style:solid;}", ".fui-FluentProvider .faptqjd.fui-focus-visible::after{border-bottom-style:solid;}", ".fui-FluentProvider .fhcdesm.fui-focus-visible::after{border-top-width:2px;}", ".fui-FluentProvider .f17qorvy.fui-focus-visible::after{border-right-width:2px;}", ".fui-FluentProvider .f1s68zmt.fui-focus-visible::after{border-left-width:2px;}", ".fui-FluentProvider .f1kaw87x.fui-focus-visible::after{border-bottom-width:2px;}", ".fui-FluentProvider .fcxw5no.fui-focus-visible::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".fui-FluentProvider .f1klxzyg.fui-focus-visible::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fui-FluentProvider .f8h35c5.fui-focus-visible::after{border-top-right-radius:var(--borderRadiusMedium);}", ".fui-FluentProvider .f41fp59.fui-focus-visible::after{border-top-left-radius:var(--borderRadiusMedium);}", ".fui-FluentProvider .f89yr8c.fui-focus-visible::after{border-top-color:var(--colorStrokeFocus2);}", ".fui-FluentProvider .f3vokhu.fui-focus-visible::after{border-right-color:var(--colorStrokeFocus2);}", ".fui-FluentProvider .fgoym2l.fui-focus-visible::after{border-left-color:var(--colorStrokeFocus2);}", ".fui-FluentProvider .f1b662q1.fui-focus-visible::after{border-bottom-color:var(--colorStrokeFocus2);}", ".fui-FluentProvider .fn1y60j.fui-focus-visible::after{top:-2px;}", ".fui-FluentProvider .f197ac7e.fui-focus-visible::after{bottom:-2px;}", ".fui-FluentProvider .f1yd45vn.fui-focus-visible::after{left:-2px;}", ".fui-FluentProvider .f1w8wcpf.fui-focus-visible::after{right:-2px;}", ".f1e4lqlz{box-sizing:content-box;}", ".f1u2r49w{background-color:inherit;}", ".f1ym3bx4{color:inherit;}", ".f1mo0ibp{font-family:inherit;}", ".fjoy568{font-size:inherit;}", ".fytdu2e{line-height:normal;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f37px4s{-webkit-appearance:button;}", ".fgusgyc{text-align:unset;}"],
|
|
103
|
+
"f": [".ftqa4ok:focus{outline-style:none;}"],
|
|
104
|
+
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
105
|
+
});
|
|
106
|
+
/**
|
|
107
|
+
* Apply styling to the DialogTitle slots based on the state
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
const useDialogTitleStyles_unstable = state => {
|
|
112
|
+
const styles = useStyles();
|
|
113
|
+
state.root.className = react_1.mergeClasses(exports.dialogTitleClassNames.root, styles.root, state.closeButton && styles.rootWithCloseButton, !state.closeButton && styles.rootWithoutCloseButton, state.root.className);
|
|
114
|
+
|
|
115
|
+
if (state.closeButton) {
|
|
116
|
+
state.closeButton.className = react_1.mergeClasses(exports.dialogTitleClassNames.closeButton, styles.resetButton, styles.closeButton, styles.closeButtonFocusIndicator, state.closeButton.className);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return state;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
exports.useDialogTitleStyles_unstable = useDialogTitleStyles_unstable;
|
|
123
|
+
//# sourceMappingURL=useDialogTitleStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogTitle/useDialogTitleStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AAEa,OAAA,CAAA,qBAAA,GAA0D;EACrE,IAAI,EAAE,iBAD+D;EAErE,WAAW,EAAE;AAFwD,CAA1D;AAKb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EAAlB;AAmCA;;AAEG;;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA8C;EACzF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,qBAAA,CAAsB,IADD,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,WAAN,IAAqB,MAAM,CAAC,mBAHP,EAIrB,CAAC,KAAK,CAAC,WAAP,IAAsB,MAAM,CAAC,sBAJR,EAKrB,KAAK,CAAC,IAAN,CAAW,SALU,CAAvB;;EAOA,IAAI,KAAK,CAAC,WAAV,EAAuB;IACrB,KAAK,CAAC,WAAN,CAAkB,SAAlB,GAA8B,OAAA,CAAA,YAAA,CAC5B,OAAA,CAAA,qBAAA,CAAsB,WADM,EAE5B,MAAM,CAAC,WAFqB,EAG5B,MAAM,CAAC,WAHqB,EAI5B,MAAM,CAAC,yBAJqB,EAK5B,KAAK,CAAC,WAAN,CAAkB,SALU,CAA9B;EAOD;;EACD,OAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogTitleSlots, DialogTitleState } from './DialogTitle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { gridArea } from '../../utils/localShorthands';\nimport { CLOSE_BUTTON_GRID_AREA, TITLE_GRID_AREA } from '../../contexts/constants';\n\nexport const dialogTitleClassNames: SlotClassNames<DialogTitleSlots> = {\n root: 'fui-DialogTitle',\n closeButton: 'fui-DialogTitle__closeButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.subtitle1,\n ...gridArea(TITLE_GRID_AREA),\n },\n rootWithoutCloseButton: {\n // ...shorthands.padding(DIALOG_CONTENT_PADDING, DIALOG_CONTENT_PADDING, '8px', DIALOG_CONTENT_PADDING),\n },\n rootWithCloseButton: {\n // ...shorthands.padding(DIALOG_CONTENT_PADDING, '20px', '8px', DIALOG_CONTENT_PADDING),\n },\n closeButton: {\n position: 'relative',\n lineHeight: '0',\n cursor: 'pointer',\n alignSelf: 'start',\n ...gridArea(CLOSE_BUTTON_GRID_AREA),\n },\n closeButtonFocusIndicator: createFocusOutlineStyle(),\n // TODO: this should be extracted to another package\n resetButton: {\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'normal',\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\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.closeButton && styles.rootWithCloseButton,\n !state.closeButton && styles.rootWithoutCloseButton,\n state.root.className,\n );\n if (state.closeButton) {\n state.closeButton.className = mergeClasses(\n dialogTitleClassNames.closeButton,\n styles.resetButton,\n styles.closeButton,\n styles.closeButtonFocusIndicator,\n state.closeButton.className,\n );\n }\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DialogTrigger = void 0;
|
|
7
|
+
|
|
8
|
+
const useDialogTrigger_1 = /*#__PURE__*/require("./useDialogTrigger");
|
|
9
|
+
|
|
10
|
+
const renderDialogTrigger_1 = /*#__PURE__*/require("./renderDialogTrigger");
|
|
11
|
+
/**
|
|
12
|
+
* A non-visual component that wraps its child
|
|
13
|
+
* and configures them to be the trigger that will open or close a `Dialog`.
|
|
14
|
+
* This component should only accept one child.
|
|
15
|
+
*
|
|
16
|
+
* In case the trigger is used outside `Dialog` component
|
|
17
|
+
* it'll still provide basic ARIA related attributes
|
|
18
|
+
* to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,
|
|
19
|
+
* in that case the user must provide a `controlled state`
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const DialogTrigger = props => {
|
|
24
|
+
const state = useDialogTrigger_1.useDialogTrigger_unstable(props);
|
|
25
|
+
return renderDialogTrigger_1.renderDialogTrigger_unstable(state);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.DialogTrigger = DialogTrigger;
|
|
29
|
+
exports.DialogTrigger.displayName = 'DialogTrigger';
|
|
30
|
+
exports.DialogTrigger.isFluentTriggerComponent = true;
|
|
31
|
+
//# sourceMappingURL=DialogTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogTrigger/DialogTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;;;;;;;;AASG;;;AACI,MAAM,aAAa,GAA0D,KAAK,IAAG;EAC1F,MAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,CAAd;EAEA,OAAO,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb;AAMb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B;AACA,OAAA,CAAA,aAAA,CAAc,wBAAd,GAAyC,IAAzC","sourcesContent":["import * as React from 'react';\nimport { useDialogTrigger_unstable } from './useDialogTrigger';\nimport { renderDialogTrigger_unstable } from './renderDialogTrigger';\nimport type { DialogTriggerProps } from './DialogTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will open or close a `Dialog`.\n * This component should only accept one child.\n *\n * In case the trigger is used outside `Dialog` component\n * it'll still provide basic ARIA related attributes\n * to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,\n * in that case the user must provide a `controlled state`\n */\nexport const DialogTrigger: React.FC<DialogTriggerProps> & FluentTriggerComponent = props => {\n const state = useDialogTrigger_unstable(props);\n\n return renderDialogTrigger_unstable(state);\n};\n\nDialogTrigger.displayName = 'DialogTrigger';\nDialogTrigger.isFluentTriggerComponent = true;\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
+
|
|
9
|
+
tslib_1.__exportStar(require("./DialogTrigger"), exports);
|
|
10
|
+
|
|
11
|
+
tslib_1.__exportStar(require("./DialogTrigger.types"), exports);
|
|
12
|
+
|
|
13
|
+
tslib_1.__exportStar(require("./renderDialogTrigger"), exports);
|
|
14
|
+
|
|
15
|
+
tslib_1.__exportStar(require("./useDialogTrigger"), exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogTrigger/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderDialogTrigger_unstable = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Render the final JSX of MenuTrigger
|
|
9
|
+
*
|
|
10
|
+
* Only renders children
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const renderDialogTrigger_unstable = state => state.children;
|
|
14
|
+
|
|
15
|
+
exports.renderDialogTrigger_unstable = renderDialogTrigger_unstable;
|
|
16
|
+
//# sourceMappingURL=renderDialogTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/DialogTrigger/renderDialogTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;;;AAIG;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA+B,KAAK,CAAC,QAA1E;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import type { DialogTriggerState } from './DialogTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderDialogTrigger_unstable = (state: DialogTriggerState) => state.children;\n"],"sourceRoot":"../src/"}
|