@fluentui/react-dialog 9.4.0 → 9.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +88 -1
  3. package/CHANGELOG.md +23 -2
  4. package/lib/Dialog.js.map +1 -1
  5. package/lib/DialogActions.js.map +1 -1
  6. package/lib/DialogBody.js.map +1 -1
  7. package/lib/DialogContent.js.map +1 -1
  8. package/lib/DialogSurface.js.map +1 -1
  9. package/lib/DialogTitle.js.map +1 -1
  10. package/lib/DialogTrigger.js.map +1 -1
  11. package/lib/components/Dialog/Dialog.js.map +1 -1
  12. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  13. package/lib/components/Dialog/index.js.map +1 -1
  14. package/lib/components/Dialog/renderDialog.js.map +1 -1
  15. package/lib/components/Dialog/useDialog.js.map +1 -1
  16. package/lib/components/Dialog/useDialogContextValues.js +3 -3
  17. package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
  18. package/lib/components/DialogActions/DialogActions.js.map +1 -1
  19. package/lib/components/DialogActions/DialogActions.types.js.map +1 -1
  20. package/lib/components/DialogActions/index.js.map +1 -1
  21. package/lib/components/DialogActions/renderDialogActions.js +1 -3
  22. package/lib/components/DialogActions/renderDialogActions.js.map +1 -1
  23. package/lib/components/DialogActions/useDialogActions.js +1 -0
  24. package/lib/components/DialogActions/useDialogActions.js.map +1 -1
  25. package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  26. package/lib/components/DialogBody/DialogBody.js.map +1 -1
  27. package/lib/components/DialogBody/DialogBody.types.js.map +1 -1
  28. package/lib/components/DialogBody/index.js.map +1 -1
  29. package/lib/components/DialogBody/renderDialogBody.js +1 -3
  30. package/lib/components/DialogBody/renderDialogBody.js.map +1 -1
  31. package/lib/components/DialogBody/useDialogBody.js +3 -2
  32. package/lib/components/DialogBody/useDialogBody.js.map +1 -1
  33. package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  34. package/lib/components/DialogContent/DialogContent.js.map +1 -1
  35. package/lib/components/DialogContent/DialogContent.types.js.map +1 -1
  36. package/lib/components/DialogContent/index.js.map +1 -1
  37. package/lib/components/DialogContent/renderDialogContent.js +1 -3
  38. package/lib/components/DialogContent/renderDialogContent.js.map +1 -1
  39. package/lib/components/DialogContent/useDialogContent.js +3 -2
  40. package/lib/components/DialogContent/useDialogContent.js.map +1 -1
  41. package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -1
  42. package/lib/components/DialogSurface/DialogSurface.js.map +1 -1
  43. package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -1
  44. package/lib/components/DialogSurface/index.js.map +1 -1
  45. package/lib/components/DialogSurface/renderDialogSurface.js +2 -6
  46. package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -1
  47. package/lib/components/DialogSurface/useDialogSurface.js +5 -4
  48. package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
  49. package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
  50. package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  51. package/lib/components/DialogTitle/DialogTitle.js.map +1 -1
  52. package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -1
  53. package/lib/components/DialogTitle/index.js.map +1 -1
  54. package/lib/components/DialogTitle/renderDialogTitle.js +1 -5
  55. package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -1
  56. package/lib/components/DialogTitle/useDialogTitle.js +2 -0
  57. package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
  58. package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  59. package/lib/components/DialogTrigger/DialogTrigger.js +1 -0
  60. package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -1
  61. package/lib/components/DialogTrigger/DialogTrigger.types.js +1 -1
  62. package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
  63. package/lib/components/DialogTrigger/index.js.map +1 -1
  64. package/lib/components/DialogTrigger/renderDialogTrigger.js +1 -2
  65. package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
  66. package/lib/components/DialogTrigger/useDialogTrigger.js +3 -2
  67. package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  68. package/lib/contexts/constants.js.map +1 -1
  69. package/lib/contexts/dialogContext.js +2 -2
  70. package/lib/contexts/dialogContext.js.map +1 -1
  71. package/lib/contexts/dialogSurfaceContext.js +2 -4
  72. package/lib/contexts/dialogSurfaceContext.js.map +1 -1
  73. package/lib/contexts/index.js.map +1 -1
  74. package/lib/index.js.map +1 -1
  75. package/lib/utils/index.js.map +1 -1
  76. package/lib/utils/isEscapeKeyDown.js +1 -0
  77. package/lib/utils/isEscapeKeyDown.js.map +1 -1
  78. package/lib/utils/useDisableBodyScroll.js +6 -5
  79. package/lib/utils/useDisableBodyScroll.js.map +1 -1
  80. package/lib/utils/useFocusFirstElement.js +4 -3
  81. package/lib/utils/useFocusFirstElement.js.map +1 -1
  82. package/lib-commonjs/Dialog.js +5 -4
  83. package/lib-commonjs/Dialog.js.map +1 -1
  84. package/lib-commonjs/DialogActions.js +5 -4
  85. package/lib-commonjs/DialogActions.js.map +1 -1
  86. package/lib-commonjs/DialogBody.js +5 -4
  87. package/lib-commonjs/DialogBody.js.map +1 -1
  88. package/lib-commonjs/DialogContent.js +5 -4
  89. package/lib-commonjs/DialogContent.js.map +1 -1
  90. package/lib-commonjs/DialogSurface.js +5 -4
  91. package/lib-commonjs/DialogSurface.js.map +1 -1
  92. package/lib-commonjs/DialogTitle.js +5 -4
  93. package/lib-commonjs/DialogTitle.js.map +1 -1
  94. package/lib-commonjs/DialogTrigger.js +5 -4
  95. package/lib-commonjs/DialogTrigger.js.map +1 -1
  96. package/lib-commonjs/components/Dialog/Dialog.js +16 -19
  97. package/lib-commonjs/components/Dialog/Dialog.js.map +1 -1
  98. package/lib-commonjs/components/Dialog/Dialog.types.js +3 -2
  99. package/lib-commonjs/components/Dialog/Dialog.types.js.map +1 -1
  100. package/lib-commonjs/components/Dialog/index.js +8 -7
  101. package/lib-commonjs/components/Dialog/index.js.map +1 -1
  102. package/lib-commonjs/components/Dialog/renderDialog.js +17 -20
  103. package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -1
  104. package/lib-commonjs/components/Dialog/useDialog.js +78 -80
  105. package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
  106. package/lib-commonjs/components/Dialog/useDialogContextValues.js +25 -32
  107. package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
  108. package/lib-commonjs/components/DialogActions/DialogActions.js +19 -21
  109. package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -1
  110. package/lib-commonjs/components/DialogActions/DialogActions.types.js +3 -2
  111. package/lib-commonjs/components/DialogActions/DialogActions.types.js.map +1 -1
  112. package/lib-commonjs/components/DialogActions/index.js +9 -8
  113. package/lib-commonjs/components/DialogActions/index.js.map +1 -1
  114. package/lib-commonjs/components/DialogActions/renderDialogActions.js +14 -19
  115. package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -1
  116. package/lib-commonjs/components/DialogActions/useDialogActions.js +23 -31
  117. package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -1
  118. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js +81 -52
  119. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  120. package/lib-commonjs/components/DialogBody/DialogBody.js +19 -21
  121. package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -1
  122. package/lib-commonjs/components/DialogBody/DialogBody.types.js +3 -2
  123. package/lib-commonjs/components/DialogBody/DialogBody.types.js.map +1 -1
  124. package/lib-commonjs/components/DialogBody/index.js +9 -8
  125. package/lib-commonjs/components/DialogBody/index.js.map +1 -1
  126. package/lib-commonjs/components/DialogBody/renderDialogBody.js +14 -19
  127. package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -1
  128. package/lib-commonjs/components/DialogBody/useDialogBody.js +21 -26
  129. package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -1
  130. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +74 -44
  131. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  132. package/lib-commonjs/components/DialogContent/DialogContent.js +19 -21
  133. package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -1
  134. package/lib-commonjs/components/DialogContent/DialogContent.types.js +3 -2
  135. package/lib-commonjs/components/DialogContent/DialogContent.types.js.map +1 -1
  136. package/lib-commonjs/components/DialogContent/index.js +9 -8
  137. package/lib-commonjs/components/DialogContent/index.js.map +1 -1
  138. package/lib-commonjs/components/DialogContent/renderDialogContent.js +13 -18
  139. package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -1
  140. package/lib-commonjs/components/DialogContent/useDialogContent.js +21 -26
  141. package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -1
  142. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +51 -35
  143. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -1
  144. package/lib-commonjs/components/DialogSurface/DialogSurface.js +21 -23
  145. package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -1
  146. package/lib-commonjs/components/DialogSurface/DialogSurface.types.js +3 -2
  147. package/lib-commonjs/components/DialogSurface/DialogSurface.types.js.map +1 -1
  148. package/lib-commonjs/components/DialogSurface/index.js +9 -8
  149. package/lib-commonjs/components/DialogSurface/index.js.map +1 -1
  150. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +17 -24
  151. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -1
  152. package/lib-commonjs/components/DialogSurface/useDialogSurface.js +75 -85
  153. package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
  154. package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js +11 -9
  155. package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
  156. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +309 -123
  157. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  158. package/lib-commonjs/components/DialogTitle/DialogTitle.js +19 -21
  159. package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -1
  160. package/lib-commonjs/components/DialogTitle/DialogTitle.types.js +3 -2
  161. package/lib-commonjs/components/DialogTitle/DialogTitle.types.js.map +1 -1
  162. package/lib-commonjs/components/DialogTitle/index.js +9 -8
  163. package/lib-commonjs/components/DialogTitle/index.js.map +1 -1
  164. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +13 -20
  165. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -1
  166. package/lib-commonjs/components/DialogTitle/useDialogTitle.js +43 -51
  167. package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
  168. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +225 -107
  169. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  170. package/lib-commonjs/components/DialogTrigger/DialogTrigger.js +15 -21
  171. package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -1
  172. package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js +5 -2
  173. package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
  174. package/lib-commonjs/components/DialogTrigger/index.js +8 -7
  175. package/lib-commonjs/components/DialogTrigger/index.js.map +1 -1
  176. package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js +10 -9
  177. package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
  178. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +45 -53
  179. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  180. package/lib-commonjs/contexts/constants.js +28 -12
  181. package/lib-commonjs/contexts/constants.js.map +1 -1
  182. package/lib-commonjs/contexts/dialogContext.js +28 -19
  183. package/lib-commonjs/contexts/dialogContext.js.map +1 -1
  184. package/lib-commonjs/contexts/dialogSurfaceContext.js +18 -11
  185. package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -1
  186. package/lib-commonjs/contexts/index.js +7 -6
  187. package/lib-commonjs/contexts/index.js.map +1 -1
  188. package/lib-commonjs/index.js +50 -197
  189. package/lib-commonjs/index.js.map +1 -1
  190. package/lib-commonjs/utils/index.js +7 -6
  191. package/lib-commonjs/utils/index.js.map +1 -1
  192. package/lib-commonjs/utils/isEscapeKeyDown.js +11 -10
  193. package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -1
  194. package/lib-commonjs/utils/useDisableBodyScroll.js +45 -47
  195. package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -1
  196. package/lib-commonjs/utils/useFocusFirstElement.js +42 -37
  197. package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -1
  198. package/package.json +14 -13
  199. package/lib-amd/Dialog.js +0 -6
  200. package/lib-amd/Dialog.js.map +0 -1
  201. package/lib-amd/DialogActions.js +0 -6
  202. package/lib-amd/DialogActions.js.map +0 -1
  203. package/lib-amd/DialogBody.js +0 -6
  204. package/lib-amd/DialogBody.js.map +0 -1
  205. package/lib-amd/DialogContent.js +0 -6
  206. package/lib-amd/DialogContent.js.map +0 -1
  207. package/lib-amd/DialogSurface.js +0 -6
  208. package/lib-amd/DialogSurface.js.map +0 -1
  209. package/lib-amd/DialogTitle.js +0 -6
  210. package/lib-amd/DialogTitle.js.map +0 -1
  211. package/lib-amd/DialogTrigger.js +0 -6
  212. package/lib-amd/DialogTrigger.js.map +0 -1
  213. package/lib-amd/components/Dialog/Dialog.js +0 -19
  214. package/lib-amd/components/Dialog/Dialog.js.map +0 -1
  215. package/lib-amd/components/Dialog/Dialog.types.js +0 -5
  216. package/lib-amd/components/Dialog/Dialog.types.js.map +0 -1
  217. package/lib-amd/components/Dialog/index.js +0 -9
  218. package/lib-amd/components/Dialog/index.js.map +0 -1
  219. package/lib-amd/components/Dialog/renderDialog.js +0 -17
  220. package/lib-amd/components/Dialog/renderDialog.js.map +0 -1
  221. package/lib-amd/components/Dialog/useDialog.js +0 -78
  222. package/lib-amd/components/Dialog/useDialog.js.map +0 -1
  223. package/lib-amd/components/Dialog/useDialogContextValues.js +0 -25
  224. package/lib-amd/components/Dialog/useDialogContextValues.js.map +0 -1
  225. package/lib-amd/components/DialogActions/DialogActions.js +0 -18
  226. package/lib-amd/components/DialogActions/DialogActions.js.map +0 -1
  227. package/lib-amd/components/DialogActions/DialogActions.types.js +0 -5
  228. package/lib-amd/components/DialogActions/DialogActions.types.js.map +0 -1
  229. package/lib-amd/components/DialogActions/index.js +0 -10
  230. package/lib-amd/components/DialogActions/index.js.map +0 -1
  231. package/lib-amd/components/DialogActions/renderDialogActions.js +0 -15
  232. package/lib-amd/components/DialogActions/renderDialogActions.js.map +0 -1
  233. package/lib-amd/components/DialogActions/useDialogActions.js +0 -27
  234. package/lib-amd/components/DialogActions/useDialogActions.js.map +0 -1
  235. package/lib-amd/components/DialogActions/useDialogActionsStyles.js +0 -33
  236. package/lib-amd/components/DialogActions/useDialogActionsStyles.js.map +0 -1
  237. package/lib-amd/components/DialogBody/DialogBody.js +0 -18
  238. package/lib-amd/components/DialogBody/DialogBody.js.map +0 -1
  239. package/lib-amd/components/DialogBody/DialogBody.types.js +0 -5
  240. package/lib-amd/components/DialogBody/DialogBody.types.js.map +0 -1
  241. package/lib-amd/components/DialogBody/index.js +0 -10
  242. package/lib-amd/components/DialogBody/index.js.map +0 -1
  243. package/lib-amd/components/DialogBody/renderDialogBody.js +0 -15
  244. package/lib-amd/components/DialogBody/renderDialogBody.js.map +0 -1
  245. package/lib-amd/components/DialogBody/useDialogBody.js +0 -25
  246. package/lib-amd/components/DialogBody/useDialogBody.js.map +0 -1
  247. package/lib-amd/components/DialogBody/useDialogBodyStyles.js +0 -31
  248. package/lib-amd/components/DialogBody/useDialogBodyStyles.js.map +0 -1
  249. package/lib-amd/components/DialogContent/DialogContent.js +0 -18
  250. package/lib-amd/components/DialogContent/DialogContent.js.map +0 -1
  251. package/lib-amd/components/DialogContent/DialogContent.types.js +0 -5
  252. package/lib-amd/components/DialogContent/DialogContent.types.js.map +0 -1
  253. package/lib-amd/components/DialogContent/index.js +0 -10
  254. package/lib-amd/components/DialogContent/index.js.map +0 -1
  255. package/lib-amd/components/DialogContent/renderDialogContent.js +0 -14
  256. package/lib-amd/components/DialogContent/renderDialogContent.js.map +0 -1
  257. package/lib-amd/components/DialogContent/useDialogContent.js +0 -25
  258. package/lib-amd/components/DialogContent/useDialogContent.js.map +0 -1
  259. package/lib-amd/components/DialogContent/useDialogContentStyles.js +0 -24
  260. package/lib-amd/components/DialogContent/useDialogContentStyles.js.map +0 -1
  261. package/lib-amd/components/DialogSurface/DialogSurface.js +0 -19
  262. package/lib-amd/components/DialogSurface/DialogSurface.js.map +0 -1
  263. package/lib-amd/components/DialogSurface/DialogSurface.types.js +0 -5
  264. package/lib-amd/components/DialogSurface/DialogSurface.types.js.map +0 -1
  265. package/lib-amd/components/DialogSurface/index.js +0 -10
  266. package/lib-amd/components/DialogSurface/index.js.map +0 -1
  267. package/lib-amd/components/DialogSurface/renderDialogSurface.js +0 -17
  268. package/lib-amd/components/DialogSurface/renderDialogSurface.js.map +0 -1
  269. package/lib-amd/components/DialogSurface/useDialogSurface.js +0 -70
  270. package/lib-amd/components/DialogSurface/useDialogSurface.js.map +0 -1
  271. package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js +0 -11
  272. package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js.map +0 -1
  273. package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js +0 -44
  274. package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js.map +0 -1
  275. package/lib-amd/components/DialogTitle/DialogTitle.js +0 -18
  276. package/lib-amd/components/DialogTitle/DialogTitle.js.map +0 -1
  277. package/lib-amd/components/DialogTitle/DialogTitle.types.js +0 -5
  278. package/lib-amd/components/DialogTitle/DialogTitle.types.js.map +0 -1
  279. package/lib-amd/components/DialogTitle/index.js +0 -10
  280. package/lib-amd/components/DialogTitle/index.js.map +0 -1
  281. package/lib-amd/components/DialogTitle/renderDialogTitle.js +0 -16
  282. package/lib-amd/components/DialogTitle/renderDialogTitle.js.map +0 -1
  283. package/lib-amd/components/DialogTitle/useDialogTitle.js +0 -36
  284. package/lib-amd/components/DialogTitle/useDialogTitle.js.map +0 -1
  285. package/lib-amd/components/DialogTitle/useDialogTitleStyles.js +0 -37
  286. package/lib-amd/components/DialogTitle/useDialogTitleStyles.js.map +0 -1
  287. package/lib-amd/components/DialogTrigger/DialogTrigger.js +0 -24
  288. package/lib-amd/components/DialogTrigger/DialogTrigger.js.map +0 -1
  289. package/lib-amd/components/DialogTrigger/DialogTrigger.types.js +0 -5
  290. package/lib-amd/components/DialogTrigger/DialogTrigger.types.js.map +0 -1
  291. package/lib-amd/components/DialogTrigger/index.js +0 -9
  292. package/lib-amd/components/DialogTrigger/index.js.map +0 -1
  293. package/lib-amd/components/DialogTrigger/renderDialogTrigger.js +0 -13
  294. package/lib-amd/components/DialogTrigger/renderDialogTrigger.js.map +0 -1
  295. package/lib-amd/components/DialogTrigger/useDialogTrigger.js +0 -37
  296. package/lib-amd/components/DialogTrigger/useDialogTrigger.js.map +0 -1
  297. package/lib-amd/contexts/constants.js +0 -15
  298. package/lib-amd/contexts/constants.js.map +0 -1
  299. package/lib-amd/contexts/dialogContext.js +0 -26
  300. package/lib-amd/contexts/dialogContext.js.map +0 -1
  301. package/lib-amd/contexts/dialogSurfaceContext.js +0 -11
  302. package/lib-amd/contexts/dialogSurfaceContext.js.map +0 -1
  303. package/lib-amd/contexts/index.js +0 -8
  304. package/lib-amd/contexts/index.js.map +0 -1
  305. package/lib-amd/index.js +0 -37
  306. package/lib-amd/index.js.map +0 -1
  307. package/lib-amd/utils/index.js +0 -8
  308. package/lib-amd/utils/index.js.map +0 -1
  309. package/lib-amd/utils/isEscapeKeyDown.js +0 -13
  310. package/lib-amd/utils/isEscapeKeyDown.js.map +0 -1
  311. package/lib-amd/utils/useDisableBodyScroll.js +0 -52
  312. package/lib-amd/utils/useDisableBodyScroll.js.map +0 -1
  313. package/lib-amd/utils/useFocusFirstElement.js +0 -38
  314. package/lib-amd/utils/useFocusFirstElement.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './isEscapeKeyDown';\nexport * from './useDisableBodyScroll';\nexport * from './useFocusFirstElement';\n"]}
1
+ {"version":3,"names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './isEscapeKeyDown';\nexport * from './useDisableBodyScroll';\nexport * from './useFocusFirstElement';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { Escape } from '@fluentui/keyboard-keys';
2
3
  /**
3
4
  * Checks if keydown event is a proper Escape key dismiss
@@ -1 +1 @@
1
- {"version":3,"names":["Escape","isEscapeKeyDismiss","event","modalType","key","isDefaultPrevented"],"sources":["../src/packages/react-components/react-dialog/src/utils/isEscapeKeyDown.ts"],"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"],"mappings":"AACA,SAASA,MAAM,QAAQ,yBAAyB;AAIhD;;;AAGA,OAAM,SAAUC,kBAAkBA,CAChCC,KAAgD,EAChDC,SAA0B;EAE1B,OAAOD,KAAK,CAACE,GAAG,KAAKJ,MAAM,IAAIG,SAAS,KAAK,OAAO,IAAI,CAACD,KAAK,CAACG,kBAAkB,EAAE;AACrF"}
1
+ {"version":3,"names":["React","Escape","isEscapeKeyDismiss","event","modalType","key","isDefaultPrevented"],"sources":["../../src/utils/isEscapeKeyDown.ts"],"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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,MAAM,QAAQ;AAIvB;;;AAGA,OAAO,SAASC,mBACdC,KAAgD,EAChDC,SAA0B,EACjB;EACT,OAAOD,KAAA,CAAME,GAAG,KAAKJ,MAAA,IAAUG,SAAA,KAAc,WAAW,CAACD,KAAA,CAAMG,kBAAkB;AACnF"}
@@ -1,3 +1,4 @@
1
+ var _element, _disableScrollElementProp;
1
2
  import { useFluent_unstable } from '@fluentui/react-shared-contexts';
2
3
  import { useCallback } from 'react';
3
4
  const disableScrollElementProp = '__fluentDisableScrollElement';
@@ -20,11 +21,12 @@ export function useDisableBodyScroll() {
20
21
  * @returns a method for enabling scrolling again
21
22
  */
22
23
  export function disableScroll(target) {
23
- var _a, _b;
24
+ var _target_ownerDocument_defaultView;
24
25
  const {
25
26
  clientWidth
26
27
  } = target.ownerDocument.documentElement;
27
- const innerWidth = (_b = (_a = target.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.innerWidth) !== null && _b !== void 0 ? _b : 0;
28
+ var _target_ownerDocument_defaultView_innerWidth;
29
+ const innerWidth = (_target_ownerDocument_defaultView_innerWidth = (_target_ownerDocument_defaultView = target.ownerDocument.defaultView) === null || _target_ownerDocument_defaultView === void 0 ? void 0 : _target_ownerDocument_defaultView.innerWidth) !== null && _target_ownerDocument_defaultView_innerWidth !== void 0 ? _target_ownerDocument_defaultView_innerWidth : 0;
28
30
  assertIsDisableScrollElement(target);
29
31
  if (target[disableScrollElementProp].count === 0) {
30
32
  target.style.overflow = 'hidden';
@@ -40,9 +42,8 @@ export function disableScroll(target) {
40
42
  };
41
43
  }
42
44
  function assertIsDisableScrollElement(element) {
43
- var _a;
44
- var _b;
45
- (_a = (_b = element)[disableScrollElementProp]) !== null && _a !== void 0 ? _a : _b[disableScrollElementProp] = {
45
+ var _;
46
+ (_ = (_element = element)[_disableScrollElementProp = disableScrollElementProp]) !== null && _ !== void 0 ? _ : _element[_disableScrollElementProp] = {
46
47
  count: 0,
47
48
  previousOverflowStyle: element.style.overflow,
48
49
  previousPaddingRightStyle: element.style.paddingRight
@@ -1 +1 @@
1
- {"version":3,"names":["useFluent_unstable","useCallback","disableScrollElementProp","useDisableBodyScroll","targetDocument","disableScroll","body","target","clientWidth","ownerDocument","documentElement","innerWidth","_b","_a","defaultView","assertIsDisableScrollElement","count","style","overflow","paddingRight","previousOverflowStyle","previousPaddingRightStyle","element"],"sources":["../src/packages/react-components/react-dialog/src/utils/useDisableBodyScroll.ts"],"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"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,WAAW,QAAQ,OAAO;AAEnC,MAAMC,wBAAwB,GAAG,8BAAuC;AAUxE;;;AAGA,OAAM,SAAUC,oBAAoBA,CAAA;EAClC,MAAM;IAAEC;EAAc,CAAE,GAAGJ,kBAAkB,EAAE;EAC/C,OAAOC,WAAW,CAAC,MAAK;IACtB,IAAIG,cAAc,EAAE;MAClB,OAAOC,aAAa,CAACD,cAAc,CAACE,IAAI,CAAC;;EAE7C,CAAC,EAAE,CAACF,cAAc,CAAC,CAAC;AACtB;AAEA;;;;;AAKA,OAAM,SAAUC,aAAaA,CAACE,MAAmB;;EAC/C,MAAM;IAAEC;EAAW,CAAE,GAAGD,MAAM,CAACE,aAAa,CAACC,eAAe;EAC5D,MAAMC,UAAU,GAAG,CAAAC,EAAA,IAAAC,EAAA,GAAAN,MAAM,CAACE,aAAa,CAACK,WAAW,cAAAD,EAAA,uBAAAA,EAAA,CAAEF,UAAU,cAAAC,EAAA,cAAAA,EAAA,GAAI,CAAC;EACpEG,4BAA4B,CAACR,MAAM,CAAC;EACpC,IAAIA,MAAM,CAACL,wBAAwB,CAAC,CAACc,KAAK,KAAK,CAAC,EAAE;IAChDT,MAAM,CAACU,KAAK,CAACC,QAAQ,GAAG,QAAQ;IAChCX,MAAM,CAACU,KAAK,CAACE,YAAY,GAAG,GAAGR,UAAU,GAAGH,WAAW,IAAI;;EAE7DD,MAAM,CAACL,wBAAwB,CAAC,CAACc,KAAK,EAAE;EACxC,OAAO,MAAK;IACVT,MAAM,CAACL,wBAAwB,CAAC,CAACc,KAAK,EAAE;IACxC,IAAIT,MAAM,CAACL,wBAAwB,CAAC,CAACc,KAAK,KAAK,CAAC,EAAE;MAChDT,MAAM,CAACU,KAAK,CAACC,QAAQ,GAAGX,MAAM,CAACL,wBAAwB,CAAC,CAACkB,qBAAqB;MAC9Eb,MAAM,CAACU,KAAK,CAACE,YAAY,GAAGZ,MAAM,CAACL,wBAAwB,CAAC,CAACmB,yBAAyB;;EAE1F,CAAC;AACH;AAEA,SAASN,4BAA4BA,CAACO,OAAoB;;;EACxD,CAAAT,EAAA,IAAAD,EAAA,GAACU,OAAsC,EAACpB,wBAAwB,eAAAW,EAAA,cAAAA,EAAA,GAAAD,EAAA,CAAxBV,wBAAwB,IAAM;IACpEc,KAAK,EAAE,CAAC;IACRI,qBAAqB,EAAEE,OAAO,CAACL,KAAK,CAACC,QAAQ;IAC7CG,yBAAyB,EAAEC,OAAO,CAACL,KAAK,CAACE;GAC1C;AACH"}
1
+ {"version":3,"names":["_element","_disableScrollElementProp","useFluent_unstable","useCallback","disableScrollElementProp","useDisableBodyScroll","targetDocument","disableScroll","body","target","_target_ownerDocument_defaultView","clientWidth","ownerDocument","documentElement","_target_ownerDocument_defaultView_innerWidth","innerWidth","defaultView","assertIsDisableScrollElement","count","style","overflow","paddingRight","previousOverflowStyle","previousPaddingRightStyle","element","_"],"sources":["../../src/utils/useDisableBodyScroll.ts"],"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"],"mappings":"IAiDGA,QAAA,EAAuCC,yBAAA;AAjD1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,WAAW,QAAQ;AAE5B,MAAMC,wBAAA,GAA2B;AAUjC;;;AAGA,OAAO,SAASC,qBAAA,EAAuB;EACrC,MAAM;IAAEC;EAAc,CAAE,GAAGJ,kBAAA;EAC3B,OAAOC,WAAA,CAAY,MAAM;IACvB,IAAIG,cAAA,EAAgB;MAClB,OAAOC,aAAA,CAAcD,cAAA,CAAeE,IAAI;IAC1C;EACF,GAAG,CAACF,cAAA,CAAe;AACrB;AAEA;;;;;AAKA,OAAO,SAASC,cAAcE,MAAmB,EAAE;MAE9BC,iCAAA;EADnB,MAAM;IAAEC;EAAW,CAAE,GAAGF,MAAA,CAAOG,aAAa,CAACC,eAAe;MACzCC,4CAAA;EAAnB,MAAMC,UAAA,GAAa,CAAAD,4CAAA,IAAAJ,iCAAA,GAAAD,MAAA,CAAOG,aAAa,CAACI,WAAW,cAAhCN,iCAAA,uBAAAA,iCAAA,CAAkCK,UAAU,cAA5CD,4CAAA,cAAAA,4CAAA,GAAgD,CAAC;EACpEG,4BAAA,CAA6BR,MAAA;EAC7B,IAAIA,MAAM,CAACL,wBAAA,CAAyB,CAACc,KAAK,KAAK,GAAG;IAChDT,MAAA,CAAOU,KAAK,CAACC,QAAQ,GAAG;IACxBX,MAAA,CAAOU,KAAK,CAACE,YAAY,GAAI,GAAEN,UAAA,GAAaJ,WAAY,IAAG;EAC7D;EACAF,MAAM,CAACL,wBAAA,CAAyB,CAACc,KAAK;EACtC,OAAO,MAAM;IACXT,MAAM,CAACL,wBAAA,CAAyB,CAACc,KAAK;IACtC,IAAIT,MAAM,CAACL,wBAAA,CAAyB,CAACc,KAAK,KAAK,GAAG;MAChDT,MAAA,CAAOU,KAAK,CAACC,QAAQ,GAAGX,MAAM,CAACL,wBAAA,CAAyB,CAACkB,qBAAqB;MAC9Eb,MAAA,CAAOU,KAAK,CAACE,YAAY,GAAGZ,MAAM,CAACL,wBAAA,CAAyB,CAACmB,yBAAyB;IACxF;EACF;AACF;AAEA,SAASN,6BAA6BO,OAAoB,EAAiD;;EACzG,CAAAC,CAAA,IAACzB,QAAA,GAAAwB,OAAA,EAAuCvB,yBAAA,GAAAG,wBAAA,CAAyB,cAAAqB,CAAA,cAAAA,CAAA,GAAhEzB,QAAsC,CAACC,yBAAA,CAAyB,GAAK;IACpEiB,KAAA,EAAO;IACPI,qBAAA,EAAuBE,OAAA,CAAQL,KAAK,CAACC,QAAQ;IAC7CG,yBAAA,EAA2BC,OAAA,CAAQL,KAAK,CAACE;EAC3C,CAAC;AACH"}
@@ -14,16 +14,17 @@ export function useFocusFirstElement(open, modalType) {
14
14
  const dialogRef = React.useRef(null);
15
15
  const triggerRef = React.useRef();
16
16
  React.useEffect(() => {
17
- var _a, _b;
18
17
  if (!open) {
19
- return (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
18
+ var _triggerRef_current;
19
+ return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();
20
20
  }
21
21
  triggerRef.current = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
22
22
  const element = dialogRef.current && findFirstFocusable(dialogRef.current);
23
23
  if (element) {
24
24
  element.focus();
25
25
  } else {
26
- (_b = dialogRef.current) === null || _b === void 0 ? void 0 : _b.focus(); // https://github.com/microsoft/fluentui/issues/25150
26
+ var _dialogRef_current;
27
+ (_dialogRef_current = dialogRef.current) === null || _dialogRef_current === void 0 ? void 0 : _dialogRef_current.focus(); // https://github.com/microsoft/fluentui/issues/25150
27
28
  if (process.env.NODE_ENV !== 'production') {
28
29
  // eslint-disable-next-line no-console
29
30
  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'));
@@ -1 +1 @@
1
- {"version":3,"names":["React","useFocusFinders","useFluent_unstable","useFocusFirstElement","open","modalType","findFirstFocusable","targetDocument","dialogRef","useRef","triggerRef","useEffect","_a","current","focus","activeElement","element","_b","process","env","NODE_ENV","console","warn","join"],"sources":["../src/packages/react-components/react-dialog/src/utils/useFocusFirstElement.ts"],"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"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,kBAAkB,QAAQ,iCAAiC;AAIpE;;;AAGA,OAAM,SAAUC,oBAAoBA,CAACC,IAAa,EAAEC,SAA0B;EAC5E,MAAM;IAAEC;EAAkB,CAAE,GAAGL,eAAe,EAAE;EAChD,MAAM;IAAEM;EAAc,CAAE,GAAGL,kBAAkB,EAAE;EAC/C,MAAMM,SAAS,GAAGR,KAAK,CAACS,MAAM,CAAuB,IAAI,CAAC;EAC1D,MAAMC,UAAU,GAAGV,KAAK,CAACS,MAAM,EAAe;EAE9CT,KAAK,CAACW,SAAS,CAAC,MAAK;;IACnB,IAAI,CAACP,IAAI,EAAE;MACT,OAAO,CAAAQ,EAAA,GAAAF,UAAU,CAACG,OAAO,cAAAD,EAAA,uBAAAA,EAAA,CAAEE,KAAK,EAAE;;IAEpCJ,UAAU,CAACG,OAAO,GAAGN,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAEQ,aAAwC;IAC7E,MAAMC,OAAO,GAAGR,SAAS,CAACK,OAAO,IAAIP,kBAAkB,CAACE,SAAS,CAACK,OAAO,CAAC;IAC1E,IAAIG,OAAO,EAAE;MACXA,OAAO,CAACF,KAAK,EAAE;KAChB,MAAM;MACL,CAAAG,EAAA,GAAAT,SAAS,CAACK,OAAO,cAAAI,EAAA,uBAAAA,EAAA,CAAEH,KAAK,EAAE,CAAC,CAAC;MAC5B,IAAII,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;QACzC;QACAC,OAAO,CAACC,IAAI,CACV,CACE,mGAAmG,EACnG,kGAAkG,CACnG,CAACC,IAAI,CAAC,IAAI,CAAC,CACb;;;EAGP,CAAC,EAAE,CAACjB,kBAAkB,EAAEF,IAAI,EAAEC,SAAS,EAAEE,cAAc,CAAC,CAAC;EAEzD,OAAOC,SAAS;AAClB"}
1
+ {"version":3,"names":["React","useFocusFinders","useFluent_unstable","useFocusFirstElement","open","modalType","findFirstFocusable","targetDocument","dialogRef","useRef","triggerRef","useEffect","_triggerRef_current","current","focus","activeElement","element","_dialogRef_current","process","env","NODE_ENV","console","warn","join"],"sources":["../../src/utils/useFocusFirstElement.ts"],"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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,eAAe,QAAQ;AAChC,SAASC,kBAAkB,QAAQ;AAInC;;;AAGA,OAAO,SAASC,qBAAqBC,IAAa,EAAEC,SAA0B,EAAE;EAC9E,MAAM;IAAEC;EAAkB,CAAE,GAAGL,eAAA;EAC/B,MAAM;IAAEM;EAAc,CAAE,GAAGL,kBAAA;EAC3B,MAAMM,SAAA,GAAYR,KAAA,CAAMS,MAAM,CAAuB,IAAI;EACzD,MAAMC,UAAA,GAAaV,KAAA,CAAMS,MAAM;EAE/BT,KAAA,CAAMW,SAAS,CAAC,MAAM;IACpB,IAAI,CAACP,IAAA,EAAM;UACFQ,mBAAA;MAAP,OAAO,CAAAA,mBAAA,GAAAF,UAAA,CAAWG,OAAO,cAAlBD,mBAAA,uBAAAA,mBAAA,CAAoBE,KAAA;IAC7B;IACAJ,UAAA,CAAWG,OAAO,GAAGN,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBQ,aAAa;IAClD,MAAMC,OAAA,GAAUR,SAAA,CAAUK,OAAO,IAAIP,kBAAA,CAAmBE,SAAA,CAAUK,OAAO;IACzE,IAAIG,OAAA,EAAS;MACXA,OAAA,CAAQF,KAAK;IACf,OAAO;UACLG,kBAAA;MAAA,CAAAA,kBAAA,GAAAT,SAAA,CAAUK,OAAO,cAAjBI,kBAAA,uBAAAA,kBAAA,CAAmBH,KAAA,IAAS;MAC5B,IAAII,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC;QACAC,OAAA,CAAQC,IAAI,CACV,CACE,qGACA,mGACD,CAACC,IAAI,CAAC;MAEX;IACF;EACF,GAAG,CAACjB,kBAAA,EAAoBF,IAAA,EAAMC,SAAA,EAAWE,cAAA,CAAe;EAExD,OAAOC,SAAA;AACT"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/Dialog/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/Dialog/index"), exports);
7
+ //# sourceMappingURL=Dialog.js.map
8
+
8
9
  //# sourceMappingURL=Dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/Dialog.ts"],"sourcesContent":["export * from './components/Dialog/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,+BAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/Dialog.js"],"sourcesContent":["export * from './components/Dialog/index';\n//# sourceMappingURL=Dialog.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,kCAAkC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/DialogActions/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/DialogActions/index"), exports);
7
+ //# sourceMappingURL=DialogActions.js.map
8
+
8
9
  //# sourceMappingURL=DialogActions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/DialogActions.ts"],"sourcesContent":["export * from './components/DialogActions/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,sCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/DialogActions.js"],"sourcesContent":["export * from './components/DialogActions/index';\n//# sourceMappingURL=DialogActions.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,yCAAyC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/DialogBody/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/DialogBody/index"), exports);
7
+ //# sourceMappingURL=DialogBody.js.map
8
+
8
9
  //# sourceMappingURL=DialogBody.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/DialogBody.ts"],"sourcesContent":["export * from './components/DialogBody/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/DialogBody.js"],"sourcesContent":["export * from './components/DialogBody/index';\n//# sourceMappingURL=DialogBody.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,sCAAsC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/DialogContent/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/DialogContent/index"), exports);
7
+ //# sourceMappingURL=DialogContent.js.map
8
+
8
9
  //# sourceMappingURL=DialogContent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/DialogContent.ts"],"sourcesContent":["export * from './components/DialogContent/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,sCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/DialogContent.js"],"sourcesContent":["export * from './components/DialogContent/index';\n//# sourceMappingURL=DialogContent.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,yCAAyC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/DialogSurface/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/DialogSurface/index"), exports);
7
+ //# sourceMappingURL=DialogSurface.js.map
8
+
8
9
  //# sourceMappingURL=DialogSurface.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/DialogSurface.ts"],"sourcesContent":["export * from './components/DialogSurface/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,sCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/DialogSurface.js"],"sourcesContent":["export * from './components/DialogSurface/index';\n//# sourceMappingURL=DialogSurface.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,yCAAyC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/DialogTitle/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/DialogTitle/index"), exports);
7
+ //# sourceMappingURL=DialogTitle.js.map
8
+
8
9
  //# sourceMappingURL=DialogTitle.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/DialogTitle.ts"],"sourcesContent":["export * from './components/DialogTitle/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,oCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/DialogTitle.js"],"sourcesContent":["export * from './components/DialogTitle/index';\n//# sourceMappingURL=DialogTitle.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,uCAAuC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/DialogTrigger/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/DialogTrigger/index"), exports);
7
+ //# sourceMappingURL=DialogTrigger.js.map
8
+
8
9
  //# sourceMappingURL=DialogTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/DialogTrigger.ts"],"sourcesContent":["export * from './components/DialogTrigger/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,sCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/DialogTrigger.js"],"sourcesContent":["export * from './components/DialogTrigger/index';\n//# sourceMappingURL=DialogTrigger.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,yCAAyC"}
@@ -1,24 +1,21 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Dialog", {
6
+ enumerable: true,
7
+ get: ()=>Dialog
5
8
  });
6
- exports.Dialog = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const useDialog_1 = /*#__PURE__*/require("./useDialog");
9
- const renderDialog_1 = /*#__PURE__*/require("./renderDialog");
10
- const useDialogContextValues_1 = /*#__PURE__*/require("./useDialogContextValues");
11
- /**
12
- * The `Dialog` root level component serves as an interface for interaction with all possible behaviors exposed.
13
- * It provides context down the hierarchy to `children` compound components to allow functionality.
14
- * This component expects to receive as children either a `DialogSurface` or a `DialogTrigger`
15
- * and a `DialogSurface` (or some component that will eventually render one of those compound components)
16
- * in this specific order
17
- */
18
- exports.Dialog = /*#__PURE__*/React.memo(props => {
19
- const state = useDialog_1.useDialog_unstable(props);
20
- const contextValues = useDialogContextValues_1.useDialogContextValues_unstable(state);
21
- return renderDialog_1.renderDialog_unstable(state, contextValues);
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _useDialog = require("./useDialog");
12
+ const _renderDialog = require("./renderDialog");
13
+ const _useDialogContextValues = require("./useDialogContextValues");
14
+ const Dialog = /*#__PURE__*/ _react.memo((props)=>{
15
+ const state = (0, _useDialog.useDialog_unstable)(props);
16
+ const contextValues = (0, _useDialogContextValues.useDialogContextValues_unstable)(state);
17
+ return (0, _renderDialog.renderDialog_unstable)(state, contextValues);
22
18
  });
23
- exports.Dialog.displayName = 'Dialog';
19
+ Dialog.displayName = 'Dialog'; //# sourceMappingURL=Dialog.js.map
20
+
24
21
  //# sourceMappingURL=Dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","useDialog_1","renderDialog_1","useDialogContextValues_1","exports","Dialog","memo","props","state","useDialog_unstable","contextValues","useDialogContextValues_unstable","renderDialog_unstable","displayName"],"sources":["../src/packages/react-components/react-dialog/src/components/Dialog/Dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDialog_unstable } from './useDialog';\nimport { renderDialog_unstable } from './renderDialog';\nimport type { DialogProps } from './Dialog.types';\nimport { useDialogContextValues_unstable } from './useDialogContextValues';\n\n/**\n * The `Dialog` root level component serves as an interface for interaction with all possible behaviors exposed.\n * It provides context down the hierarchy to `children` compound components to allow functionality.\n * This component expects to receive as children either a `DialogSurface` or a `DialogTrigger`\n * and a `DialogSurface` (or some component that will eventually render one of those compound components)\n * in this specific order\n */\nexport const Dialog: React.FC<DialogProps> = React.memo(props => {\n const state = useDialog_unstable(props);\n const contextValues = useDialogContextValues_unstable(state);\n\n return renderDialog_unstable(state, contextValues);\n});\n\nDialog.displayName = 'Dialog';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,WAAA,gBAAAD,OAAA;AACA,MAAAE,cAAA,gBAAAF,OAAA;AAEA,MAAAG,wBAAA,gBAAAH,OAAA;AAEA;;;;;;;AAOaI,OAAA,CAAAC,MAAM,gBAA0BN,KAAK,CAACO,IAAI,CAACC,KAAK,IAAG;EAC9D,MAAMC,KAAK,GAAGP,WAAA,CAAAQ,kBAAkB,CAACF,KAAK,CAAC;EACvC,MAAMG,aAAa,GAAGP,wBAAA,CAAAQ,+BAA+B,CAACH,KAAK,CAAC;EAE5D,OAAON,cAAA,CAAAU,qBAAqB,CAACJ,KAAK,EAAEE,aAAa,CAAC;AACpD,CAAC,CAAC;AAEFN,OAAA,CAAAC,MAAM,CAACQ,WAAW,GAAG,QAAQ"}
1
+ {"version":3,"sources":["../../../lib/components/Dialog/Dialog.js"],"sourcesContent":["import * as React from 'react';\nimport { useDialog_unstable } from './useDialog';\nimport { renderDialog_unstable } from './renderDialog';\nimport { useDialogContextValues_unstable } from './useDialogContextValues';\n/**\n * The `Dialog` root level component serves as an interface for interaction with all possible behaviors exposed.\n * It provides context down the hierarchy to `children` compound components to allow functionality.\n * This component expects to receive as children either a `DialogSurface` or a `DialogTrigger`\n * and a `DialogSurface` (or some component that will eventually render one of those compound components)\n * in this specific order\n */\nexport const Dialog = /*#__PURE__*/React.memo(props => {\n const state = useDialog_unstable(props);\n const contextValues = useDialogContextValues_unstable(state);\n return renderDialog_unstable(state, contextValues);\n});\nDialog.displayName = 'Dialog';\n//# sourceMappingURL=Dialog.js.map"],"names":["Dialog","React","memo","props","state","useDialog_unstable","contextValues","useDialogContextValues_unstable","renderDialog_unstable","displayName"],"mappings":";;;;+BAWaA;;aAAAA;;;6DAXU;2BACY;8BACG;wCACU;AAQzC,MAAMA,SAAS,WAAW,GAAEC,OAAMC,IAAI,CAACC,CAAAA,QAAS;IACrD,MAAMC,QAAQC,IAAAA,6BAAkB,EAACF;IACjC,MAAMG,gBAAgBC,IAAAA,uDAA+B,EAACH;IACtD,OAAOI,IAAAA,mCAAqB,EAACJ,OAAOE;AACtC;AACAN,OAAOS,WAAW,GAAG,UACrB,kCAAkC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ //# sourceMappingURL=Dialog.types.js.map
6
+
6
7
  //# sourceMappingURL=Dialog.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/react-dialog/src/components/Dialog/Dialog.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface/DialogSurface.types';\n\nexport type DialogSlots = {};\n\nexport type DialogOpenChangeEvent = DialogOpenChangeData['event'];\n\nexport type DialogOpenChangeData =\n | {\n type: 'escapeKeyDown';\n open: boolean;\n event: React.KeyboardEvent<DialogSurfaceElement>;\n }\n | {\n type: 'backdropClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n }\n | {\n type: 'triggerClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n };\n\nexport type DialogModalType = 'modal' | 'non-modal' | 'alert';\n\n/**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\nexport type DialogOpenChangeEventHandler = (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;\n\nexport type DialogContextValues = {\n dialog: DialogContextValue;\n /**\n * dialogSurface context is provided by Dialog as false\n * to ensure components inside Dialog but outside DialogSurface will consume this as false\n */\n dialogSurface: DialogSurfaceContextValue;\n};\n\nexport type DialogProps = ComponentProps<Partial<DialogSlots>> & {\n /**\n * Dialog variations.\n *\n * `modal`: When this type of dialog is open, the rest of the page is dimmed out and cannot be interacted with.\n * The tab sequence is kept within the dialog and moving the focus outside\n * the dialog will imply closing it. This is the default type of the component.\n *\n * `non-modal`: When a non-modal dialog is open, the rest of the page is not dimmed out\n * and users can interact with the rest of the page.\n * This also implies that the tab focus can move outside the dialog when it reaches the last focusable element.\n *\n * `alert`: is a special type of modal dialogs that interrupts the user's workflow\n * to communicate an important message or ask for a decision.\n * Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog,\n * and it cannot be dismissed through the dimmed background or escape key.\n *\n * @default modal\n */\n modalType?: DialogModalType;\n /**\n * Controls the open state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Default value for the uncontrolled open state of the dialog.\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\n onOpenChange?: DialogOpenChangeEventHandler;\n /**\n * Can contain two children including {@link DialogTrigger} and {@link DialogSurface}.\n * Alternatively can only contain {@link DialogSurface} if using trigger outside dialog, or controlling state.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n /**\n * Enables standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n * where the focus trap involves setting outside elements inert.\n *\n * @default false\n */\n inertTrapFocus?: boolean;\n};\n\nexport type DialogState = ComponentState<DialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"],"mappings":""}
1
+ {"version":3,"sources":["../../../lib/components/Dialog/Dialog.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Dialog.types.js.map"],"names":[],"mappings":";;;;CACA,wCAAwC"}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./Dialog"), exports);
8
- tslib_1.__exportStar(require("./Dialog.types"), exports);
9
- tslib_1.__exportStar(require("./renderDialog"), exports);
10
- tslib_1.__exportStar(require("./useDialog"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./Dialog"), exports);
7
+ _exportStar(require("./Dialog.types"), exports);
8
+ _exportStar(require("./renderDialog"), exports);
9
+ _exportStar(require("./useDialog"), exports);
10
+ //# sourceMappingURL=index.js.map
11
+
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/Dialog/index.ts"],"sourcesContent":["export * from './Dialog';\nexport * from './Dialog.types';\nexport * from './renderDialog';\nexport * from './useDialog';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,cAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,oBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,oBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,iBAAAC,OAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Dialog/index.js"],"sourcesContent":["export * from './Dialog';\nexport * from './Dialog.types';\nexport * from './renderDialog';\nexport * from './useDialog';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,24 +1,21 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderDialog_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderDialog_unstable
5
8
  });
6
- exports.renderDialog_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const contexts_1 = /*#__PURE__*/require("../../contexts");
9
- /**
10
- * Render the final JSX of Dialog
11
- */
12
- const renderDialog_unstable = (state, contextValues) => {
13
- const {
14
- content,
15
- trigger
16
- } = state;
17
- return React.createElement(contexts_1.DialogProvider, {
18
- value: contextValues.dialog
19
- }, React.createElement(contexts_1.DialogSurfaceProvider, {
20
- value: contextValues.dialogSurface
21
- }, trigger, content));
22
- };
23
- exports.renderDialog_unstable = renderDialog_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _contexts = require("../../contexts");
12
+ const renderDialog_unstable = (state, contextValues)=>{
13
+ const { content , trigger } = state;
14
+ return /*#__PURE__*/ _react.createElement(_contexts.DialogProvider, {
15
+ value: contextValues.dialog
16
+ }, /*#__PURE__*/ _react.createElement(_contexts.DialogSurfaceProvider, {
17
+ value: contextValues.dialogSurface
18
+ }, trigger, content));
19
+ }; //# sourceMappingURL=renderDialog.js.map
20
+
24
21
  //# sourceMappingURL=renderDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","contexts_1","renderDialog_unstable","state","contextValues","content","trigger","createElement","DialogProvider","value","dialog","DialogSurfaceProvider","dialogSurface","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/Dialog/renderDialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport { DialogProvider, DialogSurfaceProvider } from '../../contexts';\nimport type { DialogState, DialogContextValues } from './Dialog.types';\n\n/**\n * Render the final JSX of Dialog\n */\nexport const renderDialog_unstable = (state: DialogState, contextValues: DialogContextValues) => {\n const { content, trigger } = state;\n\n return (\n <DialogProvider value={contextValues.dialog}>\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n {trigger}\n {content}\n </DialogSurfaceProvider>\n </DialogProvider>\n );\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,UAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,qBAAqB,GAAGA,CAACC,KAAkB,EAAEC,aAAkC,KAAI;EAC9F,MAAM;IAAEC,OAAO;IAAEC;EAAO,CAAE,GAAGH,KAAK;EAElC,OACEJ,KAAA,CAAAQ,aAAA,CAACN,UAAA,CAAAO,cAAc;IAACC,KAAK,EAAEL,aAAa,CAACM;EAAM,GACzCX,KAAA,CAAAQ,aAAA,CAACN,UAAA,CAAAU,qBAAqB;IAACF,KAAK,EAAEL,aAAa,CAACQ;EAAa,GACtDN,OAAO,EACPD,OAAO,CACc,CACT;AAErB,CAAC;AAXYQ,OAAA,CAAAX,qBAAqB,GAAAA,qBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Dialog/renderDialog.js"],"sourcesContent":["import * as React from 'react';\nimport { DialogProvider, DialogSurfaceProvider } from '../../contexts';\n/**\n * Render the final JSX of Dialog\n */\nexport const renderDialog_unstable = (state, contextValues) => {\n const {\n content,\n trigger\n } = state;\n return /*#__PURE__*/React.createElement(DialogProvider, {\n value: contextValues.dialog\n }, /*#__PURE__*/React.createElement(DialogSurfaceProvider, {\n value: contextValues.dialogSurface\n }, trigger, content));\n};\n//# sourceMappingURL=renderDialog.js.map"],"names":["renderDialog_unstable","state","contextValues","content","trigger","React","createElement","DialogProvider","value","dialog","DialogSurfaceProvider","dialogSurface"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;0BAC+B;AAI/C,MAAMA,wBAAwB,CAACC,OAAOC,gBAAkB;IAC7D,MAAM,EACJC,QAAO,EACPC,QAAO,EACR,GAAGH;IACJ,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACC,wBAAc,EAAE;QACtDC,OAAON,cAAcO,MAAM;IAC7B,GAAG,WAAW,GAAEJ,OAAMC,aAAa,CAACI,+BAAqB,EAAE;QACzDF,OAAON,cAAcS,aAAa;IACpC,GAAGP,SAASD;AACd,GACA,wCAAwC"}
@@ -1,88 +1,86 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.useDialog_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
10
- const utils_1 = /*#__PURE__*/require("../../utils");
11
- const contexts_1 = /*#__PURE__*/require("../../contexts");
12
- /**
13
- * Create the state required to render Dialog.
14
- *
15
- * The returned state can be modified with hooks such as useDialogStyles_unstable,
16
- * before being passed to renderDialog_unstable.
17
- *
18
- * @param props - props from this instance of Dialog
19
- */
20
- const useDialog_unstable = props => {
21
- const {
22
- children,
23
- modalType = 'modal',
24
- onOpenChange,
25
- inertTrapFocus = false
26
- } = props;
27
- const [trigger, content] = childrenToTriggerAndContent(children);
28
- const [open, setOpen] = react_utilities_1.useControllableState({
29
- state: props.open,
30
- defaultState: props.defaultOpen,
31
- initialState: false
32
- });
33
- const requestOpenChange = react_utilities_1.useEventCallback(data => {
34
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(data.event, data);
35
- // if user prevents default then do not change state value
36
- // otherwise updates state value and trigger reference to the element that caused the opening
37
- if (!data.event.isDefaultPrevented()) {
38
- setOpen(data.open);
39
- }
40
- });
41
- const focusRef = utils_1.useFocusFirstElement(open, modalType);
42
- const disableBodyScroll = utils_1.useDisableBodyScroll();
43
- const isBodyScrollLocked = Boolean(open && modalType !== 'non-modal');
44
- react_utilities_1.useIsomorphicLayoutEffect(() => {
45
- if (isBodyScrollLocked) {
46
- return disableBodyScroll();
47
- }
48
- }, [disableBodyScroll, isBodyScrollLocked]);
49
- return {
50
- components: {
51
- backdrop: 'div'
52
- },
53
- inertTrapFocus,
54
- open,
55
- modalType,
56
- content: open ? content : null,
57
- trigger,
58
- requestOpenChange,
59
- dialogTitleId: react_utilities_1.useId('dialog-title-'),
60
- isNestedDialog: react_context_selector_1.useHasParentContext(contexts_1.DialogContext),
61
- dialogRef: focusRef
62
- };
5
+ Object.defineProperty(exports, "useDialog_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useDialog_unstable
8
+ });
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const _reactContextSelector = require("@fluentui/react-context-selector");
13
+ const _utils = require("../../utils");
14
+ const _contexts = require("../../contexts");
15
+ const useDialog_unstable = (props)=>{
16
+ const { children , modalType ='modal' , onOpenChange , inertTrapFocus =false } = props;
17
+ const [trigger, content] = childrenToTriggerAndContent(children);
18
+ const [open, setOpen] = (0, _reactUtilities.useControllableState)({
19
+ state: props.open,
20
+ defaultState: props.defaultOpen,
21
+ initialState: false
22
+ });
23
+ const requestOpenChange = (0, _reactUtilities.useEventCallback)((data)=>{
24
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(data.event, data);
25
+ // if user prevents default then do not change state value
26
+ // otherwise updates state value and trigger reference to the element that caused the opening
27
+ if (!data.event.isDefaultPrevented()) {
28
+ setOpen(data.open);
29
+ }
30
+ });
31
+ const focusRef = (0, _utils.useFocusFirstElement)(open, modalType);
32
+ const disableBodyScroll = (0, _utils.useDisableBodyScroll)();
33
+ const isBodyScrollLocked = Boolean(open && modalType !== 'non-modal');
34
+ (0, _reactUtilities.useIsomorphicLayoutEffect)(()=>{
35
+ if (isBodyScrollLocked) {
36
+ return disableBodyScroll();
37
+ }
38
+ }, [
39
+ disableBodyScroll,
40
+ isBodyScrollLocked
41
+ ]);
42
+ return {
43
+ components: {
44
+ backdrop: 'div'
45
+ },
46
+ inertTrapFocus,
47
+ open,
48
+ modalType,
49
+ content: open ? content : null,
50
+ trigger,
51
+ requestOpenChange,
52
+ dialogTitleId: (0, _reactUtilities.useId)('dialog-title-'),
53
+ isNestedDialog: (0, _reactContextSelector.useHasParentContext)(_contexts.DialogContext),
54
+ dialogRef: focusRef
55
+ };
63
56
  };
64
- exports.useDialog_unstable = useDialog_unstable;
65
57
  /**
66
58
  * Extracts trigger and content from children
67
- */
68
- function childrenToTriggerAndContent(children) {
69
- const childrenArray = React.Children.toArray(children);
70
- if (process.env.NODE_ENV !== 'production') {
71
- if (childrenArray.length !== 1 && childrenArray.length !== 2) {
72
- // eslint-disable-next-line no-console
73
- console.warn('Dialog must contain at least one child <DialogSurface/>,\n' + 'and at most two children <DialogTrigger/> <DialogSurface/> (in this order)');
59
+ */ function childrenToTriggerAndContent(children) {
60
+ const childrenArray = _react.Children.toArray(children);
61
+ if (process.env.NODE_ENV !== 'production') {
62
+ if (childrenArray.length !== 1 && childrenArray.length !== 2) {
63
+ // eslint-disable-next-line no-console
64
+ console.warn('Dialog must contain at least one child <DialogSurface/>,\n' + 'and at most two children <DialogTrigger/> <DialogSurface/> (in this order)');
65
+ }
66
+ }
67
+ switch(childrenArray.length){
68
+ // case where there's a trigger followed by content
69
+ case 2:
70
+ return childrenArray;
71
+ // case where there's only content
72
+ case 1:
73
+ return [
74
+ undefined,
75
+ childrenArray[0]
76
+ ];
77
+ // unknown case
78
+ default:
79
+ return [
80
+ undefined,
81
+ undefined
82
+ ];
74
83
  }
75
- }
76
- switch (childrenArray.length) {
77
- // case where there's a trigger followed by content
78
- case 2:
79
- return childrenArray;
80
- // case where there's only content
81
- case 1:
82
- return [undefined, childrenArray[0]];
83
- // unknown case
84
- default:
85
- return [undefined, undefined];
86
- }
87
- }
84
+ } //# sourceMappingURL=useDialog.js.map
85
+
88
86
  //# sourceMappingURL=useDialog.js.map