@fluentui/react-dialog 9.1.1 → 9.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/CHANGELOG.json +54 -1
  2. package/CHANGELOG.md +16 -2
  3. package/dist/index.d.ts +0 -1
  4. package/lib/components/Dialog/useDialog.js +0 -1
  5. package/lib/components/Dialog/useDialog.js.map +1 -1
  6. package/lib/components/Dialog/useDialogContextValues.js +0 -2
  7. package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
  8. package/lib/components/DialogContent/useDialogContent.js +0 -3
  9. package/lib/components/DialogContent/useDialogContent.js.map +1 -1
  10. package/lib/components/DialogSurface/useDialogSurface.js +0 -2
  11. package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
  12. package/lib/components/DialogTrigger/useDialogTrigger.js +2 -1
  13. package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  14. package/lib/contexts/dialogContext.js.map +1 -1
  15. package/lib-amd/Dialog.js +6 -0
  16. package/lib-amd/Dialog.js.map +1 -0
  17. package/lib-amd/DialogActions.js +6 -0
  18. package/lib-amd/DialogActions.js.map +1 -0
  19. package/lib-amd/DialogBody.js +6 -0
  20. package/lib-amd/DialogBody.js.map +1 -0
  21. package/lib-amd/DialogContent.js +6 -0
  22. package/lib-amd/DialogContent.js.map +1 -0
  23. package/lib-amd/DialogSurface.js +6 -0
  24. package/lib-amd/DialogSurface.js.map +1 -0
  25. package/lib-amd/DialogTitle.js +6 -0
  26. package/lib-amd/DialogTitle.js.map +1 -0
  27. package/lib-amd/DialogTrigger.js +6 -0
  28. package/lib-amd/DialogTrigger.js.map +1 -0
  29. package/lib-amd/components/Dialog/Dialog.js +19 -0
  30. package/lib-amd/components/Dialog/Dialog.js.map +1 -0
  31. package/lib-amd/components/Dialog/Dialog.types.js +5 -0
  32. package/lib-amd/components/Dialog/Dialog.types.js.map +1 -0
  33. package/lib-amd/components/Dialog/index.js +9 -0
  34. package/lib-amd/components/Dialog/index.js.map +1 -0
  35. package/lib-amd/components/Dialog/renderDialog.js +17 -0
  36. package/lib-amd/components/Dialog/renderDialog.js.map +1 -0
  37. package/lib-amd/components/Dialog/useDialog.js +77 -0
  38. package/lib-amd/components/Dialog/useDialog.js.map +1 -0
  39. package/lib-amd/components/Dialog/useDialogContextValues.js +24 -0
  40. package/lib-amd/components/Dialog/useDialogContextValues.js.map +1 -0
  41. package/lib-amd/components/DialogActions/DialogActions.js +16 -0
  42. package/lib-amd/components/DialogActions/DialogActions.js.map +1 -0
  43. package/lib-amd/components/DialogActions/DialogActions.types.js +5 -0
  44. package/lib-amd/components/DialogActions/DialogActions.types.js.map +1 -0
  45. package/lib-amd/components/DialogActions/index.js +10 -0
  46. package/lib-amd/components/DialogActions/index.js.map +1 -0
  47. package/lib-amd/components/DialogActions/renderDialogActions.js +15 -0
  48. package/lib-amd/components/DialogActions/renderDialogActions.js.map +1 -0
  49. package/lib-amd/components/DialogActions/useDialogActions.js +26 -0
  50. package/lib-amd/components/DialogActions/useDialogActions.js.map +1 -0
  51. package/lib-amd/components/DialogActions/useDialogActionsStyles.js +27 -0
  52. package/lib-amd/components/DialogActions/useDialogActionsStyles.js.map +1 -0
  53. package/lib-amd/components/DialogBody/DialogBody.js +16 -0
  54. package/lib-amd/components/DialogBody/DialogBody.js.map +1 -0
  55. package/lib-amd/components/DialogBody/DialogBody.types.js +5 -0
  56. package/lib-amd/components/DialogBody/DialogBody.types.js.map +1 -0
  57. package/lib-amd/components/DialogBody/index.js +10 -0
  58. package/lib-amd/components/DialogBody/index.js.map +1 -0
  59. package/lib-amd/components/DialogBody/renderDialogBody.js +15 -0
  60. package/lib-amd/components/DialogBody/renderDialogBody.js.map +1 -0
  61. package/lib-amd/components/DialogBody/useDialogBody.js +25 -0
  62. package/lib-amd/components/DialogBody/useDialogBody.js.map +1 -0
  63. package/lib-amd/components/DialogBody/useDialogBodyStyles.js +31 -0
  64. package/lib-amd/components/DialogBody/useDialogBodyStyles.js.map +1 -0
  65. package/lib-amd/components/DialogContent/DialogContent.js +16 -0
  66. package/lib-amd/components/DialogContent/DialogContent.js.map +1 -0
  67. package/lib-amd/components/DialogContent/DialogContent.types.js +5 -0
  68. package/lib-amd/components/DialogContent/DialogContent.types.js.map +1 -0
  69. package/lib-amd/components/DialogContent/index.js +10 -0
  70. package/lib-amd/components/DialogContent/index.js.map +1 -0
  71. package/lib-amd/components/DialogContent/renderDialogContent.js +14 -0
  72. package/lib-amd/components/DialogContent/renderDialogContent.js.map +1 -0
  73. package/lib-amd/components/DialogContent/useDialogContent.js +25 -0
  74. package/lib-amd/components/DialogContent/useDialogContent.js.map +1 -0
  75. package/lib-amd/components/DialogContent/useDialogContentStyles.js +24 -0
  76. package/lib-amd/components/DialogContent/useDialogContentStyles.js.map +1 -0
  77. package/lib-amd/components/DialogSurface/DialogSurface.js +17 -0
  78. package/lib-amd/components/DialogSurface/DialogSurface.js.map +1 -0
  79. package/lib-amd/components/DialogSurface/DialogSurface.types.js +5 -0
  80. package/lib-amd/components/DialogSurface/DialogSurface.types.js.map +1 -0
  81. package/lib-amd/components/DialogSurface/index.js +10 -0
  82. package/lib-amd/components/DialogSurface/index.js.map +1 -0
  83. package/lib-amd/components/DialogSurface/renderDialogSurface.js +17 -0
  84. package/lib-amd/components/DialogSurface/renderDialogSurface.js.map +1 -0
  85. package/lib-amd/components/DialogSurface/useDialogSurface.js +66 -0
  86. package/lib-amd/components/DialogSurface/useDialogSurface.js.map +1 -0
  87. package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js +11 -0
  88. package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -0
  89. package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js +44 -0
  90. package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
  91. package/lib-amd/components/DialogTitle/DialogTitle.js +16 -0
  92. package/lib-amd/components/DialogTitle/DialogTitle.js.map +1 -0
  93. package/lib-amd/components/DialogTitle/DialogTitle.types.js +5 -0
  94. package/lib-amd/components/DialogTitle/DialogTitle.types.js.map +1 -0
  95. package/lib-amd/components/DialogTitle/index.js +10 -0
  96. package/lib-amd/components/DialogTitle/index.js.map +1 -0
  97. package/lib-amd/components/DialogTitle/renderDialogTitle.js +16 -0
  98. package/lib-amd/components/DialogTitle/renderDialogTitle.js.map +1 -0
  99. package/lib-amd/components/DialogTitle/useDialogTitle.js +36 -0
  100. package/lib-amd/components/DialogTitle/useDialogTitle.js.map +1 -0
  101. package/lib-amd/components/DialogTitle/useDialogTitleStyles.js +37 -0
  102. package/lib-amd/components/DialogTitle/useDialogTitleStyles.js.map +1 -0
  103. package/lib-amd/components/DialogTrigger/DialogTrigger.js +24 -0
  104. package/lib-amd/components/DialogTrigger/DialogTrigger.js.map +1 -0
  105. package/lib-amd/components/DialogTrigger/DialogTrigger.types.js +5 -0
  106. package/lib-amd/components/DialogTrigger/DialogTrigger.types.js.map +1 -0
  107. package/lib-amd/components/DialogTrigger/index.js +9 -0
  108. package/lib-amd/components/DialogTrigger/index.js.map +1 -0
  109. package/lib-amd/components/DialogTrigger/renderDialogTrigger.js +13 -0
  110. package/lib-amd/components/DialogTrigger/renderDialogTrigger.js.map +1 -0
  111. package/lib-amd/components/DialogTrigger/useDialogTrigger.js +37 -0
  112. package/lib-amd/components/DialogTrigger/useDialogTrigger.js.map +1 -0
  113. package/lib-amd/contexts/constants.js +16 -0
  114. package/lib-amd/contexts/constants.js.map +1 -0
  115. package/lib-amd/contexts/dialogContext.js +25 -0
  116. package/lib-amd/contexts/dialogContext.js.map +1 -0
  117. package/lib-amd/contexts/dialogSurfaceContext.js +11 -0
  118. package/lib-amd/contexts/dialogSurfaceContext.js.map +1 -0
  119. package/lib-amd/contexts/index.js +8 -0
  120. package/lib-amd/contexts/index.js.map +1 -0
  121. package/lib-amd/index.js +37 -0
  122. package/lib-amd/index.js.map +1 -0
  123. package/lib-amd/utils/index.js +8 -0
  124. package/lib-amd/utils/index.js.map +1 -0
  125. package/lib-amd/utils/isEscapeKeyDown.js +13 -0
  126. package/lib-amd/utils/isEscapeKeyDown.js.map +1 -0
  127. package/lib-amd/utils/useDisableBodyScroll.js +52 -0
  128. package/lib-amd/utils/useDisableBodyScroll.js.map +1 -0
  129. package/lib-amd/utils/useFocusFirstElement.js +38 -0
  130. package/lib-amd/utils/useFocusFirstElement.js.map +1 -0
  131. package/lib-commonjs/components/Dialog/useDialog.js +0 -1
  132. package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
  133. package/lib-commonjs/components/Dialog/useDialogContextValues.js +0 -2
  134. package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
  135. package/lib-commonjs/components/DialogContent/useDialogContent.js +0 -4
  136. package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -1
  137. package/lib-commonjs/components/DialogSurface/useDialogSurface.js +0 -2
  138. package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
  139. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +2 -1
  140. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  141. package/lib-commonjs/contexts/dialogContext.js.map +1 -1
  142. package/package.json +6 -6
@@ -0,0 +1,44 @@
1
+ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme", "@fluentui/react-tabster", "../../contexts"], function (require, exports, tslib_1, react_1, react_theme_1, react_tabster_1, contexts_1) {
2
+ "use strict";
3
+ var _a;
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.useDialogSurfaceStyles_unstable = exports.dialogSurfaceClassNames = void 0;
6
+ exports.dialogSurfaceClassNames = {
7
+ root: 'fui-DialogSurface',
8
+ backdrop: 'fui-DialogSurface__backdrop',
9
+ };
10
+ /**
11
+ * Styles for the root slot
12
+ */
13
+ var useStyles = react_1.makeStyles({
14
+ focusOutline: react_tabster_1.createFocusOutlineStyle(),
15
+ root: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ display: 'block', userSelect: 'unset', visibility: 'unset' }, react_1.shorthands.inset(0)), react_1.shorthands.padding(0)), react_1.shorthands.padding(contexts_1.SURFACE_PADDING)), react_1.shorthands.margin('auto')), react_1.shorthands.borderStyle('none')), react_1.shorthands.overflow('unset')), { '&::backdrop': {
16
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
17
+ }, position: 'fixed', width: '100%', height: 'fit-content', maxWidth: '600px', maxHeight: '100vh', boxSizing: 'border-box', boxShadow: react_theme_1.tokens.shadow64, backgroundColor: react_theme_1.tokens.colorNeutralBackground1, color: react_theme_1.tokens.colorNeutralForeground1 }), react_1.shorthands.border(contexts_1.SURFACE_BORDER_WIDTH, 'solid', react_theme_1.tokens.colorTransparentStroke)), react_1.shorthands.borderRadius(contexts_1.SURFACE_BORDER_RADIUS)), (_a = {}, _a[contexts_1.MEDIA_QUERY_BREAKPOINT_SELECTOR] = {
18
+ maxWidth: '100vw',
19
+ }, _a)),
20
+ backdrop: tslib_1.__assign({ position: 'fixed', backgroundColor: 'rgba(0, 0, 0, 0.4)' }, react_1.shorthands.inset('0px')),
21
+ nestedDialogBackdrop: {
22
+ backgroundColor: 'transparent',
23
+ },
24
+ nestedNativeDialogBackdrop: {
25
+ '&::backdrop': {
26
+ backgroundColor: 'transparent',
27
+ },
28
+ },
29
+ });
30
+ /**
31
+ * Apply styling to the DialogSurface slots based on the state
32
+ */
33
+ var useDialogSurfaceStyles_unstable = function (state) {
34
+ var styles = useStyles();
35
+ var isNestedDialog = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.isNestedDialog; });
36
+ state.root.className = react_1.mergeClasses(exports.dialogSurfaceClassNames.root, styles.root, styles.focusOutline, isNestedDialog && styles.nestedNativeDialogBackdrop, state.root.className);
37
+ if (state.backdrop) {
38
+ state.backdrop.className = react_1.mergeClasses(exports.dialogSurfaceClassNames.backdrop, styles.backdrop, isNestedDialog && styles.nestedDialogBackdrop, state.backdrop.className);
39
+ }
40
+ return state;
41
+ };
42
+ exports.useDialogSurfaceStyles_unstable = useDialogSurfaceStyles_unstable;
43
+ });
44
+ //# sourceMappingURL=useDialogSurfaceStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialogSurfaceStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceStyles.ts"],"names":[],"mappings":";;;;;IAaa,QAAA,uBAAuB,GAAuC;QACzE,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,6BAA6B;KACxC,CAAC;IAEF;;OAEG;IACH,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,YAAY,EAAE,uCAAuB,EAAE;QACvC,IAAI,8KACF,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,OAAO,IAChB,kBAAU,CAAC,KAAK,CAAC,CAAC,CAAC,GACnB,kBAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GACrB,kBAAU,CAAC,OAAO,CAAC,0BAAe,CAAC,GACnC,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,GACzB,kBAAU,CAAC,WAAW,CAAC,MAAM,CAAC,GAC9B,kBAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,KAC/B,aAAa,EAAE;gBACb,eAAe,EAAE,oBAAoB;aACtC,EACD,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,oBAAM,CAAC,QAAQ,EAC1B,eAAe,EAAE,oBAAM,CAAC,uBAAuB,EAC/C,KAAK,EAAE,oBAAM,CAAC,uBAAuB,KAClC,kBAAU,CAAC,MAAM,CAAC,+BAAoB,EAAE,OAAO,EAAE,oBAAM,CAAC,sBAAsB,CAAC,GAC/E,kBAAU,CAAC,YAAY,CAAC,gCAAqB,CAAC,gBAChD,0CAA+B,IAAG;YACjC,QAAQ,EAAE,OAAO;SAClB,MACF;QACD,QAAQ,qBACN,QAAQ,EAAE,OAAO,EACjB,eAAe,EAAE,oBAAoB,IAClC,kBAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAC3B;QACD,oBAAoB,EAAE;YACpB,eAAe,EAAE,aAAa;SAC/B;QACD,0BAA0B,EAAE;YAC1B,aAAa,EAAE;gBACb,eAAe,EAAE,aAAa;aAC/B;SACF;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,+BAA+B,GAAG,UAAC,KAAyB;QACvE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,IAAM,cAAc,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,cAAc,EAAlB,CAAkB,CAAC,CAAC;QAE5E,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,+BAAuB,CAAC,IAAI,EAC5B,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,YAAY,EACnB,cAAc,IAAI,MAAM,CAAC,0BAA0B,EACnD,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QACF,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,oBAAY,CACrC,+BAAuB,CAAC,QAAQ,EAChC,MAAM,CAAC,QAAQ,EACf,cAAc,IAAI,MAAM,CAAC,oBAAoB,EAC7C,KAAK,CAAC,QAAQ,CAAC,SAAS,CACzB,CAAC;SACH;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IApBW,QAAA,+BAA+B,mCAoB1C","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"]}
@@ -0,0 +1,16 @@
1
+ define(["require", "exports", "react", "./useDialogTitle", "./renderDialogTitle", "./useDialogTitleStyles"], function (require, exports, React, useDialogTitle_1, renderDialogTitle_1, useDialogTitleStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DialogTitle = void 0;
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
+ exports.DialogTitle = React.forwardRef(function (props, ref) {
10
+ var state = useDialogTitle_1.useDialogTitle_unstable(props, ref);
11
+ useDialogTitleStyles_1.useDialogTitleStyles_unstable(state);
12
+ return renderDialogTitle_1.renderDialogTitle_unstable(state);
13
+ });
14
+ exports.DialogTitle.displayName = 'DialogTitle';
15
+ });
16
+ //# sourceMappingURL=DialogTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogTitle.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/DialogTitle.tsx"],"names":[],"mappings":";;;;IAOA;;;OAGG;IACU,QAAA,WAAW,GAA0C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC5F,IAAM,KAAK,GAAG,wCAAuB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAElD,oDAA6B,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,8CAA0B,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","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"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=DialogTitle.types.js.map
@@ -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,10 @@
1
+ define(["require", "exports", "tslib", "./DialogTitle", "./DialogTitle.types", "./renderDialogTitle", "./useDialogTitle", "./useDialogTitleStyles"], function (require, exports, tslib_1, DialogTitle_1, DialogTitle_types_1, renderDialogTitle_1, useDialogTitle_1, useDialogTitleStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(DialogTitle_1, exports);
5
+ tslib_1.__exportStar(DialogTitle_types_1, exports);
6
+ tslib_1.__exportStar(renderDialogTitle_1, exports);
7
+ tslib_1.__exportStar(useDialogTitle_1, exports);
8
+ tslib_1.__exportStar(useDialogTitleStyles_1, exports);
9
+ });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/index.ts"],"names":[],"mappings":";;;IAAA,6CAA8B;IAC9B,mDAAoC;IACpC,mDAAoC;IACpC,gDAAiC;IACjC,sDAAuC","sourcesContent":["export * from './DialogTitle';\nexport * from './DialogTitle.types';\nexport * from './renderDialogTitle';\nexport * from './useDialogTitle';\nexport * from './useDialogTitleStyles';\n"]}
@@ -0,0 +1,16 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderDialogTitle_unstable = void 0;
5
+ /**
6
+ * Render the final JSX of DialogTitle
7
+ */
8
+ var renderDialogTitle_unstable = function (state) {
9
+ var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
10
+ return (React.createElement(React.Fragment, null,
11
+ React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), slotProps.root.children),
12
+ slots.action && React.createElement(slots.action, tslib_1.__assign({}, slotProps.action))));
13
+ };
14
+ exports.renderDialogTitle_unstable = renderDialogTitle_unstable;
15
+ });
16
+ //# sourceMappingURL=renderDialogTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderDialogTitle.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/renderDialogTitle.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,0BAA0B,GAAG,UAAC,KAAuB;QAC1D,IAAA,KAAuB,0BAAQ,CAAmB,KAAK,CAAC,EAAtD,KAAK,WAAA,EAAE,SAAS,eAAsC,CAAC;QAE/D,OAAO,CACL;YACE,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAc;YACrE,KAAK,CAAC,MAAM,IAAI,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI,CACtD,CACJ,CAAC;IACJ,CAAC,CAAC;IATW,QAAA,0BAA0B,8BASrC","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"]}
@@ -0,0 +1,36 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "../../contexts/dialogContext", "@fluentui/react-icons", "@fluentui/react-utilities", "../DialogTrigger/DialogTrigger", "./useDialogTitleStyles"], function (require, exports, tslib_1, React, react_utilities_1, dialogContext_1, react_icons_1, react_utilities_2, DialogTrigger_1, useDialogTitleStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useDialogTitle_unstable = void 0;
5
+ /**
6
+ * Create the state required to render DialogTitle.
7
+ *
8
+ * The returned state can be modified with hooks such as useDialogTitleStyles_unstable,
9
+ * before being passed to renderDialogTitle_unstable.
10
+ *
11
+ * @param props - props from this instance of DialogTitle
12
+ * @param ref - reference to root HTMLElement of DialogTitle
13
+ */
14
+ var useDialogTitle_unstable = function (props, ref) {
15
+ var as = props.as, action = props.action;
16
+ var modalType = dialogContext_1.useDialogContext_unstable(function (ctx) { return ctx.modalType; });
17
+ var internalStyles = useDialogTitleStyles_1.useDialogTitleInternalStyles();
18
+ return {
19
+ components: {
20
+ root: 'div',
21
+ action: 'div',
22
+ },
23
+ root: react_utilities_1.getNativeElementProps(as !== null && as !== void 0 ? as : 'div', tslib_1.__assign({ ref: ref, id: dialogContext_1.useDialogContext_unstable(function (ctx) { return ctx.dialogTitleId; }) }, props)),
24
+ action: react_utilities_2.resolveShorthand(action, {
25
+ required: modalType === 'non-modal',
26
+ defaultProps: {
27
+ children: (React.createElement(DialogTrigger_1.DialogTrigger, { disableButtonEnhancement: true, action: "close" },
28
+ React.createElement("button", { className: internalStyles.button, "aria-label": "close" },
29
+ React.createElement(react_icons_1.Dismiss24Regular, null)))),
30
+ },
31
+ }),
32
+ };
33
+ };
34
+ exports.useDialogTitle_unstable = useDialogTitle_unstable;
35
+ });
36
+ //# sourceMappingURL=useDialogTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialogTitle.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitle.tsx"],"names":[],"mappings":";;;;IASA;;;;;;;;OAQG;IACI,IAAM,uBAAuB,GAAG,UAAC,KAAuB,EAAE,GAA2B;QAClF,IAAA,EAAE,GAAa,KAAK,GAAlB,EAAE,MAAM,GAAK,KAAK,OAAV,CAAW;QAC7B,IAAM,SAAS,GAAG,yCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,EAAb,CAAa,CAAC,CAAC;QAClE,IAAM,cAAc,GAAG,mDAA4B,EAAE,CAAC;QAEtD,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;gBACX,MAAM,EAAE,KAAK;aACd;YACD,IAAI,EAAE,uCAAqB,CAAC,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,KAAK,qBACrC,GAAG,KAAA,EACH,EAAE,EAAE,yCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,aAAa,EAAjB,CAAiB,CAAC,IACpD,KAAK,EACR;YACF,MAAM,EAAE,kCAAgB,CAAC,MAAM,EAAE;gBAC/B,QAAQ,EAAE,SAAS,KAAK,WAAW;gBACnC,YAAY,EAAE;oBACZ,QAAQ,EAAE,CACR,oBAAC,6BAAa,IAAC,wBAAwB,QAAC,MAAM,EAAC,OAAO;wBACpD,gCACE,SAAS,EAAE,cAAc,CAAC,MAAM,gBAErB,OAAO;4BAElB,oBAAC,8BAAgB,OAAG,CACb,CACK,CACjB;iBACF;aACF,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IAhCW,QAAA,uBAAuB,2BAgClC","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 disableButtonEnhancement 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"]}
@@ -0,0 +1,37 @@
1
+ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme", "../../contexts/constants", "@fluentui/react-tabster"], function (require, exports, tslib_1, react_1, react_theme_1, constants_1, react_tabster_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useDialogTitleStyles_unstable = exports.useDialogTitleInternalStyles = exports.dialogTitleClassNames = void 0;
5
+ exports.dialogTitleClassNames = {
6
+ root: 'fui-DialogTitle',
7
+ action: 'fui-DialogTitle__action',
8
+ };
9
+ /**
10
+ * Styles for the root slot
11
+ */
12
+ var useStyles = react_1.makeStyles({
13
+ root: tslib_1.__assign(tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle1), react_1.shorthands.gridArea(constants_1.TITLE_GRID_AREA)),
14
+ rootWithoutCloseButton: tslib_1.__assign({}, react_1.shorthands.gridArea(constants_1.TITLE_GRID_AREA, constants_1.TITLE_GRID_AREA, constants_1.TITLE_ACTION_GRID_AREA, constants_1.TITLE_ACTION_GRID_AREA)),
15
+ action: tslib_1.__assign({}, react_1.shorthands.gridArea(constants_1.TITLE_ACTION_GRID_AREA)),
16
+ });
17
+ /**
18
+ * Styles to be applied on internal elements used by default action on non-modal Dialog
19
+ * @internal
20
+ */
21
+ exports.useDialogTitleInternalStyles = react_1.makeStyles({
22
+ button: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ position: 'relative', boxSizing: 'content-box', backgroundColor: 'inherit', color: 'inherit', fontFamily: 'inherit', fontSize: 'inherit', cursor: 'pointer', lineHeight: 0 }, react_1.shorthands.overflow('visible')), react_1.shorthands.padding(0)), react_1.shorthands.borderStyle('none')), { WebkitAppearance: 'button', textAlign: 'unset' }), react_tabster_1.createFocusOutlineStyle()),
23
+ });
24
+ /**
25
+ * Apply styling to the DialogTitle slots based on the state
26
+ */
27
+ var useDialogTitleStyles_unstable = function (state) {
28
+ var styles = useStyles();
29
+ state.root.className = react_1.mergeClasses(exports.dialogTitleClassNames.root, styles.root, !state.action && styles.rootWithoutCloseButton, state.root.className);
30
+ if (state.action) {
31
+ state.action.className = react_1.mergeClasses(exports.dialogTitleClassNames.action, styles.action, state.action.className);
32
+ }
33
+ return state;
34
+ };
35
+ exports.useDialogTitleStyles_unstable = useDialogTitleStyles_unstable;
36
+ });
37
+ //# sourceMappingURL=useDialogTitleStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialogTitleStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitleStyles.ts"],"names":[],"mappings":";;;;IAOa,QAAA,qBAAqB,GAAqC;QACrE,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,yBAAyB;KAClC,CAAC;IAEF;;OAEG;IACH,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,wCACC,8BAAgB,CAAC,SAAS,GAC1B,kBAAU,CAAC,QAAQ,CAAC,2BAAe,CAAC,CACxC;QACD,sBAAsB,uBACjB,kBAAU,CAAC,QAAQ,CAAC,2BAAe,EAAE,2BAAe,EAAE,kCAAsB,EAAE,kCAAsB,CAAC,CACzG;QACD,MAAM,uBACD,kBAAU,CAAC,QAAQ,CAAC,kCAAsB,CAAC,CAC/C;KACF,CAAC,CAAC;IAEH;;;OAGG;IACU,QAAA,4BAA4B,GAAG,kBAAU,CAAC;QACrD,MAAM,yFACJ,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,CAAC,IACV,kBAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,GAC9B,kBAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GACrB,kBAAU,CAAC,WAAW,CAAC,MAAM,CAAC,KACjC,gBAAgB,EAAE,QAAQ,EAC1B,SAAS,EAAE,OAAO,KACf,uCAAuB,EAAE,CAC7B;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,6BAA6B,GAAG,UAAC,KAAuB;QACnE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,6BAAqB,CAAC,IAAI,EAC1B,MAAM,CAAC,IAAI,EACX,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,sBAAsB,EAC9C,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QACF,IAAI,KAAK,CAAC,MAAM,EAAE;YAChB,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,oBAAY,CAAC,6BAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SAC5G;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAZW,QAAA,6BAA6B,iCAYxC","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogTitleSlots, DialogTitleState } from './DialogTitle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { TITLE_ACTION_GRID_AREA, TITLE_GRID_AREA } from '../../contexts/constants';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\n\nexport const dialogTitleClassNames: SlotClassNames<DialogTitleSlots> = {\n root: 'fui-DialogTitle',\n action: 'fui-DialogTitle__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.subtitle1,\n ...shorthands.gridArea(TITLE_GRID_AREA),\n },\n rootWithoutCloseButton: {\n ...shorthands.gridArea(TITLE_GRID_AREA, TITLE_GRID_AREA, TITLE_ACTION_GRID_AREA, TITLE_ACTION_GRID_AREA),\n },\n action: {\n ...shorthands.gridArea(TITLE_ACTION_GRID_AREA),\n },\n});\n\n/**\n * Styles to be applied on internal elements used by default action on non-modal Dialog\n * @internal\n */\nexport const useDialogTitleInternalStyles = makeStyles({\n button: {\n position: 'relative',\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n cursor: 'pointer',\n lineHeight: 0,\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n ...createFocusOutlineStyle(),\n },\n});\n\n/**\n * Apply styling to the DialogTitle slots based on the state\n */\nexport const useDialogTitleStyles_unstable = (state: DialogTitleState): DialogTitleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogTitleClassNames.root,\n styles.root,\n !state.action && styles.rootWithoutCloseButton,\n state.root.className,\n );\n if (state.action) {\n state.action.className = mergeClasses(dialogTitleClassNames.action, styles.action, state.action.className);\n }\n return state;\n};\n"]}
@@ -0,0 +1,24 @@
1
+ define(["require", "exports", "./useDialogTrigger", "./renderDialogTrigger"], function (require, exports, useDialogTrigger_1, renderDialogTrigger_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DialogTrigger = void 0;
5
+ /**
6
+ * A non-visual component that wraps its child
7
+ * and configures them to be the trigger that will open or close a `Dialog`.
8
+ * This component should only accept one child.
9
+ *
10
+ * In case the trigger is used outside `Dialog` component
11
+ * it'll still provide basic ARIA related attributes
12
+ * to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,
13
+ * in that case the user must provide a `controlled state`
14
+ */
15
+ var DialogTrigger = function (props) {
16
+ var state = useDialogTrigger_1.useDialogTrigger_unstable(props);
17
+ return renderDialogTrigger_1.renderDialogTrigger_unstable(state);
18
+ };
19
+ exports.DialogTrigger = DialogTrigger;
20
+ exports.DialogTrigger.displayName = 'DialogTrigger';
21
+ // type casting here is required to ensure internal type FluentTriggerComponent is not leaked
22
+ exports.DialogTrigger.isFluentTriggerComponent = true;
23
+ });
24
+ //# sourceMappingURL=DialogTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogTrigger.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.tsx"],"names":[],"mappings":";;;;IAMA;;;;;;;;;OASG;IACI,IAAM,aAAa,GAAiC,UAAA,KAAK;QAC9D,IAAM,KAAK,GAAG,4CAAyB,CAAC,KAAK,CAAC,CAAC;QAE/C,OAAO,kDAA4B,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC,CAAC;IAJW,QAAA,aAAa,iBAIxB;IAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC;IAC5C,6FAA6F;IAC5F,qBAAwC,CAAC,wBAAwB,GAAG,IAAI,CAAC","sourcesContent":["import * as React from 'react';\nimport { useDialogTrigger_unstable } from './useDialogTrigger';\nimport { renderDialogTrigger_unstable } from './renderDialogTrigger';\nimport type { DialogTriggerProps } from './DialogTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will open or close a `Dialog`.\n * This component should only accept one child.\n *\n * In case the trigger is used outside `Dialog` component\n * it'll still provide basic ARIA related attributes\n * to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,\n * in that case the user must provide a `controlled state`\n */\nexport const DialogTrigger: React.FC<DialogTriggerProps> = props => {\n const state = useDialogTrigger_unstable(props);\n\n return renderDialogTrigger_unstable(state);\n};\n\nDialogTrigger.displayName = 'DialogTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(DialogTrigger as FluentTriggerComponent).isFluentTriggerComponent = true;\n"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=DialogTrigger.types.js.map
@@ -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 * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog\n */\nexport type DialogTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-haspopup'?: 'dialog';\n }\n>;\n\nexport type DialogTriggerState = {\n children: React.ReactElement | null;\n};\n"]}
@@ -0,0 +1,9 @@
1
+ define(["require", "exports", "tslib", "./DialogTrigger", "./DialogTrigger.types", "./renderDialogTrigger", "./useDialogTrigger"], function (require, exports, tslib_1, DialogTrigger_1, DialogTrigger_types_1, renderDialogTrigger_1, useDialogTrigger_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(DialogTrigger_1, exports);
5
+ tslib_1.__exportStar(DialogTrigger_types_1, exports);
6
+ tslib_1.__exportStar(renderDialogTrigger_1, exports);
7
+ tslib_1.__exportStar(useDialogTrigger_1, exports);
8
+ });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/index.ts"],"names":[],"mappings":";;;IAAA,+CAAgC;IAChC,qDAAsC;IACtC,qDAAsC;IACtC,kDAAmC","sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"]}
@@ -0,0 +1,13 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderDialogTrigger_unstable = void 0;
5
+ /**
6
+ * Render the final JSX of MenuTrigger
7
+ *
8
+ * Only renders children
9
+ */
10
+ var renderDialogTrigger_unstable = function (state) { return state.children; };
11
+ exports.renderDialogTrigger_unstable = renderDialogTrigger_unstable;
12
+ });
13
+ //# sourceMappingURL=renderDialogTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderDialogTrigger.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/renderDialogTrigger.tsx"],"names":[],"mappings":";;;;IAEA;;;;OAIG;IACI,IAAM,4BAA4B,GAAG,UAAC,KAAyB,IAAK,OAAA,KAAK,CAAC,QAAQ,EAAd,CAAc,CAAC;IAA7E,QAAA,4BAA4B,gCAAiD","sourcesContent":["import type { DialogTriggerState } from './DialogTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderDialogTrigger_unstable = (state: DialogTriggerState) => state.children;\n"]}
@@ -0,0 +1,37 @@
1
+ define(["require", "exports", "tslib", "@fluentui/react-tabster", "@fluentui/react-utilities", "../../contexts", "@fluentui/react-aria"], function (require, exports, tslib_1, react_tabster_1, react_utilities_1, contexts_1, react_aria_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useDialogTrigger_unstable = void 0;
5
+ /**
6
+ * Create the state required to render DialogTrigger.
7
+ * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog
8
+ *
9
+ * @param props - props from this instance of DialogTrigger
10
+ */
11
+ var useDialogTrigger_unstable = function (props) {
12
+ var isInsideSurfaceDialog = contexts_1.useDialogSurfaceContext_unstable();
13
+ var children = props.children, _a = props.disableButtonEnhancement, disableButtonEnhancement = _a === void 0 ? false : _a, _b = props.action, action = _b === void 0 ? isInsideSurfaceDialog ? 'close' : 'open' : _b;
14
+ var child = react_utilities_1.getTriggerChild(children);
15
+ var requestOpenChange = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.requestOpenChange; });
16
+ var open = contexts_1.useDialogContext_unstable(function (ctx) { return ctx.open; });
17
+ var triggerAttributes = react_tabster_1.useModalAttributes().triggerAttributes;
18
+ var handleClick = react_utilities_1.useEventCallback(function (event) {
19
+ var _a, _b;
20
+ (_b = child === null || child === void 0 ? void 0 : (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
21
+ if (!event.isDefaultPrevented()) {
22
+ requestOpenChange({
23
+ event: event,
24
+ type: 'triggerClick',
25
+ open: action === 'open',
26
+ });
27
+ }
28
+ });
29
+ var triggerChildProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, child === null || child === void 0 ? void 0 : child.props), { 'aria-expanded': open, ref: child === null || child === void 0 ? void 0 : child.ref, onClick: handleClick }), triggerAttributes);
30
+ var ariaButtonTriggerChildProps = react_aria_1.useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', tslib_1.__assign(tslib_1.__assign({}, triggerChildProps), { type: 'button' }));
31
+ return {
32
+ children: react_utilities_1.applyTriggerPropsToChildren(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps),
33
+ };
34
+ };
35
+ exports.useDialogTrigger_unstable = useDialogTrigger_unstable;
36
+ });
37
+ //# sourceMappingURL=useDialogTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialogTrigger.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/DialogTrigger/useDialogTrigger.ts"],"names":[],"mappings":";;;;IAOA;;;;;OAKG;IACI,IAAM,yBAAyB,GAAG,UAAC,KAAyB;QACjE,IAAM,qBAAqB,GAAG,2CAAgC,EAAE,CAAC;QAEzD,IAAA,QAAQ,GAA0F,KAAK,SAA/F,EAAE,KAAwF,KAAK,yBAA7D,EAAhC,wBAAwB,mBAAG,KAAK,KAAA,EAAE,KAAsD,KAAK,OAAV,EAAjD,MAAM,mBAAG,qBAAqB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,KAAA,CAAW;QAEhH,IAAM,KAAK,GAAG,iCAAe,CAAC,QAAQ,CAAC,CAAC;QAExC,IAAM,iBAAiB,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,iBAAiB,EAArB,CAAqB,CAAC,CAAC;QAClF,IAAM,IAAI,GAAG,oCAAyB,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAR,CAAQ,CAAC,CAAC;QAEhD,IAAA,iBAAiB,GAAK,kCAAkB,EAAE,kBAAzB,CAA0B;QAEnD,IAAM,WAAW,GAAG,kCAAgB,CAClC,UAAC,KAA+E;;YAC9E,MAAA,KAAK,aAAL,KAAK,6BAAL,KAAK,CAAE,KAAK,EAAC,OAAO,mDAAG,KAAK,CAAC,CAAC;YAC9B,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE;gBAC/B,iBAAiB,CAAC;oBAChB,KAAK,OAAA;oBACL,IAAI,EAAE,cAAc;oBACpB,IAAI,EAAE,MAAM,KAAK,MAAM;iBACxB,CAAC,CAAC;aACJ;QACH,CAAC,CACF,CAAC;QAEF,IAAM,iBAAiB,GAAG,uDACrB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,KACf,eAAe,EAAE,IAAI,EACrB,GAAG,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,EACf,OAAO,EAAE,WAAW,KACjB,iBAAiB,CACZ,CAAC;QAEX,IAAM,2BAA2B,GAAG,+BAAkB,CACpD,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,MAAK,QAAQ,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,MAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,wCAE/D,iBAAiB,KACpB,IAAI,EAAE,QAAQ,IAEjB,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,6CAA2B,CACnC,QAAQ,EACR,wBAAwB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,2BAA2B,CAC3E;SACF,CAAC;IACJ,CAAC,CAAC;IA/CW,QAAA,yBAAyB,6BA+CpC","sourcesContent":["import * as React from 'react';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport type { DialogTriggerProps, DialogTriggerState } from './DialogTrigger.types';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */\nexport const useDialogTrigger_unstable = (props: DialogTriggerProps): DialogTriggerState => {\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n\n const { children, disableButtonEnhancement = false, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const open = useDialogContext_unstable(ctx => ctx.open);\n\n const { triggerAttributes } = useModalAttributes();\n\n const handleClick = useEventCallback(\n (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open',\n });\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n 'aria-expanded': open,\n ref: child?.ref,\n onClick: handleClick,\n ...triggerAttributes,\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"]}
@@ -0,0 +1,16 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CONTENT_GRID_AREA = exports.TITLE_ACTION_GRID_AREA = exports.TITLE_GRID_AREA = exports.ACTIONS_END_GRID_AREA = exports.ACTIONS_START_GRID_AREA = exports.SURFACE_BORDER_WIDTH = exports.SURFACE_BORDER_RADIUS = exports.DIALOG_GAP = exports.SURFACE_PADDING = exports.MEDIA_QUERY_BREAKPOINT_SELECTOR = void 0;
5
+ exports.MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';
6
+ exports.SURFACE_PADDING = '24px';
7
+ exports.DIALOG_GAP = '8px';
8
+ exports.SURFACE_BORDER_RADIUS = '8px';
9
+ exports.SURFACE_BORDER_WIDTH = '1px';
10
+ exports.ACTIONS_START_GRID_AREA = 'actions-start';
11
+ exports.ACTIONS_END_GRID_AREA = 'actions-end';
12
+ exports.TITLE_GRID_AREA = 'title';
13
+ exports.TITLE_ACTION_GRID_AREA = 'close-button';
14
+ exports.CONTENT_GRID_AREA = 'body';
15
+ });
16
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/contexts/constants.ts"],"names":[],"mappings":";;;;IAAa,QAAA,+BAA+B,GAAG,sCAAsC,CAAC;IACzE,QAAA,eAAe,GAAG,MAAM,CAAC;IACzB,QAAA,UAAU,GAAG,KAAK,CAAC;IACnB,QAAA,qBAAqB,GAAG,KAAK,CAAC;IAC9B,QAAA,oBAAoB,GAAG,KAAK,CAAC;IAE7B,QAAA,uBAAuB,GAAG,eAAe,CAAC;IAC1C,QAAA,qBAAqB,GAAG,aAAa,CAAC;IACtC,QAAA,eAAe,GAAG,OAAO,CAAC;IAC1B,QAAA,sBAAsB,GAAG,cAAc,CAAC;IACxC,QAAA,iBAAiB,GAAG,MAAM,CAAC","sourcesContent":["export const MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';\nexport const SURFACE_PADDING = '24px';\nexport const DIALOG_GAP = '8px';\nexport const SURFACE_BORDER_RADIUS = '8px';\nexport const SURFACE_BORDER_WIDTH = '1px';\n\nexport const ACTIONS_START_GRID_AREA = 'actions-start';\nexport const ACTIONS_END_GRID_AREA = 'actions-end';\nexport const TITLE_GRID_AREA = 'title';\nexport const TITLE_ACTION_GRID_AREA = 'close-button';\nexport const CONTENT_GRID_AREA = 'body';\n"]}
@@ -0,0 +1,25 @@
1
+ define(["require", "exports", "@fluentui/react-context-selector"], function (require, exports, react_context_selector_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useDialogContext_unstable = exports.DialogProvider = exports.DialogContext = void 0;
5
+ var defaultContextValue = {
6
+ open: false,
7
+ modalType: 'modal',
8
+ isNestedDialog: false,
9
+ dialogRef: { current: null },
10
+ requestOpenChange: function () {
11
+ /* noop */
12
+ },
13
+ };
14
+ // Contexts should default to undefined
15
+ exports.DialogContext = react_context_selector_1.createContext(undefined);
16
+ exports.DialogProvider = exports.DialogContext.Provider;
17
+ var useDialogContext_unstable = function (selector) {
18
+ return react_context_selector_1.useContextSelector(exports.DialogContext, function (ctx) {
19
+ if (ctx === void 0) { ctx = defaultContextValue; }
20
+ return selector(ctx);
21
+ });
22
+ };
23
+ exports.useDialogContext_unstable = useDialogContext_unstable;
24
+ });
25
+ //# sourceMappingURL=dialogContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialogContext.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/contexts/dialogContext.ts"],"names":[],"mappings":";;;;IAkBA,IAAM,mBAAmB,GAAuB;QAC9C,IAAI,EAAE,KAAK;QACX,SAAS,EAAE,OAAO;QAClB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,iBAAiB;YACf,UAAU;QACZ,CAAC;KACF,CAAC;IAEF,uCAAuC;IAC1B,QAAA,aAAa,GAA4C,sCAAa,CACjF,SAAS,CACV,CAAC;IAEW,QAAA,cAAc,GAAG,qBAAa,CAAC,QAAQ,CAAC;IAC9C,IAAM,yBAAyB,GAAG,UAAI,QAAgD;QAC3F,OAAA,2CAAkB,CAAC,qBAAa,EAAE,UAAC,GAAyB;YAAzB,oBAAA,EAAA,yBAAyB;YAAK,OAAA,QAAQ,CAAC,GAAG,CAAC;QAAb,CAAa,CAAC;IAA/E,CAA+E,CAAC;IADrE,QAAA,yBAAyB,6BAC4C","sourcesContent":["import * as React from 'react';\nimport { createContext, ContextSelector, useContextSelector } from '@fluentui/react-context-selector';\nimport { DialogSurfaceElement } from '../DialogSurface';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { DialogModalType, DialogOpenChangeData } from '../Dialog';\n\nexport type DialogContextValue = {\n open: boolean;\n dialogTitleId?: string;\n isNestedDialog: boolean;\n dialogRef: React.Ref<DialogSurfaceElement>;\n modalType: DialogModalType;\n /**\n * Requests dialog main component to update it's internal open state\n */\n requestOpenChange: (data: DialogOpenChangeData) => void;\n};\n\nconst defaultContextValue: DialogContextValue = {\n open: false,\n modalType: 'modal',\n isNestedDialog: false,\n dialogRef: { current: null },\n requestOpenChange() {\n /* noop */\n },\n};\n\n// Contexts should default to undefined\nexport const DialogContext: Context<DialogContextValue | undefined> = createContext<DialogContextValue | undefined>(\n undefined,\n);\n\nexport const DialogProvider = DialogContext.Provider;\nexport const useDialogContext_unstable = <T>(selector: ContextSelector<DialogContextValue, T>): T =>\n useContextSelector(DialogContext, (ctx = defaultContextValue) => selector(ctx));\n"]}
@@ -0,0 +1,11 @@
1
+ define(["require", "exports", "react"], function (require, exports, react_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useDialogSurfaceContext_unstable = exports.DialogSurfaceProvider = exports.DialogSurfaceContext = void 0;
5
+ var defaultContextValue = false;
6
+ exports.DialogSurfaceContext = react_1.createContext(undefined);
7
+ exports.DialogSurfaceProvider = exports.DialogSurfaceContext.Provider;
8
+ var useDialogSurfaceContext_unstable = function () { var _a; return (_a = react_1.useContext(exports.DialogSurfaceContext)) !== null && _a !== void 0 ? _a : defaultContextValue; };
9
+ exports.useDialogSurfaceContext_unstable = useDialogSurfaceContext_unstable;
10
+ });
11
+ //# sourceMappingURL=dialogSurfaceContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialogSurfaceContext.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/contexts/dialogSurfaceContext.ts"],"names":[],"mappings":";;;;IAIA,IAAM,mBAAmB,GAA8B,KAAK,CAAC;IAEhD,QAAA,oBAAoB,GAAG,qBAAa,CAAwC,SAAS,CAAC,CAAC;IAEvF,QAAA,qBAAqB,GAAG,4BAAoB,CAAC,QAAQ,CAAC;IAE5D,IAAM,gCAAgC,GAAG,sBAAM,OAAA,MAAA,kBAAU,CAAC,4BAAoB,CAAC,mCAAI,mBAAmB,CAAA,EAAA,CAAC;IAAjG,QAAA,gCAAgC,oCAAiE","sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type DialogSurfaceContextValue = boolean;\n\nconst defaultContextValue: DialogSurfaceContextValue = false;\n\nexport const DialogSurfaceContext = createContext<DialogSurfaceContextValue | undefined>(undefined);\n\nexport const DialogSurfaceProvider = DialogSurfaceContext.Provider;\n\nexport const useDialogSurfaceContext_unstable = () => useContext(DialogSurfaceContext) ?? defaultContextValue;\n"]}
@@ -0,0 +1,8 @@
1
+ define(["require", "exports", "tslib", "./constants", "./dialogContext", "./dialogSurfaceContext"], function (require, exports, tslib_1, constants_1, dialogContext_1, dialogSurfaceContext_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(constants_1, exports);
5
+ tslib_1.__exportStar(dialogContext_1, exports);
6
+ tslib_1.__exportStar(dialogSurfaceContext_1, exports);
7
+ });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/contexts/index.ts"],"names":[],"mappings":";;;IAAA,2CAA4B;IAC5B,+CAAgC;IAChC,sDAAuC","sourcesContent":["export * from './constants';\nexport * from './dialogContext';\nexport * from './dialogSurfaceContext';\n"]}
@@ -0,0 +1,37 @@
1
+ define(["require", "exports", "./Dialog", "./DialogTrigger", "./DialogActions", "./DialogBody", "./DialogTitle", "./DialogSurface", "./DialogContent"], function (require, exports, Dialog_1, DialogTrigger_1, DialogActions_1, DialogBody_1, DialogTitle_1, DialogSurface_1, DialogContent_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderDialogContent_unstable = exports.useDialogContentStyles_unstable = exports.useDialogContent_unstable = exports.dialogContentClassNames = exports.DialogContent = exports.renderDialogSurface_unstable = exports.useDialogSurfaceStyles_unstable = exports.useDialogSurface_unstable = exports.dialogSurfaceClassNames = exports.DialogSurface = exports.renderDialogTitle_unstable = exports.useDialogTitleStyles_unstable = exports.useDialogTitle_unstable = exports.dialogTitleClassNames = exports.DialogTitle = exports.renderDialogBody_unstable = exports.useDialogBodyStyles_unstable = exports.useDialogBody_unstable = exports.dialogBodyClassNames = exports.DialogBody = exports.renderDialogActions_unstable = exports.useDialogActionsStyles_unstable = exports.useDialogActions_unstable = exports.dialogActionsClassNames = exports.DialogActions = exports.renderDialogTrigger_unstable = exports.useDialogTrigger_unstable = exports.DialogTrigger = exports.useDialog_unstable = exports.renderDialog_unstable = exports.Dialog = void 0;
5
+ Object.defineProperty(exports, "Dialog", { enumerable: true, get: function () { return Dialog_1.Dialog; } });
6
+ Object.defineProperty(exports, "renderDialog_unstable", { enumerable: true, get: function () { return Dialog_1.renderDialog_unstable; } });
7
+ Object.defineProperty(exports, "useDialog_unstable", { enumerable: true, get: function () { return Dialog_1.useDialog_unstable; } });
8
+ Object.defineProperty(exports, "DialogTrigger", { enumerable: true, get: function () { return DialogTrigger_1.DialogTrigger; } });
9
+ Object.defineProperty(exports, "useDialogTrigger_unstable", { enumerable: true, get: function () { return DialogTrigger_1.useDialogTrigger_unstable; } });
10
+ Object.defineProperty(exports, "renderDialogTrigger_unstable", { enumerable: true, get: function () { return DialogTrigger_1.renderDialogTrigger_unstable; } });
11
+ Object.defineProperty(exports, "DialogActions", { enumerable: true, get: function () { return DialogActions_1.DialogActions; } });
12
+ Object.defineProperty(exports, "dialogActionsClassNames", { enumerable: true, get: function () { return DialogActions_1.dialogActionsClassNames; } });
13
+ Object.defineProperty(exports, "useDialogActions_unstable", { enumerable: true, get: function () { return DialogActions_1.useDialogActions_unstable; } });
14
+ Object.defineProperty(exports, "useDialogActionsStyles_unstable", { enumerable: true, get: function () { return DialogActions_1.useDialogActionsStyles_unstable; } });
15
+ Object.defineProperty(exports, "renderDialogActions_unstable", { enumerable: true, get: function () { return DialogActions_1.renderDialogActions_unstable; } });
16
+ Object.defineProperty(exports, "DialogBody", { enumerable: true, get: function () { return DialogBody_1.DialogBody; } });
17
+ Object.defineProperty(exports, "dialogBodyClassNames", { enumerable: true, get: function () { return DialogBody_1.dialogBodyClassNames; } });
18
+ Object.defineProperty(exports, "useDialogBody_unstable", { enumerable: true, get: function () { return DialogBody_1.useDialogBody_unstable; } });
19
+ Object.defineProperty(exports, "useDialogBodyStyles_unstable", { enumerable: true, get: function () { return DialogBody_1.useDialogBodyStyles_unstable; } });
20
+ Object.defineProperty(exports, "renderDialogBody_unstable", { enumerable: true, get: function () { return DialogBody_1.renderDialogBody_unstable; } });
21
+ Object.defineProperty(exports, "DialogTitle", { enumerable: true, get: function () { return DialogTitle_1.DialogTitle; } });
22
+ Object.defineProperty(exports, "dialogTitleClassNames", { enumerable: true, get: function () { return DialogTitle_1.dialogTitleClassNames; } });
23
+ Object.defineProperty(exports, "useDialogTitle_unstable", { enumerable: true, get: function () { return DialogTitle_1.useDialogTitle_unstable; } });
24
+ Object.defineProperty(exports, "useDialogTitleStyles_unstable", { enumerable: true, get: function () { return DialogTitle_1.useDialogTitleStyles_unstable; } });
25
+ Object.defineProperty(exports, "renderDialogTitle_unstable", { enumerable: true, get: function () { return DialogTitle_1.renderDialogTitle_unstable; } });
26
+ Object.defineProperty(exports, "DialogSurface", { enumerable: true, get: function () { return DialogSurface_1.DialogSurface; } });
27
+ Object.defineProperty(exports, "dialogSurfaceClassNames", { enumerable: true, get: function () { return DialogSurface_1.dialogSurfaceClassNames; } });
28
+ Object.defineProperty(exports, "useDialogSurface_unstable", { enumerable: true, get: function () { return DialogSurface_1.useDialogSurface_unstable; } });
29
+ Object.defineProperty(exports, "useDialogSurfaceStyles_unstable", { enumerable: true, get: function () { return DialogSurface_1.useDialogSurfaceStyles_unstable; } });
30
+ Object.defineProperty(exports, "renderDialogSurface_unstable", { enumerable: true, get: function () { return DialogSurface_1.renderDialogSurface_unstable; } });
31
+ Object.defineProperty(exports, "DialogContent", { enumerable: true, get: function () { return DialogContent_1.DialogContent; } });
32
+ Object.defineProperty(exports, "dialogContentClassNames", { enumerable: true, get: function () { return DialogContent_1.dialogContentClassNames; } });
33
+ Object.defineProperty(exports, "useDialogContent_unstable", { enumerable: true, get: function () { return DialogContent_1.useDialogContent_unstable; } });
34
+ Object.defineProperty(exports, "useDialogContentStyles_unstable", { enumerable: true, get: function () { return DialogContent_1.useDialogContentStyles_unstable; } });
35
+ Object.defineProperty(exports, "renderDialogContent_unstable", { enumerable: true, get: function () { return DialogContent_1.renderDialogContent_unstable; } });
36
+ });
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-dialog/src/index.ts"],"names":[],"mappings":";;;;IAAS,gGAAA,MAAM,OAAA;IAAE,+GAAA,qBAAqB,OAAA;IAAE,4GAAA,kBAAkB,OAAA;IAUjD,8GAAA,aAAa,OAAA;IAAE,0HAAA,yBAAyB,OAAA;IAAE,6HAAA,4BAA4B,OAAA;IAS7E,8GAAA,aAAa,OAAA;IACb,wHAAA,uBAAuB,OAAA;IACvB,0HAAA,yBAAyB,OAAA;IACzB,gIAAA,+BAA+B,OAAA;IAC/B,6HAAA,4BAA4B,OAAA;IAU5B,wGAAA,UAAU,OAAA;IACV,kHAAA,oBAAoB,OAAA;IACpB,oHAAA,sBAAsB,OAAA;IACtB,0HAAA,4BAA4B,OAAA;IAC5B,uHAAA,yBAAyB,OAAA;IAKzB,0GAAA,WAAW,OAAA;IACX,oHAAA,qBAAqB,OAAA;IACrB,sHAAA,uBAAuB,OAAA;IACvB,4HAAA,6BAA6B,OAAA;IAC7B,yHAAA,0BAA0B,OAAA;IAK1B,8GAAA,aAAa,OAAA;IACb,wHAAA,uBAAuB,OAAA;IACvB,0HAAA,yBAAyB,OAAA;IACzB,gIAAA,+BAA+B,OAAA;IAC/B,6HAAA,4BAA4B,OAAA;IAK5B,8GAAA,aAAa,OAAA;IACb,wHAAA,uBAAuB,OAAA;IACvB,0HAAA,yBAAyB,OAAA;IACzB,gIAAA,+BAA+B,OAAA;IAC/B,6HAAA,4BAA4B,OAAA","sourcesContent":["export { Dialog, renderDialog_unstable, useDialog_unstable } from './Dialog';\nexport type {\n DialogSlots,\n DialogProps,\n DialogState,\n DialogOpenChangeData,\n DialogOpenChangeEvent,\n DialogOpenChangeEventHandler,\n} from './Dialog';\n\nexport { DialogTrigger, useDialogTrigger_unstable, renderDialogTrigger_unstable } from './DialogTrigger';\nexport type {\n DialogTriggerProps,\n DialogTriggerChildProps,\n DialogTriggerState,\n DialogTriggerAction,\n} from './DialogTrigger';\n\nexport {\n DialogActions,\n dialogActionsClassNames,\n useDialogActions_unstable,\n useDialogActionsStyles_unstable,\n renderDialogActions_unstable,\n} from './DialogActions';\nexport type {\n DialogActionsProps,\n DialogActionsSlots,\n DialogActionsState,\n DialogActionsPosition,\n} from './DialogActions';\n\nexport {\n DialogBody,\n dialogBodyClassNames,\n useDialogBody_unstable,\n useDialogBodyStyles_unstable,\n renderDialogBody_unstable,\n} from './DialogBody';\nexport type { DialogBodyProps, DialogBodySlots, DialogBodyState } from './DialogBody';\n\nexport {\n DialogTitle,\n dialogTitleClassNames,\n useDialogTitle_unstable,\n useDialogTitleStyles_unstable,\n renderDialogTitle_unstable,\n} from './DialogTitle';\nexport type { DialogTitleProps, DialogTitleSlots, DialogTitleState } from './DialogTitle';\n\nexport {\n DialogSurface,\n dialogSurfaceClassNames,\n useDialogSurface_unstable,\n useDialogSurfaceStyles_unstable,\n renderDialogSurface_unstable,\n} from './DialogSurface';\nexport type { DialogSurfaceProps, DialogSurfaceSlots, DialogSurfaceState, DialogSurfaceElement } from './DialogSurface';\n\nexport {\n DialogContent,\n dialogContentClassNames,\n useDialogContent_unstable,\n useDialogContentStyles_unstable,\n renderDialogContent_unstable,\n} from './DialogContent';\nexport type { DialogContentProps, DialogContentSlots, DialogContentState } from './DialogContent';\n"]}
@@ -0,0 +1,8 @@
1
+ define(["require", "exports", "tslib", "./isEscapeKeyDown", "./useDisableBodyScroll", "./useFocusFirstElement"], function (require, exports, tslib_1, isEscapeKeyDown_1, useDisableBodyScroll_1, useFocusFirstElement_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(isEscapeKeyDown_1, exports);
5
+ tslib_1.__exportStar(useDisableBodyScroll_1, exports);
6
+ tslib_1.__exportStar(useFocusFirstElement_1, exports);
7
+ });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/utils/index.ts"],"names":[],"mappings":";;;IAAA,iDAAkC;IAClC,sDAAuC;IACvC,sDAAuC","sourcesContent":["export * from './isEscapeKeyDown';\nexport * from './useDisableBodyScroll';\nexport * from './useFocusFirstElement';\n"]}
@@ -0,0 +1,13 @@
1
+ define(["require", "exports", "@fluentui/keyboard-keys"], function (require, exports, keyboard_keys_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.isEscapeKeyDismiss = void 0;
5
+ /**
6
+ * Checks if keydown event is a proper Escape key dismiss
7
+ */
8
+ function isEscapeKeyDismiss(event, modalType) {
9
+ return event.key === keyboard_keys_1.Escape && modalType !== 'alert' && !event.isDefaultPrevented();
10
+ }
11
+ exports.isEscapeKeyDismiss = isEscapeKeyDismiss;
12
+ });
13
+ //# sourceMappingURL=isEscapeKeyDown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isEscapeKeyDown.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-dialog/src/utils/isEscapeKeyDown.ts"],"names":[],"mappings":";;;;IAKA;;OAEG;IACH,SAAgB,kBAAkB,CAChC,KAAgD,EAChD,SAA0B;QAE1B,OAAO,KAAK,CAAC,GAAG,KAAK,sBAAM,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACtF,CAAC;IALD,gDAKC","sourcesContent":["import * as React from 'react';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { DialogModalType } from '../components/Dialog/Dialog.types';\nimport { DialogSurfaceElement } from '../DialogSurface';\n\n/**\n * Checks if keydown event is a proper Escape key dismiss\n */\nexport function isEscapeKeyDismiss(\n event: React.KeyboardEvent<DialogSurfaceElement>,\n modalType: DialogModalType,\n): boolean {\n return event.key === Escape && modalType !== 'alert' && !event.isDefaultPrevented();\n}\n"]}
@@ -0,0 +1,52 @@
1
+ define(["require", "exports", "@fluentui/react-shared-contexts", "react"], function (require, exports, react_shared_contexts_1, react_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.disableScroll = exports.useDisableBodyScroll = void 0;
5
+ var disableScrollElementProp = '__fluentDisableScrollElement';
6
+ /**
7
+ * hook that disables body scrolling through `overflow: hidden` CSS property
8
+ */
9
+ function useDisableBodyScroll() {
10
+ var targetDocument = react_shared_contexts_1.useFluent_unstable().targetDocument;
11
+ return react_1.useCallback(function () {
12
+ if (targetDocument) {
13
+ return disableScroll(targetDocument.body);
14
+ }
15
+ }, [targetDocument]);
16
+ }
17
+ exports.useDisableBodyScroll = useDisableBodyScroll;
18
+ /**
19
+ * disables scrolling from a given element through `overflow: hidden` CSS property
20
+ * @param target - element to disable scrolling from
21
+ * @returns a method for enabling scrolling again
22
+ */
23
+ function disableScroll(target) {
24
+ var _a, _b;
25
+ var clientWidth = target.ownerDocument.documentElement.clientWidth;
26
+ var innerWidth = (_b = (_a = target.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.innerWidth) !== null && _b !== void 0 ? _b : 0;
27
+ assertIsDisableScrollElement(target);
28
+ if (target[disableScrollElementProp].count === 0) {
29
+ target.style.overflow = 'hidden';
30
+ target.style.paddingRight = innerWidth - clientWidth + "px";
31
+ }
32
+ target[disableScrollElementProp].count++;
33
+ return function () {
34
+ target[disableScrollElementProp].count--;
35
+ if (target[disableScrollElementProp].count === 0) {
36
+ target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;
37
+ target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;
38
+ }
39
+ };
40
+ }
41
+ exports.disableScroll = disableScroll;
42
+ function assertIsDisableScrollElement(element) {
43
+ var _a;
44
+ var _b;
45
+ (_a = (_b = element)[disableScrollElementProp]) !== null && _a !== void 0 ? _a : (_b[disableScrollElementProp] = {
46
+ count: 0,
47
+ previousOverflowStyle: element.style.overflow,
48
+ previousPaddingRightStyle: element.style.paddingRight,
49
+ });
50
+ }
51
+ });
52
+ //# sourceMappingURL=useDisableBodyScroll.js.map