@fluentui/react-dialog 9.0.0-beta.10

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 (253) hide show
  1. package/CHANGELOG.json +527 -0
  2. package/CHANGELOG.md +199 -0
  3. package/LICENSE +15 -0
  4. package/README.md +5 -0
  5. package/Spec.md +537 -0
  6. package/assets/AlertDialogKeyboardInteraction.png +0 -0
  7. package/assets/AlertDialogMouseInteraction.png +0 -0
  8. package/assets/ModalDialogKeyboardInteraction.png +0 -0
  9. package/assets/ModalDialogMouseInteraction.png +0 -0
  10. package/assets/NonModalDialogKeyboardInteraction.png +0 -0
  11. package/assets/NonModalDialogMouseInteraction.png +0 -0
  12. package/dist/index.d.ts +451 -0
  13. package/lib/Dialog.js +2 -0
  14. package/lib/Dialog.js.map +1 -0
  15. package/lib/DialogActions.js +2 -0
  16. package/lib/DialogActions.js.map +1 -0
  17. package/lib/DialogBody.js +2 -0
  18. package/lib/DialogBody.js.map +1 -0
  19. package/lib/DialogContent.js +2 -0
  20. package/lib/DialogContent.js.map +1 -0
  21. package/lib/DialogSurface.js +2 -0
  22. package/lib/DialogSurface.js.map +1 -0
  23. package/lib/DialogTitle.js +2 -0
  24. package/lib/DialogTitle.js.map +1 -0
  25. package/lib/DialogTrigger.js +2 -0
  26. package/lib/DialogTrigger.js.map +1 -0
  27. package/lib/components/Dialog/Dialog.js +19 -0
  28. package/lib/components/Dialog/Dialog.js.map +1 -0
  29. package/lib/components/Dialog/Dialog.types.js +2 -0
  30. package/lib/components/Dialog/Dialog.types.js.map +1 -0
  31. package/lib/components/Dialog/index.js +5 -0
  32. package/lib/components/Dialog/index.js.map +1 -0
  33. package/lib/components/Dialog/renderDialog.js +18 -0
  34. package/lib/components/Dialog/renderDialog.js.map +1 -0
  35. package/lib/components/Dialog/useDialog.js +87 -0
  36. package/lib/components/Dialog/useDialog.js.map +1 -0
  37. package/lib/components/Dialog/useDialogContextValues.js +31 -0
  38. package/lib/components/Dialog/useDialogContextValues.js.map +1 -0
  39. package/lib/components/DialogActions/DialogActions.js +16 -0
  40. package/lib/components/DialogActions/DialogActions.js.map +1 -0
  41. package/lib/components/DialogActions/DialogActions.types.js +2 -0
  42. package/lib/components/DialogActions/DialogActions.types.js.map +1 -0
  43. package/lib/components/DialogActions/index.js +6 -0
  44. package/lib/components/DialogActions/index.js.map +1 -0
  45. package/lib/components/DialogActions/renderDialogActions.js +16 -0
  46. package/lib/components/DialogActions/renderDialogActions.js.map +1 -0
  47. package/lib/components/DialogActions/useDialogActions.js +27 -0
  48. package/lib/components/DialogActions/useDialogActions.js.map +1 -0
  49. package/lib/components/DialogActions/useDialogActionsStyles.js +49 -0
  50. package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -0
  51. package/lib/components/DialogBody/DialogBody.js +16 -0
  52. package/lib/components/DialogBody/DialogBody.js.map +1 -0
  53. package/lib/components/DialogBody/DialogBody.types.js +2 -0
  54. package/lib/components/DialogBody/DialogBody.types.js.map +1 -0
  55. package/lib/components/DialogBody/index.js +6 -0
  56. package/lib/components/DialogBody/index.js.map +1 -0
  57. package/lib/components/DialogBody/renderDialogBody.js +16 -0
  58. package/lib/components/DialogBody/renderDialogBody.js.map +1 -0
  59. package/lib/components/DialogBody/useDialogBody.js +25 -0
  60. package/lib/components/DialogBody/useDialogBody.js.map +1 -0
  61. package/lib/components/DialogBody/useDialogBodyStyles.js +50 -0
  62. package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -0
  63. package/lib/components/DialogContent/DialogContent.js +16 -0
  64. package/lib/components/DialogContent/DialogContent.js.map +1 -0
  65. package/lib/components/DialogContent/DialogContent.types.js +2 -0
  66. package/lib/components/DialogContent/DialogContent.types.js.map +1 -0
  67. package/lib/components/DialogContent/index.js +6 -0
  68. package/lib/components/DialogContent/index.js.map +1 -0
  69. package/lib/components/DialogContent/renderDialogContent.js +15 -0
  70. package/lib/components/DialogContent/renderDialogContent.js.map +1 -0
  71. package/lib/components/DialogContent/useDialogContent.js +28 -0
  72. package/lib/components/DialogContent/useDialogContent.js.map +1 -0
  73. package/lib/components/DialogContent/useDialogContentStyles.js +40 -0
  74. package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -0
  75. package/lib/components/DialogSurface/DialogSurface.js +18 -0
  76. package/lib/components/DialogSurface/DialogSurface.js.map +1 -0
  77. package/lib/components/DialogSurface/DialogSurface.types.js +2 -0
  78. package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -0
  79. package/lib/components/DialogSurface/index.js +6 -0
  80. package/lib/components/DialogSurface/index.js.map +1 -0
  81. package/lib/components/DialogSurface/renderDialogSurface.js +20 -0
  82. package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -0
  83. package/lib/components/DialogSurface/useDialogSurface.js +158 -0
  84. package/lib/components/DialogSurface/useDialogSurface.js.map +1 -0
  85. package/lib/components/DialogSurface/useDialogSurfaceContextValues.js +7 -0
  86. package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -0
  87. package/lib/components/DialogSurface/useDialogSurfaceStyles.js +95 -0
  88. package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
  89. package/lib/components/DialogTitle/DialogTitle.js +16 -0
  90. package/lib/components/DialogTitle/DialogTitle.js.map +1 -0
  91. package/lib/components/DialogTitle/DialogTitle.types.js +2 -0
  92. package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -0
  93. package/lib/components/DialogTitle/index.js +6 -0
  94. package/lib/components/DialogTitle/index.js.map +1 -0
  95. package/lib/components/DialogTitle/renderDialogTitle.js +16 -0
  96. package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -0
  97. package/lib/components/DialogTitle/useDialogTitle.js +48 -0
  98. package/lib/components/DialogTitle/useDialogTitle.js.map +1 -0
  99. package/lib/components/DialogTitle/useDialogTitleStyles.js +116 -0
  100. package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -0
  101. package/lib/components/DialogTrigger/DialogTrigger.js +20 -0
  102. package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -0
  103. package/lib/components/DialogTrigger/DialogTrigger.types.js +2 -0
  104. package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -0
  105. package/lib/components/DialogTrigger/index.js +5 -0
  106. package/lib/components/DialogTrigger/index.js.map +1 -0
  107. package/lib/components/DialogTrigger/renderDialogTrigger.js +7 -0
  108. package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -0
  109. package/lib/components/DialogTrigger/useDialogTrigger.js +48 -0
  110. package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -0
  111. package/lib/contexts/constants.js +11 -0
  112. package/lib/contexts/constants.js.map +1 -0
  113. package/lib/contexts/dialogContext.js +19 -0
  114. package/lib/contexts/dialogContext.js.map +1 -0
  115. package/lib/contexts/dialogSurfaceContext.js +10 -0
  116. package/lib/contexts/dialogSurfaceContext.js.map +1 -0
  117. package/lib/contexts/index.js +4 -0
  118. package/lib/contexts/index.js.map +1 -0
  119. package/lib/index.js +8 -0
  120. package/lib/index.js.map +1 -0
  121. package/lib/utils/index.js +6 -0
  122. package/lib/utils/index.js.map +1 -0
  123. package/lib/utils/isEscapeKeyDown.js +12 -0
  124. package/lib/utils/isEscapeKeyDown.js.map +1 -0
  125. package/lib/utils/isHTMLDialogElement.js +4 -0
  126. package/lib/utils/isHTMLDialogElement.js.map +1 -0
  127. package/lib/utils/useControlNativeDialogOpenState.js +20 -0
  128. package/lib/utils/useControlNativeDialogOpenState.js.map +1 -0
  129. package/lib/utils/useDisableBodyScroll.js +60 -0
  130. package/lib/utils/useDisableBodyScroll.js.map +1 -0
  131. package/lib/utils/useFocusFirstElement.js +41 -0
  132. package/lib/utils/useFocusFirstElement.js.map +1 -0
  133. package/lib-commonjs/Dialog.js +10 -0
  134. package/lib-commonjs/Dialog.js.map +1 -0
  135. package/lib-commonjs/DialogActions.js +10 -0
  136. package/lib-commonjs/DialogActions.js.map +1 -0
  137. package/lib-commonjs/DialogBody.js +10 -0
  138. package/lib-commonjs/DialogBody.js.map +1 -0
  139. package/lib-commonjs/DialogContent.js +10 -0
  140. package/lib-commonjs/DialogContent.js.map +1 -0
  141. package/lib-commonjs/DialogSurface.js +10 -0
  142. package/lib-commonjs/DialogSurface.js.map +1 -0
  143. package/lib-commonjs/DialogTitle.js +10 -0
  144. package/lib-commonjs/DialogTitle.js.map +1 -0
  145. package/lib-commonjs/DialogTrigger.js +10 -0
  146. package/lib-commonjs/DialogTrigger.js.map +1 -0
  147. package/lib-commonjs/components/Dialog/Dialog.js +30 -0
  148. package/lib-commonjs/components/Dialog/Dialog.js.map +1 -0
  149. package/lib-commonjs/components/Dialog/Dialog.types.js +6 -0
  150. package/lib-commonjs/components/Dialog/Dialog.types.js.map +1 -0
  151. package/lib-commonjs/components/Dialog/index.js +16 -0
  152. package/lib-commonjs/components/Dialog/index.js.map +1 -0
  153. package/lib-commonjs/components/Dialog/renderDialog.js +29 -0
  154. package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -0
  155. package/lib-commonjs/components/Dialog/useDialog.js +101 -0
  156. package/lib-commonjs/components/Dialog/useDialog.js.map +1 -0
  157. package/lib-commonjs/components/Dialog/useDialogContextValues.js +40 -0
  158. package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -0
  159. package/lib-commonjs/components/DialogActions/DialogActions.js +27 -0
  160. package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -0
  161. package/lib-commonjs/components/DialogActions/DialogActions.types.js +6 -0
  162. package/lib-commonjs/components/DialogActions/DialogActions.types.js.map +1 -0
  163. package/lib-commonjs/components/DialogActions/index.js +18 -0
  164. package/lib-commonjs/components/DialogActions/index.js.map +1 -0
  165. package/lib-commonjs/components/DialogActions/renderDialogActions.js +27 -0
  166. package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -0
  167. package/lib-commonjs/components/DialogActions/useDialogActions.js +37 -0
  168. package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -0
  169. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js +60 -0
  170. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -0
  171. package/lib-commonjs/components/DialogBody/DialogBody.js +27 -0
  172. package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -0
  173. package/lib-commonjs/components/DialogBody/DialogBody.types.js +6 -0
  174. package/lib-commonjs/components/DialogBody/DialogBody.types.js.map +1 -0
  175. package/lib-commonjs/components/DialogBody/index.js +18 -0
  176. package/lib-commonjs/components/DialogBody/index.js.map +1 -0
  177. package/lib-commonjs/components/DialogBody/renderDialogBody.js +27 -0
  178. package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -0
  179. package/lib-commonjs/components/DialogBody/useDialogBody.js +35 -0
  180. package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -0
  181. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +61 -0
  182. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -0
  183. package/lib-commonjs/components/DialogContent/DialogContent.js +27 -0
  184. package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -0
  185. package/lib-commonjs/components/DialogContent/DialogContent.types.js +6 -0
  186. package/lib-commonjs/components/DialogContent/DialogContent.types.js.map +1 -0
  187. package/lib-commonjs/components/DialogContent/index.js +18 -0
  188. package/lib-commonjs/components/DialogContent/index.js.map +1 -0
  189. package/lib-commonjs/components/DialogContent/renderDialogContent.js +26 -0
  190. package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -0
  191. package/lib-commonjs/components/DialogContent/useDialogContent.js +39 -0
  192. package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -0
  193. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +52 -0
  194. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -0
  195. package/lib-commonjs/components/DialogSurface/DialogSurface.js +30 -0
  196. package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -0
  197. package/lib-commonjs/components/DialogSurface/DialogSurface.types.js +6 -0
  198. package/lib-commonjs/components/DialogSurface/DialogSurface.types.js.map +1 -0
  199. package/lib-commonjs/components/DialogSurface/index.js +18 -0
  200. package/lib-commonjs/components/DialogSurface/index.js.map +1 -0
  201. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +33 -0
  202. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -0
  203. package/lib-commonjs/components/DialogSurface/useDialogSurface.js +171 -0
  204. package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -0
  205. package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js +16 -0
  206. package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -0
  207. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +107 -0
  208. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
  209. package/lib-commonjs/components/DialogTitle/DialogTitle.js +27 -0
  210. package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -0
  211. package/lib-commonjs/components/DialogTitle/DialogTitle.types.js +6 -0
  212. package/lib-commonjs/components/DialogTitle/DialogTitle.types.js.map +1 -0
  213. package/lib-commonjs/components/DialogTitle/index.js +18 -0
  214. package/lib-commonjs/components/DialogTitle/index.js.map +1 -0
  215. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +27 -0
  216. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -0
  217. package/lib-commonjs/components/DialogTitle/useDialogTitle.js +64 -0
  218. package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -0
  219. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +129 -0
  220. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -0
  221. package/lib-commonjs/components/DialogTrigger/DialogTrigger.js +31 -0
  222. package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -0
  223. package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js +6 -0
  224. package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js.map +1 -0
  225. package/lib-commonjs/components/DialogTrigger/index.js +16 -0
  226. package/lib-commonjs/components/DialogTrigger/index.js.map +1 -0
  227. package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js +16 -0
  228. package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -0
  229. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +62 -0
  230. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -0
  231. package/lib-commonjs/contexts/constants.js +17 -0
  232. package/lib-commonjs/contexts/constants.js.map +1 -0
  233. package/lib-commonjs/contexts/dialogContext.js +30 -0
  234. package/lib-commonjs/contexts/dialogContext.js.map +1 -0
  235. package/lib-commonjs/contexts/dialogSurfaceContext.js +21 -0
  236. package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -0
  237. package/lib-commonjs/contexts/index.js +14 -0
  238. package/lib-commonjs/contexts/index.js.map +1 -0
  239. package/lib-commonjs/index.js +214 -0
  240. package/lib-commonjs/index.js.map +1 -0
  241. package/lib-commonjs/utils/index.js +18 -0
  242. package/lib-commonjs/utils/index.js.map +1 -0
  243. package/lib-commonjs/utils/isEscapeKeyDown.js +23 -0
  244. package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -0
  245. package/lib-commonjs/utils/isHTMLDialogElement.js +13 -0
  246. package/lib-commonjs/utils/isHTMLDialogElement.js.map +1 -0
  247. package/lib-commonjs/utils/useControlNativeDialogOpenState.js +31 -0
  248. package/lib-commonjs/utils/useControlNativeDialogOpenState.js.map +1 -0
  249. package/lib-commonjs/utils/useDisableBodyScroll.js +73 -0
  250. package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -0
  251. package/lib-commonjs/utils/useFocusFirstElement.js +54 -0
  252. package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -0
  253. package/package.json +68 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/Dialog/useDialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SACE,oBADF,EAEE,gBAFF,EAGE,KAHF,EAIE,yBAJF,EAKE,aALF,QAMO,2BANP;AAOA,SAAS,mBAAT,QAAoC,kCAApC;AACA,SAAS,+BAAT,EAA0C,oBAA1C,EAAgE,oBAAhE,QAA4F,aAA5F;AACA,SAAS,aAAT,QAA8B,gBAA9B;AAIA;;;;;;;AAOG;;AACH,OAAO,MAAM,kBAAkB,GAAI,KAAD,IAAoC;EACpE,MAAM;IAAE,QAAF;IAAY,SAAS,GAAG,OAAxB;IAAiC;EAAjC,IAAkD,KAAxD;EAEA,MAAM,CAAC,OAAD,EAAU,OAAV,IAAqB,2BAA2B,CAAC,QAAD,CAAtD;EAEA,MAAM,CAAC,IAAD,EAAO,OAAP,IAAkB,oBAAoB,CAAC;IAC3C,KAAK,EAAE,KAAK,CAAC,IAD8B;IAE3C,YAAY,EAAE,KAAK,CAAC,WAFuB;IAG3C,YAAY,EAAE;EAH6B,CAAD,CAA5C;EAMA,MAAM,iBAAiB,GAAG,gBAAgB,CAAE,IAAD,IAA+B;IACxE,YAAY,KAAA,IAAZ,IAAA,YAAY,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAA,YAAY,CAAG,IAAI,CAAC,KAAR,EAAe,IAAf,CAAZ,CADwE,CAGxE;IACA;;IACA,IAAI,CAAC,IAAI,CAAC,KAAL,CAAW,kBAAX,EAAL,EAAsC;MACpC,OAAO,CAAC,IAAI,CAAC,IAAN,CAAP;IACD;EACF,CARyC,CAA1C;EAUA,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAD,EAAO,SAAP,CAArC;EACA,MAAM,gBAAgB,GAAG,+BAA+B,CAAC,IAAD,EAAO,SAAP,CAAxD;EACA,MAAM,iBAAiB,GAAG,oBAAoB,EAA9C;EACA,MAAM,kBAAkB,GAAG,OAAO,CAAC,IAAI,IAAI,SAAS,KAAK,WAAvB,CAAlC;EAEA,yBAAyB,CAAC,MAAK;IAC7B,IAAI,kBAAJ,EAAwB;MACtB,OAAO,iBAAiB,EAAxB;IACD;EACF,CAJwB,EAItB,CAAC,iBAAD,EAAoB,kBAApB,CAJsB,CAAzB;EAMA,OAAO;IACL,UAAU,EAAE;MACV,QAAQ,EAAE;IADA,CADP;IAIL,IAJK;IAKL,SALK;IAML,OAAO,EAAE,IAAI,GAAG,OAAH,GAAa,IANrB;IAOL,OAPK;IAQL,iBARK;IASL,eAAe,EAAE,KAAK,CAAC,iBAAD,CATjB;IAUL,aAAa,EAAE,KAAK,CAAC,eAAD,CAVf;IAWL,cAAc,EAAE,mBAAmB,CAAC,aAAD,CAX9B;IAYL,SAAS,EAAE,aAAa,CAAC,QAAD,EAAW,gBAAX;EAZnB,CAAP;AAcD,CA9CM;AAgDP;;AAEG;;AACH,SAAS,2BAAT,CACE,QADF,EAC2B;EAEzB,MAAM,aAAa,GAAG,KAAK,CAAC,QAAN,CAAe,OAAf,CAAuB,QAAvB,CAAtB;;EACA,IAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;IACzC,IAAI,aAAa,CAAC,MAAd,KAAyB,CAAzB,IAA8B,aAAa,CAAC,MAAd,KAAyB,CAA3D,EAA8D;MAC5D;MACA,OAAO,CAAC,IAAR,CACE,+DACE,4EAFJ;IAID;EACF;;EACD,QAAQ,aAAa,CAAC,MAAtB;IACE;IACA,KAAK,CAAL;MACE,OAAO,aAAP;IACF;;IACA,KAAK,CAAL;MACE,OAAO,CAAC,SAAD,EAAY,aAAa,CAAC,CAAD,CAAzB,CAAP;IACF;;IACA;MACE,OAAO,CAAC,SAAD,EAAY,SAAZ,CAAP;EATJ;AAWD","sourcesContent":["import * as React from 'react';\nimport {\n useControllableState,\n useEventCallback,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useControlNativeDialogOpenState, useDisableBodyScroll, useFocusFirstElement } from '../../utils';\nimport { DialogContext } from '../../contexts';\n\nimport type { DialogOpenChangeData, DialogProps, DialogState } from './Dialog.types';\n\n/**\n * Create the state required to render Dialog.\n *\n * The returned state can be modified with hooks such as useDialogStyles_unstable,\n * before being passed to renderDialog_unstable.\n *\n * @param props - props from this instance of Dialog\n */\nexport const useDialog_unstable = (props: DialogProps): DialogState => {\n const { children, modalType = 'modal', onOpenChange } = props;\n\n const [trigger, content] = childrenToTriggerAndContent(children);\n\n const [open, setOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false,\n });\n\n const requestOpenChange = useEventCallback((data: DialogOpenChangeData) => {\n onOpenChange?.(data.event, data);\n\n // if user prevents default then do not change state value\n // otherwise updates state value and trigger reference to the element that caused the opening\n if (!data.event.isDefaultPrevented()) {\n setOpen(data.open);\n }\n });\n\n const focusRef = useFocusFirstElement(open, modalType);\n const nativeControlRef = useControlNativeDialogOpenState(open, modalType);\n const disableBodyScroll = useDisableBodyScroll();\n const isBodyScrollLocked = Boolean(open && modalType !== 'non-modal');\n\n useIsomorphicLayoutEffect(() => {\n if (isBodyScrollLocked) {\n return disableBodyScroll();\n }\n }, [disableBodyScroll, isBodyScrollLocked]);\n\n return {\n components: {\n backdrop: 'div',\n },\n open,\n modalType,\n content: open ? content : null,\n trigger,\n requestOpenChange,\n dialogContentId: useId('dialog-content-'),\n dialogTitleId: useId('dialog-title-'),\n isNestedDialog: useHasParentContext(DialogContext),\n dialogRef: useMergedRefs(focusRef, nativeControlRef),\n };\n};\n\n/**\n * Extracts trigger and content from children\n */\nfunction childrenToTriggerAndContent(\n children: React.ReactNode,\n): readonly [trigger: React.ReactNode, content: React.ReactNode] {\n const childrenArray = React.Children.toArray(children) as React.ReactElement[];\n if (process.env.NODE_ENV !== 'production') {\n if (childrenArray.length !== 1 && childrenArray.length !== 2) {\n // eslint-disable-next-line no-console\n console.warn(\n 'Dialog must contain at least one child <DialogSurface/>,\\n' +\n 'and at most two children <DialogTrigger/> <DialogSurface/> (in this order)',\n );\n }\n }\n switch (childrenArray.length) {\n // case where there's a trigger followed by content\n case 2:\n return childrenArray as [trigger: React.ReactNode, content: React.ReactNode];\n // case where there's only content\n case 1:\n return [undefined, childrenArray[0]];\n // unknown case\n default:\n return [undefined, undefined];\n }\n}\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,31 @@
1
+ export function useDialogContextValues_unstable(state) {
2
+ const {
3
+ modalType,
4
+ open,
5
+ dialogContentId,
6
+ dialogRef,
7
+ dialogTitleId,
8
+ isNestedDialog,
9
+ requestOpenChange
10
+ } = state;
11
+ /**
12
+ * This context is created with "@fluentui/react-context-selector",
13
+ * there is no sense to memoize it
14
+ */
15
+
16
+ const dialog = {
17
+ open,
18
+ modalType,
19
+ dialogRef,
20
+ dialogContentId,
21
+ dialogTitleId,
22
+ isNestedDialog,
23
+ requestOpenChange
24
+ };
25
+ const dialogSurface = false;
26
+ return {
27
+ dialog,
28
+ dialogSurface
29
+ };
30
+ }
31
+ //# sourceMappingURL=useDialogContextValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/Dialog/useDialogContextValues.ts"],"names":[],"mappings":"AAGA,OAAM,SAAU,+BAAV,CAA0C,KAA1C,EAA4D;EAChE,MAAM;IAAE,SAAF;IAAa,IAAb;IAAmB,eAAnB;IAAoC,SAApC;IAA+C,aAA/C;IAA8D,cAA9D;IAA8E;EAA9E,IAAoG,KAA1G;EAEA;;;AAGG;;EACH,MAAM,MAAM,GAAuB;IACjC,IADiC;IAEjC,SAFiC;IAGjC,SAHiC;IAIjC,eAJiC;IAKjC,aALiC;IAMjC,cANiC;IAOjC;EAPiC,CAAnC;EAUA,MAAM,aAAa,GAA8B,KAAjD;EAEA,OAAO;IAAE,MAAF;IAAU;EAAV,CAAP;AACD","sourcesContent":["import type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogContextValues, DialogState } from './Dialog.types';\n\nexport function useDialogContextValues_unstable(state: DialogState): DialogContextValues {\n const { modalType, open, dialogContentId, dialogRef, dialogTitleId, isNestedDialog, requestOpenChange } = state;\n\n /**\n * This context is created with \"@fluentui/react-context-selector\",\n * there is no sense to memoize it\n */\n const dialog: DialogContextValue = {\n open,\n modalType,\n dialogRef,\n dialogContentId,\n dialogTitleId,\n isNestedDialog,\n requestOpenChange,\n };\n\n const dialogSurface: DialogSurfaceContextValue = false;\n\n return { dialog, dialogSurface };\n}\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { useDialogActions_unstable } from './useDialogActions';
3
+ import { renderDialogActions_unstable } from './renderDialogActions';
4
+ import { useDialogActionsStyles_unstable } from './useDialogActionsStyles';
5
+ /**
6
+ * `DialogActions` is a container for the actions of the dialog.
7
+ * Apart from styling, this component does not have other behavior.
8
+ */
9
+
10
+ export const DialogActions = /*#__PURE__*/React.forwardRef((props, ref) => {
11
+ const state = useDialogActions_unstable(props, ref);
12
+ useDialogActionsStyles_unstable(state);
13
+ return renderDialogActions_unstable(state);
14
+ });
15
+ DialogActions.displayName = 'DialogActions';
16
+ //# sourceMappingURL=DialogActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogActions/DialogActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AACA,SAAS,+BAAT,QAAgD,0BAAhD;AAIA;;;AAGG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,yBAAyB,CAAC,KAAD,EAAQ,GAAR,CAAvC;EAEA,+BAA+B,CAAC,KAAD,CAA/B;EACA,OAAO,4BAA4B,CAAC,KAAD,CAAnC;AACD,CALqE,CAA/D;AAOP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { useDialogActions_unstable } from './useDialogActions';\nimport { renderDialogActions_unstable } from './renderDialogActions';\nimport { useDialogActionsStyles_unstable } from './useDialogActionsStyles';\nimport type { DialogActionsProps } from './DialogActions.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * `DialogActions` is a container for the actions of the dialog.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogActions: ForwardRefComponent<DialogActionsProps> = React.forwardRef((props, ref) => {\n const state = useDialogActions_unstable(props, ref);\n\n useDialogActionsStyles_unstable(state);\n return renderDialogActions_unstable(state);\n});\n\nDialogActions.displayName = 'DialogActions';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DialogActions.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogActions.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogActions/DialogActions.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogActionsSlots = {\n root: Slot<'div'>;\n};\n\nexport type DialogActionsPosition = 'start' | 'end';\n\n/**\n * DialogActions Props\n */\nexport type DialogActionsProps = ComponentProps<DialogActionsSlots> & {\n /**\n * defines the position on the dialog grid of the actions\n * @default 'end'\n */\n position?: DialogActionsPosition;\n};\n\n/**\n * State used in rendering DialogActions\n */\nexport type DialogActionsState = ComponentState<DialogActionsSlots> & {\n position: DialogActionsPosition;\n};\n"]}
@@ -0,0 +1,6 @@
1
+ export * from './DialogActions';
2
+ export * from './DialogActions.types';
3
+ export * from './renderDialogActions';
4
+ export * from './useDialogActions';
5
+ export * from './useDialogActionsStyles';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogActions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './DialogActions';\nexport * from './DialogActions.types';\nexport * from './renderDialogActions';\nexport * from './useDialogActions';\nexport * from './useDialogActionsStyles';\n"]}
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
+ /**
4
+ * Render the final JSX of DialogActions
5
+ */
6
+
7
+ export const renderDialogActions_unstable = state => {
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state); // TODO Add additional slots in the appropriate place
12
+
13
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
14
+ });
15
+ };
16
+ //# sourceMappingURL=renderDialogActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogActions/renderDialogActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA8B;EACxE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAqB,KAArB,CAArC,CADwE,CAGxE;;EACA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CALM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogActionsState, DialogActionsSlots } from './DialogActions.types';\n\n/**\n * Render the final JSX of DialogActions\n */\nexport const renderDialogActions_unstable = (state: DialogActionsState) => {\n const { slots, slotProps } = getSlots<DialogActionsSlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,27 @@
1
+ import { getNativeElementProps } from '@fluentui/react-utilities';
2
+ /**
3
+ * Create the state required to render DialogActions.
4
+ *
5
+ * The returned state can be modified with hooks such as useDialogActionsStyles_unstable,
6
+ * before being passed to renderDialogActions_unstable.
7
+ *
8
+ * @param props - props from this instance of DialogActions
9
+ * @param ref - reference to root HTMLElement of DialogActions
10
+ */
11
+
12
+ export const useDialogActions_unstable = (props, ref) => {
13
+ const {
14
+ position = 'end'
15
+ } = props;
16
+ return {
17
+ components: {
18
+ root: 'div'
19
+ },
20
+ root: getNativeElementProps('div', {
21
+ ref,
22
+ ...props
23
+ }),
24
+ position
25
+ };
26
+ };
27
+ //# sourceMappingURL=useDialogActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogActions/useDialogActions.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,MAAM;IAAE,QAAQ,GAAG;EAAb,IAAuB,KAA7B;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;MACjC,GADiC;MAEjC,GAAG;IAF8B,CAAR,CAJtB;IAQL;EARK,CAAP;AAUD,CAfM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogActionsProps, DialogActionsState } from './DialogActions.types';\n\n/**\n * Create the state required to render DialogActions.\n *\n * The returned state can be modified with hooks such as useDialogActionsStyles_unstable,\n * before being passed to renderDialogActions_unstable.\n *\n * @param props - props from this instance of DialogActions\n * @param ref - reference to root HTMLElement of DialogActions\n */\nexport const useDialogActions_unstable = (\n props: DialogActionsProps,\n ref: React.Ref<HTMLElement>,\n): DialogActionsState => {\n const { position = 'end' } = props;\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n position,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,49 @@
1
+ import { __styles, mergeClasses, shorthands } from '@griffel/react';
2
+ import { DIALOG_GAP, ACTIONS_END_GRID_AREA, ACTIONS_START_GRID_AREA, MEDIA_QUERY_BREAKPOINT_SELECTOR } from '../../contexts/constants';
3
+ export const dialogActionsClassNames = {
4
+ root: 'fui-DialogActions'
5
+ };
6
+
7
+ const useStyles = /*#__PURE__*/__styles({
8
+ "root": {
9
+ "Bqenvij": "f3052tw",
10
+ "B7ck84d": "f1ewtqcl",
11
+ "mc9l5x": "f22iagw",
12
+ "i8kkvl": "f4px1ci",
13
+ "Belr9w4": "fn67r4l",
14
+ "Bmdcpmo": "f6glcwc",
15
+ "th9wkt": "f1e3st1r"
16
+ },
17
+ "gridPositionEnd": {
18
+ "Bdqf98w": "f1a7i8kp",
19
+ "Ijaq50": "f11u0jfc",
20
+ "Br312pm": "f1d6tb1o",
21
+ "nk6f5a": "f23awfp",
22
+ "Bw0ie65": "fiappcv"
23
+ },
24
+ "gridPositionStart": {
25
+ "Bdqf98w": "fsxvdwy",
26
+ "Ijaq50": "f1vnb230",
27
+ "Br312pm": "f14781pt",
28
+ "nk6f5a": "f13d374e",
29
+ "Bw0ie65": "f1fjo411"
30
+ }
31
+ }, {
32
+ "d": [".f3052tw{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;}", ".f1ewtqcl{box-sizing:border-box;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f1a7i8kp{justify-self:end;}", ".f11u0jfc{grid-row-start:actions-end;}", ".f1d6tb1o{grid-column-start:actions-end;}", ".f23awfp{grid-row-end:actions-end;}", ".fiappcv{grid-column-end:actions-end;}", ".fsxvdwy{justify-self:start;}", ".f1vnb230{grid-row-start:actions-start;}", ".f14781pt{grid-column-start:actions-start;}", ".f13d374e{grid-row-end:actions-start;}", ".f1fjo411{grid-column-end:actions-start;}"],
33
+ "m": [["@media screen and (max-width: 480px){.f6glcwc{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}}", {
34
+ "m": "screen and (max-width: 480px)"
35
+ }], ["@media screen and (max-width: 480px){.f1e3st1r{justify-self:stretch;}}", {
36
+ "m": "screen and (max-width: 480px)"
37
+ }]]
38
+ });
39
+ /**
40
+ * Apply styling to the DialogActions slots based on the state
41
+ */
42
+
43
+
44
+ export const useDialogActionsStyles_unstable = state => {
45
+ const styles = useStyles();
46
+ state.root.className = mergeClasses(dialogActionsClassNames.root, styles.root, state.position === 'start' && styles.gridPositionStart, state.position === 'end' && styles.gridPositionEnd, state.root.className);
47
+ return state;
48
+ };
49
+ //# sourceMappingURL=useDialogActionsStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogActions/useDialogActionsStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,SACE,UADF,EAEE,qBAFF,EAGE,uBAHF,EAIE,+BAJF,QAKO,0BALP;AAOA,OAAO,MAAM,uBAAuB,GAAuC;EACzE,IAAI,EAAE;AADmE,CAApE;;AAIP,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;IAAA;EAAA;IAAA;EAAA;AAAA,EAAlB;AAqBA;;AAEG;;;AACH,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,uBAAuB,CAAC,IADS,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,QAAN,KAAmB,OAAnB,IAA8B,MAAM,CAAC,iBAHJ,EAIjC,KAAK,CAAC,QAAN,KAAmB,KAAnB,IAA4B,MAAM,CAAC,eAJF,EAKjC,KAAK,CAAC,IAAN,CAAW,SALsB,CAAnC;EAOA,OAAO,KAAP;AACD,CAVM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogActionsSlots, DialogActionsState } from './DialogActions.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport {\n DIALOG_GAP,\n ACTIONS_END_GRID_AREA,\n ACTIONS_START_GRID_AREA,\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n} from '../../contexts/constants';\n\nexport const dialogActionsClassNames: SlotClassNames<DialogActionsSlots> = {\n root: 'fui-DialogActions',\n};\n\nconst useStyles = makeStyles({\n root: {\n height: 'fit-content',\n boxSizing: 'border-box',\n display: 'flex',\n ...shorthands.gap(DIALOG_GAP),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n flexDirection: 'column',\n justifySelf: 'stretch',\n },\n },\n gridPositionEnd: {\n justifySelf: 'end',\n ...shorthands.gridArea(ACTIONS_END_GRID_AREA),\n },\n gridPositionStart: {\n justifySelf: 'start',\n ...shorthands.gridArea(ACTIONS_START_GRID_AREA),\n },\n});\n\n/**\n * Apply styling to the DialogActions slots based on the state\n */\nexport const useDialogActionsStyles_unstable = (state: DialogActionsState): DialogActionsState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogActionsClassNames.root,\n styles.root,\n state.position === 'start' && styles.gridPositionStart,\n state.position === 'end' && styles.gridPositionEnd,\n state.root.className,\n );\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { useDialogBody_unstable } from './useDialogBody';
3
+ import { renderDialogBody_unstable } from './renderDialogBody';
4
+ import { useDialogBodyStyles_unstable } from './useDialogBodyStyles';
5
+ /**
6
+ * The `DialogBody` is a container where the content of the dialog is rendered.
7
+ * Apart from styling, this component does not have other behavior.
8
+ */
9
+
10
+ export const DialogBody = /*#__PURE__*/React.forwardRef((props, ref) => {
11
+ const state = useDialogBody_unstable(props, ref);
12
+ useDialogBodyStyles_unstable(state);
13
+ return renderDialogBody_unstable(state);
14
+ });
15
+ DialogBody.displayName = 'DialogBody';
16
+ //# sourceMappingURL=DialogBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogBody/DialogBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AAIA;;;AAGG;;AACH,OAAO,MAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAC9F,MAAM,KAAK,GAAG,sBAAsB,CAAC,KAAD,EAAQ,GAAR,CAApC;EAEA,4BAA4B,CAAC,KAAD,CAA5B;EACA,OAAO,yBAAyB,CAAC,KAAD,CAAhC;AACD,CAL+D,CAAzD;AAOP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport { useDialogBody_unstable } from './useDialogBody';\nimport { renderDialogBody_unstable } from './renderDialogBody';\nimport { useDialogBodyStyles_unstable } from './useDialogBodyStyles';\nimport type { DialogBodyProps } from './DialogBody.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogBody` is a container where the content of the dialog is rendered.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogBody: ForwardRefComponent<DialogBodyProps> = React.forwardRef((props, ref) => {\n const state = useDialogBody_unstable(props, ref);\n\n useDialogBodyStyles_unstable(state);\n return renderDialogBody_unstable(state);\n});\n\nDialogBody.displayName = 'DialogBody';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DialogBody.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogBody.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogBody/DialogBody.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogBodySlots = {\n root: Slot<'div'>;\n};\n\n/**\n * DialogBody Props\n */\nexport type DialogBodyProps = ComponentProps<DialogBodySlots> & {};\n\n/**\n * State used in rendering DialogBody\n */\nexport type DialogBodyState = ComponentState<DialogBodySlots>;\n"]}
@@ -0,0 +1,6 @@
1
+ export * from './DialogBody';
2
+ export * from './DialogBody.types';
3
+ export * from './renderDialogBody';
4
+ export * from './useDialogBody';
5
+ export * from './useDialogBodyStyles';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogBody/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './DialogBody';\nexport * from './DialogBody.types';\nexport * from './renderDialogBody';\nexport * from './useDialogBody';\nexport * from './useDialogBodyStyles';\n"]}
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
+ /**
4
+ * Render the final JSX of DialogBody
5
+ */
6
+
7
+ export const renderDialogBody_unstable = state => {
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state); // TODO Add additional slots in the appropriate place
12
+
13
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
14
+ });
15
+ };
16
+ //# sourceMappingURL=renderDialogBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogBody/renderDialogBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAA2B;EAClE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAkB,KAAlB,CAArC,CADkE,CAGlE;;EACA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CALM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogBodyState, DialogBodySlots } from './DialogBody.types';\n\n/**\n * Render the final JSX of DialogBody\n */\nexport const renderDialogBody_unstable = (state: DialogBodyState) => {\n const { slots, slotProps } = getSlots<DialogBodySlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,25 @@
1
+ import { getNativeElementProps } from '@fluentui/react-utilities';
2
+ /**
3
+ * Create the state required to render DialogBody.
4
+ *
5
+ * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,
6
+ * before being passed to renderDialogBody_unstable.
7
+ *
8
+ * @param props - props from this instance of DialogBody
9
+ * @param ref - reference to root HTMLElement of DialogBody
10
+ */
11
+
12
+ export const useDialogBody_unstable = (props, ref) => {
13
+ var _a;
14
+
15
+ return {
16
+ components: {
17
+ root: 'div'
18
+ },
19
+ root: getNativeElementProps((_a = props.as) !== null && _a !== void 0 ? _a : 'div', {
20
+ ref,
21
+ ...props
22
+ })
23
+ };
24
+ };
25
+ //# sourceMappingURL=useDialogBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogBody/useDialogBody.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAyB,GAAzB,KAAyE;;;EAC7G,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,qBAAqB,CAAC,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,KAAb,EAAoB;MAC7C,GAD6C;MAE7C,GAAG;IAF0C,CAApB;EAJtB,CAAP;AASD,CAVM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogBodyProps, DialogBodyState } from './DialogBody.types';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogBody_unstable = (props: DialogBodyProps, ref: React.Ref<HTMLElement>): DialogBodyState => {\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps(props.as ?? 'div', {\n ref,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,50 @@
1
+ import { __styles, mergeClasses, shorthands } from '@griffel/react';
2
+ import { ACTIONS_END_GRID_AREA, ACTIONS_START_GRID_AREA, CONTENT_GRID_AREA, DIALOG_GAP, MEDIA_QUERY_BREAKPOINT_SELECTOR, SURFACE_PADDING, TITLE_ACTION_GRID_AREA, TITLE_GRID_AREA } from '../../contexts';
3
+ export const dialogBodyClassNames = {
4
+ root: 'fui-DialogBody'
5
+ };
6
+ /**
7
+ * Styles for the root slot
8
+ */
9
+
10
+ const useStyles = /*#__PURE__*/__styles({
11
+ "root": {
12
+ "mc9l5x": "f13qh94s",
13
+ "fshzfu": "f120kxnn",
14
+ "a9b677": "fly5x3f",
15
+ "Bqenvij": "f3052tw",
16
+ "B2u0y6b": "fvgz9i8",
17
+ "Bxyxcbc": "flnwrvu",
18
+ "B7ck84d": "f1ewtqcl",
19
+ "wkccdc": "f874eam",
20
+ "Budl1dq": "fjj47a5",
21
+ "zoa1oz": "fe34spp",
22
+ "B68tc82": "f1ln0qer",
23
+ "Bmxbyg5": "fa2wlxz",
24
+ "i8kkvl": "f4px1ci",
25
+ "Belr9w4": "fn67r4l",
26
+ "B5xtmjs": "ff54dml",
27
+ "Bqu9lor": "f52bj20",
28
+ "B06wobe": "f1dangjo"
29
+ }
30
+ }, {
31
+ "d": [".f13qh94s{display:grid;}", ".f120kxnn::backdrop{background-color:rgba(0, 0, 0, 0.4);}", ".fly5x3f{width:100%;}", ".f3052tw{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;}", ".fvgz9i8{max-width:600px;}", ".flnwrvu{max-height:calc(100vh - 2 * 24px);}", ".f1ewtqcl{box-sizing:border-box;}", ".f874eam{grid-template-rows:auto 1fr auto;}", ".fjj47a5{grid-template-columns:1fr 1fr auto;}", ".fe34spp{grid-template-areas:\"title title close-button\" \"body body body\" \"actions-start actions-end actions-end\";}", ".f1ln0qer{overflow-x:unset;}", ".fa2wlxz{overflow-y:unset;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}"],
32
+ "m": [["@media screen and (max-width: 480px){.ff54dml{max-width:100vw;}}", {
33
+ "m": "screen and (max-width: 480px)"
34
+ }], ["@media screen and (max-width: 480px){.f52bj20{grid-template-rows:auto 1fr auto auto;}}", {
35
+ "m": "screen and (max-width: 480px)"
36
+ }], ["@media screen and (max-width: 480px){.f1dangjo{grid-template-areas:\"title title close-button\" \"body body body\" \"actions-start actions-start actions-start\" \"actions-end actions-end actions-end\";}}", {
37
+ "m": "screen and (max-width: 480px)"
38
+ }]]
39
+ });
40
+ /**
41
+ * Apply styling to the DialogBody slots based on the state
42
+ */
43
+
44
+
45
+ export const useDialogBodyStyles_unstable = state => {
46
+ const styles = useStyles();
47
+ state.root.className = mergeClasses(dialogBodyClassNames.root, styles.root, state.root.className);
48
+ return state;
49
+ };
50
+ //# sourceMappingURL=useDialogBodyStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogBody/useDialogBodyStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,SACE,qBADF,EAEE,uBAFF,EAGE,iBAHF,EAIE,UAJF,EAKE,+BALF,EAME,eANF,EAOE,sBAPF,EAQE,eARF,QASO,gBATP;AAWA,OAAO,MAAM,oBAAoB,GAAoC;EACnE,IAAI,EAAE;AAD6D,CAA9D;AAIP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;AAAA,EAAlB;AAiCA;;AAEG;;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA4C;EACtF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,oBAAoB,CAAC,IAAtB,EAA4B,MAAM,CAAC,IAAnC,EAAyC,KAAK,CAAC,IAAN,CAAW,SAApD,CAAnC;EAEA,OAAO,KAAP;AACD,CALM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogBodySlots, DialogBodyState } from './DialogBody.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport {\n ACTIONS_END_GRID_AREA,\n ACTIONS_START_GRID_AREA,\n CONTENT_GRID_AREA,\n DIALOG_GAP,\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n SURFACE_PADDING,\n TITLE_ACTION_GRID_AREA,\n TITLE_GRID_AREA,\n} from '../../contexts';\n\nexport const dialogBodyClassNames: SlotClassNames<DialogBodySlots> = {\n root: 'fui-DialogBody',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'grid',\n '&::backdrop': {\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n },\n width: `100%`,\n height: 'fit-content',\n maxWidth: '600px',\n maxHeight: `calc(100vh - 2 * ${SURFACE_PADDING})`,\n boxSizing: 'border-box',\n gridTemplateRows: 'auto 1fr auto',\n gridTemplateColumns: '1fr 1fr auto',\n gridTemplateAreas: `\n \"${TITLE_GRID_AREA} ${TITLE_GRID_AREA} ${TITLE_ACTION_GRID_AREA}\"\n \"${CONTENT_GRID_AREA} ${CONTENT_GRID_AREA} ${CONTENT_GRID_AREA}\"\n \"${ACTIONS_START_GRID_AREA} ${ACTIONS_END_GRID_AREA} ${ACTIONS_END_GRID_AREA}\"\n `,\n ...shorthands.overflow('unset'),\n ...shorthands.gap(DIALOG_GAP),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n maxWidth: '100vw',\n gridTemplateRows: 'auto 1fr auto auto',\n gridTemplateAreas: `\n \"${TITLE_GRID_AREA} ${TITLE_GRID_AREA} ${TITLE_ACTION_GRID_AREA}\"\n \"${CONTENT_GRID_AREA} ${CONTENT_GRID_AREA} ${CONTENT_GRID_AREA}\"\n \"${ACTIONS_START_GRID_AREA} ${ACTIONS_START_GRID_AREA} ${ACTIONS_START_GRID_AREA}\"\n \"${ACTIONS_END_GRID_AREA} ${ACTIONS_END_GRID_AREA} ${ACTIONS_END_GRID_AREA}\"\n `,\n },\n },\n});\n\n/**\n * Apply styling to the DialogBody slots based on the state\n */\nexport const useDialogBodyStyles_unstable = (state: DialogBodyState): DialogBodyState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogBodyClassNames.root, styles.root, state.root.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { useDialogContent_unstable } from './useDialogContent';
3
+ import { renderDialogContent_unstable } from './renderDialogContent';
4
+ import { useDialogContentStyles_unstable } from './useDialogContentStyles';
5
+ /**
6
+ * The `DialogContent` is a container where the content of the dialog is rendered.
7
+ * Apart from styling, this component does not have other behavior.
8
+ */
9
+
10
+ export const DialogContent = /*#__PURE__*/React.forwardRef((props, ref) => {
11
+ const state = useDialogContent_unstable(props, ref);
12
+ useDialogContentStyles_unstable(state);
13
+ return renderDialogContent_unstable(state);
14
+ });
15
+ DialogContent.displayName = 'DialogContent';
16
+ //# sourceMappingURL=DialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/DialogContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AACA,SAAS,+BAAT,QAAgD,0BAAhD;AAIA;;;AAGG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,yBAAyB,CAAC,KAAD,EAAQ,GAAR,CAAvC;EAEA,+BAA+B,CAAC,KAAD,CAA/B;EACA,OAAO,4BAA4B,CAAC,KAAD,CAAnC;AACD,CALqE,CAA/D;AAOP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { useDialogContent_unstable } from './useDialogContent';\nimport { renderDialogContent_unstable } from './renderDialogContent';\nimport { useDialogContentStyles_unstable } from './useDialogContentStyles';\nimport type { DialogContentProps } from './DialogContent.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogContent` is a container where the content of the dialog is rendered.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogContent: ForwardRefComponent<DialogContentProps> = React.forwardRef((props, ref) => {\n const state = useDialogContent_unstable(props, ref);\n\n useDialogContentStyles_unstable(state);\n return renderDialogContent_unstable(state);\n});\n\nDialogContent.displayName = 'DialogContent';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DialogContent.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogContent.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogContent/DialogContent.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogContentSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * DialogContent Props\n */\nexport type DialogContentProps = ComponentProps<DialogContentSlots>;\n\n/**\n * State used in rendering DialogContent\n */\nexport type DialogContentState = ComponentState<DialogContentSlots>;\n"]}
@@ -0,0 +1,6 @@
1
+ export * from './DialogContent';
2
+ export * from './DialogContent.types';
3
+ export * from './renderDialogContent';
4
+ export * from './useDialogContent';
5
+ export * from './useDialogContentStyles';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogContent/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './DialogContent';\nexport * from './DialogContent.types';\nexport * from './renderDialogContent';\nexport * from './useDialogContent';\nexport * from './useDialogContentStyles';\n"]}
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
+ /**
4
+ * Render the final JSX of DialogContent
5
+ */
6
+
7
+ export const renderDialogContent_unstable = state => {
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state);
12
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
13
+ });
14
+ };
15
+ //# sourceMappingURL=renderDialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA8B;EACxE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAqB,KAArB,CAArC;EAEA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogContentState, DialogContentSlots } from './DialogContent.types';\n\n/**\n * Render the final JSX of DialogContent\n */\nexport const renderDialogContent_unstable = (state: DialogContentState) => {\n const { slots, slotProps } = getSlots<DialogContentSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,28 @@
1
+ import { getNativeElementProps } from '@fluentui/react-utilities';
2
+ import { useDialogContext_unstable } from '../../contexts';
3
+ /**
4
+ * Create the state required to render DialogBody.
5
+ *
6
+ * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,
7
+ * before being passed to renderDialogBody_unstable.
8
+ *
9
+ * @param props - props from this instance of DialogBody
10
+ * @param ref - reference to root HTMLElement of DialogBody
11
+ */
12
+
13
+ export const useDialogContent_unstable = (props, ref) => {
14
+ var _a;
15
+
16
+ const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);
17
+ return {
18
+ components: {
19
+ root: 'div'
20
+ },
21
+ root: getNativeElementProps((_a = props.as) !== null && _a !== void 0 ? _a : 'div', {
22
+ ref,
23
+ id: dialogContentId,
24
+ ...props
25
+ })
26
+ };
27
+ };
28
+ //# sourceMappingURL=useDialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContent.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AACA,SAAS,yBAAT,QAA0C,gBAA1C;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;EACtB,MAAM,eAAe,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,eAAZ,CAAjD;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,qBAAqB,CAAC,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,KAAb,EAAoB;MAC7C,GAD6C;MAE7C,EAAE,EAAE,eAFyC;MAG7C,GAAG;IAH0C,CAApB;EAJtB,CAAP;AAUD,CAfM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { DialogContentProps, DialogContentState } from './DialogContent.types';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogContent_unstable = (\n props: DialogContentProps,\n ref: React.Ref<HTMLElement>,\n): DialogContentState => {\n const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps(props.as ?? 'div', {\n ref,\n id: dialogContentId,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,40 @@
1
+ import { __styles, mergeClasses, shorthands } from '@griffel/react';
2
+ import { CONTENT_GRID_AREA } from '../../contexts/constants';
3
+ import { typographyStyles } from '@fluentui/react-theme';
4
+ export const dialogContentClassNames = {
5
+ root: 'fui-DialogContent'
6
+ };
7
+ /**
8
+ * Styles for the root slot
9
+ */
10
+
11
+ const useStyles = /*#__PURE__*/__styles({
12
+ "root": {
13
+ "a9b677": "fly5x3f",
14
+ "Bqenvij": "f1l02sjl",
15
+ "Bmxbyg5": "f5zp4f",
16
+ "sshi5w": "f1nxs5xn",
17
+ "B7ck84d": "f1ewtqcl",
18
+ "Ijaq50": "f6owso0",
19
+ "Br312pm": "fupswjn",
20
+ "nk6f5a": "foucsne",
21
+ "Bw0ie65": "f1ka72gx",
22
+ "Bahqtrf": "fk6fouc",
23
+ "Be2twd7": "fkhj508",
24
+ "Bhrd7zp": "figsok6",
25
+ "Bg96gwp": "f1i3iumi"
26
+ }
27
+ }, {
28
+ "d": [".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f5zp4f{overflow-y:auto;}", ".f1nxs5xn{min-height:32px;}", ".f1ewtqcl{box-sizing:border-box;}", ".f6owso0{grid-row-start:body;}", ".fupswjn{grid-column-start:body;}", ".foucsne{grid-row-end:body;}", ".f1ka72gx{grid-column-end:body;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
29
+ });
30
+ /**
31
+ * Apply styling to the DialogContent slots based on the state
32
+ */
33
+
34
+
35
+ export const useDialogContentStyles_unstable = state => {
36
+ const styles = useStyles();
37
+ state.root.className = mergeClasses(dialogContentClassNames.root, styles.root, state.root.className);
38
+ return state;
39
+ };
40
+ //# sourceMappingURL=useDialogContentStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContentStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,SAAS,iBAAT,QAAkC,0BAAlC;AACA,SAAS,gBAAT,QAAiC,uBAAjC;AAEA,OAAO,MAAM,uBAAuB,GAAuC;EACzE,IAAI,EAAE;AADmE,CAApE;AAIP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAYA;;AAEG;;;AACH,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,uBAAuB,CAAC,IAAzB,EAA+B,MAAM,CAAC,IAAtC,EAA4C,KAAK,CAAC,IAAN,CAAW,SAAvD,CAAnC;EACA,OAAO,KAAP;AACD,CAJM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogContentSlots, DialogContentState } from './DialogContent.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { CONTENT_GRID_AREA } from '../../contexts/constants';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const dialogContentClassNames: SlotClassNames<DialogContentSlots> = {\n root: 'fui-DialogContent',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n overflowY: 'auto',\n minHeight: '32px',\n boxSizing: 'border-box',\n ...shorthands.gridArea(CONTENT_GRID_AREA),\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Apply styling to the DialogContent slots based on the state\n */\nexport const useDialogContentStyles_unstable = (state: DialogContentState): DialogContentState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogContentClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { useDialogSurface_unstable } from './useDialogSurface';
3
+ import { renderDialogSurface_unstable } from './renderDialogSurface';
4
+ import { useDialogSurfaceStyles_unstable } from './useDialogSurfaceStyles';
5
+ import { useDialogSurfaceContextValues_unstable } from './useDialogSurfaceContextValues';
6
+ /**
7
+ * DialogSurface component represents the visual part of a `Dialog` as a whole,
8
+ * it contains everything that should be visible.
9
+ */
10
+
11
+ export const DialogSurface = /*#__PURE__*/React.forwardRef((props, ref) => {
12
+ const state = useDialogSurface_unstable(props, ref);
13
+ const contextValues = useDialogSurfaceContextValues_unstable(state);
14
+ useDialogSurfaceStyles_unstable(state);
15
+ return renderDialogSurface_unstable(state, contextValues);
16
+ });
17
+ DialogSurface.displayName = 'DialogSurface';
18
+ //# sourceMappingURL=DialogSurface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/DialogSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AACA,SAAS,+BAAT,QAAgD,0BAAhD;AAGA,SAAS,sCAAT,QAAuD,iCAAvD;AAEA;;;AAGG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,yBAAyB,CAAC,KAAD,EAAQ,GAAR,CAAvC;EACA,MAAM,aAAa,GAAG,sCAAsC,CAAC,KAAD,CAA5D;EAEA,+BAA+B,CAAC,KAAD,CAA/B;EACA,OAAO,4BAA4B,CAAC,KAAD,EAAQ,aAAR,CAAnC;AACD,CANqE,CAA/D;AAQP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { useDialogSurface_unstable } from './useDialogSurface';\nimport { renderDialogSurface_unstable } from './renderDialogSurface';\nimport { useDialogSurfaceStyles_unstable } from './useDialogSurfaceStyles';\nimport type { DialogSurfaceProps } from './DialogSurface.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useDialogSurfaceContextValues_unstable } from './useDialogSurfaceContextValues';\n\n/**\n * DialogSurface component represents the visual part of a `Dialog` as a whole,\n * it contains everything that should be visible.\n */\nexport const DialogSurface: ForwardRefComponent<DialogSurfaceProps> = React.forwardRef((props, ref) => {\n const state = useDialogSurface_unstable(props, ref);\n const contextValues = useDialogSurfaceContextValues_unstable(state);\n\n useDialogSurfaceStyles_unstable(state);\n return renderDialogSurface_unstable(state, contextValues);\n});\n\nDialogSurface.displayName = 'DialogSurface';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DialogSurface.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogSurface.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogSurface/DialogSurface.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { DialogSurfaceContextValue } from '../../contexts';\n\nexport type DialogSurfaceSlots = {\n /**\n * Dimmed background of dialog.\n * The default backdrop is rendered as a `<div>` with styling.\n * This slot expects a `<div>` element which will replace the default backdrop.\n * The backdrop should have `aria-hidden=\"true\"`.\n *\n * By default if `DialogSurface` is `<dialog>` element the backdrop is ignored,\n * since native `<dialog>` element supports [::backdrop](https://developer.mozilla.org/en-US/docs/Web/CSS/::backdrop)\n */\n backdrop?: Slot<'div'>;\n root: NonNullable<Slot<'dialog', 'div'>>;\n};\n\n/**\n * Union between all possible semantic element that represent a DialogSurface\n */\nexport type DialogSurfaceElement = HTMLDialogElement | HTMLDivElement;\n\n/** @internal */\nexport type DialogSurfaceElementIntersection = HTMLDialogElement & HTMLDivElement;\n\n/**\n * DialogSurface Props\n *\n * Omits basic types from native `dialog` (`open`, `onCancel` and `onClose`)\n * to ensure `onOpenChange`, `open` and `defaultOpen` from `Dialog` is used instead\n */\nexport type DialogSurfaceProps = Omit<ComponentProps<DialogSurfaceSlots>, 'open' | 'onCancel' | 'onClose'>;\n\nexport type DialogSurfaceContextValues = {\n dialogSurface: DialogSurfaceContextValue;\n};\n\n/**\n * State used in rendering DialogSurface\n */\nexport type DialogSurfaceState = ComponentState<DialogSurfaceSlots>;\n"]}
@@ -0,0 +1,6 @@
1
+ export * from './DialogSurface';
2
+ export * from './DialogSurface.types';
3
+ export * from './renderDialogSurface';
4
+ export * from './useDialogSurface';
5
+ export * from './useDialogSurfaceStyles';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogSurface/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './DialogSurface';\nexport * from './DialogSurface.types';\nexport * from './renderDialogSurface';\nexport * from './useDialogSurface';\nexport * from './useDialogSurfaceStyles';\n"]}
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
+ import { DialogSurfaceProvider } from '../../contexts';
4
+ import { Portal } from '@fluentui/react-portal';
5
+ /**
6
+ * Render the final JSX of DialogSurface
7
+ */
8
+
9
+ export const renderDialogSurface_unstable = (state, contextValues) => {
10
+ const {
11
+ slots,
12
+ slotProps
13
+ } = getSlots(state);
14
+ return /*#__PURE__*/React.createElement(Portal, null, slots.backdrop && /*#__PURE__*/React.createElement(slots.backdrop, { ...slotProps.backdrop
15
+ }), /*#__PURE__*/React.createElement(DialogSurfaceProvider, {
16
+ value: contextValues.dialogSurface
17
+ }, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
18
+ })));
19
+ };
20
+ //# sourceMappingURL=renderDialogSurface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,qBAAT,QAAsC,gBAAtC;AACA,SAAS,MAAT,QAAuB,wBAAvB;AAEA;;AAEG;;AACH,OAAO,MAAM,4BAA4B,GAAG,CAAC,KAAD,EAA4B,aAA5B,KAAyE;EACnH,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAqB,KAArB,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,MAAD,EAAO,IAAP,EACG,KAAK,CAAC,QAAN,iBAAkB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;EAAf,CAAf,CADrB,eAEE,KAAA,CAAA,aAAA,CAAC,qBAAD,EAAsB;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAAtB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADF,CAFF,CADF;AAQD,CAXM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\nimport { DialogSurfaceProvider } from '../../contexts';\nimport { Portal } from '@fluentui/react-portal';\n\n/**\n * Render the final JSX of DialogSurface\n */\nexport const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {\n const { slots, slotProps } = getSlots<DialogSurfaceSlots>(state);\n\n return (\n <Portal>\n {slots.backdrop && <slots.backdrop {...slotProps.backdrop} />}\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <slots.root {...slotProps.root} />\n </DialogSurfaceProvider>\n </Portal>\n );\n};\n"],"sourceRoot":"../src/"}