@fluentui/react-dialog 9.0.0-beta.8 → 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 (165) hide show
  1. package/CHANGELOG.json +175 -1
  2. package/CHANGELOG.md +56 -2
  3. package/README.md +41 -1
  4. package/dist/index.d.ts +66 -16
  5. package/lib/Dialog.js.map +1 -1
  6. package/lib/DialogActions.js.map +1 -1
  7. package/lib/DialogBody.js.map +1 -1
  8. package/lib/DialogContent.js +2 -0
  9. package/lib/DialogContent.js.map +1 -0
  10. package/lib/DialogSurface.js.map +1 -1
  11. package/lib/DialogTitle.js.map +1 -1
  12. package/lib/DialogTrigger.js.map +1 -1
  13. package/lib/components/Dialog/Dialog.js.map +1 -1
  14. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  15. package/lib/components/Dialog/index.js.map +1 -1
  16. package/lib/components/Dialog/renderDialog.js.map +1 -1
  17. package/lib/components/Dialog/useDialog.js +5 -6
  18. package/lib/components/Dialog/useDialog.js.map +1 -1
  19. package/lib/components/Dialog/useDialogContextValues.js +4 -4
  20. package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
  21. package/lib/components/DialogActions/DialogActions.js.map +1 -1
  22. package/lib/components/DialogActions/DialogActions.types.js.map +1 -1
  23. package/lib/components/DialogActions/index.js.map +1 -1
  24. package/lib/components/DialogActions/renderDialogActions.js.map +1 -1
  25. package/lib/components/DialogActions/useDialogActions.js.map +1 -1
  26. package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  27. package/lib/components/DialogBody/DialogBody.js.map +1 -1
  28. package/lib/components/DialogBody/DialogBody.types.js.map +1 -1
  29. package/lib/components/DialogBody/index.js.map +1 -1
  30. package/lib/components/DialogBody/renderDialogBody.js.map +1 -1
  31. package/lib/components/DialogBody/useDialogBody.js +3 -3
  32. package/lib/components/DialogBody/useDialogBody.js.map +1 -1
  33. package/lib/components/DialogBody/useDialogBodyStyles.js +25 -17
  34. package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  35. package/lib/components/DialogContent/DialogContent.js +16 -0
  36. package/lib/components/DialogContent/DialogContent.js.map +1 -0
  37. package/lib/components/DialogContent/DialogContent.types.js +2 -0
  38. package/lib/components/DialogContent/DialogContent.types.js.map +1 -0
  39. package/lib/components/DialogContent/index.js +6 -0
  40. package/lib/components/DialogContent/index.js.map +1 -0
  41. package/lib/components/DialogContent/renderDialogContent.js +15 -0
  42. package/lib/components/DialogContent/renderDialogContent.js.map +1 -0
  43. package/lib/components/DialogContent/useDialogContent.js +28 -0
  44. package/lib/components/DialogContent/useDialogContent.js.map +1 -0
  45. package/lib/components/DialogContent/useDialogContentStyles.js +40 -0
  46. package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -0
  47. package/lib/components/DialogSurface/DialogSurface.js.map +1 -1
  48. package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -1
  49. package/lib/components/DialogSurface/index.js.map +1 -1
  50. package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -1
  51. package/lib/components/DialogSurface/useDialogSurface.js +10 -81
  52. package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
  53. package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
  54. package/lib/components/DialogSurface/useDialogSurfaceStyles.js +62 -59
  55. package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  56. package/lib/components/DialogTitle/DialogTitle.js.map +1 -1
  57. package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -1
  58. package/lib/components/DialogTitle/index.js.map +1 -1
  59. package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -1
  60. package/lib/components/DialogTitle/useDialogTitle.js +1 -1
  61. package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
  62. package/lib/components/DialogTitle/useDialogTitleStyles.js +29 -29
  63. package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  64. package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -1
  65. package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
  66. package/lib/components/DialogTrigger/index.js.map +1 -1
  67. package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
  68. package/lib/components/DialogTrigger/useDialogTrigger.js +4 -3
  69. package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  70. package/lib/contexts/constants.js +1 -1
  71. package/lib/contexts/constants.js.map +1 -1
  72. package/lib/contexts/dialogContext.js.map +1 -1
  73. package/lib/contexts/dialogSurfaceContext.js.map +1 -1
  74. package/lib/contexts/index.js.map +1 -1
  75. package/lib/index.js +1 -0
  76. package/lib/index.js.map +1 -1
  77. package/lib/utils/index.js +0 -2
  78. package/lib/utils/index.js.map +1 -1
  79. package/lib/utils/isEscapeKeyDown.js +1 -4
  80. package/lib/utils/isEscapeKeyDown.js.map +1 -1
  81. package/lib/utils/useDisableBodyScroll.js.map +1 -1
  82. package/lib/utils/useFocusFirstElement.js +7 -8
  83. package/lib/utils/useFocusFirstElement.js.map +1 -1
  84. package/lib-commonjs/Dialog.js.map +1 -1
  85. package/lib-commonjs/DialogActions.js.map +1 -1
  86. package/lib-commonjs/DialogBody.js.map +1 -1
  87. package/lib-commonjs/DialogContent.js +10 -0
  88. package/lib-commonjs/DialogContent.js.map +1 -0
  89. package/lib-commonjs/DialogSurface.js.map +1 -1
  90. package/lib-commonjs/DialogTitle.js.map +1 -1
  91. package/lib-commonjs/DialogTrigger.js.map +1 -1
  92. package/lib-commonjs/components/Dialog/Dialog.js.map +1 -1
  93. package/lib-commonjs/components/Dialog/index.js.map +1 -1
  94. package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -1
  95. package/lib-commonjs/components/Dialog/useDialog.js +3 -4
  96. package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
  97. package/lib-commonjs/components/Dialog/useDialogContextValues.js +4 -4
  98. package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
  99. package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -1
  100. package/lib-commonjs/components/DialogActions/index.js.map +1 -1
  101. package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -1
  102. package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -1
  103. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  104. package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -1
  105. package/lib-commonjs/components/DialogBody/index.js.map +1 -1
  106. package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -1
  107. package/lib-commonjs/components/DialogBody/useDialogBody.js +3 -4
  108. package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -1
  109. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +25 -18
  110. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  111. package/lib-commonjs/components/DialogContent/DialogContent.js +27 -0
  112. package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -0
  113. package/lib-commonjs/components/DialogContent/DialogContent.types.js +6 -0
  114. package/lib-commonjs/components/DialogContent/DialogContent.types.js.map +1 -0
  115. package/lib-commonjs/components/DialogContent/index.js +18 -0
  116. package/lib-commonjs/components/DialogContent/index.js.map +1 -0
  117. package/lib-commonjs/components/DialogContent/renderDialogContent.js +26 -0
  118. package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -0
  119. package/lib-commonjs/components/DialogContent/useDialogContent.js +39 -0
  120. package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -0
  121. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +52 -0
  122. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -0
  123. package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -1
  124. package/lib-commonjs/components/DialogSurface/index.js.map +1 -1
  125. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -1
  126. package/lib-commonjs/components/DialogSurface/useDialogSurface.js +10 -81
  127. package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
  128. package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
  129. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +63 -60
  130. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  131. package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -1
  132. package/lib-commonjs/components/DialogTitle/index.js.map +1 -1
  133. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -1
  134. package/lib-commonjs/components/DialogTitle/useDialogTitle.js +1 -1
  135. package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
  136. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +29 -29
  137. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  138. package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -1
  139. package/lib-commonjs/components/DialogTrigger/index.js.map +1 -1
  140. package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
  141. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +4 -4
  142. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  143. package/lib-commonjs/contexts/constants.js +2 -2
  144. package/lib-commonjs/contexts/constants.js.map +1 -1
  145. package/lib-commonjs/contexts/dialogContext.js.map +1 -1
  146. package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -1
  147. package/lib-commonjs/contexts/index.js.map +1 -1
  148. package/lib-commonjs/index.js +34 -1
  149. package/lib-commonjs/index.js.map +1 -1
  150. package/lib-commonjs/utils/index.js +0 -4
  151. package/lib-commonjs/utils/index.js.map +1 -1
  152. package/lib-commonjs/utils/isEscapeKeyDown.js +1 -5
  153. package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -1
  154. package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -1
  155. package/lib-commonjs/utils/useFocusFirstElement.js +7 -9
  156. package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -1
  157. package/package.json +11 -14
  158. package/lib/utils/isHTMLDialogElement.js +0 -4
  159. package/lib/utils/isHTMLDialogElement.js.map +0 -1
  160. package/lib/utils/useControlNativeDialogOpenState.js +0 -20
  161. package/lib/utils/useControlNativeDialogOpenState.js.map +0 -1
  162. package/lib-commonjs/utils/isHTMLDialogElement.js +0 -13
  163. package/lib-commonjs/utils/isHTMLDialogElement.js.map +0 -1
  164. package/lib-commonjs/utils/useControlNativeDialogOpenState.js +0 -31
  165. package/lib-commonjs/utils/useControlNativeDialogOpenState.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogTitle/useDialogTitleStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAEa,OAAA,CAAA,qBAAA,GAA0D;EACrE,IAAI,EAAE,iBAD+D;EAErE,MAAM,EAAE;AAF6D,CAA1D;AAKb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAaA;;;AAGG;;;AACU,OAAA,CAAA,4BAAA,gBAA+B,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EAA/B;AAkBb;;AAEG;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA8C;EACzF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,qBAAA,CAAsB,IADD,EAErB,MAAM,CAAC,IAFc,EAGrB,CAAC,KAAK,CAAC,MAAP,IAAiB,MAAM,CAAC,sBAHH,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;;EAMA,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,qBAAA,CAAsB,MAAnC,EAA2C,MAAM,CAAC,MAAlD,EAA0D,KAAK,CAAC,MAAN,CAAa,SAAvE,CAAzB;EACD;;EACD,OAAO,KAAP;AACD,CAZM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogTitleSlots, DialogTitleState } from './DialogTitle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { TITLE_ACTION_GRID_AREA, TITLE_GRID_AREA } from '../../contexts/constants';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\n\nexport const dialogTitleClassNames: SlotClassNames<DialogTitleSlots> = {\n root: 'fui-DialogTitle',\n action: 'fui-DialogTitle__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.subtitle1,\n ...shorthands.gridArea(TITLE_GRID_AREA),\n },\n rootWithoutCloseButton: {\n ...shorthands.gridArea(TITLE_GRID_AREA, TITLE_GRID_AREA, TITLE_ACTION_GRID_AREA, TITLE_ACTION_GRID_AREA),\n },\n action: {\n ...shorthands.gridArea(TITLE_ACTION_GRID_AREA),\n },\n});\n\n/**\n * Styles to be applied on internal elements used by default action on non-modal Dialog\n * @internal\n */\nexport const useDialogTitleInternalStyles = makeStyles({\n button: {\n position: 'relative',\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 0,\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n ...createFocusOutlineStyle(),\n },\n});\n\n/**\n * Apply styling to the DialogTitle slots based on the state\n */\nexport const useDialogTitleStyles_unstable = (state: DialogTitleState): DialogTitleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogTitleClassNames.root,\n styles.root,\n !state.action && styles.rootWithoutCloseButton,\n state.root.className,\n );\n if (state.action) {\n state.action.className = mergeClasses(dialogTitleClassNames.action, styles.action, state.action.className);\n }\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitleStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAEa,OAAA,CAAA,qBAAA,GAA0D;EACrE,IAAI,EAAE,iBAD+D;EAErE,MAAM,EAAE;AAF6D,CAA1D;AAKb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAaA;;;AAGG;;;AACU,OAAA,CAAA,4BAAA,gBAA+B,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EAA/B;AAkBb;;AAEG;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA8C;EACzF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,qBAAA,CAAsB,IADD,EAErB,MAAM,CAAC,IAFc,EAGrB,CAAC,KAAK,CAAC,MAAP,IAAiB,MAAM,CAAC,sBAHH,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;;EAMA,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,qBAAA,CAAsB,MAAnC,EAA2C,MAAM,CAAC,MAAlD,EAA0D,KAAK,CAAC,MAAN,CAAa,SAAvE,CAAzB;EACD;;EACD,OAAO,KAAP;AACD,CAZM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogTitleSlots, DialogTitleState } from './DialogTitle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { TITLE_ACTION_GRID_AREA, TITLE_GRID_AREA } from '../../contexts/constants';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\n\nexport const dialogTitleClassNames: SlotClassNames<DialogTitleSlots> = {\n root: 'fui-DialogTitle',\n action: 'fui-DialogTitle__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.subtitle1,\n ...shorthands.gridArea(TITLE_GRID_AREA),\n },\n rootWithoutCloseButton: {\n ...shorthands.gridArea(TITLE_GRID_AREA, TITLE_GRID_AREA, TITLE_ACTION_GRID_AREA, TITLE_ACTION_GRID_AREA),\n },\n action: {\n ...shorthands.gridArea(TITLE_ACTION_GRID_AREA),\n },\n});\n\n/**\n * Styles to be applied on internal elements used by default action on non-modal Dialog\n * @internal\n */\nexport const useDialogTitleInternalStyles = makeStyles({\n button: {\n position: 'relative',\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 0,\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n ...createFocusOutlineStyle(),\n },\n});\n\n/**\n * Apply styling to the DialogTitle slots based on the state\n */\nexport const useDialogTitleStyles_unstable = (state: DialogTitleState): DialogTitleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogTitleClassNames.root,\n styles.root,\n !state.action && styles.rootWithoutCloseButton,\n state.root.className,\n );\n if (state.action) {\n state.action.className = mergeClasses(dialogTitleClassNames.action, styles.action, state.action.className);\n }\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogTrigger/DialogTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;;;;;;;;AASG;;;AACI,MAAM,aAAa,GAA0D,KAAK,IAAG;EAC1F,MAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,CAAd;EAEA,OAAO,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb;AAMb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B;AACA,OAAA,CAAA,aAAA,CAAc,wBAAd,GAAyC,IAAzC","sourcesContent":["import * as React from 'react';\nimport { useDialogTrigger_unstable } from './useDialogTrigger';\nimport { renderDialogTrigger_unstable } from './renderDialogTrigger';\nimport type { DialogTriggerProps } from './DialogTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will open or close a `Dialog`.\n * This component should only accept one child.\n *\n * In case the trigger is used outside `Dialog` component\n * it'll still provide basic ARIA related attributes\n * to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,\n * in that case the user must provide a `controlled state`\n */\nexport const DialogTrigger: React.FC<DialogTriggerProps> & FluentTriggerComponent = props => {\n const state = useDialogTrigger_unstable(props);\n\n return renderDialogTrigger_unstable(state);\n};\n\nDialogTrigger.displayName = 'DialogTrigger';\nDialogTrigger.isFluentTriggerComponent = true;\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;;;;;;;;AASG;;;AACI,MAAM,aAAa,GAA0D,KAAK,IAAG;EAC1F,MAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,CAAd;EAEA,OAAO,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb;AAMb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B;AACA,OAAA,CAAA,aAAA,CAAc,wBAAd,GAAyC,IAAzC","sourcesContent":["import * as React from 'react';\nimport { useDialogTrigger_unstable } from './useDialogTrigger';\nimport { renderDialogTrigger_unstable } from './renderDialogTrigger';\nimport type { DialogTriggerProps } from './DialogTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will open or close a `Dialog`.\n * This component should only accept one child.\n *\n * In case the trigger is used outside `Dialog` component\n * it'll still provide basic ARIA related attributes\n * to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,\n * in that case the user must provide a `controlled state`\n */\nexport const DialogTrigger: React.FC<DialogTriggerProps> & FluentTriggerComponent = props => {\n const state = useDialogTrigger_unstable(props);\n\n return renderDialogTrigger_unstable(state);\n};\n\nDialogTrigger.displayName = 'DialogTrigger';\nDialogTrigger.isFluentTriggerComponent = true;\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogTrigger/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogTrigger/renderDialogTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;;;AAIG;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA+B,KAAK,CAAC,QAA1E;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import type { DialogTriggerState } from './DialogTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderDialogTrigger_unstable = (state: DialogTriggerState) => state.children;\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/renderDialogTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;;;AAIG;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA+B,KAAK,CAAC,QAA1E;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import type { DialogTriggerState } from './DialogTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderDialogTrigger_unstable = (state: DialogTriggerState) => state.children;\n"],"sourceRoot":"../src/"}
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useDialogTrigger_unstable = void 0;
7
7
 
8
- const React = /*#__PURE__*/require("react");
9
-
10
8
  const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
9
 
12
10
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
@@ -28,7 +26,7 @@ const useDialogTrigger_unstable = props => {
28
26
  children,
29
27
  action = isInsideSurfaceDialog ? 'close' : 'open'
30
28
  } = props;
31
- const child = React.isValidElement(children) ? react_utilities_1.getTriggerChild(children) : undefined;
29
+ const child = react_utilities_1.getTriggerChild(children);
32
30
  const requestOpenChange = contexts_1.useDialogContext_unstable(ctx => ctx.requestOpenChange);
33
31
  const {
34
32
  triggerAttributes
@@ -47,7 +45,9 @@ const useDialogTrigger_unstable = props => {
47
45
  }
48
46
  });
49
47
  return {
50
- children: react_utilities_1.applyTriggerPropsToChildren(children, 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', { ...(child === null || child === void 0 ? void 0 : child.props),
48
+ children: react_utilities_1.applyTriggerPropsToChildren(children, 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', {
49
+ type: 'button',
50
+ ...(child === null || child === void 0 ? void 0 : child.props),
51
51
  'aria-haspopup': action === 'close' ? undefined : 'dialog',
52
52
  ref: child === null || child === void 0 ? void 0 : child.ref,
53
53
  onClick: handleClick,
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogTrigger/useDialogTrigger.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,UAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;AAEA;;;;;AAKG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAAkD;EACzF,MAAM,qBAAqB,GAAG,UAAA,CAAA,gCAAA,EAA9B;EAEA,MAAM;IAAE,QAAF;IAAY,MAAM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L,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAV,CADuF;MAEvF,iBAAiB,MAAM,KAAK,OAAX,GAAqB,SAArB,GAAiC,QAFqC;MAGvF,GAAG,EAAE,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,GAH2E;MAIvF,OAAO,EAAE,WAJ8E;MAKvF,GAAG;IALoF,CAAzF,CAFQ;EADL,CAAP;AAYD,CApCM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { DialogTriggerChildProps, 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, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = React.isValidElement(children) ? getTriggerChild<DialogTriggerChildProps>(children) : undefined;\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\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 return {\n children: applyTriggerPropsToChildren<DialogTriggerChildProps>(\n children,\n useARIAButtonProps(child?.type === 'button' || child?.type === 'a' ? child.type : 'div', {\n ...child?.props,\n 'aria-haspopup': action === 'close' ? undefined : 'dialog',\n ref: child?.ref as React.Ref<never>,\n onClick: handleClick,\n ...triggerAttributes,\n }),\n ),\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/useDialogTrigger.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,UAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;AAEA;;;;;AAKG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAAkD;EACzF,MAAM,qBAAqB,GAAG,UAAA,CAAA,gCAAA,EAA9B;EAEA,MAAM;IAAE,QAAF;IAAY,MAAM,GAAG,qBAAqB,GAAG,OAAH,GAAa;EAAvD,IAAkE,KAAxE;EAEA,MAAM,KAAK,GAAG,iBAAA,CAAA,eAAA,CAAgB,QAAhB,CAAd;EAEA,MAAM,iBAAiB,GAAG,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,iBAArC,CAA1B;EAEA,MAAM;IAAE;EAAF,IAAwB,eAAA,CAAA,kBAAA,EAA9B;EAEA,MAAM,WAAW,GAAG,iBAAA,CAAA,gBAAA,CACjB,KAAD,IAAoF;;;IAClF,CAAA,EAAA,GAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAK,CAAA,EAAA,GAAL,KAAK,CAAE,KAAF,EAAQ,OAAb,MAAoB,IAApB,IAAoB,EAAA,KAAA,KAAA,CAApB,GAAoB,KAAA,CAApB,GAAoB,EAAA,CAAA,IAAA,CAAA,EAAA,EAAG,KAAH,CAApB;;IACA,IAAI,CAAC,KAAK,CAAC,kBAAN,EAAL,EAAiC;MAC/B,iBAAiB,CAAC;QAChB,KADgB;QAEhB,IAAI,EAAE,cAFU;QAGhB,IAAI,EAAE,MAAM,KAAK;MAHD,CAAD,CAAjB;IAKD;EACF,CAViB,CAApB;EAaA,OAAO;IACL,QAAQ,EAAE,iBAAA,CAAA,2BAAA,CACR,QADQ,EAER,YAAA,CAAA,kBAAA,CAAmB,CAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,IAAP,MAAgB,QAAhB,IAA4B,CAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,IAAP,MAAgB,GAA5C,GAAkD,KAAK,CAAC,IAAxD,GAA+D,KAAlF,EAAyF;MACvF,IAAI,EAAE,QADiF;MAEvF,IAAG,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAV,CAFuF;MAGvF,iBAAiB,MAAM,KAAK,OAAX,GAAqB,SAArB,GAAiC,QAHqC;MAIvF,GAAG,EAAE,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,GAJ2E;MAKvF,OAAO,EAAE,WAL8E;MAMvF,GAAG;IANoF,CAAzF,CAFQ;EADL,CAAP;AAaD,CArCM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","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, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\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 return {\n children: applyTriggerPropsToChildren(\n children,\n useARIAButtonProps(child?.type === 'button' || child?.type === 'a' ? child.type : 'div', {\n type: 'button',\n ...child?.props,\n 'aria-haspopup': action === 'close' ? undefined : 'dialog',\n ref: child?.ref,\n onClick: handleClick,\n ...triggerAttributes,\n }),\n ),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.BODY_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;
6
+ 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;
7
7
  exports.MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';
8
8
  exports.SURFACE_PADDING = '24px';
9
9
  exports.DIALOG_GAP = '8px';
@@ -13,5 +13,5 @@ exports.ACTIONS_START_GRID_AREA = 'actions-start';
13
13
  exports.ACTIONS_END_GRID_AREA = 'actions-end';
14
14
  exports.TITLE_GRID_AREA = 'title';
15
15
  exports.TITLE_ACTION_GRID_AREA = 'close-button';
16
- exports.BODY_GRID_AREA = 'body';
16
+ exports.CONTENT_GRID_AREA = 'body';
17
17
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["contexts/constants.ts"],"names":[],"mappings":";;;;;;AAAa,OAAA,CAAA,+BAAA,GAAkC,sCAAlC;AACA,OAAA,CAAA,eAAA,GAAkB,MAAlB;AACA,OAAA,CAAA,UAAA,GAAa,KAAb;AACA,OAAA,CAAA,qBAAA,GAAwB,KAAxB;AACA,OAAA,CAAA,oBAAA,GAAuB,KAAvB;AAEA,OAAA,CAAA,uBAAA,GAA0B,eAA1B;AACA,OAAA,CAAA,qBAAA,GAAwB,aAAxB;AACA,OAAA,CAAA,eAAA,GAAkB,OAAlB;AACA,OAAA,CAAA,sBAAA,GAAyB,cAAzB;AACA,OAAA,CAAA,cAAA,GAAiB,MAAjB","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 BODY_GRID_AREA = 'body';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/contexts/constants.ts"],"names":[],"mappings":";;;;;;AAAa,OAAA,CAAA,+BAAA,GAAkC,sCAAlC;AACA,OAAA,CAAA,eAAA,GAAkB,MAAlB;AACA,OAAA,CAAA,UAAA,GAAa,KAAb;AACA,OAAA,CAAA,qBAAA,GAAwB,KAAxB;AACA,OAAA,CAAA,oBAAA,GAAuB,KAAvB;AAEA,OAAA,CAAA,uBAAA,GAA0B,eAA1B;AACA,OAAA,CAAA,qBAAA,GAAwB,aAAxB;AACA,OAAA,CAAA,eAAA,GAAkB,OAAlB;AACA,OAAA,CAAA,sBAAA,GAAyB,cAAzB;AACA,OAAA,CAAA,iBAAA,GAAoB,MAApB","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"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["contexts/dialogContext.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAkBA,MAAM,mBAAmB,GAAuB;EAC9C,IAAI,EAAE,KADwC;EAE9C,SAAS,EAAE,OAFmC;EAG9C,cAAc,EAAE,KAH8B;EAI9C,SAAS,EAAE;IAAE,OAAO,EAAE;EAAX,CAJmC;;EAK9C,iBAAiB,GAAA;IACf;EACD;;AAP6C,CAAhD,C,CAUA;;AACa,OAAA,CAAA,aAAA,gBAAyD,wBAAA,CAAA,aAAA,CACpE,SADoE,CAAzD;AAIA,OAAA,CAAA,cAAA,GAAiB,OAAA,CAAA,aAAA,CAAc,QAA/B;;AACN,MAAM,yBAAyB,GAAO,QAAJ,IACvC,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,aAAnB,EAAkC,CAAC,GAAG,GAAG,mBAAP,KAA+B,QAAQ,CAAC,GAAD,CAAzE,CADK;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","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 dialogBodyID?: string;\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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/contexts/dialogContext.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAkBA,MAAM,mBAAmB,GAAuB;EAC9C,IAAI,EAAE,KADwC;EAE9C,SAAS,EAAE,OAFmC;EAG9C,cAAc,EAAE,KAH8B;EAI9C,SAAS,EAAE;IAAE,OAAO,EAAE;EAAX,CAJmC;;EAK9C,iBAAiB,GAAA;IACf;EACD;;AAP6C,CAAhD,C,CAUA;;AACa,OAAA,CAAA,aAAA,gBAAyD,wBAAA,CAAA,aAAA,CACpE,SADoE,CAAzD;AAIA,OAAA,CAAA,cAAA,GAAiB,OAAA,CAAA,aAAA,CAAc,QAA/B;;AACN,MAAM,yBAAyB,GAAO,QAAJ,IACvC,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,aAAnB,EAAkC,CAAC,GAAG,GAAG,mBAAP,KAA+B,QAAQ,CAAC,GAAD,CAAzE,CADK;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","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 dialogContentId?: string;\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"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["contexts/dialogSurfaceContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAIA,MAAM,mBAAmB,GAA8B,KAAvD;AAEa,OAAA,CAAA,oBAAA,gBAAuB,OAAA,CAAA,aAAA,CAAqD,SAArD,CAAvB;AAEA,OAAA,CAAA,qBAAA,GAAwB,OAAA,CAAA,oBAAA,CAAqB,QAA7C;;AAEN,MAAM,gCAAgC,GAAG,MAAK;EAAA,IAAA,EAAA;;EAAC,OAAA,CAAA,EAAA,GAAA,OAAA,CAAA,UAAA,CAAW,OAAA,CAAA,oBAAX,CAAA,MAAgC,IAAhC,IAAgC,EAAA,KAAA,KAAA,CAAhC,GAAgC,EAAhC,GAAoC,mBAApC;AAAuD,CAAtG;;AAAM,OAAA,CAAA,gCAAA,GAAgC,gCAAhC","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/contexts/dialogSurfaceContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAIA,MAAM,mBAAmB,GAA8B,KAAvD;AAEa,OAAA,CAAA,oBAAA,gBAAuB,OAAA,CAAA,aAAA,CAAqD,SAArD,CAAvB;AAEA,OAAA,CAAA,qBAAA,GAAwB,OAAA,CAAA,oBAAA,CAAqB,QAA7C;;AAEN,MAAM,gCAAgC,GAAG,MAAK;EAAA,IAAA,EAAA;;EAAC,OAAA,CAAA,EAAA,GAAA,OAAA,CAAA,UAAA,CAAW,OAAA,CAAA,oBAAX,CAAA,MAAgC,IAAhC,IAAgC,EAAA,KAAA,KAAA,CAAhC,GAAgC,EAAhC,GAAoC,mBAApC;AAAuD,CAAtG;;AAAM,OAAA,CAAA,gCAAA,GAAgC,gCAAhC","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"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["contexts/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './constants';\nexport * from './dialogContext';\nexport * from './dialogSurfaceContext';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/contexts/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './constants';\nexport * from './dialogContext';\nexport * from './dialogSurfaceContext';\n"],"sourceRoot":"../src/"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- 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;
6
+ 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;
7
7
 
8
8
  var Dialog_1 = /*#__PURE__*/require("./Dialog");
9
9
 
@@ -178,4 +178,37 @@ Object.defineProperty(exports, "renderDialogSurface_unstable", {
178
178
  return DialogSurface_1.renderDialogSurface_unstable;
179
179
  }
180
180
  });
181
+
182
+ var DialogContent_1 = /*#__PURE__*/require("./DialogContent");
183
+
184
+ Object.defineProperty(exports, "DialogContent", {
185
+ enumerable: true,
186
+ get: function () {
187
+ return DialogContent_1.DialogContent;
188
+ }
189
+ });
190
+ Object.defineProperty(exports, "dialogContentClassNames", {
191
+ enumerable: true,
192
+ get: function () {
193
+ return DialogContent_1.dialogContentClassNames;
194
+ }
195
+ });
196
+ Object.defineProperty(exports, "useDialogContent_unstable", {
197
+ enumerable: true,
198
+ get: function () {
199
+ return DialogContent_1.useDialogContent_unstable;
200
+ }
201
+ });
202
+ Object.defineProperty(exports, "useDialogContentStyles_unstable", {
203
+ enumerable: true,
204
+ get: function () {
205
+ return DialogContent_1.useDialogContentStyles_unstable;
206
+ }
207
+ });
208
+ Object.defineProperty(exports, "renderDialogContent_unstable", {
209
+ enumerable: true,
210
+ get: function () {
211
+ return DialogContent_1.renderDialogContent_unstable;
212
+ }
213
+ });
181
214
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,QAAA,gBAAA,OAAA,CAAA,UAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,QAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,MAAA;EAAM;AAAN,CAAA;AAAQ,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,qBAAA;EAAqB;AAArB,CAAA;AAAuB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,kBAAA;EAAkB;AAAlB,CAAA;;AAUxC,IAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,eAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,aAAA;EAAa;AAAb,CAAA;AAAe,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,yBAAA;EAAyB;AAAzB,CAAA;AAA2B,MAAA,CAAA,cAAA,CAAA,OAAA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EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,aAAA,CAAA,0BAAA;EAA0B;AAA1B,CAAA;;AAIF,IAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,eAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,aAAA;EAAa;AAAb,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,uBAAA;EAAuB;AAAvB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,yBAAA;EAAyB;AAAzB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,+BAAA;EAA+B;AAA/B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,8BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,4BAAA;EAA4B;AAA5B,CAAA","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 } from './DialogSurface';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,QAAA,gBAAA,OAAA,CAAA,UAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,QAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,MAAA;EAAM;AAAN,CAAA;AAAQ,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,qBAAA;EAAqB;AAArB,CAAA;AAAuB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,kBAAA;EAAkB;AAAlB,CAAA;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EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,4BAAA;EAA4B;AAA5B,CAAA;;AAIF,IAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,eAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,aAAA;EAAa;AAAb,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,uBAAA;EAAuB;AAAvB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,yBAAA;EAAyB;AAAzB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,+BAAA;EAA+B;AAA/B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,8BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,4BAAA;EAA4B;AAA5B,CAAA","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"],"sourceRoot":"../src/"}
@@ -11,8 +11,4 @@ tslib_1.__exportStar(require("./isEscapeKeyDown"), exports);
11
11
  tslib_1.__exportStar(require("./useDisableBodyScroll"), exports);
12
12
 
13
13
  tslib_1.__exportStar(require("./useFocusFirstElement"), exports);
14
-
15
- tslib_1.__exportStar(require("./isHTMLDialogElement"), exports);
16
-
17
- tslib_1.__exportStar(require("./useControlNativeDialogOpenState"), exports);
18
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["utils/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './isEscapeKeyDown';\nexport * from './useDisableBodyScroll';\nexport * from './useFocusFirstElement';\nexport * from './isHTMLDialogElement';\nexport * from './useControlNativeDialogOpenState';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/utils/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './isEscapeKeyDown';\nexport * from './useDisableBodyScroll';\nexport * from './useFocusFirstElement';\n"],"sourceRoot":"../src/"}
@@ -6,17 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.isEscapeKeyDismiss = void 0;
7
7
 
8
8
  const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
9
-
10
- const isHTMLDialogElement_1 = /*#__PURE__*/require("./isHTMLDialogElement");
11
9
  /**
12
10
  * Checks if keydown event is a proper Escape key dismiss
13
11
  */
14
12
 
15
13
 
16
14
  function isEscapeKeyDismiss(event, modalType) {
17
- return event.key === keyboard_keys_1.Escape && ( // `non-modal` should always have Escape key handling
18
- // `modal` should only be handled in the case of non native dialog
19
- modalType === 'non-modal' || !isHTMLDialogElement_1.isHTMLDialogElement(event.currentTarget) && modalType === 'modal') && !event.isDefaultPrevented();
15
+ return event.key === keyboard_keys_1.Escape && modalType !== 'alert' && !event.isDefaultPrevented();
20
16
  }
21
17
 
22
18
  exports.isEscapeKeyDismiss = isEscapeKeyDismiss;
@@ -1 +1 @@
1
- {"version":3,"sources":["utils/isEscapeKeyDown.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAGA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAEA;;AAEG;;;AACH,SAAgB,kBAAhB,CACE,KADF,EAEE,SAFF,EAE4B;EAE1B,OACE,KAAK,CAAC,GAAN,KAAc,eAAA,CAAA,MAAd,MACA;EACA;EACC,SAAS,KAAK,WAAd,IAA8B,CAAC,qBAAA,CAAA,mBAAA,CAAoB,KAAK,CAAC,aAA1B,CAAD,IAA6C,SAAS,KAAK,OAH1F,KAIA,CAAC,KAAK,CAAC,kBAAN,EALH;AAOD;;AAXD,OAAA,CAAA,kBAAA,GAAA,kBAAA","sourcesContent":["import * as React from 'react';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { DialogModalType } from '../components/Dialog/Dialog.types';\nimport { DialogSurfaceElement } from '../DialogSurface';\nimport { isHTMLDialogElement } from './isHTMLDialogElement';\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 (\n event.key === Escape &&\n // `non-modal` should always have Escape key handling\n // `modal` should only be handled in the case of non native dialog\n (modalType === 'non-modal' || (!isHTMLDialogElement(event.currentTarget) && modalType === 'modal')) &&\n !event.isDefaultPrevented()\n );\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/utils/isEscapeKeyDown.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAIA;;AAEG;;;AACH,SAAgB,kBAAhB,CACE,KADF,EAEE,SAFF,EAE4B;EAE1B,OAAO,KAAK,CAAC,GAAN,KAAc,eAAA,CAAA,MAAd,IAAwB,SAAS,KAAK,OAAtC,IAAiD,CAAC,KAAK,CAAC,kBAAN,EAAzD;AACD;;AALD,OAAA,CAAA,kBAAA,GAAA,kBAAA","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"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["utils/useDisableBodyScroll.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,MAAM,wBAAwB,GAAG,8BAAjC;AAUA;;AAEG;;AACH,SAAgB,oBAAhB,GAAoC;EAClC,MAAM;IAAE;EAAF,IAAqB,uBAAA,CAAA,kBAAA,EAA3B;EACA,OAAO,OAAA,CAAA,WAAA,CAAY,MAAK;IACtB,IAAI,cAAJ,EAAoB;MAClB,OAAO,aAAa,CAAC,cAAc,CAAC,IAAhB,CAApB;IACD;EACF,CAJM,EAIJ,CAAC,cAAD,CAJI,CAAP;AAKD;;AAPD,OAAA,CAAA,oBAAA,GAAA,oBAAA;AASA;;;;AAIG;;AACH,SAAgB,aAAhB,CAA8B,MAA9B,EAAiD;;;EAC/C,MAAM;IAAE;EAAF,IAAkB,MAAM,CAAC,aAAP,CAAqB,eAA7C;EACA,MAAM,UAAU,GAAG,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAM,CAAC,aAAP,CAAqB,WAArB,MAAgC,IAAhC,IAAgC,EAAA,KAAA,KAAA,CAAhC,GAAgC,KAAA,CAAhC,GAAgC,EAAA,CAAE,UAAlC,MAA4C,IAA5C,IAA4C,EAAA,KAAA,KAAA,CAA5C,GAA4C,EAA5C,GAAgD,CAAnE;EACA,4BAA4B,CAAC,MAAD,CAA5B;;EACA,IAAI,MAAM,CAAC,wBAAD,CAAN,CAAiC,KAAjC,KAA2C,CAA/C,EAAkD;IAChD,MAAM,CAAC,KAAP,CAAa,QAAb,GAAwB,QAAxB;IACA,MAAM,CAAC,KAAP,CAAa,YAAb,GAA4B,GAAG,UAAU,GAAG,WAAW,IAAvD;EACD;;EACD,MAAM,CAAC,wBAAD,CAAN,CAAiC,KAAjC;EACA,OAAO,MAAK;IACV,MAAM,CAAC,wBAAD,CAAN,CAAiC,KAAjC;;IACA,IAAI,MAAM,CAAC,wBAAD,CAAN,CAAiC,KAAjC,KAA2C,CAA/C,EAAkD;MAChD,MAAM,CAAC,KAAP,CAAa,QAAb,GAAwB,MAAM,CAAC,wBAAD,CAAN,CAAiC,qBAAzD;MACA,MAAM,CAAC,KAAP,CAAa,YAAb,GAA4B,MAAM,CAAC,wBAAD,CAAN,CAAiC,yBAA7D;IACD;EACF,CAND;AAOD;;AAhBD,OAAA,CAAA,aAAA,GAAA,aAAA;;AAkBA,SAAS,4BAAT,CAAsC,OAAtC,EAA0D;;;;;EACxD,CAAA,EAAA,GAAA,CAAA,EAAA,GAAC,OAAD,EAAwC,wBAAxC,CAAA,MAAgE,IAAhE,IAAgE,EAAA,KAAA,KAAA,CAAhE,GAAgE,EAAhE,GAAgE,EAAA,CAAxB,wBAAwB,CAAA,GAAM;IACpE,KAAK,EAAE,CAD6D;IAEpE,qBAAqB,EAAE,OAAO,CAAC,KAAR,CAAc,QAF+B;IAGpE,yBAAyB,EAAE,OAAO,CAAC,KAAR,CAAc;EAH2B,CAAtE;AAKD","sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nconst disableScrollElementProp = '__fluentDisableScrollElement' as const;\n\ntype FluentDisableScrollElement = HTMLElement & {\n [disableScrollElementProp]: {\n count: number;\n previousOverflowStyle: string;\n previousPaddingRightStyle: string;\n };\n};\n\n/**\n * hook that disables body scrolling through `overflow: hidden` CSS property\n */\nexport function useDisableBodyScroll() {\n const { targetDocument } = useFluent_unstable();\n return useCallback(() => {\n if (targetDocument) {\n return disableScroll(targetDocument.body);\n }\n }, [targetDocument]);\n}\n\n/**\n * disables scrolling from a given element through `overflow: hidden` CSS property\n * @param target - element to disable scrolling from\n * @returns a method for enabling scrolling again\n */\nexport function disableScroll(target: HTMLElement) {\n const { clientWidth } = target.ownerDocument.documentElement;\n const innerWidth = target.ownerDocument.defaultView?.innerWidth ?? 0;\n assertIsDisableScrollElement(target);\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = 'hidden';\n target.style.paddingRight = `${innerWidth - clientWidth}px`;\n }\n target[disableScrollElementProp].count++;\n return () => {\n target[disableScrollElementProp].count--;\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;\n target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;\n }\n };\n}\n\nfunction assertIsDisableScrollElement(element: HTMLElement): asserts element is FluentDisableScrollElement {\n (element as FluentDisableScrollElement)[disableScrollElementProp] ??= {\n count: 0,\n previousOverflowStyle: element.style.overflow,\n previousPaddingRightStyle: element.style.paddingRight,\n };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/utils/useDisableBodyScroll.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,MAAM,wBAAwB,GAAG,8BAAjC;AAUA;;AAEG;;AACH,SAAgB,oBAAhB,GAAoC;EAClC,MAAM;IAAE;EAAF,IAAqB,uBAAA,CAAA,kBAAA,EAA3B;EACA,OAAO,OAAA,CAAA,WAAA,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C,OAAtC,EAA0D;;;;;EACxD,CAAA,EAAA,GAAA,CAAA,EAAA,GAAC,OAAD,EAAwC,wBAAxC,CAAA,MAAgE,IAAhE,IAAgE,EAAA,KAAA,KAAA,CAAhE,GAAgE,EAAhE,GAAgE,EAAA,CAAxB,wBAAwB,CAAA,GAAM;IACpE,KAAK,EAAE,CAD6D;IAEpE,qBAAqB,EAAE,OAAO,CAAC,KAAR,CAAc,QAF+B;IAGpE,yBAAyB,EAAE,OAAO,CAAC,KAAR,CAAc;EAH2B,CAAtE;AAKD","sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nconst disableScrollElementProp = '__fluentDisableScrollElement' as const;\n\ntype FluentDisableScrollElement = HTMLElement & {\n [disableScrollElementProp]: {\n count: number;\n previousOverflowStyle: string;\n previousPaddingRightStyle: string;\n };\n};\n\n/**\n * hook that disables body scrolling through `overflow: hidden` CSS property\n */\nexport function useDisableBodyScroll() {\n const { targetDocument } = useFluent_unstable();\n return useCallback(() => {\n if (targetDocument) {\n return disableScroll(targetDocument.body);\n }\n }, [targetDocument]);\n}\n\n/**\n * disables scrolling from a given element through `overflow: hidden` CSS property\n * @param target - element to disable scrolling from\n * @returns a method for enabling scrolling again\n */\nexport function disableScroll(target: HTMLElement) {\n const { clientWidth } = target.ownerDocument.documentElement;\n const innerWidth = target.ownerDocument.defaultView?.innerWidth ?? 0;\n assertIsDisableScrollElement(target);\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = 'hidden';\n target.style.paddingRight = `${innerWidth - clientWidth}px`;\n }\n target[disableScrollElementProp].count++;\n return () => {\n target[disableScrollElementProp].count--;\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;\n target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;\n }\n };\n}\n\nfunction assertIsDisableScrollElement(element: HTMLElement): asserts element is FluentDisableScrollElement {\n (element as FluentDisableScrollElement)[disableScrollElementProp] ??= {\n count: 0,\n previousOverflowStyle: element.style.overflow,\n previousPaddingRightStyle: element.style.paddingRight,\n };\n}\n"],"sourceRoot":"../src/"}
@@ -10,8 +10,6 @@ const React = /*#__PURE__*/require("react");
10
10
  const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
11
 
12
12
  const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
13
-
14
- const isHTMLDialogElement_1 = /*#__PURE__*/require("./isHTMLDialogElement");
15
13
  /**
16
14
  * Focus first element on content when dialog is opened,
17
15
  */
@@ -37,14 +35,14 @@ function useFocusFirstElement(open, modalType) {
37
35
  const element = dialogRef.current && findFirstFocusable(dialogRef.current);
38
36
 
39
37
  if (element) {
40
- // this is only required for non native dialogs
41
- if (!isHTMLDialogElement_1.isHTMLDialogElement(dialogRef.current)) {
42
- element.focus();
43
- }
44
- } else if (process.env.NODE_ENV !== 'production') {
45
- (_b = triggerRef.current) === null || _b === void 0 ? void 0 : _b.blur(); // eslint-disable-next-line no-console
38
+ element.focus();
39
+ } else {
40
+ (_b = dialogRef.current) === null || _b === void 0 ? void 0 : _b.focus(); // https://github.com/microsoft/fluentui/issues/25150
46
41
 
47
- console.warn('A Dialog should have at least one focusable element inside DialogSurface');
42
+ if (process.env.NODE_ENV !== 'production') {
43
+ // eslint-disable-next-line no-console
44
+ console.warn(['@fluentui/react-dialog: a Dialog should have at least one focusable element inside DialogSurface.', 'Please add at least a close button either on `DialogTitle` action slot or inside `DialogActions`'].join('\n'));
45
+ }
48
46
  }
49
47
  }, [findFirstFocusable, open, modalType, targetDocument]);
50
48
  return dialogRef;
@@ -1 +1 @@
1
- {"version":3,"sources":["utils/useFocusFirstElement.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA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ArB,EAA2B,SAA3B,EAAsC,cAAtC,CAhBH;EAkBA,OAAO,SAAP;AACD;;AAzBD,OAAA,CAAA,oBAAA,GAAA,oBAAA","sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface';\nimport type { DialogModalType } from '../Dialog';\nimport { isHTMLDialogElement } from './isHTMLDialogElement';\n\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(open: boolean, modalType: DialogModalType) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef<DialogSurfaceElement>(null);\n const triggerRef = React.useRef<HTMLElement>();\n\n React.useEffect(() => {\n if (!open) {\n return triggerRef.current?.focus();\n }\n triggerRef.current = targetDocument?.activeElement as HTMLElement | undefined;\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n // this is only required for non native dialogs\n if (!isHTMLDialogElement(dialogRef.current)) {\n element.focus();\n }\n } else if (process.env.NODE_ENV !== 'production') {\n triggerRef.current?.blur();\n // eslint-disable-next-line no-console\n console.warn('A Dialog should have at least one focusable element inside DialogSurface');\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/utils/useFocusFirstElement.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;AAIA;;AAEG;;;AACH,SAAgB,oBAAhB,CAAqC,IAArC,EAAoD,SAApD,EAA8E;EAC5E,MAAM;IAAE;EAAF,IAAyB,eAAA,CAAA,eAAA,EAA/B;EACA,MAAM;IAAE;EAAF,IAAqB,uBAAA,CAAA,kBAAA,EAA3B;EACA,MAAM,SAAS,GAAG,KAAK,CAAC,MAAN,CAAmC,IAAnC,CAAlB;EACA,MAAM,UAAU,GAAG,KAAK,CAAC,MAAN,EAAnB;EAEA,KAAK,CAAC,SAAN,CAAgB,MAAK;;;IACnB,IAAI,CAAC,IAAL,EAAW;MACT,OAAO,CAAA,EAAA,GAAA,UAAU,CAAC,OAAX,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,KAAA,CAAlB,GAAkB,EAAA,CAAE,KAAF,EAAzB;IACD;;IACD,UAAU,CAAC,OAAX,GAAqB,cAAc,KAAA,IAAd,IAAA,cAAc,KAAA,KAAA,CAAd,GAAc,KAAA,CAAd,GAAA,cAAc,CAAE,aAArC;IACA,MAAM,OAAO,GAAG,SAAS,CAAC,OAAV,IAAqB,kBAAkB,CAAC,SAAS,CAAC,OAAX,CAAvD;;IACA,IAAI,OAAJ,EAAa;MACX,OAAO,CAAC,KAAR;IACD,CAFD,MAEO;MACL,CAAA,EAAA,GAAA,SAAS,CAAC,OAAV,MAAiB,IAAjB,IAAiB,EAAA,KAAA,KAAA,CAAjB,GAAiB,KAAA,CAAjB,GAAiB,EAAA,CAAE,KAAF,EAAjB,CADK,CACuB;;MAC5B,IAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;QACzC;QACA,OAAO,CAAC,IAAR,CACE,CACE,mGADF,EAEE,kGAFF,EAGE,IAHF,CAGO,IAHP,CADF;MAMD;IACF;EACF,CApBD,EAoBG,CAAC,kBAAD,EAAqB,IAArB,EAA2B,SAA3B,EAAsC,cAAtC,CApBH;EAsBA,OAAO,SAAP;AACD;;AA7BD,OAAA,CAAA,oBAAA,GAAA,oBAAA","sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface';\nimport type { DialogModalType } from '../Dialog';\n\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(open: boolean, modalType: DialogModalType) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef<DialogSurfaceElement>(null);\n const triggerRef = React.useRef<HTMLElement>();\n\n React.useEffect(() => {\n if (!open) {\n return triggerRef.current?.focus();\n }\n triggerRef.current = targetDocument?.activeElement as HTMLElement | undefined;\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n dialogRef.current?.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n [\n '@fluentui/react-dialog: a Dialog should have at least one focusable element inside DialogSurface.',\n 'Please add at least a close button either on `DialogTitle` action slot or inside `DialogActions`',\n ].join('\\n'),\n );\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-dialog",
3
- "version": "9.0.0-beta.8",
3
+ "version": "9.0.0",
4
4
  "description": "Dialog component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -22,28 +22,27 @@
22
22
  "test": "jest --passWithNoTests",
23
23
  "e2e": "cypress run --component",
24
24
  "e2e:local": "cypress open --component",
25
- "docs": "api-extractor run --config=config/api-extractor.local.json --local",
26
- "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-dialog/src && yarn docs",
27
25
  "storybook": "start-storybook",
28
- "type-check": "tsc -b tsconfig.json"
26
+ "type-check": "tsc -b tsconfig.json",
27
+ "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
29
28
  },
30
29
  "devDependencies": {
31
30
  "@fluentui/eslint-plugin": "*",
32
31
  "@fluentui/react-conformance": "*",
33
- "@fluentui/react-conformance-griffel": "9.0.0-beta.13",
32
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.15",
34
33
  "@fluentui/scripts": "^1.0.0"
35
34
  },
36
35
  "dependencies": {
37
- "@griffel/react": "^1.3.0",
38
- "@fluentui/react-utilities": "^9.1.0",
36
+ "@griffel/react": "^1.4.0",
37
+ "@fluentui/react-utilities": "^9.1.1",
39
38
  "@fluentui/keyboard-keys": "^9.0.0",
40
- "@fluentui/react-context-selector": "^9.0.3",
39
+ "@fluentui/react-context-selector": "^9.0.4",
41
40
  "@fluentui/react-shared-contexts": "^9.0.1",
42
- "@fluentui/react-aria": "^9.2.0",
41
+ "@fluentui/react-aria": "^9.2.2",
43
42
  "@fluentui/react-icons": "^2.0.175",
44
- "@fluentui/react-tabster": "^9.1.1",
43
+ "@fluentui/react-tabster": "^9.1.3",
45
44
  "@fluentui/react-theme": "^9.1.0",
46
- "@fluentui/react-portal": "^9.0.5",
45
+ "@fluentui/react-portal": "^9.0.7",
47
46
  "tslib": "^2.1.0"
48
47
  },
49
48
  "peerDependencies": {
@@ -54,9 +53,7 @@
54
53
  },
55
54
  "beachball": {
56
55
  "disallowedChangeTypes": [
57
- "major",
58
- "minor",
59
- "patch"
56
+ "major"
60
57
  ]
61
58
  },
62
59
  "exports": {
@@ -1,4 +0,0 @@
1
- export function isHTMLDialogElement(element) {
2
- return Boolean(element && 'open' in element && 'show' in element && 'showModal' in element && 'close' in element);
3
- }
4
- //# sourceMappingURL=isHTMLDialogElement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["utils/isHTMLDialogElement.ts"],"names":[],"mappings":"AAEA,OAAM,SAAU,mBAAV,CAA8B,OAA9B,EAA0D;EAC9D,OAAO,OAAO,CAAC,OAAO,IAAI,UAAU,OAArB,IAAgC,UAAU,OAA1C,IAAqD,eAAe,OAApE,IAA+E,WAAW,OAA3F,CAAd;AACD","sourcesContent":["import * as React from 'react';\n\nexport function isHTMLDialogElement(element?: HTMLElement | null): element is HTMLDialogElement {\n return Boolean(element && 'open' in element && 'show' in element && 'showModal' in element && 'close' in element);\n}\n\n/**\n * adds additional types which are missing from current version of react\n * @internal\n */\nexport type HTMLDialogElementProps = JSX.IntrinsicElements['dialog'] & {\n /**\n * The close event is fired on a <dialog> when it has been closed.\n */\n onClose?: (event: React.SyntheticEvent) => void;\n /**\n * The cancel event fires on a <dialog> when\n * the user instructs the browser that they wish to dismiss the current open dialog.\n * For example, the browser might fire this event when the user presses the Esc\n * key.\n */\n onCancel?: (event: React.SyntheticEvent) => void;\n};\n"],"sourceRoot":"../src/"}
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import { isHTMLDialogElement } from './isHTMLDialogElement';
3
- export function useControlNativeDialogOpenState(open, modalType) {
4
- const dialogSurfaceRef = React.useRef(null);
5
- React.useEffect(() => {
6
- if (isHTMLDialogElement(dialogSurfaceRef.current) && dialogSurfaceRef.current.open !== open) {
7
- if (open) {
8
- if (modalType === 'non-modal') {
9
- dialogSurfaceRef.current.show();
10
- } else {
11
- dialogSurfaceRef.current.showModal();
12
- }
13
- } else {
14
- dialogSurfaceRef.current.close();
15
- }
16
- }
17
- }, [open, modalType]);
18
- return dialogSurfaceRef;
19
- }
20
- //# sourceMappingURL=useControlNativeDialogOpenState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["utils/useControlNativeDialogOpenState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,mBAAT,QAAoC,uBAApC;AAIA,OAAM,SAAU,+BAAV,CAA0C,IAA1C,EAAyD,SAAzD,EAAmF;EACvF,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAN,CAAmC,IAAnC,CAAzB;EAEA,KAAK,CAAC,SAAN,CAAgB,MAAK;IACnB,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,OAAlB,CAAnB,IAAiD,gBAAgB,CAAC,OAAjB,CAAyB,IAAzB,KAAkC,IAAvF,EAA6F;MAC3F,IAAI,IAAJ,EAAU;QACR,IAAI,SAAS,KAAK,WAAlB,EAA+B;UAC7B,gBAAgB,CAAC,OAAjB,CAAyB,IAAzB;QACD,CAFD,MAEO;UACL,gBAAgB,CAAC,OAAjB,CAAyB,SAAzB;QACD;MACF,CAND,MAMO;QACL,gBAAgB,CAAC,OAAjB,CAAyB,KAAzB;MACD;IACF;EACF,CAZD,EAYG,CAAC,IAAD,EAAO,SAAP,CAZH;EAcA,OAAO,gBAAP;AACD","sourcesContent":["import * as React from 'react';\nimport { isHTMLDialogElement } from './isHTMLDialogElement';\nimport type { DialogModalType } from '../Dialog';\nimport type { DialogSurfaceElement } from '../DialogSurface';\n\nexport function useControlNativeDialogOpenState(open: boolean, modalType: DialogModalType) {\n const dialogSurfaceRef = React.useRef<DialogSurfaceElement>(null);\n\n React.useEffect(() => {\n if (isHTMLDialogElement(dialogSurfaceRef.current) && dialogSurfaceRef.current.open !== open) {\n if (open) {\n if (modalType === 'non-modal') {\n dialogSurfaceRef.current.show();\n } else {\n dialogSurfaceRef.current.showModal();\n }\n } else {\n dialogSurfaceRef.current.close();\n }\n }\n }, [open, modalType]);\n\n return dialogSurfaceRef;\n}\n"],"sourceRoot":"../src/"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isHTMLDialogElement = void 0;
7
-
8
- function isHTMLDialogElement(element) {
9
- return Boolean(element && 'open' in element && 'show' in element && 'showModal' in element && 'close' in element);
10
- }
11
-
12
- exports.isHTMLDialogElement = isHTMLDialogElement;
13
- //# sourceMappingURL=isHTMLDialogElement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["utils/isHTMLDialogElement.ts"],"names":[],"mappings":";;;;;;;AAEA,SAAgB,mBAAhB,CAAoC,OAApC,EAAgE;EAC9D,OAAO,OAAO,CAAC,OAAO,IAAI,UAAU,OAArB,IAAgC,UAAU,OAA1C,IAAqD,eAAe,OAApE,IAA+E,WAAW,OAA3F,CAAd;AACD;;AAFD,OAAA,CAAA,mBAAA,GAAA,mBAAA","sourcesContent":["import * as React from 'react';\n\nexport function isHTMLDialogElement(element?: HTMLElement | null): element is HTMLDialogElement {\n return Boolean(element && 'open' in element && 'show' in element && 'showModal' in element && 'close' in element);\n}\n\n/**\n * adds additional types which are missing from current version of react\n * @internal\n */\nexport type HTMLDialogElementProps = JSX.IntrinsicElements['dialog'] & {\n /**\n * The close event is fired on a <dialog> when it has been closed.\n */\n onClose?: (event: React.SyntheticEvent) => void;\n /**\n * The cancel event fires on a <dialog> when\n * the user instructs the browser that they wish to dismiss the current open dialog.\n * For example, the browser might fire this event when the user presses the Esc\n * key.\n */\n onCancel?: (event: React.SyntheticEvent) => void;\n};\n"],"sourceRoot":"../src/"}
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useControlNativeDialogOpenState = void 0;
7
-
8
- const React = /*#__PURE__*/require("react");
9
-
10
- const isHTMLDialogElement_1 = /*#__PURE__*/require("./isHTMLDialogElement");
11
-
12
- function useControlNativeDialogOpenState(open, modalType) {
13
- const dialogSurfaceRef = React.useRef(null);
14
- React.useEffect(() => {
15
- if (isHTMLDialogElement_1.isHTMLDialogElement(dialogSurfaceRef.current) && dialogSurfaceRef.current.open !== open) {
16
- if (open) {
17
- if (modalType === 'non-modal') {
18
- dialogSurfaceRef.current.show();
19
- } else {
20
- dialogSurfaceRef.current.showModal();
21
- }
22
- } else {
23
- dialogSurfaceRef.current.close();
24
- }
25
- }
26
- }, [open, modalType]);
27
- return dialogSurfaceRef;
28
- }
29
-
30
- exports.useControlNativeDialogOpenState = useControlNativeDialogOpenState;
31
- //# sourceMappingURL=useControlNativeDialogOpenState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["utils/useControlNativeDialogOpenState.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIA,SAAgB,+BAAhB,CAAgD,IAAhD,EAA+D,SAA/D,EAAyF;EACvF,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAN,CAAmC,IAAnC,CAAzB;EAEA,KAAK,CAAC,SAAN,CAAgB,MAAK;IACnB,IAAI,qBAAA,CAAA,mBAAA,CAAoB,gBAAgB,CAAC,OAArC,KAAiD,gBAAgB,CAAC,OAAjB,CAAyB,IAAzB,KAAkC,IAAvF,EAA6F;MAC3F,IAAI,IAAJ,EAAU;QACR,IAAI,SAAS,KAAK,WAAlB,EAA+B;UAC7B,gBAAgB,CAAC,OAAjB,CAAyB,IAAzB;QACD,CAFD,MAEO;UACL,gBAAgB,CAAC,OAAjB,CAAyB,SAAzB;QACD;MACF,CAND,MAMO;QACL,gBAAgB,CAAC,OAAjB,CAAyB,KAAzB;MACD;IACF;EACF,CAZD,EAYG,CAAC,IAAD,EAAO,SAAP,CAZH;EAcA,OAAO,gBAAP;AACD;;AAlBD,OAAA,CAAA,+BAAA,GAAA,+BAAA","sourcesContent":["import * as React from 'react';\nimport { isHTMLDialogElement } from './isHTMLDialogElement';\nimport type { DialogModalType } from '../Dialog';\nimport type { DialogSurfaceElement } from '../DialogSurface';\n\nexport function useControlNativeDialogOpenState(open: boolean, modalType: DialogModalType) {\n const dialogSurfaceRef = React.useRef<DialogSurfaceElement>(null);\n\n React.useEffect(() => {\n if (isHTMLDialogElement(dialogSurfaceRef.current) && dialogSurfaceRef.current.open !== open) {\n if (open) {\n if (modalType === 'non-modal') {\n dialogSurfaceRef.current.show();\n } else {\n dialogSurfaceRef.current.showModal();\n }\n } else {\n dialogSurfaceRef.current.close();\n }\n }\n }, [open, modalType]);\n\n return dialogSurfaceRef;\n}\n"],"sourceRoot":"../src/"}