@fluentui/react-dialog 9.0.0-beta.9 → 9.0.0

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.
Files changed (86) hide show
  1. package/CHANGELOG.json +141 -2
  2. package/CHANGELOG.md +47 -3
  3. package/README.md +41 -1
  4. package/dist/index.d.ts +27 -21
  5. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  6. package/lib/components/Dialog/useDialog.js +5 -6
  7. package/lib/components/Dialog/useDialog.js.map +1 -1
  8. package/lib/components/Dialog/useDialogContextValues.js +4 -4
  9. package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
  10. package/lib/components/DialogBody/useDialogBody.js +3 -3
  11. package/lib/components/DialogBody/useDialogBody.js.map +1 -1
  12. package/lib/components/DialogBody/useDialogBodyStyles.js +25 -17
  13. package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  14. package/lib/components/DialogContent/DialogContent.js +2 -1
  15. package/lib/components/DialogContent/DialogContent.js.map +1 -1
  16. package/lib/components/DialogContent/DialogContent.types.js.map +1 -1
  17. package/lib/components/DialogContent/renderDialogContent.js +1 -2
  18. package/lib/components/DialogContent/renderDialogContent.js.map +1 -1
  19. package/lib/components/DialogContent/useDialogContent.js +11 -10
  20. package/lib/components/DialogContent/useDialogContent.js.map +1 -1
  21. package/lib/components/DialogContent/useDialogContentStyles.js +23 -9
  22. package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -1
  23. package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -1
  24. package/lib/components/DialogSurface/useDialogSurface.js +10 -81
  25. package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
  26. package/lib/components/DialogSurface/useDialogSurfaceStyles.js +61 -59
  27. package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  28. package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -1
  29. package/lib/components/DialogTitle/useDialogTitle.js +1 -1
  30. package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
  31. package/lib/components/DialogTitle/useDialogTitleStyles.js +29 -29
  32. package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
  33. package/lib/components/DialogTrigger/useDialogTrigger.js +4 -3
  34. package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  35. package/lib/contexts/constants.js +1 -1
  36. package/lib/contexts/constants.js.map +1 -1
  37. package/lib/contexts/dialogContext.js.map +1 -1
  38. package/lib/utils/index.js +0 -2
  39. package/lib/utils/index.js.map +1 -1
  40. package/lib/utils/isEscapeKeyDown.js +1 -4
  41. package/lib/utils/isEscapeKeyDown.js.map +1 -1
  42. package/lib/utils/useFocusFirstElement.js +7 -8
  43. package/lib/utils/useFocusFirstElement.js.map +1 -1
  44. package/lib-commonjs/components/Dialog/useDialog.js +3 -4
  45. package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
  46. package/lib-commonjs/components/Dialog/useDialogContextValues.js +4 -4
  47. package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
  48. package/lib-commonjs/components/DialogBody/useDialogBody.js +3 -4
  49. package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -1
  50. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +25 -18
  51. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  52. package/lib-commonjs/components/DialogContent/DialogContent.js +2 -1
  53. package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -1
  54. package/lib-commonjs/components/DialogContent/renderDialogContent.js +1 -2
  55. package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -1
  56. package/lib-commonjs/components/DialogContent/useDialogContent.js +12 -10
  57. package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -1
  58. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +24 -8
  59. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -1
  60. package/lib-commonjs/components/DialogSurface/useDialogSurface.js +10 -81
  61. package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
  62. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +62 -60
  63. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  64. package/lib-commonjs/components/DialogTitle/useDialogTitle.js +1 -1
  65. package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
  66. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +29 -29
  67. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +4 -4
  68. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  69. package/lib-commonjs/contexts/constants.js +2 -2
  70. package/lib-commonjs/contexts/constants.js.map +1 -1
  71. package/lib-commonjs/contexts/dialogContext.js.map +1 -1
  72. package/lib-commonjs/utils/index.js +0 -4
  73. package/lib-commonjs/utils/index.js.map +1 -1
  74. package/lib-commonjs/utils/isEscapeKeyDown.js +1 -5
  75. package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -1
  76. package/lib-commonjs/utils/useFocusFirstElement.js +7 -9
  77. package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -1
  78. package/package.json +9 -11
  79. package/lib/utils/isHTMLDialogElement.js +0 -4
  80. package/lib/utils/isHTMLDialogElement.js.map +0 -1
  81. package/lib/utils/useControlNativeDialogOpenState.js +0 -20
  82. package/lib/utils/useControlNativeDialogOpenState.js.map +0 -1
  83. package/lib-commonjs/utils/isHTMLDialogElement.js +0 -13
  84. package/lib-commonjs/utils/isHTMLDialogElement.js.map +0 -1
  85. package/lib-commonjs/utils/useControlNativeDialogOpenState.js +0 -31
  86. package/lib-commonjs/utils/useControlNativeDialogOpenState.js.map +0 -1
@@ -3,7 +3,8 @@ import { useDialogContent_unstable } from './useDialogContent';
3
3
  import { renderDialogContent_unstable } from './renderDialogContent';
4
4
  import { useDialogContentStyles_unstable } from './useDialogContentStyles';
5
5
  /**
6
- * DialogContent component - TODO: add more docs
6
+ * The `DialogContent` is a container where the content of the dialog is rendered.
7
+ * Apart from styling, this component does not have other behavior.
7
8
  */
8
9
 
9
10
  export const DialogContent = /*#__PURE__*/React.forwardRef((props, ref) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/DialogContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AACA,SAAS,+BAAT,QAAgD,0BAAhD;AAIA;;AAEG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,yBAAyB,CAAC,KAAD,EAAQ,GAAR,CAAvC;EAEA,+BAA+B,CAAC,KAAD,CAA/B;EACA,OAAO,4BAA4B,CAAC,KAAD,CAAnC;AACD,CALqE,CAA/D;AAOP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { useDialogContent_unstable } from './useDialogContent';\nimport { renderDialogContent_unstable } from './renderDialogContent';\nimport { useDialogContentStyles_unstable } from './useDialogContentStyles';\nimport type { DialogContentProps } from './DialogContent.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DialogContent component - TODO: add more docs\n */\nexport const DialogContent: ForwardRefComponent<DialogContentProps> = React.forwardRef((props, ref) => {\n const state = useDialogContent_unstable(props, ref);\n\n useDialogContentStyles_unstable(state);\n return renderDialogContent_unstable(state);\n});\n\nDialogContent.displayName = 'DialogContent';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/DialogContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AACA,SAAS,+BAAT,QAAgD,0BAAhD;AAIA;;;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;EAEA,+BAA+B,CAAC,KAAD,CAA/B;EACA,OAAO,4BAA4B,CAAC,KAAD,CAAnC;AACD,CALqE,CAA/D;AAOP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { useDialogContent_unstable } from './useDialogContent';\nimport { renderDialogContent_unstable } from './renderDialogContent';\nimport { useDialogContentStyles_unstable } from './useDialogContentStyles';\nimport type { DialogContentProps } from './DialogContent.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogContent` is a container where the content of the dialog is rendered.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogContent: ForwardRefComponent<DialogContentProps> = React.forwardRef((props, ref) => {\n const state = useDialogContent_unstable(props, ref);\n\n useDialogContentStyles_unstable(state);\n return renderDialogContent_unstable(state);\n});\n\nDialogContent.displayName = 'DialogContent';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"DialogContent.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogContent/DialogContent.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogContentSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * DialogContent Props\n */\nexport type DialogContentProps = ComponentProps<DialogContentSlots> & {};\n\n/**\n * State used in rendering DialogContent\n */\nexport type DialogContentState = ComponentState<DialogContentSlots>;\n"]}
1
+ {"version":3,"file":"DialogContent.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogContent/DialogContent.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogContentSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * DialogContent Props\n */\nexport type DialogContentProps = ComponentProps<DialogContentSlots>;\n\n/**\n * State used in rendering DialogContent\n */\nexport type DialogContentState = ComponentState<DialogContentSlots>;\n"]}
@@ -8,8 +8,7 @@ export const renderDialogContent_unstable = state => {
8
8
  const {
9
9
  slots,
10
10
  slotProps
11
- } = getSlots(state); // TODO Add additional slots in the appropriate place
12
-
11
+ } = getSlots(state);
13
12
  return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
14
13
  });
15
14
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA8B;EACxE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAqB,KAArB,CAArC,CADwE,CAGxE;;EACA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CALM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogContentState, DialogContentSlots } from './DialogContent.types';\n\n/**\n * Render the final JSX of DialogContent\n */\nexport const renderDialogContent_unstable = (state: DialogContentState) => {\n const { slots, slotProps } = getSlots<DialogContentSlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA8B;EACxE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAqB,KAArB,CAArC;EAEA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogContentState, DialogContentSlots } from './DialogContent.types';\n\n/**\n * Render the final JSX of DialogContent\n */\nexport const renderDialogContent_unstable = (state: DialogContentState) => {\n const { slots, slotProps } = getSlots<DialogContentSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
@@ -1,25 +1,26 @@
1
1
  import { getNativeElementProps } from '@fluentui/react-utilities';
2
+ import { useDialogContext_unstable } from '../../contexts';
2
3
  /**
3
- * Create the state required to render DialogContent.
4
+ * Create the state required to render DialogBody.
4
5
  *
5
- * The returned state can be modified with hooks such as useDialogContentStyles_unstable,
6
- * before being passed to renderDialogContent_unstable.
6
+ * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,
7
+ * before being passed to renderDialogBody_unstable.
7
8
  *
8
- * @param props - props from this instance of DialogContent
9
- * @param ref - reference to root HTMLElement of DialogContent
9
+ * @param props - props from this instance of DialogBody
10
+ * @param ref - reference to root HTMLElement of DialogBody
10
11
  */
11
12
 
12
13
  export const useDialogContent_unstable = (props, ref) => {
14
+ var _a;
15
+
16
+ const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);
13
17
  return {
14
- // TODO add appropriate props/defaults
15
18
  components: {
16
- // TODO add each slot's element type or component
17
19
  root: 'div'
18
20
  },
19
- // TODO add appropriate slots, for example:
20
- // mySlot: resolveShorthand(props.mySlot),
21
- root: getNativeElementProps('div', {
21
+ root: getNativeElementProps((_a = props.as) !== null && _a !== void 0 ? _a : 'div', {
22
22
  ref,
23
+ id: dialogContentId,
23
24
  ...props
24
25
  })
25
26
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContent.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,OAAO;IACL;IACA,UAAU,EAAE;MACV;MACA,IAAI,EAAE;IAFI,CAFP;IAML;IACA;IACA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;MACjC,GADiC;MAEjC,GAAG;IAF8B,CAAR;EARtB,CAAP;AAaD,CAjBM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogContentProps, DialogContentState } from './DialogContent.types';\n\n/**\n * Create the state required to render DialogContent.\n *\n * The returned state can be modified with hooks such as useDialogContentStyles_unstable,\n * before being passed to renderDialogContent_unstable.\n *\n * @param props - props from this instance of DialogContent\n * @param ref - reference to root HTMLElement of DialogContent\n */\nexport const useDialogContent_unstable = (\n props: DialogContentProps,\n ref: React.Ref<HTMLElement>,\n): DialogContentState => {\n return {\n // TODO add appropriate props/defaults\n components: {\n // TODO add each slot's element type or component\n root: 'div',\n },\n // TODO add appropriate slots, for example:\n // mySlot: resolveShorthand(props.mySlot),\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContent.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AACA,SAAS,yBAAT,QAA0C,gBAA1C;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;EACtB,MAAM,eAAe,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,eAAZ,CAAjD;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,qBAAqB,CAAC,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,KAAb,EAAoB;MAC7C,GAD6C;MAE7C,EAAE,EAAE,eAFyC;MAG7C,GAAG;IAH0C,CAApB;EAJtB,CAAP;AAUD,CAfM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { DialogContentProps, DialogContentState } from './DialogContent.types';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogContent_unstable = (\n props: DialogContentProps,\n ref: React.Ref<HTMLElement>,\n): DialogContentState => {\n const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps(props.as ?? 'div', {\n ref,\n id: dialogContentId,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -1,16 +1,32 @@
1
- import { __styles, mergeClasses } from '@griffel/react';
1
+ import { __styles, mergeClasses, shorthands } from '@griffel/react';
2
+ import { CONTENT_GRID_AREA } from '../../contexts/constants';
3
+ import { typographyStyles } from '@fluentui/react-theme';
2
4
  export const dialogContentClassNames = {
3
- root: 'fui-DialogContent' // TODO: add class names for all slots on DialogContentSlots.
4
- // Should be of the form `<slotName>: 'fui-DialogContent__<slotName>`
5
-
5
+ root: 'fui-DialogContent'
6
6
  };
7
7
  /**
8
8
  * Styles for the root slot
9
9
  */
10
10
 
11
11
  const useStyles = /*#__PURE__*/__styles({
12
- "root": {}
13
- }, {});
12
+ "root": {
13
+ "a9b677": "fly5x3f",
14
+ "Bqenvij": "f1l02sjl",
15
+ "Bmxbyg5": "f5zp4f",
16
+ "sshi5w": "f1nxs5xn",
17
+ "B7ck84d": "f1ewtqcl",
18
+ "Ijaq50": "f6owso0",
19
+ "Br312pm": "fupswjn",
20
+ "nk6f5a": "foucsne",
21
+ "Bw0ie65": "f1ka72gx",
22
+ "Bahqtrf": "fk6fouc",
23
+ "Be2twd7": "fkhj508",
24
+ "Bhrd7zp": "figsok6",
25
+ "Bg96gwp": "f1i3iumi"
26
+ }
27
+ }, {
28
+ "d": [".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f5zp4f{overflow-y:auto;}", ".f1nxs5xn{min-height:32px;}", ".f1ewtqcl{box-sizing:border-box;}", ".f6owso0{grid-row-start:body;}", ".fupswjn{grid-column-start:body;}", ".foucsne{grid-row-end:body;}", ".f1ka72gx{grid-column-end:body;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
29
+ });
14
30
  /**
15
31
  * Apply styling to the DialogContent slots based on the state
16
32
  */
@@ -18,9 +34,7 @@ const useStyles = /*#__PURE__*/__styles({
18
34
 
19
35
  export const useDialogContentStyles_unstable = state => {
20
36
  const styles = useStyles();
21
- state.root.className = mergeClasses(dialogContentClassNames.root, styles.root, state.root.className); // TODO Add class names to slots, for example:
22
- // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);
23
-
37
+ state.root.className = mergeClasses(dialogContentClassNames.root, styles.root, state.root.className);
24
38
  return state;
25
39
  };
26
40
  //# sourceMappingURL=useDialogContentStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContentStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AAIA,OAAO,MAAM,uBAAuB,GAAuC;EACzE,IAAI,EAAE,mBADmE,CAEzE;EACA;;AAHyE,CAApE;AAMP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;AAAA,MAAlB;AAQA;;AAEG;;;AACH,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,uBAAuB,CAAC,IAAzB,EAA+B,MAAM,CAAC,IAAtC,EAA4C,KAAK,CAAC,IAAN,CAAW,SAAvD,CAAnC,CAF+F,CAI/F;EACA;;EAEA,OAAO,KAAP;AACD,CARM","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport type { DialogContentSlots, DialogContentState } from './DialogContent.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const dialogContentClassNames: SlotClassNames<DialogContentSlots> = {\n root: 'fui-DialogContent',\n // TODO: add class names for all slots on DialogContentSlots.\n // Should be of the form `<slotName>: 'fui-DialogContent__<slotName>`\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n // TODO Add default styles for the root element\n },\n\n // TODO add additional classes for different states and/or slots\n});\n\n/**\n * Apply styling to the DialogContent slots based on the state\n */\nexport const useDialogContentStyles_unstable = (state: DialogContentState): DialogContentState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogContentClassNames.root, styles.root, state.root.className);\n\n // TODO Add class names to slots, for example:\n // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContentStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,SAAS,iBAAT,QAAkC,0BAAlC;AACA,SAAS,gBAAT,QAAiC,uBAAjC;AAEA,OAAO,MAAM,uBAAuB,GAAuC;EACzE,IAAI,EAAE;AADmE,CAApE;AAIP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAYA;;AAEG;;;AACH,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,uBAAuB,CAAC,IAAzB,EAA+B,MAAM,CAAC,IAAtC,EAA4C,KAAK,CAAC,IAAN,CAAW,SAAvD,CAAnC;EACA,OAAO,KAAP;AACD,CAJM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogContentSlots, DialogContentState } from './DialogContent.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { CONTENT_GRID_AREA } from '../../contexts/constants';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const dialogContentClassNames: SlotClassNames<DialogContentSlots> = {\n root: 'fui-DialogContent',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n overflowY: 'auto',\n minHeight: '32px',\n boxSizing: 'border-box',\n ...shorthands.gridArea(CONTENT_GRID_AREA),\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Apply styling to the DialogContent slots based on the state\n */\nexport const useDialogContentStyles_unstable = (state: DialogContentState): DialogContentState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogContentClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"DialogSurface.types.js","sourceRoot":"../src/","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: NonNullable<Slot<'dialog', '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"]}
1
+ {"version":3,"file":"DialogSurface.types.js","sourceRoot":"../src/","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"]}
@@ -17,78 +17,12 @@ export const useDialogSurface_unstable = (props, ref) => {
17
17
  backdrop,
18
18
  as
19
19
  } = props;
20
- const isNativeDialog = as === 'dialog' || as === undefined;
21
20
  const modalType = useDialogContext_unstable(ctx => ctx.modalType);
22
21
  const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);
23
22
  const open = useDialogContext_unstable(ctx => ctx.open);
24
23
  const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);
25
- const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleID);
26
- const dialogBodyID = useDialogContext_unstable(ctx => ctx.dialogBodyID);
27
- const handleNativeClick = useEventCallback(event => {
28
- var _a;
29
-
30
- (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, event);
31
-
32
- if (modalType === 'alert' || event.target !== event.currentTarget) {
33
- return;
34
- }
35
-
36
- const {
37
- clientX,
38
- clientY
39
- } = event;
40
- const {
41
- top,
42
- left,
43
- width,
44
- height
45
- } = event.currentTarget.getBoundingClientRect();
46
- const isBackdropClick = top > clientY || clientY > top + height || left > clientX || clientX > left + width;
47
-
48
- if (isBackdropClick) {
49
- requestOpenChange({
50
- event,
51
- open: false,
52
- type: 'backdropClick'
53
- });
54
- }
55
- });
56
- const handleNativeCancel = useEventCallback(event => {
57
- var _a, _b;
58
-
59
- (_b = (_a = props).onCancel) === null || _b === void 0 ? void 0 : _b.call(_a, event);
60
-
61
- if (event.currentTarget !== event.target) {
62
- return;
63
- }
64
-
65
- if (modalType !== 'alert') {
66
- requestOpenChange({
67
- event,
68
- open: false,
69
- type: 'dialogCancel'
70
- });
71
- }
72
-
73
- event.preventDefault();
74
- });
75
- const handleNativeClose = useEventCallback(event => {
76
- var _a, _b;
77
-
78
- (_b = (_a = props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a, event); // Ensure dialog remains open if force closed by close event
79
-
80
- if (event.currentTarget.open !== open) {
81
- if (open) {
82
- if (modalType === 'non-modal') {
83
- event.currentTarget.show();
84
- } else {
85
- event.currentTarget.showModal();
86
- }
87
- } else {
88
- event.currentTarget.close();
89
- }
90
- }
91
- });
24
+ const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);
25
+ const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);
92
26
  const handledBackdropClick = useEventCallback(event => {
93
27
  var _a, _b;
94
28
 
@@ -128,29 +62,24 @@ export const useDialogSurface_unstable = (props, ref) => {
128
62
  return {
129
63
  components: {
130
64
  backdrop: 'div',
131
- root: 'dialog'
65
+ root: 'div'
132
66
  },
133
67
  backdrop: resolveShorthand(backdrop, {
134
- required: !isNativeDialog && open && modalType !== 'non-modal',
68
+ required: open && modalType !== 'non-modal',
135
69
  defaultProps: {
136
70
  'aria-hidden': 'true',
137
71
  onClick: handledBackdropClick
138
72
  }
139
73
  }),
140
- root: getNativeElementProps(as !== null && as !== void 0 ? as : 'dialog', { ...(isNativeDialog ? {
141
- role: modalType === 'alert' ? 'alertdialog' : undefined,
142
- onClose: handleNativeClose,
143
- onClick: handleNativeClick,
144
- onCancel: handleNativeCancel
145
- } : {
146
- 'aria-modal': modalType !== 'non-modal',
147
- role: modalType === 'alert' ? 'alertdialog' : 'dialog'
148
- }),
74
+ root: getNativeElementProps(as !== null && as !== void 0 ? as : 'div', {
75
+ tabIndex: -1,
76
+ 'aria-modal': modalType !== 'non-modal',
77
+ role: modalType === 'alert' ? 'alertdialog' : 'dialog',
78
+ 'aria-describedby': dialogContentId,
79
+ 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,
149
80
  ...props,
150
81
  ...modalAttributes,
151
82
  onKeyDown: handleKeyDown,
152
- 'aria-describedby': dialogBodyID,
153
- 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,
154
83
  ref: useMergedRefs(ref, dialogRef)
155
84
  })
156
85
  };
@@ -1 +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,QAA2D,aAA3D;AACA,SAAS,kBAAT,QAAmC,yBAAnC;AACA;;;;;;;;AAQG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAmB,KAAzB;EACA,MAAM,cAAc,GAAG,EAAE,KAAK,QAAP,IAAmB,EAAE,KAAK,SAAjD;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,YAAY,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,YAAZ,CAA9C;EAEA,MAAM,iBAAiB,GAAG,gBAAgB,CAAE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AAC,GAAD,EAAM,SAAN;IAjBwB,CAAjB;EAZtB,CAAP;AAgCD,CA3HM","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, HTMLDialogElementProps } from '../../utils';\nimport { useModalAttributes } from '@fluentui/react-tabster';\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 isNativeDialog = as === 'dialog' || as === undefined;\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 dialogBodyID = useDialogContext_unstable(ctx => ctx.dialogBodyID);\n\n const handleNativeClick = useEventCallback((event: React.MouseEvent<DialogSurfaceElementIntersection>) => {\n props.onClick?.(event);\n if (modalType === 'alert' || event.target !== event.currentTarget) {\n return;\n }\n const { clientX, clientY } = event;\n const { top, left, width, height } = event.currentTarget.getBoundingClientRect();\n const isBackdropClick = top > clientY || clientY > top + height || left > clientX || clientX > left + width;\n if (isBackdropClick) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleNativeCancel = useEventCallback((event: React.SyntheticEvent<DialogSurfaceElementIntersection>) => {\n (props as HTMLDialogElementProps).onCancel?.(event);\n if (event.currentTarget !== event.target) {\n return;\n }\n if (modalType !== 'alert') {\n requestOpenChange({\n event,\n open: false,\n type: 'dialogCancel',\n });\n }\n event.preventDefault();\n });\n\n const handleNativeClose = useEventCallback((event: React.SyntheticEvent<DialogSurfaceElementIntersection>) => {\n (props as HTMLDialogElementProps).onClose?.(event);\n // Ensure dialog remains open if force closed by close event\n if (event.currentTarget.open !== open) {\n if (open) {\n if (modalType === 'non-modal') {\n event.currentTarget.show();\n } else {\n event.currentTarget.showModal();\n }\n } else {\n event.currentTarget.close();\n }\n }\n });\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: 'dialog',\n },\n backdrop: resolveShorthand(backdrop, {\n required: !isNativeDialog && open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n onClick: handledBackdropClick,\n },\n }),\n root: getNativeElementProps(as ?? 'dialog', {\n ...(isNativeDialog\n ? {\n role: modalType === 'alert' ? 'alertdialog' : undefined,\n onClose: handleNativeClose,\n onClick: handleNativeClick,\n onCancel: handleNativeCancel,\n }\n : {\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n }),\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n 'aria-describedby': dialogBodyID,\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ref: useMergedRefs(ref, dialogRef),\n }),\n };\n};\n"],"sourceRoot":"../src/"}
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,IAA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CAAC,CAD4B;MAEvC,cAAc,SAAS,KAAK,WAFW;MAGvC,IAAI,EAAE,SAAS,KAAK,OAAd,GAAwB,aAAxB,GAAwC,QAHP;MAIvC,oBAAoB,eAJmB;MAKvC,mBAAmB,KAAK,CAAC,YAAD,CAAL,GAAsB,SAAtB,GAAkC,aALd;MAMvC,GAAG,KANoC;MAOvC,GAAG,eAPoC;MAQvC,SAAS,EAAE,aAR4B;MASvC,GAAG,EAAE,aAAa,CAAC,GAAD,EAAM,SAAN;IATqB,CAAd;EAZtB,CAAP;AAwBD,CAlEM","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 tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150\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":"../src/"}
@@ -1,7 +1,7 @@
1
1
  import { __styles, mergeClasses, shorthands } from '@griffel/react';
2
2
  import { tokens } from '@fluentui/react-theme';
3
- import { TITLE_GRID_AREA, ACTIONS_END_GRID_AREA, ACTIONS_START_GRID_AREA, SURFACE_BORDER_RADIUS, SURFACE_BORDER_WIDTH, SURFACE_PADDING, DIALOG_GAP, MEDIA_QUERY_BREAKPOINT_SELECTOR, BODY_GRID_AREA, TITLE_ACTION_GRID_AREA } from '../../contexts/constants';
4
- import { useDialogContext_unstable } from '../../contexts/dialogContext';
3
+ import { createFocusOutlineStyle } from '@fluentui/react-tabster';
4
+ import { MEDIA_QUERY_BREAKPOINT_SELECTOR, SURFACE_BORDER_RADIUS, SURFACE_BORDER_WIDTH, SURFACE_PADDING, useDialogContext_unstable } from '../../contexts';
5
5
  export const dialogSurfaceClassNames = {
6
6
  root: 'fui-DialogSurface',
7
7
  backdrop: 'fui-DialogSurface__backdrop'
@@ -11,7 +11,61 @@ export const dialogSurfaceClassNames = {
11
11
  */
12
12
 
13
13
  const useStyles = /*#__PURE__*/__styles({
14
+ "focusOutline": {
15
+ "Brovlpu": "ftqa4ok",
16
+ "B486eqv": "f2hkw1w",
17
+ "B8q5s1w": "f8hki3x",
18
+ "Bci5o5g": ["f1d2448m", "ffh67wi"],
19
+ "n8qw10": "f1bjia2o",
20
+ "Bdrgwmp": ["ffh67wi", "f1d2448m"],
21
+ "Bm4h7ae": "f15bsgw9",
22
+ "B7ys5i9": "f14e48fq",
23
+ "Busjfv9": "f18yb2kv",
24
+ "Bhk32uz": "fd6o370",
25
+ "Bf4ptjt": "fh1cnn4",
26
+ "kclons": ["fy7oxxb", "f184ne2d"],
27
+ "Bhdgwq3": "fpukqih",
28
+ "Blkhhs4": ["f184ne2d", "fy7oxxb"],
29
+ "Bqtpl0w": "frrh606",
30
+ "clg4pj": ["f1v5zibi", "fo2hd23"],
31
+ "hgwjuy": "ful5kiu",
32
+ "Bonggc9": ["fo2hd23", "f1v5zibi"],
33
+ "B1tsrr9": ["f1jqcqds", "ftffrms"],
34
+ "Dah5zi": ["ftffrms", "f1jqcqds"],
35
+ "Bkh64rk": ["f2e7qr6", "fsr1zz6"],
36
+ "qqdqy8": ["fsr1zz6", "f2e7qr6"],
37
+ "B6dhp37": "f1dvezut",
38
+ "i03rao": ["fd0oaoj", "f1cwg4i8"],
39
+ "Boxcth7": "fjvm52t",
40
+ "Bsom6fd": ["f1cwg4i8", "fd0oaoj"],
41
+ "J0r882": "fdiulkx",
42
+ "Bjwuhne": "f1yalx80",
43
+ "Ghsupd": ["fq22d5a", "f1jw7pan"],
44
+ "Bule8hv": ["f1jw7pan", "fq22d5a"]
45
+ },
14
46
  "root": {
47
+ "mc9l5x": "ftgm304",
48
+ "famaaq": "f1c515w",
49
+ "Bcdw1i0": "f1bitti",
50
+ "Bhzewxz": "f15twtuk",
51
+ "j35jbq": ["f1e31b4d", "f1vgc2s3"],
52
+ "B5kzvoi": "f1yab3r1",
53
+ "oyh7mz": ["f1vgc2s3", "f1e31b4d"],
54
+ "z8tnut": "fuq56rw",
55
+ "z189sj": ["f15kemlc", "fdgang7"],
56
+ "Byoj8tv": "fl2zwns",
57
+ "uwmqm3": ["fdgang7", "f15kemlc"],
58
+ "B6of3ja": "fgr6219",
59
+ "t21cq0": ["f1ujusj6", "fcgxt0o"],
60
+ "jrapky": "f10jk5vf",
61
+ "Frg6f3": ["fcgxt0o", "f1ujusj6"],
62
+ "icvyot": "fzkkow9",
63
+ "vrafjx": ["fcdblym", "fjik90z"],
64
+ "oivjwe": "fg706s2",
65
+ "wvpqe5": ["fjik90z", "fcdblym"],
66
+ "B68tc82": "f1ln0qer",
67
+ "Bmxbyg5": "fa2wlxz",
68
+ "fshzfu": "f120kxnn",
15
69
  "qhf8xq": "f19dog8a",
16
70
  "a9b677": "fly5x3f",
17
71
  "Bqenvij": "f3052tw",
@@ -21,16 +75,10 @@ const useStyles = /*#__PURE__*/__styles({
21
75
  "E5pizo": "f10nrhrw",
22
76
  "De3pzq": "fxugw4r",
23
77
  "sj55zd": "f19n0e5",
24
- "i8kkvl": "f4px1ci",
25
- "Belr9w4": "fn67r4l",
26
78
  "B4j52fo": "f5ogflp",
27
79
  "Bekrc4i": ["f1hqa2wf", "finvdd3"],
28
80
  "Bn0qgzm": "f1f09k3d",
29
81
  "ibv6hh": ["finvdd3", "f1hqa2wf"],
30
- "icvyot": "fzkkow9",
31
- "vrafjx": ["fcdblym", "fjik90z"],
32
- "oivjwe": "fg706s2",
33
- "wvpqe5": ["fjik90z", "fcdblym"],
34
82
  "g2u3we": "fghlq4f",
35
83
  "h3c5rm": ["f1gn591s", "fjscplz"],
36
84
  "B9xav0g": "fb073pr",
@@ -39,51 +87,7 @@ const useStyles = /*#__PURE__*/__styles({
39
87
  "Beyfa6y": ["f1ehz9de", "f1erghxr"],
40
88
  "B7oj6ja": ["f1spoy8", "fmb70yw"],
41
89
  "Btl43ni": ["fmb70yw", "f1spoy8"],
42
- "B6of3ja": "fgr6219",
43
- "t21cq0": ["f1ujusj6", "fcgxt0o"],
44
- "jrapky": "f10jk5vf",
45
- "Frg6f3": ["fcgxt0o", "f1ujusj6"],
46
- "mc9l5x": "f13qh94s",
47
- "wkccdc": "f874eam",
48
- "Budl1dq": "fjj47a5",
49
- "zoa1oz": "f16o7v7l",
50
- "z8tnut": "fuq56rw",
51
- "z189sj": ["f15kemlc", "fdgang7"],
52
- "Byoj8tv": "fl2zwns",
53
- "uwmqm3": ["fdgang7", "f15kemlc"],
54
- "B5xtmjs": "ff54dml",
55
- "Bqu9lor": "f52bj20",
56
- "B06wobe": "f1dangjo"
57
- },
58
- "dialog": {
59
- "mc9l5x": "ftgm304",
60
- "qhf8xq": "f19dog8a",
61
- "oyh7mz": ["f1vgc2s3", "f1e31b4d"],
62
- "j35jbq": ["f1e31b4d", "f1vgc2s3"],
63
- "Bhzewxz": "f15twtuk",
64
- "B5kzvoi": "f1yab3r1",
65
- "a9b677": "f1acs6jw",
66
- "Bqenvij": "f3052tw",
67
- "De3pzq": "f1k92xex",
68
- "B2u0y6b": "fheyfof",
69
- "Bxyxcbc": "f1xxuklu",
70
- "famaaq": "f1c515w",
71
- "Bcdw1i0": "f1bitti",
72
- "z8tnut": "f1g0x7ka",
73
- "z189sj": ["fhxju0i", "f1cnd47f"],
74
- "Byoj8tv": "f1qch9an",
75
- "uwmqm3": ["f1cnd47f", "fhxju0i"],
76
- "B6of3ja": "fgr6219",
77
- "t21cq0": ["f1ujusj6", "fcgxt0o"],
78
- "jrapky": "f10jk5vf",
79
- "Frg6f3": ["fcgxt0o", "f1ujusj6"],
80
- "icvyot": "f1ern45e",
81
- "vrafjx": ["f1n71otn", "f1deefiw"],
82
- "oivjwe": "f1h8hb77",
83
- "wvpqe5": ["f1deefiw", "f1n71otn"],
84
- "B68tc82": "f1ln0qer",
85
- "Bmxbyg5": "fa2wlxz",
86
- "fshzfu": "f120kxnn"
90
+ "B5xtmjs": "ff54dml"
87
91
  },
88
92
  "backdrop": {
89
93
  "qhf8xq": "f19dog8a",
@@ -100,13 +104,11 @@ const useStyles = /*#__PURE__*/__styles({
100
104
  "fshzfu": "foe20jx"
101
105
  }
102
106
  }, {
103
- "d": [".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);}", ".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;}", ".ftgm304{display:block;}", ".f1vgc2s3{left:0;}", ".f1e31b4d{right:0;}", ".f15twtuk{top:0;}", ".f1yab3r1{bottom:0;}", ".f1acs6jw{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}", ".f1k92xex{background-color:unset;}", ".fheyfof{max-width:unset;}", ".f1xxuklu{max-height:unset;}", ".f1c515w{-webkit-user-select:unset;-moz-user-select:unset;-ms-user-select:unset;user-select:unset;}", ".f1bitti{visibility:unset;}", ".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;}", ".f1ln0qer{overflow-x:unset;}", ".fa2wlxz{overflow-y:unset;}", ".f120kxnn::backdrop{background-color:rgba(0, 0, 0, 0.4);}", ".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;}"],
107
+ "f": [".ftqa4ok:focus{outline-style:none;}"],
108
+ "i": [".f2hkw1w:focus-visible{outline-style:none;}"],
109
+ "d": [".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;}", ".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;}"],
104
110
  "m": [["@media screen and (max-width: 480px){.ff54dml{max-width:100vw;}}", {
105
111
  "m": "screen and (max-width: 480px)"
106
- }], ["@media screen and (max-width: 480px){.f52bj20{grid-template-rows:auto 1fr auto auto;}}", {
107
- "m": "screen and (max-width: 480px)"
108
- }], ["@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\";}}", {
109
- "m": "screen and (max-width: 480px)"
110
112
  }]]
111
113
  });
112
114
  /**
@@ -117,7 +119,7 @@ const useStyles = /*#__PURE__*/__styles({
117
119
  export const useDialogSurfaceStyles_unstable = state => {
118
120
  const styles = useStyles();
119
121
  const isNestedDialog = useDialogContext_unstable(ctx => ctx.isNestedDialog);
120
- state.root.className = mergeClasses(dialogSurfaceClassNames.root, styles.dialog, styles.root, isNestedDialog && styles.nestedNativeDialogBackdrop, state.root.className);
122
+ state.root.className = mergeClasses(dialogSurfaceClassNames.root, styles.root, styles.focusOutline, isNestedDialog && styles.nestedNativeDialogBackdrop, state.root.className);
121
123
 
122
124
  if (state.backdrop) {
123
125
  state.backdrop.className = mergeClasses(dialogSurfaceClassNames.backdrop, styles.backdrop, isNestedDialog && styles.nestedDialogBackdrop, state.backdrop.className);
@@ -1 +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,eADF,EAEE,qBAFF,EAGE,uBAHF,EAIE,qBAJF,EAKE,oBALF,EAME,eANF,EAOE,UAPF,EAQE,+BARF,EASE,cATF,EAUE,sBAVF,QAWO,0BAXP;AAYA,SAAS,yBAAT,QAA0C,8BAA1C;AAGA,OAAO,MAAM,uBAAuB,GAAuC;EACzE,IAAI,EAAE,mBADmE;EAEzE,QAAQ,EAAE;AAF+D,CAApE;AAKP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;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cesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\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 TITLE_ACTION_GRID_AREA,\n} from '../../contexts/constants';\nimport { useDialogContext_unstable } from '../../contexts/dialogContext';\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 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.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} ${TITLE_ACTION_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} ${TITLE_ACTION_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 dialog: {\n display: 'block',\n position: 'fixed',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n width: 'fit-content',\n height: 'fit-content',\n backgroundColor: 'unset',\n maxWidth: 'unset',\n maxHeight: 'unset',\n userSelect: 'unset',\n visibility: 'unset',\n ...shorthands.padding(0),\n ...shorthands.margin('auto'),\n ...shorthands.borderStyle('none'),\n ...shorthands.overflow('unset'),\n '&::backdrop': {\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\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.dialog,\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":"../src/"}
1
+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AY,CACjC,uBAAuB,CAAC,IADS,EAEjC,MAAM,CAAC,IAF0B,EAGjC,MAAM,CAAC,YAH0B,EAIjC,cAAc,IAAI,MAAM,CAAC,0BAJQ,EAKjC,KAAK,CAAC,IAAN,CAAW,SALsB,CAAnC;;EAOA,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,CApBM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\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 focusOutline: createFocusOutlineStyle(),\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 styles.focusOutline,\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":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"DialogTitle.types.js","sourceRoot":"../src/","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"]}
1
+ {"version":3,"file":"DialogTitle.types.js","sourceRoot":"../src/","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"]}
@@ -29,7 +29,7 @@ export const useDialogTitle_unstable = (props, ref) => {
29
29
  },
30
30
  root: getNativeElementProps(as !== null && as !== void 0 ? as : 'div', {
31
31
  ref,
32
- id: useDialogContext_unstable(ctx => ctx.dialogTitleID),
32
+ id: useDialogContext_unstable(ctx => ctx.dialogTitleId),
33
33
  ...props
34
34
  }),
35
35
  action: resolveShorthand(action, {
@@ -1 +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":"../src/"}
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":"../src/"}