@fluentui/react-dialog 9.1.0 → 9.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/CHANGELOG.json +137 -1
  2. package/CHANGELOG.md +35 -2
  3. package/dist/index.d.ts +0 -8
  4. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  5. package/lib/components/Dialog/useDialog.js +0 -1
  6. package/lib/components/Dialog/useDialog.js.map +1 -1
  7. package/lib/components/Dialog/useDialogContextValues.js +0 -2
  8. package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
  9. package/lib/components/DialogContent/useDialogContent.js +0 -3
  10. package/lib/components/DialogContent/useDialogContent.js.map +1 -1
  11. package/lib/components/DialogSurface/useDialogSurface.js +0 -2
  12. package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
  13. package/lib/components/DialogTrigger/useDialogTrigger.js +2 -1
  14. package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  15. package/lib/contexts/dialogContext.js.map +1 -1
  16. package/lib-amd/Dialog.js +6 -0
  17. package/lib-amd/Dialog.js.map +1 -0
  18. package/lib-amd/DialogActions.js +6 -0
  19. package/lib-amd/DialogActions.js.map +1 -0
  20. package/lib-amd/DialogBody.js +6 -0
  21. package/lib-amd/DialogBody.js.map +1 -0
  22. package/lib-amd/DialogContent.js +6 -0
  23. package/lib-amd/DialogContent.js.map +1 -0
  24. package/lib-amd/DialogSurface.js +6 -0
  25. package/lib-amd/DialogSurface.js.map +1 -0
  26. package/lib-amd/DialogTitle.js +6 -0
  27. package/lib-amd/DialogTitle.js.map +1 -0
  28. package/lib-amd/DialogTrigger.js +6 -0
  29. package/lib-amd/DialogTrigger.js.map +1 -0
  30. package/lib-amd/components/Dialog/Dialog.js +19 -0
  31. package/lib-amd/components/Dialog/Dialog.js.map +1 -0
  32. package/lib-amd/components/Dialog/Dialog.types.js +5 -0
  33. package/lib-amd/components/Dialog/Dialog.types.js.map +1 -0
  34. package/lib-amd/components/Dialog/index.js +9 -0
  35. package/lib-amd/components/Dialog/index.js.map +1 -0
  36. package/lib-amd/components/Dialog/renderDialog.js +17 -0
  37. package/lib-amd/components/Dialog/renderDialog.js.map +1 -0
  38. package/lib-amd/components/Dialog/useDialog.js +77 -0
  39. package/lib-amd/components/Dialog/useDialog.js.map +1 -0
  40. package/lib-amd/components/Dialog/useDialogContextValues.js +24 -0
  41. package/lib-amd/components/Dialog/useDialogContextValues.js.map +1 -0
  42. package/lib-amd/components/DialogActions/DialogActions.js +16 -0
  43. package/lib-amd/components/DialogActions/DialogActions.js.map +1 -0
  44. package/lib-amd/components/DialogActions/DialogActions.types.js +5 -0
  45. package/lib-amd/components/DialogActions/DialogActions.types.js.map +1 -0
  46. package/lib-amd/components/DialogActions/index.js +10 -0
  47. package/lib-amd/components/DialogActions/index.js.map +1 -0
  48. package/lib-amd/components/DialogActions/renderDialogActions.js +15 -0
  49. package/lib-amd/components/DialogActions/renderDialogActions.js.map +1 -0
  50. package/lib-amd/components/DialogActions/useDialogActions.js +26 -0
  51. package/lib-amd/components/DialogActions/useDialogActions.js.map +1 -0
  52. package/lib-amd/components/DialogActions/useDialogActionsStyles.js +27 -0
  53. package/lib-amd/components/DialogActions/useDialogActionsStyles.js.map +1 -0
  54. package/lib-amd/components/DialogBody/DialogBody.js +16 -0
  55. package/lib-amd/components/DialogBody/DialogBody.js.map +1 -0
  56. package/lib-amd/components/DialogBody/DialogBody.types.js +5 -0
  57. package/lib-amd/components/DialogBody/DialogBody.types.js.map +1 -0
  58. package/lib-amd/components/DialogBody/index.js +10 -0
  59. package/lib-amd/components/DialogBody/index.js.map +1 -0
  60. package/lib-amd/components/DialogBody/renderDialogBody.js +15 -0
  61. package/lib-amd/components/DialogBody/renderDialogBody.js.map +1 -0
  62. package/lib-amd/components/DialogBody/useDialogBody.js +25 -0
  63. package/lib-amd/components/DialogBody/useDialogBody.js.map +1 -0
  64. package/lib-amd/components/DialogBody/useDialogBodyStyles.js +31 -0
  65. package/lib-amd/components/DialogBody/useDialogBodyStyles.js.map +1 -0
  66. package/lib-amd/components/DialogContent/DialogContent.js +16 -0
  67. package/lib-amd/components/DialogContent/DialogContent.js.map +1 -0
  68. package/lib-amd/components/DialogContent/DialogContent.types.js +5 -0
  69. package/lib-amd/components/DialogContent/DialogContent.types.js.map +1 -0
  70. package/lib-amd/components/DialogContent/index.js +10 -0
  71. package/lib-amd/components/DialogContent/index.js.map +1 -0
  72. package/lib-amd/components/DialogContent/renderDialogContent.js +14 -0
  73. package/lib-amd/components/DialogContent/renderDialogContent.js.map +1 -0
  74. package/lib-amd/components/DialogContent/useDialogContent.js +25 -0
  75. package/lib-amd/components/DialogContent/useDialogContent.js.map +1 -0
  76. package/lib-amd/components/DialogContent/useDialogContentStyles.js +24 -0
  77. package/lib-amd/components/DialogContent/useDialogContentStyles.js.map +1 -0
  78. package/lib-amd/components/DialogSurface/DialogSurface.js +17 -0
  79. package/lib-amd/components/DialogSurface/DialogSurface.js.map +1 -0
  80. package/lib-amd/components/DialogSurface/DialogSurface.types.js +5 -0
  81. package/lib-amd/components/DialogSurface/DialogSurface.types.js.map +1 -0
  82. package/lib-amd/components/DialogSurface/index.js +10 -0
  83. package/lib-amd/components/DialogSurface/index.js.map +1 -0
  84. package/lib-amd/components/DialogSurface/renderDialogSurface.js +17 -0
  85. package/lib-amd/components/DialogSurface/renderDialogSurface.js.map +1 -0
  86. package/lib-amd/components/DialogSurface/useDialogSurface.js +66 -0
  87. package/lib-amd/components/DialogSurface/useDialogSurface.js.map +1 -0
  88. package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js +11 -0
  89. package/lib-amd/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -0
  90. package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js +44 -0
  91. package/lib-amd/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -0
  92. package/lib-amd/components/DialogTitle/DialogTitle.js +16 -0
  93. package/lib-amd/components/DialogTitle/DialogTitle.js.map +1 -0
  94. package/lib-amd/components/DialogTitle/DialogTitle.types.js +5 -0
  95. package/lib-amd/components/DialogTitle/DialogTitle.types.js.map +1 -0
  96. package/lib-amd/components/DialogTitle/index.js +10 -0
  97. package/lib-amd/components/DialogTitle/index.js.map +1 -0
  98. package/lib-amd/components/DialogTitle/renderDialogTitle.js +16 -0
  99. package/lib-amd/components/DialogTitle/renderDialogTitle.js.map +1 -0
  100. package/lib-amd/components/DialogTitle/useDialogTitle.js +36 -0
  101. package/lib-amd/components/DialogTitle/useDialogTitle.js.map +1 -0
  102. package/lib-amd/components/DialogTitle/useDialogTitleStyles.js +37 -0
  103. package/lib-amd/components/DialogTitle/useDialogTitleStyles.js.map +1 -0
  104. package/lib-amd/components/DialogTrigger/DialogTrigger.js +24 -0
  105. package/lib-amd/components/DialogTrigger/DialogTrigger.js.map +1 -0
  106. package/lib-amd/components/DialogTrigger/DialogTrigger.types.js +5 -0
  107. package/lib-amd/components/DialogTrigger/DialogTrigger.types.js.map +1 -0
  108. package/lib-amd/components/DialogTrigger/index.js +9 -0
  109. package/lib-amd/components/DialogTrigger/index.js.map +1 -0
  110. package/lib-amd/components/DialogTrigger/renderDialogTrigger.js +13 -0
  111. package/lib-amd/components/DialogTrigger/renderDialogTrigger.js.map +1 -0
  112. package/lib-amd/components/DialogTrigger/useDialogTrigger.js +37 -0
  113. package/lib-amd/components/DialogTrigger/useDialogTrigger.js.map +1 -0
  114. package/lib-amd/contexts/constants.js +16 -0
  115. package/lib-amd/contexts/constants.js.map +1 -0
  116. package/lib-amd/contexts/dialogContext.js +25 -0
  117. package/lib-amd/contexts/dialogContext.js.map +1 -0
  118. package/lib-amd/contexts/dialogSurfaceContext.js +11 -0
  119. package/lib-amd/contexts/dialogSurfaceContext.js.map +1 -0
  120. package/lib-amd/contexts/index.js +8 -0
  121. package/lib-amd/contexts/index.js.map +1 -0
  122. package/lib-amd/index.js +37 -0
  123. package/lib-amd/index.js.map +1 -0
  124. package/lib-amd/utils/index.js +8 -0
  125. package/lib-amd/utils/index.js.map +1 -0
  126. package/lib-amd/utils/isEscapeKeyDown.js +13 -0
  127. package/lib-amd/utils/isEscapeKeyDown.js.map +1 -0
  128. package/lib-amd/utils/useDisableBodyScroll.js +52 -0
  129. package/lib-amd/utils/useDisableBodyScroll.js.map +1 -0
  130. package/lib-amd/utils/useFocusFirstElement.js +38 -0
  131. package/lib-amd/utils/useFocusFirstElement.js.map +1 -0
  132. package/lib-commonjs/components/Dialog/useDialog.js +0 -1
  133. package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
  134. package/lib-commonjs/components/Dialog/useDialogContextValues.js +0 -2
  135. package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
  136. package/lib-commonjs/components/DialogContent/useDialogContent.js +0 -4
  137. package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -1
  138. package/lib-commonjs/components/DialogSurface/useDialogSurface.js +0 -2
  139. package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
  140. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +2 -1
  141. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  142. package/lib-commonjs/contexts/dialogContext.js.map +1 -1
  143. package/package.json +14 -13
  144. package/Spec.md +0 -537
  145. package/assets/AlertDialogKeyboardInteraction.png +0 -0
  146. package/assets/AlertDialogMouseInteraction.png +0 -0
  147. package/assets/ModalDialogKeyboardInteraction.png +0 -0
  148. package/assets/ModalDialogMouseInteraction.png +0 -0
  149. package/assets/NonModalDialogKeyboardInteraction.png +0 -0
  150. package/assets/NonModalDialogMouseInteraction.png +0 -0
package/CHANGELOG.json CHANGED
@@ -2,7 +2,143 @@
2
2
  "name": "@fluentui/react-dialog",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 02 Nov 2022 11:54:51 GMT",
5
+ "date": "Thu, 17 Nov 2022 23:02:36 GMT",
6
+ "tag": "@fluentui/react-dialog_v9.1.2",
7
+ "version": "9.1.2",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-dialog",
13
+ "commit": "a510bccdb429d1a038f5c28b84bf3e98b51906b3",
14
+ "comment": "feat: removes aria-haspopup"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-dialog",
19
+ "comment": "Bump @fluentui/react-utilities to v9.2.2",
20
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-dialog",
25
+ "comment": "Bump @fluentui/react-context-selector to v9.1.2",
26
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-dialog",
31
+ "comment": "Bump @fluentui/react-aria to v9.3.2",
32
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-dialog",
37
+ "comment": "Bump @fluentui/react-tabster to v9.3.1",
38
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-dialog",
43
+ "comment": "Bump @fluentui/react-portal to v9.0.11",
44
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
45
+ }
46
+ ],
47
+ "none": [
48
+ {
49
+ "author": "martinhochel@microsoft.com",
50
+ "package": "@fluentui/react-dialog",
51
+ "commit": "ea768501802d65d63ddc63fff3816fb6b5008ae4",
52
+ "comment": "chore: update package scaffold"
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ {
58
+ "date": "Fri, 11 Nov 2022 14:58:02 GMT",
59
+ "tag": "@fluentui/react-dialog_v9.1.1",
60
+ "version": "9.1.1",
61
+ "comments": {
62
+ "patch": [
63
+ {
64
+ "author": "bernardo.sunderhus@gmail.com",
65
+ "package": "@fluentui/react-dialog",
66
+ "commit": "d1228a137bb5f28014bad869d88584ae95ba46da",
67
+ "comment": "chore: removes unnecessary union case for DialogOpenChangeData"
68
+ },
69
+ {
70
+ "author": "martinhochel@microsoft.com",
71
+ "package": "@fluentui/react-dialog",
72
+ "commit": "b3907043bd8d7b650c55e8e7c3119b14f2606c38",
73
+ "comment": "fix: create valid export maps"
74
+ },
75
+ {
76
+ "author": "beachball",
77
+ "package": "@fluentui/react-dialog",
78
+ "comment": "Bump @fluentui/react-utilities to v9.2.1",
79
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
80
+ },
81
+ {
82
+ "author": "beachball",
83
+ "package": "@fluentui/react-dialog",
84
+ "comment": "Bump @fluentui/keyboard-keys to v9.0.1",
85
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
86
+ },
87
+ {
88
+ "author": "beachball",
89
+ "package": "@fluentui/react-dialog",
90
+ "comment": "Bump @fluentui/react-context-selector to v9.1.1",
91
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
92
+ },
93
+ {
94
+ "author": "beachball",
95
+ "package": "@fluentui/react-dialog",
96
+ "comment": "Bump @fluentui/react-shared-contexts to v9.1.1",
97
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
98
+ },
99
+ {
100
+ "author": "beachball",
101
+ "package": "@fluentui/react-dialog",
102
+ "comment": "Bump @fluentui/react-aria to v9.3.1",
103
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
104
+ },
105
+ {
106
+ "author": "beachball",
107
+ "package": "@fluentui/react-dialog",
108
+ "comment": "Bump @fluentui/react-tabster to v9.3.0",
109
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
110
+ },
111
+ {
112
+ "author": "beachball",
113
+ "package": "@fluentui/react-dialog",
114
+ "comment": "Bump @fluentui/react-theme to v9.1.2",
115
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
116
+ },
117
+ {
118
+ "author": "beachball",
119
+ "package": "@fluentui/react-dialog",
120
+ "comment": "Bump @fluentui/react-portal to v9.0.10",
121
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
122
+ },
123
+ {
124
+ "author": "beachball",
125
+ "package": "@fluentui/react-dialog",
126
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.18",
127
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
128
+ }
129
+ ],
130
+ "none": [
131
+ {
132
+ "author": "tristan.watanabe@gmail.com",
133
+ "package": "@fluentui/react-dialog",
134
+ "commit": "956c72db167ea7f1f0be7c9713fc663ab6194544",
135
+ "comment": "chore: Migrate to new package structure."
136
+ }
137
+ ]
138
+ }
139
+ },
140
+ {
141
+ "date": "Wed, 02 Nov 2022 11:57:50 GMT",
6
142
  "tag": "@fluentui/react-dialog_v9.1.0",
7
143
  "version": "9.1.0",
8
144
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,45 @@
1
1
  # Change Log - @fluentui/react-dialog
2
2
 
3
- This log was last generated on Wed, 02 Nov 2022 11:54:51 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 17 Nov 2022 23:02:36 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.1.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.1.2)
8
+
9
+ Thu, 17 Nov 2022 23:02:36 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.1.1..@fluentui/react-dialog_v9.1.2)
11
+
12
+ ### Patches
13
+
14
+ - feat: removes aria-haspopup ([PR #25611](https://github.com/microsoft/fluentui/pull/25611) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-utilities to v9.2.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
16
+ - Bump @fluentui/react-context-selector to v9.1.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
17
+ - Bump @fluentui/react-aria to v9.3.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.3.1 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
19
+ - Bump @fluentui/react-portal to v9.0.11 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
20
+
21
+ ## [9.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.1.1)
22
+
23
+ Fri, 11 Nov 2022 14:58:02 GMT
24
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.1.0..@fluentui/react-dialog_v9.1.1)
25
+
26
+ ### Patches
27
+
28
+ - chore: removes unnecessary union case for DialogOpenChangeData ([PR #25504](https://github.com/microsoft/fluentui/pull/25504) by bernardo.sunderhus@gmail.com)
29
+ - fix: create valid export maps ([PR #25558](https://github.com/microsoft/fluentui/pull/25558) by martinhochel@microsoft.com)
30
+ - Bump @fluentui/react-utilities to v9.2.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
31
+ - Bump @fluentui/keyboard-keys to v9.0.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
32
+ - Bump @fluentui/react-context-selector to v9.1.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
33
+ - Bump @fluentui/react-shared-contexts to v9.1.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
34
+ - Bump @fluentui/react-aria to v9.3.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
35
+ - Bump @fluentui/react-tabster to v9.3.0 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
36
+ - Bump @fluentui/react-theme to v9.1.2 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
37
+ - Bump @fluentui/react-portal to v9.0.10 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
38
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.18 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
39
+
7
40
  ## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.1.0)
8
41
 
9
- Wed, 02 Nov 2022 11:54:51 GMT
42
+ Wed, 02 Nov 2022 11:57:50 GMT
10
43
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.0.3..@fluentui/react-dialog_v9.1.0)
11
44
 
12
45
  ### Minor changes
package/dist/index.d.ts CHANGED
@@ -99,7 +99,6 @@ export declare type DialogContentState = ComponentState<DialogContentSlots>;
99
99
 
100
100
  declare type DialogContextValue = {
101
101
  open: boolean;
102
- dialogContentId?: string;
103
102
  dialogTitleId?: string;
104
103
  isNestedDialog: boolean;
105
104
  dialogRef: React_2.Ref<DialogSurfaceElement>;
@@ -122,13 +121,6 @@ declare type DialogContextValues = {
122
121
  declare type DialogModalType = 'modal' | 'non-modal' | 'alert';
123
122
 
124
123
  export declare type DialogOpenChangeData = {
125
- /**
126
- * triggered when Escape key is pressed in a native `dialog`
127
- */
128
- type: 'dialogCancel';
129
- open: boolean;
130
- event: React_2.SyntheticEvent<DialogSurfaceElement>;
131
- } | {
132
124
  type: 'escapeKeyDown';
133
125
  open: boolean;
134
126
  event: React_2.KeyboardEvent<DialogSurfaceElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/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,\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\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":["packages/react-components/react-dialog/src/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 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\nexport type DialogState = ComponentState<DialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"]}
@@ -49,7 +49,6 @@ export const useDialog_unstable = props => {
49
49
  content: open ? content : null,
50
50
  trigger,
51
51
  requestOpenChange,
52
- dialogContentId: useId('dialog-content-'),
53
52
  dialogTitleId: useId('dialog-title-'),
54
53
  isNestedDialog: useHasParentContext(DialogContext),
55
54
  dialogRef: focusRef
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/components/Dialog/useDialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,oBAAT,EAA+B,gBAA/B,EAAiD,KAAjD,EAAwD,yBAAxD,QAAyF,2BAAzF;AACA,SAAS,mBAAT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O,EAAE,IAAI,GAAG,OAAH,GAAa,IANrB;IAOL,OAPK;IAQL,iBARK;IASL,eAAe,EAAE,KAAK,CAAC,iBAAD,CATjB;IAUL,aAAa,EAAE,KAAK,CAAC,eAAD,CAVf;IAWL,cAAc,EAAE,mBAAmB,CAAC,aAAD,CAX9B;IAYL,SAAS,EAAE;EAZN,CAAP;AAcD,CA7CM;AA+CP;;AAEG;;AACH,SAAS,2BAAT,CACE,QADF,EAC2B;EAEzB,MAAM,aAAa,GAAG,KAAK,CAAC,QAAN,CAAe,OAAf,CAAuB,QAAvB,CAAtB;;EACA,IAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;IACzC,IAAI,aAAa,CAAC,MAAd,KAAyB,CAAzB,IAA8B,aAAa,CAAC,MAAd,KAAyB,CAA3D,EAA8D;MAC5D;MACA,OAAO,CAAC,IAAR,CACE,+DACE,4EAFJ;IAID;EACF;;EACD,QAAQ,aAAa,CAAC,MAAtB;IACE;IACA,KAAK,CAAL;MACE,OAAO,aAAP;IACF;;IACA,KAAK,CAAL;MACE,OAAO,CAAC,SAAD,EAAY,aAAa,CAAC,CAAD,CAAzB,CAAP;IACF;;IACA;MACE,OAAO,CAAC,SAAD,EAAY,SAAZ,CAAP;EATJ;AAWD","sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback, useId, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useDisableBodyScroll, useFocusFirstElement } from '../../utils';\nimport { DialogContext } from '../../contexts';\n\nimport type { DialogOpenChangeData, DialogProps, DialogState } from './Dialog.types';\n\n/**\n * Create the state required to render Dialog.\n *\n * The returned state can be modified with hooks such as useDialogStyles_unstable,\n * before being passed to renderDialog_unstable.\n *\n * @param props - props from this instance of Dialog\n */\nexport const useDialog_unstable = (props: DialogProps): DialogState => {\n const { children, modalType = 'modal', onOpenChange } = props;\n\n const [trigger, content] = childrenToTriggerAndContent(children);\n\n const [open, setOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false,\n });\n\n const requestOpenChange = useEventCallback((data: DialogOpenChangeData) => {\n onOpenChange?.(data.event, data);\n\n // if user prevents default then do not change state value\n // otherwise updates state value and trigger reference to the element that caused the opening\n if (!data.event.isDefaultPrevented()) {\n setOpen(data.open);\n }\n });\n\n const focusRef = useFocusFirstElement(open, modalType);\n const disableBodyScroll = useDisableBodyScroll();\n const isBodyScrollLocked = Boolean(open && modalType !== 'non-modal');\n\n useIsomorphicLayoutEffect(() => {\n if (isBodyScrollLocked) {\n return disableBodyScroll();\n }\n }, [disableBodyScroll, isBodyScrollLocked]);\n\n return {\n components: {\n backdrop: 'div',\n },\n open,\n modalType,\n content: open ? content : null,\n trigger,\n requestOpenChange,\n dialogContentId: useId('dialog-content-'),\n dialogTitleId: useId('dialog-title-'),\n isNestedDialog: useHasParentContext(DialogContext),\n dialogRef: focusRef,\n };\n};\n\n/**\n * Extracts trigger and content from children\n */\nfunction childrenToTriggerAndContent(\n children: React.ReactNode,\n): readonly [trigger: React.ReactNode, content: React.ReactNode] {\n const childrenArray = React.Children.toArray(children) as React.ReactElement[];\n if (process.env.NODE_ENV !== 'production') {\n if (childrenArray.length !== 1 && childrenArray.length !== 2) {\n // eslint-disable-next-line no-console\n console.warn(\n 'Dialog must contain at least one child <DialogSurface/>,\\n' +\n 'and at most two children <DialogTrigger/> <DialogSurface/> (in this order)',\n );\n }\n }\n switch (childrenArray.length) {\n // case where there's a trigger followed by content\n case 2:\n return childrenArray as [trigger: React.ReactNode, content: React.ReactNode];\n // case where there's only content\n case 1:\n return [undefined, childrenArray[0]];\n // unknown case\n default:\n return [undefined, undefined];\n }\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/Dialog/useDialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,oBAAT,EAA+B,gBAA/B,EA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;MACV,QAAQ,EAAE;IADA,CADP;IAIL,IAJK;IAKL,SALK;IAML,OAAO,EAAE,IAAI,GAAG,OAAH,GAAa,IANrB;IAOL,OAPK;IAQL,iBARK;IASL,aAAa,EAAE,KAAK,CAAC,eAAD,CATf;IAUL,cAAc,EAAE,mBAAmB,CAAC,aAAD,CAV9B;IAWL,SAAS,EAAE;EAXN,CAAP;AAaD,CA5CM;AA8CP;;AAEG;;AACH,SAAS,2BAAT,CACE,QADF,EAC2B;EAEzB,MAAM,aAAa,GAAG,KAAK,CAAC,QAAN,CAAe,OAAf,CAAuB,QAAvB,CAAtB;;EACA,IAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;IACzC,IAAI,aAAa,CAAC,MAAd,KAAyB,CAAzB,IAA8B,aAAa,CAAC,MAAd,KAAyB,CAA3D,EAA8D;MAC5D;MACA,OAAO,CAAC,IAAR,CACE,+DACE,4EAFJ;IAID;EACF;;EACD,QAAQ,aAAa,CAAC,MAAtB;IACE;IACA,KAAK,CAAL;MACE,OAAO,aAAP;IACF;;IACA,KAAK,CAAL;MACE,OAAO,CAAC,SAAD,EAAY,aAAa,CAAC,CAAD,CAAzB,CAAP;IACF;;IACA;MACE,OAAO,CAAC,SAAD,EAAY,SAAZ,CAAP;EATJ;AAWD","sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback, useId, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useDisableBodyScroll, useFocusFirstElement } from '../../utils';\nimport { DialogContext } from '../../contexts';\n\nimport type { DialogOpenChangeData, DialogProps, DialogState } from './Dialog.types';\n\n/**\n * Create the state required to render Dialog.\n *\n * The returned state can be modified with hooks such as useDialogStyles_unstable,\n * before being passed to renderDialog_unstable.\n *\n * @param props - props from this instance of Dialog\n */\nexport const useDialog_unstable = (props: DialogProps): DialogState => {\n const { children, modalType = 'modal', onOpenChange } = props;\n\n const [trigger, content] = childrenToTriggerAndContent(children);\n\n const [open, setOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false,\n });\n\n const requestOpenChange = useEventCallback((data: DialogOpenChangeData) => {\n onOpenChange?.(data.event, data);\n\n // if user prevents default then do not change state value\n // otherwise updates state value and trigger reference to the element that caused the opening\n if (!data.event.isDefaultPrevented()) {\n setOpen(data.open);\n }\n });\n\n const focusRef = useFocusFirstElement(open, modalType);\n const disableBodyScroll = useDisableBodyScroll();\n const isBodyScrollLocked = Boolean(open && modalType !== 'non-modal');\n\n useIsomorphicLayoutEffect(() => {\n if (isBodyScrollLocked) {\n return disableBodyScroll();\n }\n }, [disableBodyScroll, isBodyScrollLocked]);\n\n return {\n components: {\n backdrop: 'div',\n },\n open,\n modalType,\n content: open ? content : null,\n trigger,\n requestOpenChange,\n dialogTitleId: useId('dialog-title-'),\n isNestedDialog: useHasParentContext(DialogContext),\n dialogRef: focusRef,\n };\n};\n\n/**\n * Extracts trigger and content from children\n */\nfunction childrenToTriggerAndContent(\n children: React.ReactNode,\n): readonly [trigger: React.ReactNode, content: React.ReactNode] {\n const childrenArray = React.Children.toArray(children) as React.ReactElement[];\n if (process.env.NODE_ENV !== 'production') {\n if (childrenArray.length !== 1 && childrenArray.length !== 2) {\n // eslint-disable-next-line no-console\n console.warn(\n 'Dialog must contain at least one child <DialogSurface/>,\\n' +\n 'and at most two children <DialogTrigger/> <DialogSurface/> (in this order)',\n );\n }\n }\n switch (childrenArray.length) {\n // case where there's a trigger followed by content\n case 2:\n return childrenArray as [trigger: React.ReactNode, content: React.ReactNode];\n // case where there's only content\n case 1:\n return [undefined, childrenArray[0]];\n // unknown case\n default:\n return [undefined, undefined];\n }\n}\n"],"sourceRoot":"../src/"}
@@ -2,7 +2,6 @@ export function useDialogContextValues_unstable(state) {
2
2
  const {
3
3
  modalType,
4
4
  open,
5
- dialogContentId,
6
5
  dialogRef,
7
6
  dialogTitleId,
8
7
  isNestedDialog,
@@ -17,7 +16,6 @@ export function useDialogContextValues_unstable(state) {
17
16
  open,
18
17
  modalType,
19
18
  dialogRef,
20
- dialogContentId,
21
19
  dialogTitleId,
22
20
  isNestedDialog,
23
21
  requestOpenChange
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/components/Dialog/useDialogContextValues.ts"],"names":[],"mappings":"AAGA,OAAM,SAAU,+BAAV,CAA0C,KAA1C,EAA4D;EAChE,MAAM;IAAE,SAAF;IAAa,IAAb;IAAmB,eAAnB;IAAoC,SAApC;IAA+C,aAA/C;IAA8D,cAA9D;IAA8E;EAA9E,IAAoG,KAA1G;EAEA;;;AAGG;;EACH,MAAM,MAAM,GAAuB;IACjC,IADiC;IAEjC,SAFiC;IAGjC,SAHiC;IAIjC,eAJiC;IAKjC,aALiC;IAMjC,cANiC;IAOjC;EAPiC,CAAnC;EAUA,MAAM,aAAa,GAA8B,KAAjD;EAEA,OAAO;IAAE,MAAF;IAAU;EAAV,CAAP;AACD","sourcesContent":["import type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogContextValues, DialogState } from './Dialog.types';\n\nexport function useDialogContextValues_unstable(state: DialogState): DialogContextValues {\n const { modalType, open, dialogContentId, dialogRef, dialogTitleId, isNestedDialog, requestOpenChange } = state;\n\n /**\n * This context is created with \"@fluentui/react-context-selector\",\n * there is no sense to memoize it\n */\n const dialog: DialogContextValue = {\n open,\n modalType,\n dialogRef,\n dialogContentId,\n dialogTitleId,\n isNestedDialog,\n requestOpenChange,\n };\n\n const dialogSurface: DialogSurfaceContextValue = false;\n\n return { dialog, dialogSurface };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/Dialog/useDialogContextValues.ts"],"names":[],"mappings":"AAGA,OAAM,SAAU,+BAAV,CAA0C,KAA1C,EAA4D;EAChE,MAAM;IAAE,SAAF;IAAa,IAAb;IAAmB,SAAnB;IAA8B,aAA9B;IAA6C,cAA7C;IAA6D;EAA7D,IAAmF,KAAzF;EAEA;;;AAGG;;EACH,MAAM,MAAM,GAAuB;IACjC,IADiC;IAEjC,SAFiC;IAGjC,SAHiC;IAIjC,aAJiC;IAKjC,cALiC;IAMjC;EANiC,CAAnC;EASA,MAAM,aAAa,GAA8B,KAAjD;EAEA,OAAO;IAAE,MAAF;IAAU;EAAV,CAAP;AACD","sourcesContent":["import type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogContextValues, DialogState } from './Dialog.types';\n\nexport function useDialogContextValues_unstable(state: DialogState): DialogContextValues {\n const { modalType, open, dialogRef, dialogTitleId, isNestedDialog, requestOpenChange } = state;\n\n /**\n * This context is created with \"@fluentui/react-context-selector\",\n * there is no sense to memoize it\n */\n const dialog: DialogContextValue = {\n open,\n modalType,\n dialogRef,\n dialogTitleId,\n isNestedDialog,\n requestOpenChange,\n };\n\n const dialogSurface: DialogSurfaceContextValue = false;\n\n return { dialog, dialogSurface };\n}\n"],"sourceRoot":"../src/"}
@@ -1,5 +1,4 @@
1
1
  import { getNativeElementProps } from '@fluentui/react-utilities';
2
- import { useDialogContext_unstable } from '../../contexts';
3
2
  /**
4
3
  * Create the state required to render DialogBody.
5
4
  *
@@ -13,14 +12,12 @@ import { useDialogContext_unstable } from '../../contexts';
13
12
  export const useDialogContent_unstable = (props, ref) => {
14
13
  var _a;
15
14
 
16
- const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);
17
15
  return {
18
16
  components: {
19
17
  root: 'div'
20
18
  },
21
19
  root: getNativeElementProps((_a = props.as) !== null && _a !== void 0 ? _a : 'div', {
22
20
  ref,
23
- id: dialogContentId,
24
21
  ...props
25
22
  })
26
23
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContent.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AACA,SAAS,yBAAT,QAA0C,gBAA1C;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;EACtB,MAAM,eAAe,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,eAAZ,CAAjD;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,qBAAqB,CAAC,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,KAAb,EAAoB;MAC7C,GAD6C;MAE7C,EAAE,EAAE,eAFyC;MAG7C,GAAG;IAH0C,CAApB;EAJtB,CAAP;AAUD,CAfM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { DialogContentProps, DialogContentState } from './DialogContent.types';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogContent_unstable = (\n props: DialogContentProps,\n ref: React.Ref<HTMLElement>,\n): DialogContentState => {\n const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps(props.as ?? 'div', {\n ref,\n id: dialogContentId,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContent.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;EACtB,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,qBAAqB,CAAC,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,KAAb,EAAoB;MAC7C,GAD6C;MAE7C,GAAG;IAF0C,CAApB;EAJtB,CAAP;AASD,CAbM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { DialogContentProps, DialogContentState } from './DialogContent.types';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogContent_unstable = (\n props: DialogContentProps,\n ref: React.Ref<HTMLElement>,\n): DialogContentState => {\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps(props.as ?? 'div', {\n ref,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -22,7 +22,6 @@ export const useDialogSurface_unstable = (props, ref) => {
22
22
  const open = useDialogContext_unstable(ctx => ctx.open);
23
23
  const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);
24
24
  const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);
25
- const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);
26
25
  const handledBackdropClick = useEventCallback(event => {
27
26
  var _a, _b;
28
27
 
@@ -75,7 +74,6 @@ export const useDialogSurface_unstable = (props, ref) => {
75
74
  tabIndex: -1,
76
75
  'aria-modal': modalType !== 'non-modal',
77
76
  role: modalType === 'alert' ? 'alertdialog' : 'dialog',
78
- 'aria-describedby': dialogContentId,
79
77
  'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,
80
78
  ...props,
81
79
  ...modalAttributes,
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurface.ts"],"names":[],"mappings":"AACA,SACE,qBADF,EAEE,gBAFF,EAGE,gBAHF,EAIE,aAJF,EAKE,mBALF,QAMO,2BANP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AP;AAwBD,CAlEM","sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n resolveShorthand,\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n} from '@fluentui/react-utilities';\nimport type {\n DialogSurfaceElement,\n DialogSurfaceElementIntersection,\n DialogSurfaceProps,\n DialogSurfaceState,\n} from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { isEscapeKeyDismiss } from '../../utils';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */\nexport const useDialogSurface_unstable = (\n props: DialogSurfaceProps,\n ref: React.Ref<DialogSurfaceElement>,\n): DialogSurfaceState => {\n const { backdrop, as } = props;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);\n const open = useDialogContext_unstable(ctx => ctx.open);\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);\n const dialogContentId = useDialogContext_unstable(ctx => ctx.dialogContentId);\n\n const handledBackdropClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n if (isResolvedShorthand(props.backdrop)) {\n props.backdrop.onClick?.(event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleKeyDown = useEventCallback((event: React.KeyboardEvent<DialogSurfaceElementIntersection>) => {\n props.onKeyDown?.(event);\n\n if (isEscapeKeyDismiss(event, modalType)) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown',\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n\n const { modalAttributes } = useModalAttributes({ trapFocus: modalType !== 'non-modal' });\n\n return {\n components: {\n backdrop: 'div',\n root: 'div',\n },\n backdrop: resolveShorthand(backdrop, {\n required: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n onClick: handledBackdropClick,\n },\n }),\n root: getNativeElementProps(as ?? 'div', {\n tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-describedby': dialogContentId,\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n ref: useMergedRefs(ref, dialogRef),\n }),\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurface.ts"],"names":[],"mappings":"AACA,SACE,qBADF,EAEE,gBAFF,EAGE,gBAHF,EAIE,aAJF,EAKE,mBALF,QAMO,2BANP;AAaA,SAAS,yBAAT,QAA0C,gBAA1C;AACA,SAAS,kBAAT,QAAmC,aAAnC;AACA,SAAS,kBAAT,QAAmC,yBAAnC;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAmB,KAAzB;EACA,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,SAAZ,CAA3C;EACA,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,SAAZ,CAA3C;EACA,MAAM,IAAI,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,IAAZ,CAAtC;EACA,MAAM,iBAAiB,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,iBAAZ,CAAnD;EACA,MAAM,aAAa,GAAG,yBAAyB,CA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,IAAI,IAAI,SAAS,KAAK,WADG;MAEnC,YAAY,EAAE;QACZ,eAAe,MADH;QAEZ,OAAO,EAAE;MAFG;IAFqB,CAAX,CALrB;IAYL,IAAI,EAAE,qBAAqB,CAAC,EAAE,KAAA,IAAF,IAAA,EAAE,KAAA,KAAA,CAAF,GAAA,EAAA,GAAM,KAAP,EAAc;MACvC,QAAQ,EAAE,CAAC,CAD4B;MAEvC,cAAc,SAAS,KAAK,WAFW;MAGvC,IAAI,EAAE,SAAS,KAAK,OAAd,GAAwB,aAAxB,GAAwC,QAHP;MAIvC,mBAAmB,KAAK,CAAC,YAAD,CAAL,GAAsB,SAAtB,GAAkC,aAJd;MAKvC,GAAG,KALoC;MAMvC,GAAG,eANoC;MAOvC,SAAS,EAAE,aAP4B;MAQvC,GAAG,EAAE,aAAa,CAAC,GAAD,EAAM,SAAN;IARqB,CAAd;EAZtB,CAAP;AAuBD,CAhEM","sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n resolveShorthand,\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n} from '@fluentui/react-utilities';\nimport type {\n DialogSurfaceElement,\n DialogSurfaceElementIntersection,\n DialogSurfaceProps,\n DialogSurfaceState,\n} from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { isEscapeKeyDismiss } from '../../utils';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */\nexport const useDialogSurface_unstable = (\n props: DialogSurfaceProps,\n ref: React.Ref<DialogSurfaceElement>,\n): DialogSurfaceState => {\n const { backdrop, as } = props;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);\n const open = useDialogContext_unstable(ctx => ctx.open);\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);\n\n const handledBackdropClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n if (isResolvedShorthand(props.backdrop)) {\n props.backdrop.onClick?.(event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleKeyDown = useEventCallback((event: React.KeyboardEvent<DialogSurfaceElementIntersection>) => {\n props.onKeyDown?.(event);\n\n if (isEscapeKeyDismiss(event, modalType)) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown',\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n\n const { modalAttributes } = useModalAttributes({ trapFocus: modalType !== 'non-modal' });\n\n return {\n components: {\n backdrop: 'div',\n root: 'div',\n },\n backdrop: resolveShorthand(backdrop, {\n required: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n onClick: handledBackdropClick,\n },\n }),\n root: getNativeElementProps(as ?? 'div', {\n tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n ref: useMergedRefs(ref, dialogRef),\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -18,6 +18,7 @@ export const useDialogTrigger_unstable = props => {
18
18
  } = props;
19
19
  const child = getTriggerChild(children);
20
20
  const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);
21
+ const open = useDialogContext_unstable(ctx => ctx.open);
21
22
  const {
22
23
  triggerAttributes
23
24
  } = useModalAttributes();
@@ -35,7 +36,7 @@ export const useDialogTrigger_unstable = props => {
35
36
  }
36
37
  });
37
38
  const triggerChildProps = { ...(child === null || child === void 0 ? void 0 : child.props),
38
- 'aria-haspopup': action === 'close' ? undefined : 'dialog',
39
+ 'aria-expanded': open,
39
40
  ref: child === null || child === void 0 ? void 0 : child.ref,
40
41
  onClick: handleClick,
41
42
  ...triggerAttributes
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/useDialogTrigger.ts"],"names":[],"mappings":"AACA,SAAS,kBAAT,QAAmC,yBAAnC;AACA,SAAS,2BAAT,EAAsC,eAAtC,EAAuD,gBAAvD,QAA+E,2BAA/E;AAEA,SAAS,yBAAT,EAAoC,gCAApC,QAA4E,gBAA5E;AACA,SAAS,kBAAT,QAAmC,sBAAnC;AAEA;;;;;AAKG;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAAkD;EACzF,MAAM,qBAAqB,GAAG,gCAAgC,EAA9D;EAEA,MAAM;IAAE,QAAF;IAAY,wBAAwB,GAAG,KAAvC;IAA8C,MAAM,GAAG,qBAAqB,GAAG,OAAH,GAAa;EAAzF,IAAoG,KAA1G;EAEA,MAAM,KAAK,GAAG,eAAe,CAAC,QAAD,CAA7B;EAEA,MAAM,iBAAiB,GAAG,yBAAyB,CAAC,GAAG,IAAI,GAAG,CAAC,iBAAZ,CAAnD;EAEA,MAAM;IAAE;EAAF,IAAwB,kBAAkB,EAAhD;EAEA,MAAM,WAAW,GAAG,gBAAgB,CACjC,KAAD,IAAoF;;;IAClF,CAAA,EAAA,GAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAK,CAAA,EAAA,GAAL,KAAK,CAAE,KAAF,EAAQ,OAAb,MAAoB,IAApB,IAAoB,EAAA,KAAA,KAAA,CAApB,GAAoB,KAAA,CAApB,GAAoB,EAAA,CAAA,IAAA,CAAA,EAAA,EAAG,KAAH,CAApB;;IACA,IAAI,CAAC,KAAK,CAAC,kBAAN,EAAL,EAAiC;MAC/B,iBAAiB,CAAC;QAChB,KADgB;QAEhB,IAAI,EAAE,cAFU;QAGhB,IAAI,EAAE,MAAM,KAAK;MAHD,CAAD,CAAjB;IAKD;EACF,CAViC,CAApC;EAaA,MAAM,iBAAiB,GAAG,EACxB,IAAG,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAV,CADwB;IAExB,iBAAiB,MAAM,KAAK,OAAX,GAAqB,SAArB,GAAiC,QAF1B;IAGxB,GAAG,EAAE,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,GAHY;IAIxB,OAAO,EAAE,WAJe;IAKxB,GAAG;EALqB,CAA1B;EAQA,MAAM,2BAA2B,GAAG,kBAAkB,CACpD,CAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,IAAP,MAAgB,QAAhB,IAA4B,CAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,IAAP,MAAgB,GAA5C,GAAkD,KAAK,CAAC,IAAxD,GAA+D,KADX,EAEpD,EACE,GAAG,iBADL;IAEE,IAAI,EAAE;EAFR,CAFoD,CAAtD;EAQA,OAAO;IACL,QAAQ,EAAE,2BAA2B,CACnC,QADmC,EAEnC,wBAAwB,GAAG,iBAAH,GAAuB,2BAFZ;EADhC,CAAP;AAMD,CA9CM","sourcesContent":["import * as React from 'react';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport type { DialogTriggerProps, DialogTriggerState } from './DialogTrigger.types';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */\nexport const useDialogTrigger_unstable = (props: DialogTriggerProps): DialogTriggerState => {\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n\n const { children, disableButtonEnhancement = false, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n\n const { triggerAttributes } = useModalAttributes();\n\n const handleClick = useEventCallback(\n (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open',\n });\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n 'aria-haspopup': action === 'close' ? undefined : 'dialog',\n ref: child?.ref,\n onClick: handleClick,\n ...triggerAttributes,\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogTrigger/useDialogTrigger.ts"],"names":[],"mappings":"AACA,SAAS,kBAAT,QAAmC,yBAAnC;AACA,SAAS,2BAAT,EAAsC,eAAtC,EAAuD,gBAAvD,QAA+E,2BAA/E;AAEA,SAAS,yBAAT,EAAoC,gCAApC,QAA4E,gBAA5E;AACA,SAAS,kBAAT,QAAmC,sBAAnC;AAEA;;;;;AAKG;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAAkD;EACzF,MAAM,qBAAqB,GAAG,gCAAgC,EAA9D;EAEA,MAAM;IAAE,QAAF;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AAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,IAAP,MAAgB,QAAhB,IAA4B,CAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,IAAP,MAAgB,GAA5C,GAAkD,KAAK,CAAC,IAAxD,GAA+D,KADX,EAEpD,EACE,GAAG,iBADL;IAEE,IAAI,EAAE;EAFR,CAFoD,CAAtD;EAQA,OAAO;IACL,QAAQ,EAAE,2BAA2B,CACnC,QADmC,EAEnC,wBAAwB,GAAG,iBAAH,GAAuB,2BAFZ;EADhC,CAAP;AAMD,CA/CM","sourcesContent":["import * as React from 'react';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport type { DialogTriggerProps, DialogTriggerState } from './DialogTrigger.types';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */\nexport const useDialogTrigger_unstable = (props: DialogTriggerProps): DialogTriggerState => {\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n\n const { children, disableButtonEnhancement = false, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const open = useDialogContext_unstable(ctx => ctx.open);\n\n const { triggerAttributes } = useModalAttributes();\n\n const handleClick = useEventCallback(\n (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open',\n });\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n 'aria-expanded': open,\n ref: child?.ref,\n onClick: handleClick,\n ...triggerAttributes,\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-dialog/src/contexts/dialogContext.ts"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAyC,kBAAzC,QAAmE,kCAAnE;AAkBA,MAAM,mBAAmB,GAAuB;EAC9C,IAAI,EAAE,KADwC;EAE9C,SAAS,EAAE,OAFmC;EAG9C,cAAc,EAAE,KAH8B;EAI9C,SAAS,EAAE;IAAE,OAAO,EAAE;EAAX,CAJmC;;EAK9C,iBAAiB,GAAA;IACf;EACD;;AAP6C,CAAhD,C,CAUA;;AACA,OAAO,MAAM,aAAa,gBAA4C,aAAa,CACjF,SADiF,CAA5E;AAIP,OAAO,MAAM,cAAc,GAAG,aAAa,CAAC,QAArC;AACP,OAAO,MAAM,yBAAyB,GAAO,QAAJ,IACvC,kBAAkB,CAAC,aAAD,EAAgB,CAAC,GAAG,GAAG,mBAAP,KAA+B,QAAQ,CAAC,GAAD,CAAvD,CADb","sourcesContent":["import * as React from 'react';\nimport { createContext, ContextSelector, useContextSelector } from '@fluentui/react-context-selector';\nimport { DialogSurfaceElement } from '../DialogSurface';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { DialogModalType, DialogOpenChangeData } from '../Dialog';\n\nexport type DialogContextValue = {\n open: boolean;\n dialogContentId?: string;\n dialogTitleId?: string;\n isNestedDialog: boolean;\n dialogRef: React.Ref<DialogSurfaceElement>;\n modalType: DialogModalType;\n /**\n * Requests dialog main component to update it's internal open state\n */\n requestOpenChange: (data: DialogOpenChangeData) => void;\n};\n\nconst defaultContextValue: DialogContextValue = {\n open: false,\n modalType: 'modal',\n isNestedDialog: false,\n dialogRef: { current: null },\n requestOpenChange() {\n /* noop */\n },\n};\n\n// Contexts should default to undefined\nexport const DialogContext: Context<DialogContextValue | undefined> = createContext<DialogContextValue | undefined>(\n undefined,\n);\n\nexport const DialogProvider = DialogContext.Provider;\nexport const useDialogContext_unstable = <T>(selector: ContextSelector<DialogContextValue, T>): T =>\n useContextSelector(DialogContext, (ctx = defaultContextValue) => selector(ctx));\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/contexts/dialogContext.ts"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAyC,kBAAzC,QAAmE,kCAAnE;AAiBA,MAAM,mBAAmB,GAAuB;EAC9C,IAAI,EAAE,KADwC;EAE9C,SAAS,EAAE,OAFmC;EAG9C,cAAc,EAAE,KAH8B;EAI9C,SAAS,EAAE;IAAE,OAAO,EAAE;EAAX,CAJmC;;EAK9C,iBAAiB,GAAA;IACf;EACD;;AAP6C,CAAhD,C,CAUA;;AACA,OAAO,MAAM,aAAa,gBAA4C,aAAa,CACjF,SADiF,CAA5E;AAIP,OAAO,MAAM,cAAc,GAAG,aAAa,CAAC,QAArC;AACP,OAAO,MAAM,yBAAyB,GAAO,QAAJ,IACvC,kBAAkB,CAAC,aAAD,EAAgB,CAAC,GAAG,GAAG,mBAAP,KAA+B,QAAQ,CAAC,GAAD,CAAvD,CADb","sourcesContent":["import * as React from 'react';\nimport { createContext, ContextSelector, useContextSelector } from '@fluentui/react-context-selector';\nimport { DialogSurfaceElement } from '../DialogSurface';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { DialogModalType, DialogOpenChangeData } from '../Dialog';\n\nexport type DialogContextValue = {\n open: boolean;\n dialogTitleId?: string;\n isNestedDialog: boolean;\n dialogRef: React.Ref<DialogSurfaceElement>;\n modalType: DialogModalType;\n /**\n * Requests dialog main component to update it's internal open state\n */\n requestOpenChange: (data: DialogOpenChangeData) => void;\n};\n\nconst defaultContextValue: DialogContextValue = {\n open: false,\n modalType: 'modal',\n isNestedDialog: false,\n dialogRef: { current: null },\n requestOpenChange() {\n /* noop */\n },\n};\n\n// Contexts should default to undefined\nexport const DialogContext: Context<DialogContextValue | undefined> = createContext<DialogContextValue | undefined>(\n undefined,\n);\n\nexport const DialogProvider = DialogContext.Provider;\nexport const useDialogContext_unstable = <T>(selector: ContextSelector<DialogContextValue, T>): T =>\n useContextSelector(DialogContext, (ctx = defaultContextValue) => selector(ctx));\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/Dialog/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=Dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-dialog/src/Dialog.ts"],"names":[],"mappings":";;;IAAA,uCAA0C","sourcesContent":["export * from './components/Dialog/index';\n"]}
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/DialogActions/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=DialogActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogActions.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-dialog/src/DialogActions.ts"],"names":[],"mappings":";;;IAAA,uCAAiD","sourcesContent":["export * from './components/DialogActions/index';\n"]}
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/DialogBody/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=DialogBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogBody.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-dialog/src/DialogBody.ts"],"names":[],"mappings":";;;IAAA,uCAA8C","sourcesContent":["export * from './components/DialogBody/index';\n"]}
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/DialogContent/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=DialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogContent.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-dialog/src/DialogContent.ts"],"names":[],"mappings":";;;IAAA,uCAAiD","sourcesContent":["export * from './components/DialogContent/index';\n"]}
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/DialogSurface/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=DialogSurface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogSurface.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-dialog/src/DialogSurface.ts"],"names":[],"mappings":";;;IAAA,uCAAiD","sourcesContent":["export * from './components/DialogSurface/index';\n"]}
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/DialogTitle/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=DialogTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogTitle.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-dialog/src/DialogTitle.ts"],"names":[],"mappings":";;;IAAA,uCAA+C","sourcesContent":["export * from './components/DialogTitle/index';\n"]}
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/DialogTrigger/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=DialogTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogTrigger.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-dialog/src/DialogTrigger.ts"],"names":[],"mappings":";;;IAAA,uCAAiD","sourcesContent":["export * from './components/DialogTrigger/index';\n"]}
@@ -0,0 +1,19 @@
1
+ define(["require", "exports", "react", "./useDialog", "./renderDialog", "./useDialogContextValues"], function (require, exports, React, useDialog_1, renderDialog_1, useDialogContextValues_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Dialog = void 0;
5
+ /**
6
+ * The `Dialog` root level component serves as an interface for interaction with all possible behaviors exposed.
7
+ * It provides context down the hierarchy to `children` compound components to allow functionality.
8
+ * This component expects to receive as children either a `DialogSurface` or a `DialogTrigger`
9
+ * and a `DialogSurface` (or some component that will eventually render one of those compound components)
10
+ * in this specific order
11
+ */
12
+ exports.Dialog = React.memo(function (props) {
13
+ var state = useDialog_1.useDialog_unstable(props);
14
+ var contextValues = useDialogContextValues_1.useDialogContextValues_unstable(state);
15
+ return renderDialog_1.renderDialog_unstable(state, contextValues);
16
+ });
17
+ exports.Dialog.displayName = 'Dialog';
18
+ });
19
+ //# sourceMappingURL=Dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/Dialog/Dialog.tsx"],"names":[],"mappings":";;;;IAMA;;;;;;OAMG;IACU,QAAA,MAAM,GAA0B,KAAK,CAAC,IAAI,CAAC,UAAA,KAAK;QAC3D,IAAM,KAAK,GAAG,8BAAkB,CAAC,KAAK,CAAC,CAAC;QACxC,IAAM,aAAa,GAAG,wDAA+B,CAAC,KAAK,CAAC,CAAC;QAE7D,OAAO,oCAAqB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,cAAM,CAAC,WAAW,GAAG,QAAQ,CAAC","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"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=Dialog.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/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 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\nexport type DialogState = ComponentState<DialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"]}
@@ -0,0 +1,9 @@
1
+ define(["require", "exports", "tslib", "./Dialog", "./Dialog.types", "./renderDialog", "./useDialog"], function (require, exports, tslib_1, Dialog_1, Dialog_types_1, renderDialog_1, useDialog_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(Dialog_1, exports);
5
+ tslib_1.__exportStar(Dialog_types_1, exports);
6
+ tslib_1.__exportStar(renderDialog_1, exports);
7
+ tslib_1.__exportStar(useDialog_1, exports);
8
+ });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/Dialog/index.ts"],"names":[],"mappings":";;;IAAA,wCAAyB;IACzB,8CAA+B;IAC/B,8CAA+B;IAC/B,2CAA4B","sourcesContent":["export * from './Dialog';\nexport * from './Dialog.types';\nexport * from './renderDialog';\nexport * from './useDialog';\n"]}
@@ -0,0 +1,17 @@
1
+ define(["require", "exports", "react", "../../contexts"], function (require, exports, React, contexts_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderDialog_unstable = void 0;
5
+ /**
6
+ * Render the final JSX of Dialog
7
+ */
8
+ var renderDialog_unstable = function (state, contextValues) {
9
+ var content = state.content, trigger = state.trigger;
10
+ return (React.createElement(contexts_1.DialogProvider, { value: contextValues.dialog },
11
+ React.createElement(contexts_1.DialogSurfaceProvider, { value: contextValues.dialogSurface },
12
+ trigger,
13
+ content)));
14
+ };
15
+ exports.renderDialog_unstable = renderDialog_unstable;
16
+ });
17
+ //# sourceMappingURL=renderDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderDialog.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-dialog/src/components/Dialog/renderDialog.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,qBAAqB,GAAG,UAAC,KAAkB,EAAE,aAAkC;QAClF,IAAA,OAAO,GAAc,KAAK,QAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;QAEnC,OAAO,CACL,oBAAC,yBAAc,IAAC,KAAK,EAAE,aAAa,CAAC,MAAM;YACzC,oBAAC,gCAAqB,IAAC,KAAK,EAAE,aAAa,CAAC,aAAa;gBACtD,OAAO;gBACP,OAAO,CACc,CACT,CAClB,CAAC;IACJ,CAAC,CAAC;IAXW,QAAA,qBAAqB,yBAWhC","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"]}