@fluentui/react-dialog 0.0.0-nightly-20221007-1237.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +629 -0
- package/CHANGELOG.md +229 -0
- package/LICENSE +15 -0
- package/README.md +5 -0
- package/Spec.md +537 -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 +456 -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/DialogContent.js +2 -0
- package/lib/DialogContent.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 +19 -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 +5 -0
- package/lib/components/Dialog/index.js.map +1 -0
- package/lib/components/Dialog/renderDialog.js +18 -0
- package/lib/components/Dialog/renderDialog.js.map +1 -0
- package/lib/components/Dialog/useDialog.js +86 -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/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 +49 -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 +50 -0
- package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -0
- package/lib/components/DialogContent/DialogContent.js +16 -0
- package/lib/components/DialogContent/DialogContent.js.map +1 -0
- package/lib/components/DialogContent/DialogContent.types.js +2 -0
- package/lib/components/DialogContent/DialogContent.types.js.map +1 -0
- package/lib/components/DialogContent/index.js +6 -0
- package/lib/components/DialogContent/index.js.map +1 -0
- package/lib/components/DialogContent/renderDialogContent.js +15 -0
- package/lib/components/DialogContent/renderDialogContent.js.map +1 -0
- package/lib/components/DialogContent/useDialogContent.js +28 -0
- package/lib/components/DialogContent/useDialogContent.js.map +1 -0
- package/lib/components/DialogContent/useDialogContentStyles.js +40 -0
- package/lib/components/DialogContent/useDialogContentStyles.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 +20 -0
- package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -0
- package/lib/components/DialogSurface/useDialogSurface.js +86 -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 +95 -0
- package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
- package/lib/components/DialogTitle/DialogTitle.js +16 -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 +16 -0
- package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -0
- package/lib/components/DialogTitle/useDialogTitle.js +48 -0
- package/lib/components/DialogTitle/useDialogTitle.js.map +1 -0
- package/lib/components/DialogTitle/useDialogTitleStyles.js +116 -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 +47 -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 +19 -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 +8 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/index.js +4 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/isEscapeKeyDown.js +9 -0
- package/lib/utils/isEscapeKeyDown.js.map +1 -0
- package/lib/utils/useDisableBodyScroll.js +60 -0
- package/lib/utils/useDisableBodyScroll.js.map +1 -0
- package/lib/utils/useFocusFirstElement.js +37 -0
- package/lib/utils/useFocusFirstElement.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/DialogContent.js +10 -0
- package/lib-commonjs/DialogContent.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 +30 -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 +16 -0
- package/lib-commonjs/components/Dialog/index.js.map +1 -0
- package/lib-commonjs/components/Dialog/renderDialog.js +29 -0
- package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -0
- package/lib-commonjs/components/Dialog/useDialog.js +100 -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/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 +60 -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 +35 -0
- package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -0
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +61 -0
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -0
- package/lib-commonjs/components/DialogContent/DialogContent.js +27 -0
- package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -0
- package/lib-commonjs/components/DialogContent/DialogContent.types.js +6 -0
- package/lib-commonjs/components/DialogContent/DialogContent.types.js.map +1 -0
- package/lib-commonjs/components/DialogContent/index.js +18 -0
- package/lib-commonjs/components/DialogContent/index.js.map +1 -0
- package/lib-commonjs/components/DialogContent/renderDialogContent.js +26 -0
- package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -0
- package/lib-commonjs/components/DialogContent/useDialogContent.js +39 -0
- package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -0
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +52 -0
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.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 +33 -0
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js +99 -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 +107 -0
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/DialogTitle.js +27 -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 +27 -0
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js +64 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -0
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +129 -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 +60 -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 +30 -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 +214 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/utils/index.js +14 -0
- package/lib-commonjs/utils/index.js.map +1 -0
- package/lib-commonjs/utils/isEscapeKeyDown.js +19 -0
- package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -0
- package/lib-commonjs/utils/useDisableBodyScroll.js +73 -0
- package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -0
- package/lib-commonjs/utils/useFocusFirstElement.js +49 -0
- package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useDialogSurface_unstable } from './useDialogSurface';
|
|
3
|
+
import { renderDialogSurface_unstable } from './renderDialogSurface';
|
|
4
|
+
import { useDialogSurfaceStyles_unstable } from './useDialogSurfaceStyles';
|
|
5
|
+
import { useDialogSurfaceContextValues_unstable } from './useDialogSurfaceContextValues';
|
|
6
|
+
/**
|
|
7
|
+
* DialogSurface component represents the visual part of a `Dialog` as a whole,
|
|
8
|
+
* it contains everything that should be visible.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const DialogSurface = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
|
+
const state = useDialogSurface_unstable(props, ref);
|
|
13
|
+
const contextValues = useDialogSurfaceContextValues_unstable(state);
|
|
14
|
+
useDialogSurfaceStyles_unstable(state);
|
|
15
|
+
return renderDialogSurface_unstable(state, contextValues);
|
|
16
|
+
});
|
|
17
|
+
DialogSurface.displayName = 'DialogSurface';
|
|
18
|
+
//# sourceMappingURL=DialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/DialogSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AACA,SAAS,+BAAT,QAAgD,0BAAhD;AAGA,SAAS,sCAAT,QAAuD,iCAAvD;AAEA;;;AAGG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,yBAAyB,CAAC,KAAD,EAAQ,GAAR,CAAvC;EACA,MAAM,aAAa,GAAG,sCAAsC,CAAC,KAAD,CAA5D;EAEA,+BAA+B,CAAC,KAAD,CAA/B;EACA,OAAO,4BAA4B,CAAC,KAAD,EAAQ,aAAR,CAAnC;AACD,CANqE,CAA/D;AAQP,aAAa,CAAC,WAAd,GAA4B,eAA5B","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"],"sourceRoot":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './DialogSurface';\nexport * from './DialogSurface.types';\nexport * from './renderDialogSurface';\nexport * from './useDialogSurface';\nexport * from './useDialogSurfaceStyles';\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
|
3
|
+
import { DialogSurfaceProvider } from '../../contexts';
|
|
4
|
+
import { Portal } from '@fluentui/react-portal';
|
|
5
|
+
/**
|
|
6
|
+
* Render the final JSX of DialogSurface
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const renderDialogSurface_unstable = (state, contextValues) => {
|
|
10
|
+
const {
|
|
11
|
+
slots,
|
|
12
|
+
slotProps
|
|
13
|
+
} = getSlots(state);
|
|
14
|
+
return /*#__PURE__*/React.createElement(Portal, null, slots.backdrop && /*#__PURE__*/React.createElement(slots.backdrop, { ...slotProps.backdrop
|
|
15
|
+
}), /*#__PURE__*/React.createElement(DialogSurfaceProvider, {
|
|
16
|
+
value: contextValues.dialogSurface
|
|
17
|
+
}, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
18
|
+
})));
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=renderDialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,qBAAT,QAAsC,gBAAtC;AACA,SAAS,MAAT,QAAuB,wBAAvB;AAEA;;AAEG;;AACH,OAAO,MAAM,4BAA4B,GAAG,CAAC,KAAD,EAA4B,aAA5B,KAAyE;EACnH,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAqB,KAArB,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,MAAD,EAAO,IAAP,EACG,KAAK,CAAC,QAAN,iBAAkB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;EAAf,CAAf,CADrB,eAEE,KAAA,CAAA,aAAA,CAAC,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,CAFF,CADF;AAQD,CAXM","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"],"sourceRoot":""}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { getNativeElementProps, resolveShorthand, useEventCallback, useMergedRefs, isResolvedShorthand } from '@fluentui/react-utilities';
|
|
2
|
+
import { useDialogContext_unstable } from '../../contexts';
|
|
3
|
+
import { isEscapeKeyDismiss } from '../../utils';
|
|
4
|
+
import { useModalAttributes } from '@fluentui/react-tabster';
|
|
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
|
+
|
|
15
|
+
export const useDialogSurface_unstable = (props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
backdrop,
|
|
18
|
+
as
|
|
19
|
+
} = props;
|
|
20
|
+
const modalType = useDialogContext_unstable(ctx => ctx.modalType);
|
|
21
|
+
const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);
|
|
22
|
+
const open = useDialogContext_unstable(ctx => ctx.open);
|
|
23
|
+
const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);
|
|
24
|
+
const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);
|
|
25
|
+
const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);
|
|
26
|
+
const handledBackdropClick = useEventCallback(event => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
|
|
29
|
+
if (isResolvedShorthand(props.backdrop)) {
|
|
30
|
+
(_b = (_a = props.backdrop).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (modalType === 'modal' && !event.isDefaultPrevented()) {
|
|
34
|
+
requestOpenChange({
|
|
35
|
+
event,
|
|
36
|
+
open: false,
|
|
37
|
+
type: 'backdropClick'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const handleKeyDown = useEventCallback(event => {
|
|
42
|
+
var _a;
|
|
43
|
+
|
|
44
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
45
|
+
|
|
46
|
+
if (isEscapeKeyDismiss(event, modalType)) {
|
|
47
|
+
requestOpenChange({
|
|
48
|
+
event,
|
|
49
|
+
open: false,
|
|
50
|
+
type: 'escapeKeyDown'
|
|
51
|
+
}); // stop propagation to avoid conflicting with other elements that listen for `Escape`
|
|
52
|
+
// e,g: nested Dialog, Popover, Menu and Tooltip
|
|
53
|
+
|
|
54
|
+
event.stopPropagation();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const {
|
|
58
|
+
modalAttributes
|
|
59
|
+
} = useModalAttributes({
|
|
60
|
+
trapFocus: modalType !== 'non-modal'
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
components: {
|
|
64
|
+
backdrop: 'div',
|
|
65
|
+
root: 'div'
|
|
66
|
+
},
|
|
67
|
+
backdrop: resolveShorthand(backdrop, {
|
|
68
|
+
required: open && modalType !== 'non-modal',
|
|
69
|
+
defaultProps: {
|
|
70
|
+
'aria-hidden': 'true',
|
|
71
|
+
onClick: handledBackdropClick
|
|
72
|
+
}
|
|
73
|
+
}),
|
|
74
|
+
root: getNativeElementProps(as !== null && as !== void 0 ? as : 'div', {
|
|
75
|
+
'aria-modal': modalType !== 'non-modal',
|
|
76
|
+
role: modalType === 'alert' ? 'alertdialog' : 'dialog',
|
|
77
|
+
'aria-describedby': dialogContentId,
|
|
78
|
+
'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,
|
|
79
|
+
...props,
|
|
80
|
+
...modalAttributes,
|
|
81
|
+
onKeyDown: handleKeyDown,
|
|
82
|
+
ref: useMergedRefs(ref, dialogRef)
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=useDialogSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurface.ts"],"names":[],"mappings":"AACA,SACE,qBADF,EAEE,gBAFF,EAGE,gBAHF,EAIE,aAJF,EAKE,mBALF,QAMO,2BANP;AAaA,SAAS,yBAAT,QAA0C,gBAA1C;AACA,SAAS,kBAAT,QAAmC,aAAnC;AACA,SAAS,kBAAT,QAAmC,yBAAnC;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAmB,KAAzB;EACA,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,SAAZ,CAA3C;EACA,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,SAAZ,CAA3C;EACA,MAAM,IAAI,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,IAAZ,CAAtC;EACA,MAAM,iBAAiB,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,iBAAZ,CAAnD;EACA,MAAM,aAAa,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,aAAZ,CAA/C;EACA,MAAM,eAAe,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,eAAZ,CAAjD;EAEA,MAAM,oBAAoB,GAAG,gBAAgB,CAAE,KAAD,IAA4C;;;IACxF,IAAI,mBAAmB,CAAC,KAAK,CAAC,QAAP,CAAvB,EAAyC;MACvC,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,KAAK,CAAC,QAAN,EAAe,OAAf,MAAsB,IAAtB,IAAsB,EAAA,KAAA,KAAA,CAAtB,GAAsB,KAAA,CAAtB,GAAsB,EAAA,CAAA,IAAA,CAAA,EAAA,EAAG,KAAH,CAAtB;IACD;;IACD,IAAI,SAAS,KAAK,OAAd,IAAyB,CAAC,KAAK,CAAC,kBAAN,EAA9B,EAA0D;MACxD,iBAAiB,CAAC;QAChB,KADgB;QAEhB,IAAI,EAAE,KAFU;QAGhB,IAAI,EAAE;MAHU,CAAD,CAAjB;IAKD;EACF,CAX4C,CAA7C;EAaA,MAAM,aAAa,GAAG,gBAAgB,CAAE,KAAD,IAAiE;;;IACtG,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;;IAEA,IAAI,kBAAkB,CAAC,KAAD,EAAQ,SAAR,CAAtB,EAA0C;MACxC,iBAAiB,CAAC;QAChB,KADgB;QAEhB,IAAI,EAAE,KAFU;QAGhB,IAAI,EAAE;MAHU,CAAD,CAAjB,CADwC,CAMxC;MACA;;MACA,KAAK,CAAC,eAAN;IACD;EACF,CAbqC,CAAtC;EAeA,MAAM;IAAE;EAAF,IAAsB,kBAAkB,CAAC;IAAE,SAAS,EAAE,SAAS,KAAK;EAA3B,CAAD,CAA9C;EAEA,OAAO;IACL,UAAU,EAAE;MACV,QAAQ,EAAE,KADA;MAEV,IAAI,EAAE;IAFI,CADP;IAKL,QAAQ,EAAE,gBAAgB,CAAC,QAAD,EAAW;MACnC,QAAQ,EAAE,IAAI,IAAI,SAAS,KAAK,WADG;MAEnC,YAAY,EAAE;QACZ,eAAe,MADH;QAEZ,OAAO,EAAE;MAFG;IAFqB,CAAX,CALrB;IAYL,IAAI,EAAE,qBAAqB,CAAC,EAAE,KAAA,IAAF,IAAA,EAAE,KAAA,KAAA,CAAF,GAAA,EAAA,GAAM,KAAP,EAAc;MACvC,cAAc,SAAS,KAAK,WADW;MAEvC,IAAI,EAAE,SAAS,KAAK,OAAd,GAAwB,aAAxB,GAAwC,QAFP;MAGvC,oBAAoB,eAHmB;MAIvC,mBAAmB,KAAK,CAAC,YAAD,CAAL,GAAsB,SAAtB,GAAkC,aAJd;MAKvC,GAAG,KALoC;MAMvC,GAAG,eANoC;MAOvC,SAAS,EAAE,aAP4B;MAQvC,GAAG,EAAE,aAAa,CAAC,GAAD,EAAM,SAAN;IARqB,CAAd;EAZtB,CAAP;AAuBD,CAjEM","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 const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);\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 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-describedby': dialogContentId,\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n ref: useMergedRefs(ref, dialogRef),\n }),\n };\n};\n"],"sourceRoot":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceContextValues.ts"],"names":[],"mappings":"AAGA,OAAM,SAAU,sCAAV,CAAiD,KAAjD,EAA0E;EAC9E,MAAM,aAAa,GAA8B,IAAjD;EAEA,OAAO;IAAE;EAAF,CAAP;AACD","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":""}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
|
3
|
+
import { MEDIA_QUERY_BREAKPOINT_SELECTOR, SURFACE_BORDER_RADIUS, SURFACE_BORDER_WIDTH, SURFACE_PADDING, useDialogContext_unstable } from '../../contexts';
|
|
4
|
+
export const dialogSurfaceClassNames = {
|
|
5
|
+
root: 'fui-DialogSurface',
|
|
6
|
+
backdrop: 'fui-DialogSurface__backdrop'
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Styles for the root slot
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const useStyles = /*#__PURE__*/__styles({
|
|
13
|
+
"root": {
|
|
14
|
+
"mc9l5x": "ftgm304",
|
|
15
|
+
"famaaq": "f1c515w",
|
|
16
|
+
"Bcdw1i0": "f1bitti",
|
|
17
|
+
"Bhzewxz": "f15twtuk",
|
|
18
|
+
"j35jbq": ["f1e31b4d", "f1vgc2s3"],
|
|
19
|
+
"B5kzvoi": "f1yab3r1",
|
|
20
|
+
"oyh7mz": ["f1vgc2s3", "f1e31b4d"],
|
|
21
|
+
"z8tnut": "fuq56rw",
|
|
22
|
+
"z189sj": ["f15kemlc", "fdgang7"],
|
|
23
|
+
"Byoj8tv": "fl2zwns",
|
|
24
|
+
"uwmqm3": ["fdgang7", "f15kemlc"],
|
|
25
|
+
"B6of3ja": "fgr6219",
|
|
26
|
+
"t21cq0": ["f1ujusj6", "fcgxt0o"],
|
|
27
|
+
"jrapky": "f10jk5vf",
|
|
28
|
+
"Frg6f3": ["fcgxt0o", "f1ujusj6"],
|
|
29
|
+
"icvyot": "fzkkow9",
|
|
30
|
+
"vrafjx": ["fcdblym", "fjik90z"],
|
|
31
|
+
"oivjwe": "fg706s2",
|
|
32
|
+
"wvpqe5": ["fjik90z", "fcdblym"],
|
|
33
|
+
"B68tc82": "f1ln0qer",
|
|
34
|
+
"Bmxbyg5": "fa2wlxz",
|
|
35
|
+
"fshzfu": "f120kxnn",
|
|
36
|
+
"qhf8xq": "f19dog8a",
|
|
37
|
+
"a9b677": "fly5x3f",
|
|
38
|
+
"Bqenvij": "f3052tw",
|
|
39
|
+
"B2u0y6b": "fvgz9i8",
|
|
40
|
+
"Bxyxcbc": "f6a9g1z",
|
|
41
|
+
"B7ck84d": "f1ewtqcl",
|
|
42
|
+
"E5pizo": "f10nrhrw",
|
|
43
|
+
"De3pzq": "fxugw4r",
|
|
44
|
+
"sj55zd": "f19n0e5",
|
|
45
|
+
"B4j52fo": "f5ogflp",
|
|
46
|
+
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
|
47
|
+
"Bn0qgzm": "f1f09k3d",
|
|
48
|
+
"ibv6hh": ["finvdd3", "f1hqa2wf"],
|
|
49
|
+
"g2u3we": "fghlq4f",
|
|
50
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
|
51
|
+
"B9xav0g": "fb073pr",
|
|
52
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
|
53
|
+
"Bbmb7ep": ["f1erghxr", "f1ehz9de"],
|
|
54
|
+
"Beyfa6y": ["f1ehz9de", "f1erghxr"],
|
|
55
|
+
"B7oj6ja": ["f1spoy8", "fmb70yw"],
|
|
56
|
+
"Btl43ni": ["fmb70yw", "f1spoy8"],
|
|
57
|
+
"B5xtmjs": "ff54dml"
|
|
58
|
+
},
|
|
59
|
+
"backdrop": {
|
|
60
|
+
"qhf8xq": "f19dog8a",
|
|
61
|
+
"De3pzq": "fju19wo",
|
|
62
|
+
"Bhzewxz": "f113wtx2",
|
|
63
|
+
"j35jbq": ["f10k790i", "f1xynx9j"],
|
|
64
|
+
"B5kzvoi": "f5gq2j6",
|
|
65
|
+
"oyh7mz": ["f1xynx9j", "f10k790i"]
|
|
66
|
+
},
|
|
67
|
+
"nestedDialogBackdrop": {
|
|
68
|
+
"De3pzq": "f3rmtva"
|
|
69
|
+
},
|
|
70
|
+
"nestedNativeDialogBackdrop": {
|
|
71
|
+
"fshzfu": "foe20jx"
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
"d": [".ftgm304{display:block;}", ".f1c515w{-webkit-user-select:unset;-moz-user-select:unset;-ms-user-select:unset;user-select:unset;}", ".f1bitti{visibility:unset;}", ".f15twtuk{top:0;}", ".f1e31b4d{right:0;}", ".f1vgc2s3{left:0;}", ".f1yab3r1{bottom:0;}", ".fuq56rw{padding-top:24px;}", ".f15kemlc{padding-right:24px;}", ".fdgang7{padding-left:24px;}", ".fl2zwns{padding-bottom:24px;}", ".fgr6219{margin-top:auto;}", ".f1ujusj6{margin-right:auto;}", ".fcgxt0o{margin-left:auto;}", ".f10jk5vf{margin-bottom:auto;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1ln0qer{overflow-x:unset;}", ".fa2wlxz{overflow-y:unset;}", ".f120kxnn::backdrop{background-color:rgba(0, 0, 0, 0.4);}", ".f19dog8a{position:fixed;}", ".fly5x3f{width:100%;}", ".f3052tw{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;}", ".fvgz9i8{max-width:600px;}", ".f6a9g1z{max-height:100vh;}", ".f1ewtqcl{box-sizing:border-box;}", ".f10nrhrw{box-shadow:var(--shadow64);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1erghxr{border-bottom-right-radius:8px;}", ".f1ehz9de{border-bottom-left-radius:8px;}", ".f1spoy8{border-top-right-radius:8px;}", ".fmb70yw{border-top-left-radius:8px;}", ".fju19wo{background-color:rgba(0, 0, 0, 0.4);}", ".f113wtx2{top:0px;}", ".f10k790i{right:0px;}", ".f1xynx9j{left:0px;}", ".f5gq2j6{bottom:0px;}", ".f3rmtva{background-color:transparent;}", ".foe20jx::backdrop{background-color:transparent;}"],
|
|
75
|
+
"m": [["@media screen and (max-width: 480px){.ff54dml{max-width:100vw;}}", {
|
|
76
|
+
"m": "screen and (max-width: 480px)"
|
|
77
|
+
}]]
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* Apply styling to the DialogSurface slots based on the state
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
export const useDialogSurfaceStyles_unstable = state => {
|
|
85
|
+
const styles = useStyles();
|
|
86
|
+
const isNestedDialog = useDialogContext_unstable(ctx => ctx.isNestedDialog);
|
|
87
|
+
state.root.className = mergeClasses(dialogSurfaceClassNames.root, styles.root, isNestedDialog && styles.nestedNativeDialogBackdrop, state.root.className);
|
|
88
|
+
|
|
89
|
+
if (state.backdrop) {
|
|
90
|
+
state.backdrop.className = mergeClasses(dialogSurfaceClassNames.backdrop, styles.backdrop, isNestedDialog && styles.nestedDialogBackdrop, state.backdrop.className);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return state;
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=useDialogSurfaceStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAEA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SACE,+BADF,EAEE,qBAFF,EAGE,oBAHF,EAIE,eAJF,EAKE,yBALF,QAMO,gBANP;AASA,OAAO,MAAM,uBAAuB,GAAuC;EACzE,IAAI,EAAE,mBADmE;EAEzE,QAAQ,EAAE;AAF+D,CAApE;AAKP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA,EAAlB;AA4CA;;AAEG;;;AACH,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,cAAc,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,cAAZ,CAAhD;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,uBAAuB,CAAC,IADS,EAEjC,MAAM,CAAC,IAF0B,EAGjC,cAAc,IAAI,MAAM,CAAC,0BAHQ,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;;EAMA,IAAI,KAAK,CAAC,QAAV,EAAoB;IAClB,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CACrC,uBAAuB,CAAC,QADa,EAErC,MAAM,CAAC,QAF8B,EAGrC,cAAc,IAAI,MAAM,CAAC,oBAHY,EAIrC,KAAK,CAAC,QAAN,CAAe,SAJsB,CAAvC;EAMD;;EACD,OAAO,KAAP;AACD,CAnBM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n SURFACE_BORDER_RADIUS,\n SURFACE_BORDER_WIDTH,\n SURFACE_PADDING,\n useDialogContext_unstable,\n} from '../../contexts';\nimport type { DialogSurfaceSlots, DialogSurfaceState } from './DialogSurface.types';\n\nexport const dialogSurfaceClassNames: SlotClassNames<DialogSurfaceSlots> = {\n root: 'fui-DialogSurface',\n backdrop: 'fui-DialogSurface__backdrop',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'block',\n userSelect: 'unset',\n visibility: 'unset',\n ...shorthands.inset(0),\n ...shorthands.padding(0),\n ...shorthands.padding(SURFACE_PADDING),\n ...shorthands.margin('auto'),\n ...shorthands.borderStyle('none'),\n ...shorthands.overflow('unset'),\n '&::backdrop': {\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n },\n position: 'fixed',\n width: '100%',\n height: 'fit-content',\n maxWidth: '600px',\n maxHeight: '100vh',\n boxSizing: 'border-box',\n boxShadow: tokens.shadow64,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n ...shorthands.border(SURFACE_BORDER_WIDTH, 'solid', tokens.colorTransparentStroke),\n ...shorthands.borderRadius(SURFACE_BORDER_RADIUS),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n maxWidth: '100vw',\n },\n },\n backdrop: {\n position: 'fixed',\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n ...shorthands.inset('0px'),\n },\n nestedDialogBackdrop: {\n backgroundColor: 'transparent',\n },\n nestedNativeDialogBackdrop: {\n '&::backdrop': {\n backgroundColor: 'transparent',\n },\n },\n});\n\n/**\n * Apply styling to the DialogSurface slots based on the state\n */\nexport const useDialogSurfaceStyles_unstable = (state: DialogSurfaceState): DialogSurfaceState => {\n const styles = useStyles();\n const isNestedDialog = useDialogContext_unstable(ctx => ctx.isNestedDialog);\n\n state.root.className = mergeClasses(\n dialogSurfaceClassNames.root,\n styles.root,\n isNestedDialog && styles.nestedNativeDialogBackdrop,\n state.root.className,\n );\n if (state.backdrop) {\n state.backdrop.className = mergeClasses(\n dialogSurfaceClassNames.backdrop,\n styles.backdrop,\n isNestedDialog && styles.nestedDialogBackdrop,\n state.backdrop.className,\n );\n }\n return state;\n};\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useDialogTitle_unstable } from './useDialogTitle';
|
|
3
|
+
import { renderDialogTitle_unstable } from './renderDialogTitle';
|
|
4
|
+
import { useDialogTitleStyles_unstable } from './useDialogTitleStyles';
|
|
5
|
+
/**
|
|
6
|
+
* The `DialogTitle` component expects to have a title/header
|
|
7
|
+
* and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const DialogTitle = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
11
|
+
const state = useDialogTitle_unstable(props, ref);
|
|
12
|
+
useDialogTitleStyles_unstable(state);
|
|
13
|
+
return renderDialogTitle_unstable(state);
|
|
14
|
+
});
|
|
15
|
+
DialogTitle.displayName = 'DialogTitle';
|
|
16
|
+
//# sourceMappingURL=DialogTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/DialogTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AAIA;;;AAGG;;AACH,OAAO,MAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChG,MAAM,KAAK,GAAG,uBAAuB,CAAC,KAAD,EAAQ,GAAR,CAArC;EAEA,6BAA6B,CAAC,KAAD,CAA7B;EACA,OAAO,0BAA0B,CAAC,KAAD,CAAjC;AACD,CALiE,CAA3D;AAOP,WAAW,CAAC,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 expects to have a title/header\n * and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.\n */\nexport const DialogTitle: ForwardRefComponent<DialogTitleProps> = React.forwardRef((props, ref) => {\n const state = useDialogTitle_unstable(props, ref);\n\n useDialogTitleStyles_unstable(state);\n return renderDialogTitle_unstable(state);\n});\n\nDialogTitle.displayName = 'DialogTitle';\n"],"sourceRoot":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogTitle.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/DialogTitle.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogTitleSlots = {\n /**\n * By default this is a div, but can be a heading.\n */\n root: Slot<'div', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;\n /**\n * By default a Dialog with modalType='non-modal' will have a close button action\n */\n action?: Slot<'div'>;\n};\n\n/**\n * DialogTitle Props\n */\nexport type DialogTitleProps = ComponentProps<DialogTitleSlots>;\n\n/**\n * State used in rendering DialogTitle\n */\nexport type DialogTitleState = ComponentState<DialogTitleSlots>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './DialogTitle';\nexport * from './DialogTitle.types';\nexport * from './renderDialogTitle';\nexport * from './useDialogTitle';\nexport * from './useDialogTitleStyles';\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of DialogTitle
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const renderDialogTitle_unstable = state => {
|
|
8
|
+
const {
|
|
9
|
+
slots,
|
|
10
|
+
slotProps
|
|
11
|
+
} = getSlots(state);
|
|
12
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
13
|
+
}, slotProps.root.children), slots.action && /*#__PURE__*/React.createElement(slots.action, { ...slotProps.action
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=renderDialogTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/renderDialogTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,0BAA0B,GAAI,KAAD,IAA4B;EACpE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAmB,KAAnB,CAArC;EAEA,oBACE,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,MAAN,iBAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;EAAf,CAAb,CAFnB,CADF;AAMD,CATM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogTitleState, DialogTitleSlots } from './DialogTitle.types';\n\n/**\n * Render the final JSX of DialogTitle\n */\nexport const renderDialogTitle_unstable = (state: DialogTitleState) => {\n const { slots, slotProps } = getSlots<DialogTitleSlots>(state);\n\n return (\n <>\n <slots.root {...slotProps.root}>{slotProps.root.children}</slots.root>\n {slots.action && <slots.action {...slotProps.action} />}\n </>\n );\n};\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getNativeElementProps } from '@fluentui/react-utilities';
|
|
3
|
+
import { useDialogContext_unstable } from '../../contexts/dialogContext';
|
|
4
|
+
import { Dismiss24Regular } from '@fluentui/react-icons';
|
|
5
|
+
import { resolveShorthand } from '@fluentui/react-utilities';
|
|
6
|
+
import { DialogTrigger } from '../DialogTrigger/DialogTrigger';
|
|
7
|
+
import { useDialogTitleInternalStyles } from './useDialogTitleStyles';
|
|
8
|
+
/**
|
|
9
|
+
* Create the state required to render DialogTitle.
|
|
10
|
+
*
|
|
11
|
+
* The returned state can be modified with hooks such as useDialogTitleStyles_unstable,
|
|
12
|
+
* before being passed to renderDialogTitle_unstable.
|
|
13
|
+
*
|
|
14
|
+
* @param props - props from this instance of DialogTitle
|
|
15
|
+
* @param ref - reference to root HTMLElement of DialogTitle
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export const useDialogTitle_unstable = (props, ref) => {
|
|
19
|
+
const {
|
|
20
|
+
as,
|
|
21
|
+
action
|
|
22
|
+
} = props;
|
|
23
|
+
const modalType = useDialogContext_unstable(ctx => ctx.modalType);
|
|
24
|
+
const internalStyles = useDialogTitleInternalStyles();
|
|
25
|
+
return {
|
|
26
|
+
components: {
|
|
27
|
+
root: 'div',
|
|
28
|
+
action: 'div'
|
|
29
|
+
},
|
|
30
|
+
root: getNativeElementProps(as !== null && as !== void 0 ? as : 'div', {
|
|
31
|
+
ref,
|
|
32
|
+
id: useDialogContext_unstable(ctx => ctx.dialogTitleId),
|
|
33
|
+
...props
|
|
34
|
+
}),
|
|
35
|
+
action: resolveShorthand(action, {
|
|
36
|
+
required: modalType === 'non-modal',
|
|
37
|
+
defaultProps: {
|
|
38
|
+
children: /*#__PURE__*/React.createElement(DialogTrigger, {
|
|
39
|
+
action: "close"
|
|
40
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
41
|
+
className: internalStyles.button,
|
|
42
|
+
"aria-label": "close"
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Dismiss24Regular, null)))
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=useDialogTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAEA,SAAS,yBAAT,QAA0C,8BAA1C;AACA,SAAS,gBAAT,QAAiC,uBAAjC;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,aAAT,QAA8B,gCAA9B;AACA,SAAS,4BAAT,QAA6C,wBAA7C;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;EAChH,MAAM;IAAE,EAAF;IAAM;EAAN,IAAiB,KAAvB;EACA,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,SAAZ,CAA3C;EACA,MAAM,cAAc,GAAG,4BAA4B,EAAnD;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,MAAM,EAAE;IAFE,CADP;IAKL,IAAI,EAAE,qBAAqB,CAAC,EAAE,KAAA,IAAF,IAAA,EAAE,KAAA,KAAA,CAAF,GAAA,EAAA,GAAM,KAAP,EAAc;MACvC,GADuC;MAEvC,EAAE,EAAE,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,aAAZ,CAFU;MAGvC,GAAG;IAHoC,CAAd,CALtB;IAUL,MAAM,EAAE,gBAAgB,CAAC,MAAD,EAAS;MAC/B,QAAQ,EAAE,SAAS,KAAK,WADO;MAE/B,YAAY,EAAE;QACZ,QAAQ,eACN,KAAA,CAAA,aAAA,CAAC,aAAD,EAAc;UAAC,MAAM,EAAC;QAAR,CAAd,eACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;UACE,SAAS,EAAE,cAAc,CAAC,MAD5B;UACkC,cAErB;QAHb,CAAA,eAKE,KAAA,CAAA,aAAA,CAAC,gBAAD,EAAiB,IAAjB,CALF,CADF;MAFU;IAFiB,CAAT;EAVnB,CAAP;AA2BD,CAhCM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogTitleProps, DialogTitleState } from './DialogTitle.types';\nimport { useDialogContext_unstable } from '../../contexts/dialogContext';\nimport { Dismiss24Regular } from '@fluentui/react-icons';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { DialogTrigger } from '../DialogTrigger/DialogTrigger';\nimport { useDialogTitleInternalStyles } from './useDialogTitleStyles';\n\n/**\n * Create the state required to render DialogTitle.\n *\n * The returned state can be modified with hooks such as useDialogTitleStyles_unstable,\n * before being passed to renderDialogTitle_unstable.\n *\n * @param props - props from this instance of DialogTitle\n * @param ref - reference to root HTMLElement of DialogTitle\n */\nexport const useDialogTitle_unstable = (props: DialogTitleProps, ref: React.Ref<HTMLElement>): DialogTitleState => {\n const { as, action } = props;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const internalStyles = useDialogTitleInternalStyles();\n\n return {\n components: {\n root: 'div',\n action: 'div',\n },\n root: getNativeElementProps(as ?? 'div', {\n ref,\n id: useDialogContext_unstable(ctx => ctx.dialogTitleId),\n ...props,\n }),\n action: resolveShorthand(action, {\n required: modalType === 'non-modal',\n defaultProps: {\n children: (\n <DialogTrigger action=\"close\">\n <button\n className={internalStyles.button}\n // TODO: find a better way to add internal labels\n aria-label=\"close\"\n >\n <Dismiss24Regular />\n </button>\n </DialogTrigger>\n ),\n },\n }),\n };\n};\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
+
import { typographyStyles } from '@fluentui/react-theme';
|
|
3
|
+
import { TITLE_ACTION_GRID_AREA, TITLE_GRID_AREA } from '../../contexts/constants';
|
|
4
|
+
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
|
|
5
|
+
export const dialogTitleClassNames = {
|
|
6
|
+
root: 'fui-DialogTitle',
|
|
7
|
+
action: 'fui-DialogTitle__action'
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Styles for the root slot
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const useStyles = /*#__PURE__*/__styles({
|
|
14
|
+
"root": {
|
|
15
|
+
"Bahqtrf": "fk6fouc",
|
|
16
|
+
"Be2twd7": "f1pp30po",
|
|
17
|
+
"Bhrd7zp": "fl43uef",
|
|
18
|
+
"Bg96gwp": "f106mvju",
|
|
19
|
+
"Ijaq50": "faq1aip",
|
|
20
|
+
"Br312pm": "f1m489tg",
|
|
21
|
+
"nk6f5a": "fv2srd9",
|
|
22
|
+
"Bw0ie65": "f1tz6hh8"
|
|
23
|
+
},
|
|
24
|
+
"rootWithoutCloseButton": {
|
|
25
|
+
"Ijaq50": "faq1aip",
|
|
26
|
+
"Br312pm": "f1m489tg",
|
|
27
|
+
"nk6f5a": "f11nczdl",
|
|
28
|
+
"Bw0ie65": "f98d4vj"
|
|
29
|
+
},
|
|
30
|
+
"action": {
|
|
31
|
+
"Ijaq50": "f1hysmiz",
|
|
32
|
+
"Br312pm": "f1379kmu",
|
|
33
|
+
"nk6f5a": "f11nczdl",
|
|
34
|
+
"Bw0ie65": "f98d4vj"
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
"d": [".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f106mvju{line-height:var(--lineHeightBase500);}", ".faq1aip{grid-row-start:title;}", ".f1m489tg{grid-column-start:title;}", ".fv2srd9{grid-row-end:title;}", ".f1tz6hh8{grid-column-end:title;}", ".f11nczdl{grid-row-end:close-button;}", ".f98d4vj{grid-column-end:close-button;}", ".f1hysmiz{grid-row-start:close-button;}", ".f1379kmu{grid-column-start:close-button;}"]
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Styles to be applied on internal elements used by default action on non-modal Dialog
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export const useDialogTitleInternalStyles = /*#__PURE__*/__styles({
|
|
46
|
+
"button": {
|
|
47
|
+
"qhf8xq": "f10pi13n",
|
|
48
|
+
"B7ck84d": "f1e4lqlz",
|
|
49
|
+
"De3pzq": "f1u2r49w",
|
|
50
|
+
"sj55zd": "f1ym3bx4",
|
|
51
|
+
"Bahqtrf": "f1mo0ibp",
|
|
52
|
+
"Be2twd7": "fjoy568",
|
|
53
|
+
"Bg96gwp": "fez10in",
|
|
54
|
+
"B68tc82": "f1mtd64y",
|
|
55
|
+
"Bmxbyg5": "f1y7q3j9",
|
|
56
|
+
"z8tnut": "f1g0x7ka",
|
|
57
|
+
"z189sj": ["fhxju0i", "f1cnd47f"],
|
|
58
|
+
"Byoj8tv": "f1qch9an",
|
|
59
|
+
"uwmqm3": ["f1cnd47f", "fhxju0i"],
|
|
60
|
+
"icvyot": "f1ern45e",
|
|
61
|
+
"vrafjx": ["f1n71otn", "f1deefiw"],
|
|
62
|
+
"oivjwe": "f1h8hb77",
|
|
63
|
+
"wvpqe5": ["f1deefiw", "f1n71otn"],
|
|
64
|
+
"Bv0vk6g": "f37px4s",
|
|
65
|
+
"fsow6f": "fgusgyc",
|
|
66
|
+
"Brovlpu": "ftqa4ok",
|
|
67
|
+
"B486eqv": "f2hkw1w",
|
|
68
|
+
"B8q5s1w": "f8hki3x",
|
|
69
|
+
"Bci5o5g": ["f1d2448m", "ffh67wi"],
|
|
70
|
+
"n8qw10": "f1bjia2o",
|
|
71
|
+
"Bdrgwmp": ["ffh67wi", "f1d2448m"],
|
|
72
|
+
"Bm4h7ae": "f15bsgw9",
|
|
73
|
+
"B7ys5i9": "f14e48fq",
|
|
74
|
+
"Busjfv9": "f18yb2kv",
|
|
75
|
+
"Bhk32uz": "fd6o370",
|
|
76
|
+
"Bf4ptjt": "fh1cnn4",
|
|
77
|
+
"kclons": ["fy7oxxb", "f184ne2d"],
|
|
78
|
+
"Bhdgwq3": "fpukqih",
|
|
79
|
+
"Blkhhs4": ["f184ne2d", "fy7oxxb"],
|
|
80
|
+
"Bqtpl0w": "frrh606",
|
|
81
|
+
"clg4pj": ["f1v5zibi", "fo2hd23"],
|
|
82
|
+
"hgwjuy": "ful5kiu",
|
|
83
|
+
"Bonggc9": ["fo2hd23", "f1v5zibi"],
|
|
84
|
+
"B1tsrr9": ["f1jqcqds", "ftffrms"],
|
|
85
|
+
"Dah5zi": ["ftffrms", "f1jqcqds"],
|
|
86
|
+
"Bkh64rk": ["f2e7qr6", "fsr1zz6"],
|
|
87
|
+
"qqdqy8": ["fsr1zz6", "f2e7qr6"],
|
|
88
|
+
"B6dhp37": "f1dvezut",
|
|
89
|
+
"i03rao": ["fd0oaoj", "f1cwg4i8"],
|
|
90
|
+
"Boxcth7": "fjvm52t",
|
|
91
|
+
"Bsom6fd": ["f1cwg4i8", "fd0oaoj"],
|
|
92
|
+
"J0r882": "fdiulkx",
|
|
93
|
+
"Bjwuhne": "f1yalx80",
|
|
94
|
+
"Ghsupd": ["fq22d5a", "f1jw7pan"],
|
|
95
|
+
"Bule8hv": ["f1jw7pan", "fq22d5a"]
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
"d": [".f10pi13n{position:relative;}", ".f1e4lqlz{box-sizing:content-box;}", ".f1u2r49w{background-color:inherit;}", ".f1ym3bx4{color:inherit;}", ".f1mo0ibp{font-family:inherit;}", ".fjoy568{font-size:inherit;}", ".fez10in{line-height:0;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f37px4s{-webkit-appearance:button;}", ".fgusgyc{text-align:unset;}", ".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}", ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}", ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}", ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}", ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}", ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}", ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}", ".fd6o370[data-fui-focus-visible]::after{z-index:1;}", ".fh1cnn4[data-fui-focus-visible]::after{border-top-style:solid;}", ".fy7oxxb[data-fui-focus-visible]::after{border-right-style:solid;}", ".f184ne2d[data-fui-focus-visible]::after{border-left-style:solid;}", ".fpukqih[data-fui-focus-visible]::after{border-bottom-style:solid;}", ".frrh606[data-fui-focus-visible]::after{border-top-width:2px;}", ".f1v5zibi[data-fui-focus-visible]::after{border-right-width:2px;}", ".fo2hd23[data-fui-focus-visible]::after{border-left-width:2px;}", ".ful5kiu[data-fui-focus-visible]::after{border-bottom-width:2px;}", ".f1jqcqds[data-fui-focus-visible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".ftffrms[data-fui-focus-visible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f2e7qr6[data-fui-focus-visible]::after{border-top-right-radius:var(--borderRadiusMedium);}", ".fsr1zz6[data-fui-focus-visible]::after{border-top-left-radius:var(--borderRadiusMedium);}", ".f1dvezut[data-fui-focus-visible]::after{border-top-color:var(--colorStrokeFocus2);}", ".fd0oaoj[data-fui-focus-visible]::after{border-right-color:var(--colorStrokeFocus2);}", ".f1cwg4i8[data-fui-focus-visible]::after{border-left-color:var(--colorStrokeFocus2);}", ".fjvm52t[data-fui-focus-visible]::after{border-bottom-color:var(--colorStrokeFocus2);}", ".fdiulkx[data-fui-focus-visible]::after{top:-2px;}", ".f1yalx80[data-fui-focus-visible]::after{bottom:-2px;}", ".fq22d5a[data-fui-focus-visible]::after{left:-2px;}", ".f1jw7pan[data-fui-focus-visible]::after{right:-2px;}"],
|
|
99
|
+
"f": [".ftqa4ok:focus{outline-style:none;}"],
|
|
100
|
+
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
101
|
+
});
|
|
102
|
+
/**
|
|
103
|
+
* Apply styling to the DialogTitle slots based on the state
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
export const useDialogTitleStyles_unstable = state => {
|
|
107
|
+
const styles = useStyles();
|
|
108
|
+
state.root.className = mergeClasses(dialogTitleClassNames.root, styles.root, !state.action && styles.rootWithoutCloseButton, state.root.className);
|
|
109
|
+
|
|
110
|
+
if (state.action) {
|
|
111
|
+
state.action.className = mergeClasses(dialogTitleClassNames.action, styles.action, state.action.className);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return state;
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=useDialogTitleStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitleStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,SAAS,gBAAT,QAAiC,uBAAjC;AACA,SAAS,sBAAT,EAAiC,eAAjC,QAAwD,0BAAxD;AACA,SAAS,uBAAT,QAAwC,yBAAxC;AAEA,OAAO,MAAM,qBAAqB,GAAqC;EACrE,IAAI,EAAE,iBAD+D;EAErE,MAAM,EAAE;AAF6D,CAAhE;AAKP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAaA;;;AAGG;;;AACH,OAAO,MAAM,4BAA4B,gBAAG;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;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EAArC;AAkBP;;AAEG;;AACH,OAAO,MAAM,6BAA6B,GAAI,KAAD,IAA8C;EACzF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,qBAAqB,CAAC,IADW,EAEjC,MAAM,CAAC,IAF0B,EAGjC,CAAC,KAAK,CAAC,MAAP,IAAiB,MAAM,CAAC,sBAHS,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;;EAMA,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CAAC,qBAAqB,CAAC,MAAvB,EAA+B,MAAM,CAAC,MAAtC,EAA8C,KAAK,CAAC,MAAN,CAAa,SAA3D,CAArC;EACD;;EACD,OAAO,KAAP;AACD,CAZM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogTitleSlots, DialogTitleState } from './DialogTitle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { TITLE_ACTION_GRID_AREA, TITLE_GRID_AREA } from '../../contexts/constants';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\n\nexport const dialogTitleClassNames: SlotClassNames<DialogTitleSlots> = {\n root: 'fui-DialogTitle',\n action: 'fui-DialogTitle__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.subtitle1,\n ...shorthands.gridArea(TITLE_GRID_AREA),\n },\n rootWithoutCloseButton: {\n ...shorthands.gridArea(TITLE_GRID_AREA, TITLE_GRID_AREA, TITLE_ACTION_GRID_AREA, TITLE_ACTION_GRID_AREA),\n },\n action: {\n ...shorthands.gridArea(TITLE_ACTION_GRID_AREA),\n },\n});\n\n/**\n * Styles to be applied on internal elements used by default action on non-modal Dialog\n * @internal\n */\nexport const useDialogTitleInternalStyles = makeStyles({\n button: {\n position: 'relative',\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 0,\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n ...createFocusOutlineStyle(),\n },\n});\n\n/**\n * Apply styling to the DialogTitle slots based on the state\n */\nexport const useDialogTitleStyles_unstable = (state: DialogTitleState): DialogTitleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogTitleClassNames.root,\n styles.root,\n !state.action && styles.rootWithoutCloseButton,\n state.root.className,\n );\n if (state.action) {\n state.action.className = mergeClasses(dialogTitleClassNames.action, styles.action, state.action.className);\n }\n return state;\n};\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useDialogTrigger_unstable } from './useDialogTrigger';
|
|
2
|
+
import { renderDialogTrigger_unstable } from './renderDialogTrigger';
|
|
3
|
+
/**
|
|
4
|
+
* A non-visual component that wraps its child
|
|
5
|
+
* and configures them to be the trigger that will open or close a `Dialog`.
|
|
6
|
+
* This component should only accept one child.
|
|
7
|
+
*
|
|
8
|
+
* In case the trigger is used outside `Dialog` component
|
|
9
|
+
* it'll still provide basic ARIA related attributes
|
|
10
|
+
* to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,
|
|
11
|
+
* in that case the user must provide a `controlled state`
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export const DialogTrigger = props => {
|
|
15
|
+
const state = useDialogTrigger_unstable(props);
|
|
16
|
+
return renderDialogTrigger_unstable(state);
|
|
17
|
+
};
|
|
18
|
+
DialogTrigger.displayName = 'DialogTrigger';
|
|
19
|
+
DialogTrigger.isFluentTriggerComponent = true;
|
|
20
|
+
//# sourceMappingURL=DialogTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.tsx"],"names":[],"mappings":"AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AAIA;;;;;;;;;AASG;;AACH,OAAO,MAAM,aAAa,GAA0D,KAAK,IAAG;EAC1F,MAAM,KAAK,GAAG,yBAAyB,CAAC,KAAD,CAAvC;EAEA,OAAO,4BAA4B,CAAC,KAAD,CAAnC;AACD,CAJM;AAMP,aAAa,CAAC,WAAd,GAA4B,eAA5B;AACA,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":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogTrigger.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type DialogTriggerAction = 'open' | 'close';\n\nexport type DialogTriggerProps = TriggerProps<DialogTriggerChildProps> & {\n /**\n * Explicitly declare if the trigger is responsible for opening or\n * closing a Dialog visibility state.\n *\n * If `DialogTrigger` is outside `DialogSurface` then it'll be `open` by default\n *\n * If `DialogTrigger` is inside `DialogSurface` then it'll be `close` by default\n */\n action?: DialogTriggerAction;\n};\n\n/**\n * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog\n */\nexport type DialogTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-haspopup'?: 'dialog';\n }\n>;\n\nexport type DialogTriggerState = {\n children: React.ReactElement | null;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/renderDialogTrigger.tsx"],"names":[],"mappings":"AAEA;;;;AAIG;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA+B,KAAK,CAAC,QAA1E","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":""}
|