@fluentui/react-dialog 9.0.0-beta.7 → 9.0.0-beta.8

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 (122) hide show
  1. package/CHANGELOG.json +154 -5
  2. package/CHANGELOG.md +34 -6
  3. package/Spec.md +44 -25
  4. package/dist/index.d.ts +59 -59
  5. package/lib/components/Dialog/Dialog.js +0 -2
  6. package/lib/components/Dialog/Dialog.js.map +1 -1
  7. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  8. package/lib/components/Dialog/index.js +0 -1
  9. package/lib/components/Dialog/index.js.map +1 -1
  10. package/lib/components/Dialog/renderDialog.js +2 -10
  11. package/lib/components/Dialog/renderDialog.js.map +1 -1
  12. package/lib/components/Dialog/useDialog.js +19 -129
  13. package/lib/components/Dialog/useDialog.js.map +1 -1
  14. package/lib/components/Dialog/useDialogContextValues.js +4 -4
  15. package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
  16. package/lib/components/DialogActions/useDialogActionsStyles.js +3 -5
  17. package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  18. package/lib/components/DialogBody/useDialogBodyStyles.js +5 -5
  19. package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  20. package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -1
  21. package/lib/components/DialogSurface/renderDialogSurface.js +4 -2
  22. package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -1
  23. package/lib/components/DialogSurface/useDialogSurface.js +120 -21
  24. package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
  25. package/lib/components/DialogSurface/useDialogSurfaceStyles.js +56 -7
  26. package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  27. package/lib/components/DialogTitle/DialogTitle.js +2 -3
  28. package/lib/components/DialogTitle/DialogTitle.js.map +1 -1
  29. package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -1
  30. package/lib/components/DialogTitle/renderDialogTitle.js +2 -5
  31. package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -1
  32. package/lib/components/DialogTitle/useDialogTitle.js +15 -9
  33. package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
  34. package/lib/components/DialogTitle/useDialogTitleStyles.js +61 -54
  35. package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  36. package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
  37. package/lib/components/DialogTrigger/useDialogTrigger.js +3 -22
  38. package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  39. package/lib/contexts/constants.js +1 -1
  40. package/lib/contexts/constants.js.map +1 -1
  41. package/lib/contexts/dialogContext.js +2 -4
  42. package/lib/contexts/dialogContext.js.map +1 -1
  43. package/lib/index.js +1 -1
  44. package/lib/index.js.map +1 -1
  45. package/lib/utils/index.js +4 -3
  46. package/lib/utils/index.js.map +1 -1
  47. package/lib/utils/isEscapeKeyDown.js +5 -4
  48. package/lib/utils/isEscapeKeyDown.js.map +1 -1
  49. package/lib/utils/isHTMLDialogElement.js +4 -0
  50. package/lib/utils/isHTMLDialogElement.js.map +1 -0
  51. package/lib/utils/useControlNativeDialogOpenState.js +20 -0
  52. package/lib/utils/useControlNativeDialogOpenState.js.map +1 -0
  53. package/lib/utils/useDisableBodyScroll.js +60 -0
  54. package/lib/utils/useDisableBodyScroll.js.map +1 -0
  55. package/lib/utils/useFocusFirstElement.js +41 -0
  56. package/lib/utils/useFocusFirstElement.js.map +1 -0
  57. package/lib-commonjs/components/Dialog/Dialog.js +0 -3
  58. package/lib-commonjs/components/Dialog/Dialog.js.map +1 -1
  59. package/lib-commonjs/components/Dialog/index.js +0 -2
  60. package/lib-commonjs/components/Dialog/index.js.map +1 -1
  61. package/lib-commonjs/components/Dialog/renderDialog.js +2 -12
  62. package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -1
  63. package/lib-commonjs/components/Dialog/useDialog.js +18 -128
  64. package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
  65. package/lib-commonjs/components/Dialog/useDialogContextValues.js +4 -4
  66. package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
  67. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js +3 -6
  68. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  69. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +4 -5
  70. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  71. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +5 -2
  72. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -1
  73. package/lib-commonjs/components/DialogSurface/useDialogSurface.js +120 -21
  74. package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
  75. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +56 -6
  76. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  77. package/lib-commonjs/components/DialogTitle/DialogTitle.js +2 -3
  78. package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -1
  79. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +2 -6
  80. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -1
  81. package/lib-commonjs/components/DialogTitle/useDialogTitle.js +18 -10
  82. package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
  83. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +62 -56
  84. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  85. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +4 -24
  86. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  87. package/lib-commonjs/contexts/constants.js +2 -2
  88. package/lib-commonjs/contexts/constants.js.map +1 -1
  89. package/lib-commonjs/contexts/dialogContext.js +2 -4
  90. package/lib-commonjs/contexts/dialogContext.js.map +1 -1
  91. package/lib-commonjs/index.js +1 -13
  92. package/lib-commonjs/index.js.map +1 -1
  93. package/lib-commonjs/utils/index.js +5 -3
  94. package/lib-commonjs/utils/index.js.map +1 -1
  95. package/lib-commonjs/utils/isEscapeKeyDown.js +5 -4
  96. package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -1
  97. package/lib-commonjs/utils/isHTMLDialogElement.js +13 -0
  98. package/lib-commonjs/utils/isHTMLDialogElement.js.map +1 -0
  99. package/lib-commonjs/utils/useControlNativeDialogOpenState.js +31 -0
  100. package/lib-commonjs/utils/useControlNativeDialogOpenState.js.map +1 -0
  101. package/lib-commonjs/utils/useDisableBodyScroll.js +73 -0
  102. package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -0
  103. package/lib-commonjs/utils/useFocusFirstElement.js +54 -0
  104. package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -0
  105. package/package.json +13 -13
  106. package/dist/tsdoc-metadata.json +0 -11
  107. package/lib/components/Dialog/useDialogStyles.js +0 -41
  108. package/lib/components/Dialog/useDialogStyles.js.map +0 -1
  109. package/lib/utils/isTargetDisabled.js +0 -14
  110. package/lib/utils/isTargetDisabled.js.map +0 -1
  111. package/lib/utils/localShorthands.js +0 -9
  112. package/lib/utils/localShorthands.js.map +0 -1
  113. package/lib/utils/normalizeDefaultPrevented.js +0 -11
  114. package/lib/utils/normalizeDefaultPrevented.js.map +0 -1
  115. package/lib-commonjs/components/Dialog/useDialogStyles.js +0 -53
  116. package/lib-commonjs/components/Dialog/useDialogStyles.js.map +0 -1
  117. package/lib-commonjs/utils/isTargetDisabled.js +0 -23
  118. package/lib-commonjs/utils/isTargetDisabled.js.map +0 -1
  119. package/lib-commonjs/utils/localShorthands.js +0 -18
  120. package/lib-commonjs/utils/localShorthands.js.map +0 -1
  121. package/lib-commonjs/utils/normalizeDefaultPrevented.js +0 -20
  122. package/lib-commonjs/utils/normalizeDefaultPrevented.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,156 @@
2
2
  "name": "@fluentui/react-dialog",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 03 Aug 2022 16:00:14 GMT",
5
+ "date": "Thu, 15 Sep 2022 09:44:20 GMT",
6
+ "tag": "@fluentui/react-dialog_v9.0.0-beta.8",
7
+ "version": "9.0.0-beta.8",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-dialog",
13
+ "commit": "0547583ebcebe746110e5ef8d0599b0972b1f4c6",
14
+ "comment": "chore(react-dialog): Updates trigger to use useARIAButtonProps"
15
+ },
16
+ {
17
+ "author": "olfedias@microsoft.com",
18
+ "package": "@fluentui/react-dialog",
19
+ "commit": "e610024474cfe5d45f61501a8b6a21daf4c794a2",
20
+ "comment": "chore: Update Griffel to latest version"
21
+ },
22
+ {
23
+ "author": "bernardo.sunderhus@gmail.com",
24
+ "package": "@fluentui/react-dialog",
25
+ "commit": "827dffa4e4a164682c29b157b572ceb63c5dd6a9",
26
+ "comment": "chore(react-dialog): removes react-button max-width overrides"
27
+ },
28
+ {
29
+ "author": "bernardo.sunderhus@gmail.com",
30
+ "package": "@fluentui/react-dialog",
31
+ "commit": "7b46e969e352bd636f7094ac5e29177fb7e8bff2",
32
+ "comment": "feat: add scroll lock feature to Dialog"
33
+ },
34
+ {
35
+ "author": "bernardo.sunderhus@gmail.com",
36
+ "package": "@fluentui/react-dialog",
37
+ "commit": "b02e8f3ab48daf6b9db7f7efebbf026c6cbed740",
38
+ "comment": "feat(react-dialog): moves backdrop slot from Dialog to DialogSurface"
39
+ },
40
+ {
41
+ "author": "bernardo.sunderhus@gmail.com",
42
+ "package": "@fluentui/react-dialog",
43
+ "commit": "9c10bc432b8fc8df6d51975c580a19603a10fd1e",
44
+ "comment": "feat(react-dialog): adds proper style to make DialogBody responsive"
45
+ },
46
+ {
47
+ "author": "bernardo.sunderhus@gmail.com",
48
+ "package": "@fluentui/react-dialog",
49
+ "commit": "c9a58334a7abebf949f59d2c0a4bb1271074d808",
50
+ "comment": "chore: renames overlay slot to backdrop"
51
+ },
52
+ {
53
+ "author": "bernardo.sunderhus@gmail.com",
54
+ "package": "@fluentui/react-dialog",
55
+ "commit": "6c6fe4c8246abec30d9cd3ba2079d379c4d7acb8",
56
+ "comment": "bugfix: stops propagation on Escape key"
57
+ },
58
+ {
59
+ "author": "bernardo.sunderhus@gmail.com",
60
+ "package": "@fluentui/react-dialog",
61
+ "commit": "2630091d8093879d26c38dc6a4c585e886cff057",
62
+ "comment": "feat: Adds padding-right style to avoid jumping on scroll lock"
63
+ },
64
+ {
65
+ "author": "bernardo.sunderhus@gmail.com",
66
+ "package": "@fluentui/react-dialog",
67
+ "commit": "94ab82dd00db0bf177908e7ccc60125efaa4e22d",
68
+ "comment": "chore(react-dialog): removes document listener to Escape keydown"
69
+ },
70
+ {
71
+ "author": "bernardo.sunderhus@gmail.com",
72
+ "package": "@fluentui/react-dialog",
73
+ "commit": "0865ee92c7cab7273aafd21b1b3dff9418c0d479",
74
+ "comment": "feat(react-dialog): replace `closeButton` to a more generic `action` slot"
75
+ },
76
+ {
77
+ "author": "bernardo.sunderhus@gmail.com",
78
+ "package": "@fluentui/react-dialog",
79
+ "commit": "fd88d8b10fe32eb635c949aa28653c3376f64c3d",
80
+ "comment": "feat(react-dialog): 1st rule of ARIA for Dialog"
81
+ },
82
+ {
83
+ "author": "beachball",
84
+ "package": "@fluentui/react-dialog",
85
+ "comment": "Bump @fluentui/react-utilities to v9.1.0",
86
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
87
+ },
88
+ {
89
+ "author": "beachball",
90
+ "package": "@fluentui/react-dialog",
91
+ "comment": "Bump @fluentui/react-context-selector to v9.0.3",
92
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
93
+ },
94
+ {
95
+ "author": "beachball",
96
+ "package": "@fluentui/react-dialog",
97
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.1",
98
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
99
+ },
100
+ {
101
+ "author": "beachball",
102
+ "package": "@fluentui/react-dialog",
103
+ "comment": "Bump @fluentui/react-aria to v9.2.0",
104
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
105
+ },
106
+ {
107
+ "author": "beachball",
108
+ "package": "@fluentui/react-dialog",
109
+ "comment": "Bump @fluentui/react-tabster to v9.1.1",
110
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
111
+ },
112
+ {
113
+ "author": "beachball",
114
+ "package": "@fluentui/react-dialog",
115
+ "comment": "Bump @fluentui/react-theme to v9.1.0",
116
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
117
+ },
118
+ {
119
+ "author": "beachball",
120
+ "package": "@fluentui/react-dialog",
121
+ "comment": "Bump @fluentui/react-portal to v9.0.5",
122
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
123
+ },
124
+ {
125
+ "author": "beachball",
126
+ "package": "@fluentui/react-dialog",
127
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.13",
128
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
129
+ }
130
+ ],
131
+ "none": [
132
+ {
133
+ "author": "martinhochel@microsoft.com",
134
+ "package": "@fluentui/react-dialog",
135
+ "commit": "e6cf183695d6d67a24e038c49a876224e5ed35e5",
136
+ "comment": "chore: update package scaffold"
137
+ },
138
+ {
139
+ "author": "bernardo.sunderhus@gmail.com",
140
+ "package": "@fluentui/react-dialog",
141
+ "commit": "5cd0e8dbc07b0a71ab0a48813cdcbbbd37a222e1",
142
+ "comment": "chore: remove localShorthands in favor of griffel shorthands"
143
+ },
144
+ {
145
+ "author": "martinhochel@microsoft.com",
146
+ "package": "@fluentui/react-dialog",
147
+ "commit": "ba9444d594f3a960cc590eae5237c08bf7c5a07f",
148
+ "comment": "chore: consume cypress.config from it's package boundary"
149
+ }
150
+ ]
151
+ }
152
+ },
153
+ {
154
+ "date": "Wed, 03 Aug 2022 16:03:47 GMT",
6
155
  "tag": "@fluentui/react-dialog_v9.0.0-beta.7",
7
156
  "version": "9.0.0-beta.7",
8
157
  "comments": {
@@ -23,25 +172,25 @@
23
172
  "author": "beachball",
24
173
  "package": "@fluentui/react-dialog",
25
174
  "comment": "Bump @fluentui/react-aria to v9.1.0",
26
- "commit": "54bc6105c5c9c9023da35d4670239e44117ed4a5"
175
+ "commit": "ee4a8be0d0831a6615f878f98db6a97cc61a802d"
27
176
  },
28
177
  {
29
178
  "author": "beachball",
30
179
  "package": "@fluentui/react-dialog",
31
180
  "comment": "Bump @fluentui/react-tabster to v9.1.0",
32
- "commit": "54bc6105c5c9c9023da35d4670239e44117ed4a5"
181
+ "commit": "ee4a8be0d0831a6615f878f98db6a97cc61a802d"
33
182
  },
34
183
  {
35
184
  "author": "beachball",
36
185
  "package": "@fluentui/react-dialog",
37
186
  "comment": "Bump @fluentui/react-portal to v9.0.4",
38
- "commit": "54bc6105c5c9c9023da35d4670239e44117ed4a5"
187
+ "commit": "ee4a8be0d0831a6615f878f98db6a97cc61a802d"
39
188
  },
40
189
  {
41
190
  "author": "beachball",
42
191
  "package": "@fluentui/react-dialog",
43
192
  "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.12",
44
- "commit": "54bc6105c5c9c9023da35d4670239e44117ed4a5"
193
+ "commit": "ee4a8be0d0831a6615f878f98db6a97cc61a802d"
45
194
  }
46
195
  ],
47
196
  "none": [
package/CHANGELOG.md CHANGED
@@ -1,22 +1,50 @@
1
1
  # Change Log - @fluentui/react-dialog
2
2
 
3
- This log was last generated on Wed, 03 Aug 2022 16:00:14 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 15 Sep 2022 09:44:20 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-beta.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.0.0-beta.8)
8
+
9
+ Thu, 15 Sep 2022 09:44:20 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.0.0-beta.7..@fluentui/react-dialog_v9.0.0-beta.8)
11
+
12
+ ### Changes
13
+
14
+ - chore(react-dialog): Updates trigger to use useARIAButtonProps ([PR #24177](https://github.com/microsoft/fluentui/pull/24177) by bernardo.sunderhus@gmail.com)
15
+ - chore: Update Griffel to latest version ([PR #24221](https://github.com/microsoft/fluentui/pull/24221) by olfedias@microsoft.com)
16
+ - chore(react-dialog): removes react-button max-width overrides ([PR #24674](https://github.com/microsoft/fluentui/pull/24674) by bernardo.sunderhus@gmail.com)
17
+ - feat: add scroll lock feature to Dialog ([PR #24375](https://github.com/microsoft/fluentui/pull/24375) by bernardo.sunderhus@gmail.com)
18
+ - feat(react-dialog): moves backdrop slot from Dialog to DialogSurface ([PR #24669](https://github.com/microsoft/fluentui/pull/24669) by bernardo.sunderhus@gmail.com)
19
+ - feat(react-dialog): adds proper style to make DialogBody responsive ([PR #24354](https://github.com/microsoft/fluentui/pull/24354) by bernardo.sunderhus@gmail.com)
20
+ - chore: renames overlay slot to backdrop ([PR #24220](https://github.com/microsoft/fluentui/pull/24220) by bernardo.sunderhus@gmail.com)
21
+ - bugfix: stops propagation on Escape key ([PR #24750](https://github.com/microsoft/fluentui/pull/24750) by bernardo.sunderhus@gmail.com)
22
+ - feat: Adds padding-right style to avoid jumping on scroll lock ([PR #24408](https://github.com/microsoft/fluentui/pull/24408) by bernardo.sunderhus@gmail.com)
23
+ - chore(react-dialog): removes document listener to Escape keydown ([PR #24668](https://github.com/microsoft/fluentui/pull/24668) by bernardo.sunderhus@gmail.com)
24
+ - feat(react-dialog): replace `closeButton` to a more generic `action` slot ([PR #24719](https://github.com/microsoft/fluentui/pull/24719) by bernardo.sunderhus@gmail.com)
25
+ - feat(react-dialog): 1st rule of ARIA for Dialog ([PR #24525](https://github.com/microsoft/fluentui/pull/24525) by bernardo.sunderhus@gmail.com)
26
+ - Bump @fluentui/react-utilities to v9.1.0 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
27
+ - Bump @fluentui/react-context-selector to v9.0.3 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
28
+ - Bump @fluentui/react-shared-contexts to v9.0.1 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
29
+ - Bump @fluentui/react-aria to v9.2.0 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
30
+ - Bump @fluentui/react-tabster to v9.1.1 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
31
+ - Bump @fluentui/react-theme to v9.1.0 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
32
+ - Bump @fluentui/react-portal to v9.0.5 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
33
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.13 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
34
+
7
35
  ## [9.0.0-beta.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.0.0-beta.7)
8
36
 
9
- Wed, 03 Aug 2022 16:00:14 GMT
37
+ Wed, 03 Aug 2022 16:03:47 GMT
10
38
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.0.0-beta.6..@fluentui/react-dialog_v9.0.0-beta.7)
11
39
 
12
40
  ### Changes
13
41
 
14
42
  - chore: adds aria-labelledby and aria-describedby attributes ([PR #24141](https://github.com/microsoft/fluentui/pull/24141) by bernardo.sunderhus@gmail.com)
15
43
  - feat: adds react-dialog to react-components unstable ([PR #24140](https://github.com/microsoft/fluentui/pull/24140) by bernardo.sunderhus@gmail.com)
16
- - Bump @fluentui/react-aria to v9.1.0 ([PR #24201](https://github.com/microsoft/fluentui/pull/24201) by beachball)
17
- - Bump @fluentui/react-tabster to v9.1.0 ([PR #24201](https://github.com/microsoft/fluentui/pull/24201) by beachball)
18
- - Bump @fluentui/react-portal to v9.0.4 ([PR #24201](https://github.com/microsoft/fluentui/pull/24201) by beachball)
19
- - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.12 ([PR #24201](https://github.com/microsoft/fluentui/pull/24201) by beachball)
44
+ - Bump @fluentui/react-aria to v9.1.0 ([PR #24131](https://github.com/microsoft/fluentui/pull/24131) by beachball)
45
+ - Bump @fluentui/react-tabster to v9.1.0 ([PR #24131](https://github.com/microsoft/fluentui/pull/24131) by beachball)
46
+ - Bump @fluentui/react-portal to v9.0.4 ([PR #24131](https://github.com/microsoft/fluentui/pull/24131) by beachball)
47
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.12 ([PR #24131](https://github.com/microsoft/fluentui/pull/24131) by beachball)
20
48
 
21
49
  ## [9.0.0-beta.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.0.0-beta.6)
22
50
 
package/Spec.md CHANGED
@@ -83,19 +83,7 @@ Sample usages will be give in the following section of this document [Sample cod
83
83
  The root level component serves as an interface for interaction with all possible behaviors exposed. It provides context down the hierarchy to `children` compound components to allow functionality. This component expects to receive as children either a `DialogSurface` or a `DialogTrigger` and a `DialogSurface` (or some component that will eventually render one of those compound components) in this specific order
84
84
 
85
85
  ```tsx
86
- type DialogSlots = {
87
- /**
88
- * Dimmed background of dialog.
89
- * The default overlay is rendered as a `<div>` with styling.
90
- * This slot expects a `<div>` element which will replace the default overlay.
91
- * The overlay should have `aria-hidden="true"`.
92
- */
93
- overlay?: Slot<'div'>;
94
- /**
95
- * The root element of the Dialog right after Portal.
96
- */
97
- root: Slot<'div'>;
98
- };
86
+ type DialogSlots = {};
99
87
 
100
88
  type DialogProps = ComponentProps<DialogSlots> & {
101
89
  /**
@@ -131,7 +119,7 @@ type DialogOpenChangeData = {
131
119
  /**
132
120
  * The event source of the callback invocation
133
121
  */
134
- type: 'escapeKeyDown' | 'overlayClick' | 'triggerClick';
122
+ type: 'escapeKeyDown' | 'backdropClick' | 'triggerClick';
135
123
  /**
136
124
  * The next value for the internal state of the dialog
137
125
  */
@@ -167,19 +155,26 @@ export type DialogTriggerProps = {
167
155
  The `DialogSurface` component represents the visual part of a `Dialog` as a whole, it contains everything that should be visible.
168
156
 
169
157
  ```tsx
170
- type DialogTitleSlots = {
158
+ type DialogSurfaceSlots = {
171
159
  /**
172
- * By default this is a div.
160
+ * Dimmed background of dialog.
161
+ * The default backdrop is rendered as a `<div>` with styling.
162
+ * This slot expects a `<div>` element which will replace the default backdrop.
163
+ * The backdrop should have `aria-hidden="true"`.
164
+ *
165
+ * By default if `DialogSurface` is `<dialog>` element the backdrop is ignored,
166
+ * since native `<dialog>` element supports [::backdrop](https://developer.mozilla.org/en-US/docs/Web/CSS/::backdrop)
173
167
  */
174
- root: Slot<'div', 'main'>;
168
+ backdrop?: Slot<'div'>;
169
+ root: NonNullable<Slot<'dialog', 'div'>>;
175
170
  };
176
171
 
177
- type DialogTitleProps = ComponentProps<DialogTitleSlots>;
172
+ type DialogTitleProps = ComponentProps<DialogSurfaceSlots>;
178
173
  ```
179
174
 
180
175
  ### DialogTitle
181
176
 
182
- The DialogTitle component will expect to have a dialog title/header and will show the close (X icon) button if specified so. Apart from styling and presenting `closeButton`, this component does not have other behavior.
177
+ The `DialogTitle` component expects to have a title/header and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.
183
178
 
184
179
  ```tsx
185
180
  type DialogTitleSlots = {
@@ -187,7 +182,10 @@ type DialogTitleSlots = {
187
182
  * By default this is a div, but can be a heading.
188
183
  */
189
184
  root: Slot<'div', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;
190
- closeButton?: Slot<'button'>;
185
+ /**
186
+ * By default a Dialog with modalType='non-modal' will have a close button action
187
+ */
188
+ action?: Slot<'div'>;
191
189
  };
192
190
 
193
191
  type DialogTitleProps = ComponentProps<DialogTitleSlots>;
@@ -238,7 +236,7 @@ const dialog = <Dialog>
238
236
  <!-- expected DOM output -->
239
237
  <button aria-haspopup="true" class="fui-button">Open Dialog</button>
240
238
  <!-- ... portal ... -->
241
- <div aria-hidden="true" class="fui-dialog-overlay"></div>
239
+ <div aria-hidden="true" class="fui-dialog-backdrop"></div>
242
240
  <div aria-modal="true" role="dialog" class="fui-dialog-content">This is as basic as it gets</div>
243
241
  ```
244
242
 
@@ -271,7 +269,7 @@ const dialog = <Dialog type="alert">
271
269
  ```html
272
270
  <button aria-haspopup="true" class="fui-button">Open Dialog</button>
273
271
  <!-- ... portal ... -->
274
- <div aria-hidden="true" class="fui-dialog-overlay"></div>
272
+ <div aria-hidden="true" class="fui-dialog-backdrop"></div>
275
273
  <div
276
274
  aria-describedby="fui-dialog-body-id"
277
275
  aria-labelledby="fui-dialog-title-id"
@@ -281,7 +279,7 @@ const dialog = <Dialog type="alert">
281
279
  >
282
280
  <div id="fui-dialog-title-id" class="fui-dialog-title">
283
281
  <span>Title</span>
284
- <!-- closeButton -->
282
+ <!-- action -->
285
283
  </div>
286
284
  <div id="fui-dialog-body-id" class="fui-dialog-body">This is going to be inside the dialog</div>
287
285
  <div class="fui-dialog-actions">
@@ -333,7 +331,7 @@ const CustomDialog = () => {
333
331
  ```html
334
332
  <button aria-haspopup="true" class="fui-button">Open Dialog</button>
335
333
  <!-- ... portal ... -->
336
- <div aria-hidden="true" class="fui-dialog-overlay"></div>
334
+ <div aria-hidden="true" class="fui-dialog-backdrop"></div>
337
335
  <div
338
336
  aria-describedby="fui-dialog-body-id"
339
337
  aria-labelledby="fui-dialog-title-id"
@@ -343,7 +341,7 @@ const CustomDialog = () => {
343
341
  >
344
342
  <div id="fui-dialog-title-id" class="fui-dialog-title">
345
343
  <span>Title</span>
346
- <!-- closeButton -->
344
+ <!-- action -->
347
345
  </div>
348
346
  <div id="fui-dialog-body-id" class="fui-dialog-body">This is going to be inside the dialog</div>
349
347
  <div class="fui-dialog-actions">
@@ -402,6 +400,27 @@ function AsyncConfirmDialog() {
402
400
  }
403
401
  ```
404
402
 
403
+ ### Opting out of native `<dialog>`
404
+
405
+ ```tsx
406
+ const dialog = <Dialog>
407
+ <DialogTrigger>
408
+ <Button>Open Dialog</Button>
409
+ <DialogTrigger>
410
+ <DialogSurface as="div">
411
+ This is as basic as it gets.
412
+ </DialogSurface>
413
+ </Dialog>
414
+ ```
415
+
416
+ ```html
417
+ <!-- expected DOM output -->
418
+ <button aria-haspopup="true" class="fui-button">Open Dialog</button>
419
+ <!-- ... portal ... -->
420
+ <div aria-hidden="true" class="fui-dialog-backdrop"></div>
421
+ <div aria-modal="true" role="dialog" class="fui-dialog-content">This is as basic as it gets</div>
422
+ ```
423
+
405
424
  ## Migration
406
425
 
407
426
  _TBA: Link to migration guide doc_
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
 
3
- import { ARIAButtonSlotProps } from '@fluentui/react-aria';
3
+ import { ARIAButtonResultProps } from '@fluentui/react-aria';
4
+ import { ARIAButtonType } from '@fluentui/react-aria';
4
5
  import type { ComponentProps } from '@fluentui/react-utilities';
5
6
  import type { ComponentState } from '@fluentui/react-utilities';
6
7
  import type { FluentTriggerComponent } from '@fluentui/react-utilities';
@@ -74,19 +75,13 @@ export declare type DialogBodySlots = {
74
75
  */
75
76
  export declare type DialogBodyState = ComponentState<DialogBodySlots>;
76
77
 
77
- export declare const dialogClassNames: SlotClassNames<DialogSlots>;
78
-
79
78
  declare type DialogContextValue = {
80
- /**
81
- * Reference to trigger element that opened the Dialog
82
- * null if Dialog is closed
83
- */
84
- triggerRef: React_2.RefObject<HTMLElement>;
85
- contentRef: React_2.RefObject<HTMLElement>;
86
- modalType: DialogModalType;
87
- dialogTitleID?: string;
88
- dialogBodyID?: string;
89
79
  open: boolean;
80
+ dialogBodyID?: string;
81
+ dialogTitleID?: string;
82
+ isNestedDialog: boolean;
83
+ dialogRef: React_2.Ref<DialogSurfaceElement>;
84
+ modalType: DialogModalType;
90
85
  /**
91
86
  * Requests dialog main component to update it's internal open state
92
87
  */
@@ -105,28 +100,35 @@ declare type DialogContextValues = {
105
100
  declare type DialogModalType = 'modal' | 'non-modal' | 'alert';
106
101
 
107
102
  export declare type DialogOpenChangeData = {
108
- type: 'escapeKeyDown';
103
+ /**
104
+ * triggered when Escape key is pressed in a native `dialog`
105
+ */
106
+ type: 'dialogCancel';
109
107
  open: boolean;
110
- event: React_2.KeyboardEvent;
111
- }
112
- /**
113
- * document escape keydown defers from internal escape keydown events because of the synthetic event API
114
- */
115
- | {
116
- type: 'documentEscapeKeyDown';
108
+ event: React_2.SyntheticEvent<DialogSurfaceElement>;
109
+ } | {
110
+ type: 'escapeKeyDown';
117
111
  open: boolean;
118
- event: KeyboardEvent;
112
+ event: React_2.KeyboardEvent<DialogSurfaceElement>;
119
113
  } | {
120
- type: 'overlayClick';
114
+ type: 'backdropClick';
121
115
  open: boolean;
122
- event: React_2.MouseEvent;
116
+ event: React_2.MouseEvent<DialogSurfaceElement>;
123
117
  } | {
124
118
  type: 'triggerClick';
125
119
  open: boolean;
126
- event: React_2.MouseEvent;
120
+ event: React_2.MouseEvent<DialogSurfaceElement>;
127
121
  };
128
122
 
129
- export declare type DialogOpenChangeEvent = React_2.KeyboardEvent | React_2.MouseEvent | KeyboardEvent;
123
+ export declare type DialogOpenChangeEvent = DialogOpenChangeData['event'];
124
+
125
+ /**
126
+ * Callback fired when the component changes value from open state.
127
+ *
128
+ * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`
129
+ * @param data - A data object with relevant information, such as open value and type
130
+ */
131
+ export declare type DialogOpenChangeEventHandler = (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;
130
132
 
131
133
  export declare type DialogProps = ComponentProps<Partial<DialogSlots>> & {
132
134
  /**
@@ -158,13 +160,7 @@ export declare type DialogProps = ComponentProps<Partial<DialogSlots>> & {
158
160
  * @default false
159
161
  */
160
162
  defaultOpen?: boolean;
161
- /**
162
- * Callback fired when the component changes value from open state.
163
- *
164
- * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`
165
- * @param data - A data object with relevant information, such as open value and type
166
- */
167
- onOpenChange?: (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;
163
+ onOpenChange?: DialogOpenChangeEventHandler;
168
164
  /**
169
165
  * Can contain two children including {@link DialogTrigger} and {@link DialogSurface}.
170
166
  * Alternatively can only contain {@link DialogSurface} if using trigger outside dialog, or controlling state.
@@ -172,15 +168,7 @@ export declare type DialogProps = ComponentProps<Partial<DialogSlots>> & {
172
168
  children: [JSX.Element, JSX.Element] | JSX.Element;
173
169
  };
174
170
 
175
- export declare type DialogSlots = {
176
- /**
177
- * Dimmed background of dialog.
178
- * The default overlay is rendered as a `<div>` with styling.
179
- * This slot expects a `<div>` element which will replace the default overlay.
180
- * The overlay should have `aria-hidden="true"`.
181
- */
182
- overlay?: Slot<'div'>;
183
- };
171
+ export declare type DialogSlots = {};
184
172
 
185
173
  export declare type DialogState = ComponentState<DialogSlots> & DialogContextValue & {
186
174
  content: React_2.ReactNode;
@@ -201,13 +189,29 @@ declare type DialogSurfaceContextValues = {
201
189
  dialogSurface: DialogSurfaceContextValue;
202
190
  };
203
191
 
192
+ /** @internal */
193
+ declare type DialogSurfaceElement = HTMLDialogElement | HTMLDivElement;
194
+
204
195
  /**
205
196
  * DialogSurface Props
197
+ *
198
+ * Omits basic types from native `dialog` (`open`, `onCancel` and `onClose`)
199
+ * to ensure `onOpenChange`, `open` and `defaultOpen` from `Dialog` is used instead
206
200
  */
207
- export declare type DialogSurfaceProps = ComponentProps<DialogSurfaceSlots> & {};
201
+ export declare type DialogSurfaceProps = Omit<ComponentProps<DialogSurfaceSlots>, 'open' | 'onCancel' | 'onClose'>;
208
202
 
209
203
  export declare type DialogSurfaceSlots = {
210
- root: Slot<'div', 'main'>;
204
+ /**
205
+ * Dimmed background of dialog.
206
+ * The default backdrop is rendered as a `<div>` with styling.
207
+ * This slot expects a `<div>` element which will replace the default backdrop.
208
+ * The backdrop should have `aria-hidden="true"`.
209
+ *
210
+ * By default if `DialogSurface` is `<dialog>` element the backdrop is ignored,
211
+ * since native `<dialog>` element supports [::backdrop](https://developer.mozilla.org/en-US/docs/Web/CSS/::backdrop)
212
+ */
213
+ backdrop?: Slot<'div'>;
214
+ root: NonNullable<Slot<'dialog', 'div'>>;
211
215
  };
212
216
 
213
217
  /**
@@ -216,9 +220,8 @@ export declare type DialogSurfaceSlots = {
216
220
  export declare type DialogSurfaceState = ComponentState<DialogSurfaceSlots>;
217
221
 
218
222
  /**
219
- * The `DialogTitle` component will expect to have a dialog title/header
220
- * and will show the close (X icon) button if specified so.
221
- * Apart from styling and presenting `closeButton`, this component does not have other behavior.
223
+ * The `DialogTitle` component expects to have a title/header
224
+ * and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.
222
225
  */
223
226
  export declare const DialogTitle: ForwardRefComponent<DialogTitleProps>;
224
227
 
@@ -234,7 +237,10 @@ export declare type DialogTitleSlots = {
234
237
  * By default this is a div, but can be a heading.
235
238
  */
236
239
  root: Slot<'div', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;
237
- closeButton?: Slot<ARIAButtonSlotProps>;
240
+ /**
241
+ * By default a Dialog with modalType='non-modal' will have a close button action
242
+ */
243
+ action?: Slot<'div'>;
238
244
  };
239
245
 
240
246
  /**
@@ -259,9 +265,10 @@ export declare type DialogTriggerAction = 'open' | 'close';
259
265
  /**
260
266
  * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog
261
267
  */
262
- export declare type DialogTriggerChildProps = Pick<React_2.HTMLAttributes<HTMLElement>, 'onClick' | 'onKeyDown' | 'aria-haspopup'> & {
263
- ref?: React_2.Ref<never>;
264
- };
268
+ export declare type DialogTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<Type, Props & {
269
+ ref: React_2.Ref<unknown>;
270
+ 'aria-haspopup'?: 'dialog';
271
+ }>;
265
272
 
266
273
  export declare type DialogTriggerProps = {
267
274
  /**
@@ -275,9 +282,7 @@ export declare type DialogTriggerProps = {
275
282
  * Explicitly require single child or render function
276
283
  * to inject properties
277
284
  */
278
- children: (React_2.ReactElement & {
279
- ref?: React_2.Ref<unknown>;
280
- }) | ((props: DialogTriggerChildProps) => React_2.ReactElement | null);
285
+ children: React_2.ReactElement | ((props: DialogTriggerChildProps) => React_2.ReactElement | null);
281
286
  };
282
287
 
283
288
  export declare type DialogTriggerState = {
@@ -358,11 +363,6 @@ export declare const useDialogBody_unstable: (props: DialogBodyProps, ref: React
358
363
  */
359
364
  export declare const useDialogBodyStyles_unstable: (state: DialogBodyState) => DialogBodyState;
360
365
 
361
- /**
362
- * Apply styling to the Dialog slots based on the state
363
- */
364
- export declare const useDialogStyles_unstable: (state: DialogState) => DialogState;
365
-
366
366
  /**
367
367
  * Create the state required to render DialogSurface.
368
368
  *
@@ -372,7 +372,7 @@ export declare const useDialogStyles_unstable: (state: DialogState) => DialogSta
372
372
  * @param props - props from this instance of DialogSurface
373
373
  * @param ref - reference to root HTMLElement of DialogSurface
374
374
  */
375
- export declare const useDialogSurface_unstable: (props: DialogSurfaceProps, ref: React_2.Ref<HTMLElement>) => DialogSurfaceState;
375
+ export declare const useDialogSurface_unstable: (props: DialogSurfaceProps, ref: React_2.Ref<DialogSurfaceElement>) => DialogSurfaceState;
376
376
 
377
377
  /**
378
378
  * Apply styling to the DialogSurface slots based on the state
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useDialog_unstable } from './useDialog';
3
3
  import { renderDialog_unstable } from './renderDialog';
4
- import { useDialogStyles_unstable } from './useDialogStyles';
5
4
  import { useDialogContextValues_unstable } from './useDialogContextValues';
6
5
  /**
7
6
  * The `Dialog` root level component serves as an interface for interaction with all possible behaviors exposed.
@@ -14,7 +13,6 @@ import { useDialogContextValues_unstable } from './useDialogContextValues';
14
13
  export const Dialog = /*#__PURE__*/React.memo(props => {
15
14
  const state = useDialog_unstable(props);
16
15
  const contextValues = useDialogContextValues_unstable(state);
17
- useDialogStyles_unstable(state);
18
16
  return renderDialog_unstable(state, contextValues);
19
17
  });
20
18
  Dialog.displayName = 'Dialog';
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,aAAnC;AACA,SAAS,qBAAT,QAAsC,gBAAtC;AACA,SAAS,wBAAT,QAAyC,mBAAzC;AAEA,SAAS,+BAAT,QAAgD,0BAAhD;AAEA;;;;;;AAMG;;AACH,OAAO,MAAM,MAAM,gBAA0B,KAAK,CAAC,IAAN,CAAW,KAAK,IAAG;EAC9D,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAD,CAAhC;EACA,MAAM,aAAa,GAAG,+BAA+B,CAAC,KAAD,CAArD;EAEA,wBAAwB,CAAC,KAAD,CAAxB;EACA,OAAO,qBAAqB,CAAC,KAAD,EAAQ,aAAR,CAA5B;AACD,CAN4C,CAAtC;AAQP,MAAM,CAAC,WAAP,GAAqB,QAArB","sourcesContent":["import * as React from 'react';\nimport { useDialog_unstable } from './useDialog';\nimport { renderDialog_unstable } from './renderDialog';\nimport { useDialogStyles_unstable } from './useDialogStyles';\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 useDialogStyles_unstable(state);\n return renderDialog_unstable(state, contextValues);\n});\n\nDialog.displayName = 'Dialog';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,aAAnC;AACA,SAAS,qBAAT,QAAsC,gBAAtC;AAEA,SAAS,+BAAT,QAAgD,0BAAhD;AAEA;;;;;;AAMG;;AACH,OAAO,MAAM,MAAM,gBAA0B,KAAK,CAAC,IAAN,CAAW,KAAK,IAAG;EAC9D,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAD,CAAhC;EACA,MAAM,aAAa,GAAG,+BAA+B,CAAC,KAAD,CAArD;EAEA,OAAO,qBAAqB,CAAC,KAAD,EAAQ,aAAR,CAA5B;AACD,CAL4C,CAAtC;AAOP,MAAM,CAAC,WAAP,GAAqB,QAArB","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"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.types.js","sourceRoot":"../src/","sources":["components/Dialog/Dialog.types.ts"],"names":[],"mappings":"","sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\n\nexport type DialogSlots = {\n /**\n * Dimmed background of dialog.\n * The default overlay is rendered as a `<div>` with styling.\n * This slot expects a `<div>` element which will replace the default overlay.\n * The overlay should have `aria-hidden=\"true\"`.\n */\n overlay?: Slot<'div'>;\n};\n\nexport type DialogOpenChangeEvent = React.KeyboardEvent | React.MouseEvent | KeyboardEvent;\n\nexport type DialogOpenChangeData =\n | { type: 'escapeKeyDown'; open: boolean; event: React.KeyboardEvent }\n /**\n * document escape keydown defers from internal escape keydown events because of the synthetic event API\n */\n | { type: 'documentEscapeKeyDown'; open: boolean; event: KeyboardEvent }\n | { type: 'overlayClick'; open: boolean; event: React.MouseEvent }\n | { type: 'triggerClick'; open: boolean; event: React.MouseEvent };\n\nexport type DialogModalType = 'modal' | 'non-modal' | 'alert';\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, such as open value and type\n */\n onOpenChange?: (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;\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\nexport type DialogState = ComponentState<DialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"]}
1
+ {"version":3,"file":"Dialog.types.js","sourceRoot":"../src/","sources":["components/Dialog/Dialog.types.ts"],"names":[],"mappings":"","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 /**\n * triggered when Escape key is pressed in a native `dialog`\n */\n type: 'dialogCancel';\n open: boolean;\n event: React.SyntheticEvent<DialogSurfaceElement>;\n }\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, such as open value and type\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 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\nexport type DialogState = ComponentState<DialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"]}