@fluentui/react-dialog 9.7.1 → 9.7.4
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.
- package/CHANGELOG.json +190 -1
- package/CHANGELOG.md +53 -2
- package/dist/index.d.ts +1 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/useDialog.js +1 -2
- package/lib/components/Dialog/useDialog.js.map +1 -1
- package/lib/components/DialogActions/useDialogActionsStyles.styles.js +12 -19
- package/lib/components/DialogActions/useDialogActionsStyles.styles.js.map +1 -1
- package/lib/components/DialogBody/useDialogBodyStyles.styles.js +7 -25
- package/lib/components/DialogBody/useDialogBodyStyles.styles.js.map +1 -1
- package/lib/components/DialogContent/useDialogContentStyles.styles.js +3 -27
- package/lib/components/DialogContent/useDialogContentStyles.styles.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurface.js +2 -2
- package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib/components/DialogSurface/useDialogSurfaceStyles.styles.js +23 -94
- package/lib/components/DialogSurface/useDialogSurfaceStyles.styles.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitle.js +1 -1
- package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
- package/lib/components/DialogTitle/useDialogTitleStyles.styles.js +12 -83
- package/lib/components/DialogTitle/useDialogTitleStyles.styles.js.map +1 -1
- package/lib/components/DialogTrigger/useDialogTrigger.js +5 -6
- package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib/contexts/dialogSurfaceContext.js +4 -2
- package/lib/contexts/dialogSurfaceContext.js.map +1 -1
- package/lib-commonjs/components/Dialog/useDialog.js +1 -2
- package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.js +12 -31
- package/lib-commonjs/components/DialogActions/useDialogActionsStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.js +8 -42
- package/lib-commonjs/components/DialogBody/useDialogBodyStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.js +5 -58
- package/lib-commonjs/components/DialogContent/useDialogContentStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js +2 -2
- package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.js +40 -273
- package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.js +27 -211
- package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +5 -6
- package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
- package/lib-commonjs/contexts/dialogSurfaceContext.js +4 -2
- package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,196 @@
|
|
|
2
2
|
"name": "@fluentui/react-dialog",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 02 Oct 2023 08:53:05 GMT",
|
|
6
|
+
"tag": "@fluentui/react-dialog_v9.7.4",
|
|
7
|
+
"version": "9.7.4",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@fluentui/react-dialog",
|
|
13
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.9.2",
|
|
14
|
+
"commit": "18ddec93bdb85a009bc1392058c52b2ea336340e"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-dialog",
|
|
19
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.2",
|
|
20
|
+
"commit": "18ddec93bdb85a009bc1392058c52b2ea336340e"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-dialog",
|
|
25
|
+
"comment": "Bump @fluentui/react-portal to v9.3.19",
|
|
26
|
+
"commit": "18ddec93bdb85a009bc1392058c52b2ea336340e"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"date": "Tue, 26 Sep 2023 17:49:05 GMT",
|
|
33
|
+
"tag": "@fluentui/react-dialog_v9.7.3",
|
|
34
|
+
"version": "9.7.3",
|
|
35
|
+
"comments": {
|
|
36
|
+
"patch": [
|
|
37
|
+
{
|
|
38
|
+
"author": "yuanboxue@microsoft.com",
|
|
39
|
+
"package": "@fluentui/react-dialog",
|
|
40
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d",
|
|
41
|
+
"comment": "chore: trigger manual version bump after broken release"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "beachball",
|
|
45
|
+
"package": "@fluentui/react-dialog",
|
|
46
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.5",
|
|
47
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@fluentui/react-dialog",
|
|
52
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.12",
|
|
53
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@fluentui/react-dialog",
|
|
58
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.6",
|
|
59
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"author": "beachball",
|
|
63
|
+
"package": "@fluentui/react-dialog",
|
|
64
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.36",
|
|
65
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"author": "beachball",
|
|
69
|
+
"package": "@fluentui/react-dialog",
|
|
70
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.9.1",
|
|
71
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"author": "beachball",
|
|
75
|
+
"package": "@fluentui/react-dialog",
|
|
76
|
+
"comment": "Bump @fluentui/react-aria to v9.3.38",
|
|
77
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "beachball",
|
|
81
|
+
"package": "@fluentui/react-dialog",
|
|
82
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.1",
|
|
83
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@fluentui/react-dialog",
|
|
88
|
+
"comment": "Bump @fluentui/react-theme to v9.1.14",
|
|
89
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-dialog",
|
|
94
|
+
"comment": "Bump @fluentui/react-portal to v9.3.18",
|
|
95
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"date": "Tue, 26 Sep 2023 15:32:01 GMT",
|
|
102
|
+
"tag": "@fluentui/react-dialog_v9.7.2",
|
|
103
|
+
"version": "9.7.2",
|
|
104
|
+
"comments": {
|
|
105
|
+
"patch": [
|
|
106
|
+
{
|
|
107
|
+
"author": "marcosvmmoura@gmail.com",
|
|
108
|
+
"package": "@fluentui/react-dialog",
|
|
109
|
+
"commit": "031ecaf9c383f81965aa5d057cd779f222a6d10a",
|
|
110
|
+
"comment": "fix: use makeResetStyles for base dialog components styles"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"author": "martinhochel@microsoft.com",
|
|
114
|
+
"package": "@fluentui/react-dialog",
|
|
115
|
+
"commit": "e61473fa10195f6ebf2308205c1e72e91b711831",
|
|
116
|
+
"comment": "fix: bump swc core to mitigate transpilation memory leaks"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"author": "ololubek@microsoft.com",
|
|
120
|
+
"package": "@fluentui/react-dialog",
|
|
121
|
+
"commit": "a31e7394d9f169bc5aa55430a22cdc65425a1b49",
|
|
122
|
+
"comment": "chore: Update react-icons version to pick up IconDirectionContextProvider updated export"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
126
|
+
"package": "@fluentui/react-dialog",
|
|
127
|
+
"commit": "530a6a6a4513d0a28b6c0f7a447b3ebc8eeac750",
|
|
128
|
+
"comment": "chore: adds CSS containment to DialogSurface"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
132
|
+
"package": "@fluentui/react-dialog",
|
|
133
|
+
"commit": "6e1421bed0b194d31235fb8f83e09c61fa40a13a",
|
|
134
|
+
"comment": "doc: updates documentation on alert dialog escape dismiss"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"author": "beachball",
|
|
138
|
+
"package": "@fluentui/react-dialog",
|
|
139
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.4",
|
|
140
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"author": "beachball",
|
|
144
|
+
"package": "@fluentui/react-dialog",
|
|
145
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.11",
|
|
146
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"author": "beachball",
|
|
150
|
+
"package": "@fluentui/react-dialog",
|
|
151
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.5",
|
|
152
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"author": "beachball",
|
|
156
|
+
"package": "@fluentui/react-dialog",
|
|
157
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.35",
|
|
158
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"author": "beachball",
|
|
162
|
+
"package": "@fluentui/react-dialog",
|
|
163
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.9.0",
|
|
164
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"author": "beachball",
|
|
168
|
+
"package": "@fluentui/react-dialog",
|
|
169
|
+
"comment": "Bump @fluentui/react-aria to v9.3.37",
|
|
170
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"author": "beachball",
|
|
174
|
+
"package": "@fluentui/react-dialog",
|
|
175
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.0",
|
|
176
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"author": "beachball",
|
|
180
|
+
"package": "@fluentui/react-dialog",
|
|
181
|
+
"comment": "Bump @fluentui/react-theme to v9.1.13",
|
|
182
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"author": "beachball",
|
|
186
|
+
"package": "@fluentui/react-dialog",
|
|
187
|
+
"comment": "Bump @fluentui/react-portal to v9.3.17",
|
|
188
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"date": "Wed, 20 Sep 2023 17:47:36 GMT",
|
|
6
195
|
"tag": "@fluentui/react-dialog_v9.7.1",
|
|
7
196
|
"version": "9.7.1",
|
|
8
197
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,63 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-dialog
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 02 Oct 2023 08:53:05 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.7.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.7.4)
|
|
8
|
+
|
|
9
|
+
Mon, 02 Oct 2023 08:53:05 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.7.3..@fluentui/react-dialog_v9.7.4)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-shared-contexts to v9.9.2 ([PR #29351](https://github.com/microsoft/fluentui/pull/29351) by beachball)
|
|
15
|
+
- Bump @fluentui/react-tabster to v9.13.2 ([PR #29351](https://github.com/microsoft/fluentui/pull/29351) by beachball)
|
|
16
|
+
- Bump @fluentui/react-portal to v9.3.19 ([PR #29351](https://github.com/microsoft/fluentui/pull/29351) by beachball)
|
|
17
|
+
|
|
18
|
+
## [9.7.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.7.3)
|
|
19
|
+
|
|
20
|
+
Tue, 26 Sep 2023 17:49:05 GMT
|
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.7.2..@fluentui/react-dialog_v9.7.3)
|
|
22
|
+
|
|
23
|
+
### Patches
|
|
24
|
+
|
|
25
|
+
- chore: trigger manual version bump after broken release ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by yuanboxue@microsoft.com)
|
|
26
|
+
- Bump @fluentui/react-utilities to v9.13.5 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
27
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.12 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
28
|
+
- Bump @fluentui/keyboard-keys to v9.0.6 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
29
|
+
- Bump @fluentui/react-context-selector to v9.1.36 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
30
|
+
- Bump @fluentui/react-shared-contexts to v9.9.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
31
|
+
- Bump @fluentui/react-aria to v9.3.38 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
32
|
+
- Bump @fluentui/react-tabster to v9.13.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
33
|
+
- Bump @fluentui/react-theme to v9.1.14 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
34
|
+
- Bump @fluentui/react-portal to v9.3.18 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
35
|
+
|
|
36
|
+
## [9.7.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.7.2)
|
|
37
|
+
|
|
38
|
+
Tue, 26 Sep 2023 15:32:01 GMT
|
|
39
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.7.1..@fluentui/react-dialog_v9.7.2)
|
|
40
|
+
|
|
41
|
+
### Patches
|
|
42
|
+
|
|
43
|
+
- fix: use makeResetStyles for base dialog components styles ([PR #29280](https://github.com/microsoft/fluentui/pull/29280) by marcosvmmoura@gmail.com)
|
|
44
|
+
- fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
|
|
45
|
+
- chore: Update react-icons version to pick up IconDirectionContextProvider updated export ([PR #29151](https://github.com/microsoft/fluentui/pull/29151) by ololubek@microsoft.com)
|
|
46
|
+
- chore: adds CSS containment to DialogSurface ([PR #29213](https://github.com/microsoft/fluentui/pull/29213) by bernardo.sunderhus@gmail.com)
|
|
47
|
+
- doc: updates documentation on alert dialog escape dismiss ([PR #29211](https://github.com/microsoft/fluentui/pull/29211) by bernardo.sunderhus@gmail.com)
|
|
48
|
+
- Bump @fluentui/react-utilities to v9.13.4 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
49
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.11 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
50
|
+
- Bump @fluentui/keyboard-keys to v9.0.5 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
51
|
+
- Bump @fluentui/react-context-selector to v9.1.35 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
52
|
+
- Bump @fluentui/react-shared-contexts to v9.9.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
53
|
+
- Bump @fluentui/react-aria to v9.3.37 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
54
|
+
- Bump @fluentui/react-tabster to v9.13.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
55
|
+
- Bump @fluentui/react-theme to v9.1.13 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
56
|
+
- Bump @fluentui/react-portal to v9.3.17 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
57
|
+
|
|
7
58
|
## [9.7.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.7.1)
|
|
8
59
|
|
|
9
|
-
Wed, 20 Sep 2023 17:
|
|
60
|
+
Wed, 20 Sep 2023 17:47:36 GMT
|
|
10
61
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.7.0..@fluentui/react-dialog_v9.7.1)
|
|
11
62
|
|
|
12
63
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -168,7 +168,7 @@ export declare type DialogProps = ComponentProps<Partial<DialogSlots>> & {
|
|
|
168
168
|
* `alert`: is a special type of modal dialogs that interrupts the user's workflow
|
|
169
169
|
* to communicate an important message or ask for a decision.
|
|
170
170
|
* Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog,
|
|
171
|
-
* and it cannot be dismissed through the dimmed background
|
|
171
|
+
* and it cannot be dismissed through the dimmed background.
|
|
172
172
|
*
|
|
173
173
|
* @default modal
|
|
174
174
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Dialog.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface/DialogSurface.types';\n\nexport type DialogSlots = {};\n\nexport type DialogOpenChangeEvent = DialogOpenChangeData['event'];\n\nexport type DialogOpenChangeData =\n | {\n type: 'escapeKeyDown';\n open: boolean;\n event: React.KeyboardEvent<DialogSurfaceElement>;\n }\n | {\n type: 'backdropClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n }\n | {\n type: 'triggerClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n };\n\nexport type DialogModalType = 'modal' | 'non-modal' | 'alert';\n\n/**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\nexport type DialogOpenChangeEventHandler = (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;\n\nexport type DialogContextValues = {\n dialog: DialogContextValue;\n /**\n * dialogSurface context is provided by Dialog as false\n * to ensure components inside Dialog but outside DialogSurface will consume this as false\n */\n dialogSurface: DialogSurfaceContextValue;\n};\n\nexport type DialogProps = ComponentProps<Partial<DialogSlots>> & {\n /**\n * Dialog variations.\n *\n * `modal`: When this type of dialog is open, the rest of the page is dimmed out and cannot be interacted with.\n * The tab sequence is kept within the dialog and moving the focus outside\n * the dialog will imply closing it. This is the default type of the component.\n *\n * `non-modal`: When a non-modal dialog is open, the rest of the page is not dimmed out\n * and users can interact with the rest of the page.\n * This also implies that the tab focus can move outside the dialog when it reaches the last focusable element.\n *\n * `alert`: is a special type of modal dialogs that interrupts the user's workflow\n * to communicate an important message or ask for a decision.\n * Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog,\n * and it cannot be dismissed through the dimmed background
|
|
1
|
+
{"version":3,"sources":["Dialog.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface/DialogSurface.types';\n\nexport type DialogSlots = {};\n\nexport type DialogOpenChangeEvent = DialogOpenChangeData['event'];\n\nexport type DialogOpenChangeData =\n | {\n type: 'escapeKeyDown';\n open: boolean;\n event: React.KeyboardEvent<DialogSurfaceElement>;\n }\n | {\n type: 'backdropClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n }\n | {\n type: 'triggerClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n };\n\nexport type DialogModalType = 'modal' | 'non-modal' | 'alert';\n\n/**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\nexport type DialogOpenChangeEventHandler = (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;\n\nexport type DialogContextValues = {\n dialog: DialogContextValue;\n /**\n * dialogSurface context is provided by Dialog as false\n * to ensure components inside Dialog but outside DialogSurface will consume this as false\n */\n dialogSurface: DialogSurfaceContextValue;\n};\n\nexport type DialogProps = ComponentProps<Partial<DialogSlots>> & {\n /**\n * Dialog variations.\n *\n * `modal`: When this type of dialog is open, the rest of the page is dimmed out and cannot be interacted with.\n * The tab sequence is kept within the dialog and moving the focus outside\n * the dialog will imply closing it. This is the default type of the component.\n *\n * `non-modal`: When a non-modal dialog is open, the rest of the page is not dimmed out\n * and users can interact with the rest of the page.\n * This also implies that the tab focus can move outside the dialog when it reaches the last focusable element.\n *\n * `alert`: is a special type of modal dialogs that interrupts the user's workflow\n * to communicate an important message or ask for a decision.\n * Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog,\n * and it cannot be dismissed through the dimmed background.\n *\n * @default modal\n */\n modalType?: DialogModalType;\n /**\n * Controls the open state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Default value for the uncontrolled open state of the dialog.\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\n onOpenChange?: DialogOpenChangeEventHandler;\n /**\n * Can contain two children including {@link DialogTrigger} and {@link DialogSurface}.\n * Alternatively can only contain {@link DialogSurface} if using trigger outside dialog, or controlling state.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n /**\n * Enables standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n * where the focus trap involves setting outside elements inert.\n *\n * @default false\n */\n inertTrapFocus?: boolean;\n};\n\nexport type DialogState = ComponentState<DialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"],"names":[],"mappings":"AAAA,WAsGI"}
|
|
@@ -20,8 +20,7 @@ import { useModalAttributes } from '@fluentui/react-tabster';
|
|
|
20
20
|
initialState: false
|
|
21
21
|
});
|
|
22
22
|
const requestOpenChange = useEventCallback((data)=>{
|
|
23
|
-
|
|
24
|
-
(_onOpenChange = onOpenChange) === null || _onOpenChange === void 0 ? void 0 : _onOpenChange(data.event, data);
|
|
23
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(data.event, data);
|
|
25
24
|
// if user prevents default then do not change state value
|
|
26
25
|
// otherwise updates state value and trigger reference to the element that caused the opening
|
|
27
26
|
if (!data.event.isDefaultPrevented()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDialog.ts"],"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';\nimport { useModalAttributes } from '@fluentui/react-tabster';\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, inertTrapFocus = false } = 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 const { modalAttributes, triggerAttributes } = useModalAttributes({\n trapFocus: modalType !== 'non-modal',\n legacyTrapFocus: !inertTrapFocus,\n });\n\n return {\n components: {\n backdrop: 'div',\n },\n inertTrapFocus,\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 modalAttributes: modalType !== 'non-modal' ? modalAttributes : undefined,\n triggerAttributes,\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(/* #__DE-INDENT__ */ `\n @fluentui/react-dialog [useDialog]:\n Dialog must contain at least one child <DialogSurface/>,\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"],"names":["React","useControllableState","useEventCallback","useId","useIsomorphicLayoutEffect","useHasParentContext","useDisableBodyScroll","useFocusFirstElement","DialogContext","useModalAttributes","useDialog_unstable","props","children","modalType","onOpenChange","inertTrapFocus","trigger","content","childrenToTriggerAndContent","open","setOpen","state","defaultState","defaultOpen","initialState","requestOpenChange","data","event","isDefaultPrevented","focusRef","disableBodyScroll","isBodyScrollLocked","Boolean","modalAttributes","triggerAttributes","trapFocus","legacyTrapFocus","components","backdrop","dialogTitleId","isNestedDialog","dialogRef","undefined","childrenArray","Children","toArray","process","env","NODE_ENV","length","console","warn"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,yBAAyB,QAAQ,4BAA4B;AACrH,SAASC,mBAAmB,QAAQ,mCAAmC;AACvE,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,cAAc;AACzE,SAASC,aAAa,QAAQ,iBAAiB;AAG/C,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7D;;;;;;;CAOC,GACD,OAAO,MAAMC,qBAAqB,CAACC;IACjC,MAAM,EAAEC,QAAQ,EAAEC,YAAY,OAAO,EAAEC,YAAY,EAAEC,iBAAiB,KAAK,EAAE,GAAGJ;IAEhF,MAAM,CAACK,SAASC,QAAQ,GAAGC,4BAA4BN;IAEvD,MAAM,CAACO,MAAMC,QAAQ,GAAGnB,qBAAqB;QAC3CoB,OAAOV,MAAMQ,IAAI;QACjBG,cAAcX,MAAMY,WAAW;QAC/BC,cAAc;IAChB;IAEA,MAAMC,oBAAoBvB,iBAAiB,CAACwB;
|
|
1
|
+
{"version":3,"sources":["useDialog.ts"],"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';\nimport { useModalAttributes } from '@fluentui/react-tabster';\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, inertTrapFocus = false } = 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 const { modalAttributes, triggerAttributes } = useModalAttributes({\n trapFocus: modalType !== 'non-modal',\n legacyTrapFocus: !inertTrapFocus,\n });\n\n return {\n components: {\n backdrop: 'div',\n },\n inertTrapFocus,\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 modalAttributes: modalType !== 'non-modal' ? modalAttributes : undefined,\n triggerAttributes,\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(/* #__DE-INDENT__ */ `\n @fluentui/react-dialog [useDialog]:\n Dialog must contain at least one child <DialogSurface/>,\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"],"names":["React","useControllableState","useEventCallback","useId","useIsomorphicLayoutEffect","useHasParentContext","useDisableBodyScroll","useFocusFirstElement","DialogContext","useModalAttributes","useDialog_unstable","props","children","modalType","onOpenChange","inertTrapFocus","trigger","content","childrenToTriggerAndContent","open","setOpen","state","defaultState","defaultOpen","initialState","requestOpenChange","data","event","isDefaultPrevented","focusRef","disableBodyScroll","isBodyScrollLocked","Boolean","modalAttributes","triggerAttributes","trapFocus","legacyTrapFocus","components","backdrop","dialogTitleId","isNestedDialog","dialogRef","undefined","childrenArray","Children","toArray","process","env","NODE_ENV","length","console","warn"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,yBAAyB,QAAQ,4BAA4B;AACrH,SAASC,mBAAmB,QAAQ,mCAAmC;AACvE,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,cAAc;AACzE,SAASC,aAAa,QAAQ,iBAAiB;AAG/C,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7D;;;;;;;CAOC,GACD,OAAO,MAAMC,qBAAqB,CAACC;IACjC,MAAM,EAAEC,QAAQ,EAAEC,YAAY,OAAO,EAAEC,YAAY,EAAEC,iBAAiB,KAAK,EAAE,GAAGJ;IAEhF,MAAM,CAACK,SAASC,QAAQ,GAAGC,4BAA4BN;IAEvD,MAAM,CAACO,MAAMC,QAAQ,GAAGnB,qBAAqB;QAC3CoB,OAAOV,MAAMQ,IAAI;QACjBG,cAAcX,MAAMY,WAAW;QAC/BC,cAAc;IAChB;IAEA,MAAMC,oBAAoBvB,iBAAiB,CAACwB;QAC1CZ,yBAAAA,mCAAAA,aAAeY,KAAKC,KAAK,EAAED;QAE3B,0DAA0D;QAC1D,6FAA6F;QAC7F,IAAI,CAACA,KAAKC,KAAK,CAACC,kBAAkB,IAAI;YACpCR,QAAQM,KAAKP,IAAI;QACnB;IACF;IAEA,MAAMU,WAAWtB,qBAAqBY,MAAMN;IAC5C,MAAMiB,oBAAoBxB;IAC1B,MAAMyB,qBAAqBC,QAAQb,QAAQN,cAAc;IAEzDT,0BAA0B;QACxB,IAAI2B,oBAAoB;YACtB,OAAOD;QACT;IACF,GAAG;QAACA;QAAmBC;KAAmB;IAE1C,MAAM,EAAEE,eAAe,EAAEC,iBAAiB,EAAE,GAAGzB,mBAAmB;QAChE0B,WAAWtB,cAAc;QACzBuB,iBAAiB,CAACrB;IACpB;IAEA,OAAO;QACLsB,YAAY;YACVC,UAAU;QACZ;QACAvB;QACAI;QACAN;QACAI,SAASE,OAAOF,UAAU;QAC1BD;QACAS;QACAc,eAAepC,MAAM;QACrBqC,gBAAgBnC,oBAAoBG;QACpCiC,WAAWZ;QACXI,iBAAiBpB,cAAc,cAAcoB,kBAAkBS;QAC/DR;IACF;AACF,EAAE;AAEF;;CAEC,GACD,SAAShB,4BACPN,QAAyB;IAEzB,MAAM+B,gBAAgB3C,MAAM4C,QAAQ,CAACC,OAAO,CAACjC;IAC7C,IAAIkC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIL,cAAcM,MAAM,KAAK,KAAKN,cAAcM,MAAM,KAAK,GAAG;YAC5D,sCAAsC;YACtCC,QAAQC,IAAI,CAAsB,CAAC;;2EAInC,CAAC;QACH;IACF;IACA,OAAQR,cAAcM,MAAM;QAC1B,mDAAmD;QACnD,KAAK;YACH,OAAON;QACT,kCAAkC;QAClC,KAAK;YACH,OAAO;gBAACD;gBAAWC,aAAa,CAAC,EAAE;aAAC;QACtC,eAAe;QACf;YACE,OAAO;gBAACD;gBAAWA;aAAU;IACjC;AACF"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
2
|
import { DIALOG_GAP, MEDIA_QUERY_BREAKPOINT_SELECTOR } from '../../contexts/constants';
|
|
3
3
|
export const dialogActionsClassNames = {
|
|
4
4
|
root: 'fui-DialogActions'
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Styles for the root slot
|
|
8
|
+
*/
|
|
9
|
+
const useResetStyles = /*#__PURE__*/__resetStyles("r78gbj", null, {
|
|
10
|
+
r: [".r78gbj{column-gap:8px;row-gap:8px;height:fit-content;box-sizing:border-box;display:flex;grid-row-start:3;grid-row-end:3;}"],
|
|
11
|
+
s: ["@media screen and (max-width: 480px){.r78gbj{flex-direction:column;justify-self:stretch;}}"]
|
|
12
|
+
});
|
|
6
13
|
const useStyles = /*#__PURE__*/__styles({
|
|
7
|
-
root: {
|
|
8
|
-
Bqenvij: "f3052tw",
|
|
9
|
-
B7ck84d: "f1ewtqcl",
|
|
10
|
-
mc9l5x: "f22iagw",
|
|
11
|
-
Ijaq50: "f1cztu7b",
|
|
12
|
-
nk6f5a: "fcu02xx",
|
|
13
|
-
i8kkvl: "f4px1ci",
|
|
14
|
-
Belr9w4: "fn67r4l",
|
|
15
|
-
Bmdcpmo: "f6glcwc",
|
|
16
|
-
th9wkt: "f1e3st1r"
|
|
17
|
-
},
|
|
18
14
|
gridPositionEnd: {
|
|
19
15
|
Bdqf98w: "f1a7i8kp",
|
|
20
16
|
Br312pm: "fd46tj4",
|
|
@@ -38,12 +34,8 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
38
34
|
Br312pm: "fwpfdsa"
|
|
39
35
|
}
|
|
40
36
|
}, {
|
|
41
|
-
d: [".
|
|
42
|
-
m: [["@media screen and (max-width: 480px){.
|
|
43
|
-
m: "screen and (max-width: 480px)"
|
|
44
|
-
}], ["@media screen and (max-width: 480px){.f1e3st1r{justify-self:stretch;}}", {
|
|
45
|
-
m: "screen and (max-width: 480px)"
|
|
46
|
-
}], ["@media screen and (max-width: 480px){.f1f41i0t{grid-column-start:1;}}", {
|
|
37
|
+
d: [".f1a7i8kp{justify-self:end;}", ".fd46tj4{grid-column-start:2;}", ".fsyjsko{grid-column-end:4;}", ".fsxvdwy{justify-self:start;}", ".fwpfdsa{grid-column-start:1;}", ".f1e2fz10{grid-column-end:2;}"],
|
|
38
|
+
m: [["@media screen and (max-width: 480px){.f1f41i0t{grid-column-start:1;}}", {
|
|
47
39
|
m: "screen and (max-width: 480px)"
|
|
48
40
|
}], ["@media screen and (max-width: 480px){.f1jaqex3{grid-row-start:4;}}", {
|
|
49
41
|
m: "screen and (max-width: 480px)"
|
|
@@ -59,8 +51,9 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
59
51
|
* Apply styling to the DialogActions slots based on the state
|
|
60
52
|
*/
|
|
61
53
|
export const useDialogActionsStyles_unstable = state => {
|
|
54
|
+
const resetStyles = useResetStyles();
|
|
62
55
|
const styles = useStyles();
|
|
63
|
-
state.root.className = mergeClasses(dialogActionsClassNames.root,
|
|
56
|
+
state.root.className = mergeClasses(dialogActionsClassNames.root, resetStyles, state.position === 'start' && styles.gridPositionStart, state.position === 'end' && styles.gridPositionEnd, state.fluid && state.position === 'start' && styles.fluidStart, state.fluid && state.position === 'end' && styles.fluidEnd, state.root.className);
|
|
64
57
|
return state;
|
|
65
58
|
};
|
|
66
59
|
//# sourceMappingURL=useDialogActionsStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","shorthands","DIALOG_GAP","MEDIA_QUERY_BREAKPOINT_SELECTOR","dialogActionsClassNames","root","
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","shorthands","DIALOG_GAP","MEDIA_QUERY_BREAKPOINT_SELECTOR","dialogActionsClassNames","root","useResetStyles","r","s","useStyles","gridPositionEnd","Bdqf98w","Br312pm","Bw0ie65","B6n781s","Bv5d0be","v4ugfu","gridPositionStart","Bojbm9c","fluidStart","fluidEnd","d","m","useDialogActionsStyles_unstable","state","resetStyles","styles","className","position","fluid"],"sources":["useDialogActionsStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { DIALOG_GAP, MEDIA_QUERY_BREAKPOINT_SELECTOR } from '../../contexts/constants';\nexport const dialogActionsClassNames = {\n root: 'fui-DialogActions'\n};\n/**\n * Styles for the root slot\n */ const useResetStyles = makeResetStyles({\n ...shorthands.gap(DIALOG_GAP),\n height: 'fit-content',\n boxSizing: 'border-box',\n display: 'flex',\n gridRowStart: 3,\n gridRowEnd: 3,\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n flexDirection: 'column',\n justifySelf: 'stretch'\n }\n});\nconst useStyles = makeStyles({\n gridPositionEnd: {\n justifySelf: 'end',\n gridColumnStart: 2,\n gridColumnEnd: 4,\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n gridColumnStart: 1,\n gridRowStart: 4,\n gridRowEnd: 'auto'\n }\n },\n gridPositionStart: {\n justifySelf: 'start',\n gridColumnStart: 1,\n gridColumnEnd: 2,\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n gridColumnEnd: 4,\n gridRowStart: 3,\n gridRowEnd: 'auto'\n }\n },\n fluidStart: {\n gridColumnEnd: 4\n },\n fluidEnd: {\n gridColumnStart: 1\n }\n});\n/**\n * Apply styling to the DialogActions slots based on the state\n */ export const useDialogActionsStyles_unstable = (state)=>{\n const resetStyles = useResetStyles();\n const styles = useStyles();\n state.root.className = mergeClasses(dialogActionsClassNames.root, resetStyles, state.position === 'start' && styles.gridPositionStart, state.position === 'end' && styles.gridPositionEnd, state.fluid && state.position === 'start' && styles.fluidStart, state.fluid && state.position === 'end' && styles.fluidEnd, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACtF,SAASC,UAAU,EAAEC,+BAA+B,QAAQ,0BAA0B;AACtF,OAAO,MAAMC,uBAAuB,GAAG;EACnCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,cAAc,gBAAGR,aAAA;EAAAS,CAAA;EAAAC,CAAA;AAAA,CAW1B,CAAC;AACF,MAAMC,SAAS,gBAAGV,QAAA;EAAAW,eAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,iBAAA;IAAAN,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAK,OAAA;IAAAH,OAAA;IAAAC,MAAA;EAAA;EAAAG,UAAA;IAAAN,OAAA;EAAA;EAAAO,QAAA;IAAAR,OAAA;EAAA;AAAA;EAAAS,CAAA;EAAAC,CAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CA2BjB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,+BAA+B,GAAIC,KAAK,IAAG;EACxD,MAAMC,WAAW,GAAGnB,cAAc,CAAC,CAAC;EACpC,MAAMoB,MAAM,GAAGjB,SAAS,CAAC,CAAC;EAC1Be,KAAK,CAACnB,IAAI,CAACsB,SAAS,GAAG3B,YAAY,CAACI,uBAAuB,CAACC,IAAI,EAAEoB,WAAW,EAAED,KAAK,CAACI,QAAQ,KAAK,OAAO,IAAIF,MAAM,CAACT,iBAAiB,EAAEO,KAAK,CAACI,QAAQ,KAAK,KAAK,IAAIF,MAAM,CAAChB,eAAe,EAAEc,KAAK,CAACK,KAAK,IAAIL,KAAK,CAACI,QAAQ,KAAK,OAAO,IAAIF,MAAM,CAACP,UAAU,EAAEK,KAAK,CAACK,KAAK,IAAIL,KAAK,CAACI,QAAQ,KAAK,KAAK,IAAIF,MAAM,CAACN,QAAQ,EAAEI,KAAK,CAACnB,IAAI,CAACsB,SAAS,CAAC;EAC5U,OAAOH,KAAK;AAChB,CAAC"}
|
|
@@ -1,40 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __resetStyles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
2
|
import { DIALOG_GAP, MEDIA_QUERY_BREAKPOINT_SELECTOR, SURFACE_PADDING } from '../../contexts';
|
|
3
|
+
import { backdropStyles } from '../DialogSurface/useDialogSurfaceStyles.styles';
|
|
3
4
|
export const dialogBodyClassNames = {
|
|
4
5
|
root: 'fui-DialogBody'
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* Styles for the root slot
|
|
8
9
|
*/
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fshzfu: "f120kxnn",
|
|
13
|
-
Bxyxcbc: "flnwrvu",
|
|
14
|
-
B7ck84d: "f1ewtqcl",
|
|
15
|
-
B68tc82: "f1ln0qer",
|
|
16
|
-
Bmxbyg5: "fa2wlxz",
|
|
17
|
-
i8kkvl: "f4px1ci",
|
|
18
|
-
Belr9w4: "fn67r4l",
|
|
19
|
-
wkccdc: "f1x46k84",
|
|
20
|
-
Budl1dq: "fjj47a5",
|
|
21
|
-
B5xtmjs: "ff54dml",
|
|
22
|
-
Bqu9lor: "f1t97isy"
|
|
23
|
-
}
|
|
24
|
-
}, {
|
|
25
|
-
d: [".f13qh94s{display:grid;}", ".f120kxnn::backdrop{background-color:rgba(0, 0, 0, 0.4);}", ".flnwrvu{max-height:calc(100vh - 2 * 24px);}", ".f1ewtqcl{box-sizing:border-box;}", ".f1ln0qer{overflow-x:unset;}", ".fa2wlxz{overflow-y:unset;}", ".f4px1ci{column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f1x46k84{grid-template-rows:auto 1fr;}", ".fjj47a5{grid-template-columns:1fr 1fr auto;}"],
|
|
26
|
-
m: [["@media screen and (max-width: 480px){.ff54dml{max-width:100vw;}}", {
|
|
27
|
-
m: "screen and (max-width: 480px)"
|
|
28
|
-
}], ["@media screen and (max-width: 480px){.f1t97isy{grid-template-rows:auto 1fr auto;}}", {
|
|
29
|
-
m: "screen and (max-width: 480px)"
|
|
30
|
-
}]]
|
|
10
|
+
const useResetStyles = /*#__PURE__*/__resetStyles("r1evyu59", null, {
|
|
11
|
+
r: [".r1evyu59{overflow-x:unset;overflow-y:unset;column-gap:8px;row-gap:8px;display:grid;max-height:calc(100vh - 2 * 24px);box-sizing:border-box;grid-template-rows:auto 1fr;grid-template-columns:1fr 1fr auto;}", ".r1evyu59::backdrop{background-color:rgba(0, 0, 0, 0.4);}"],
|
|
12
|
+
s: ["@media screen and (max-width: 480px){.r1evyu59{max-width:100vw;grid-template-rows:auto 1fr auto;}}"]
|
|
31
13
|
});
|
|
32
14
|
/**
|
|
33
15
|
* Apply styling to the DialogBody slots based on the state
|
|
34
16
|
*/
|
|
35
17
|
export const useDialogBodyStyles_unstable = state => {
|
|
36
|
-
const
|
|
37
|
-
state.root.className = mergeClasses(dialogBodyClassNames.root,
|
|
18
|
+
const resetStyles = useResetStyles();
|
|
19
|
+
state.root.className = mergeClasses(dialogBodyClassNames.root, resetStyles, state.root.className);
|
|
38
20
|
return state;
|
|
39
21
|
};
|
|
40
22
|
//# sourceMappingURL=useDialogBodyStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["__resetStyles","mergeClasses","shorthands","DIALOG_GAP","MEDIA_QUERY_BREAKPOINT_SELECTOR","SURFACE_PADDING","backdropStyles","dialogBodyClassNames","root","useResetStyles","r","s","useDialogBodyStyles_unstable","state","resetStyles","className"],"sources":["useDialogBodyStyles.styles.js"],"sourcesContent":["import { makeResetStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { DIALOG_GAP, MEDIA_QUERY_BREAKPOINT_SELECTOR, SURFACE_PADDING } from '../../contexts';\nimport { backdropStyles } from '../DialogSurface/useDialogSurfaceStyles.styles';\nexport const dialogBodyClassNames = {\n root: 'fui-DialogBody'\n};\n/**\n * Styles for the root slot\n */ const useResetStyles = makeResetStyles({\n ...shorthands.overflow('unset'),\n ...shorthands.gap(DIALOG_GAP),\n display: 'grid',\n maxHeight: `calc(100vh - 2 * ${SURFACE_PADDING})`,\n boxSizing: 'border-box',\n gridTemplateRows: 'auto 1fr',\n gridTemplateColumns: '1fr 1fr auto',\n '&::backdrop': backdropStyles,\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n maxWidth: '100vw',\n gridTemplateRows: 'auto 1fr auto'\n }\n});\n/**\n * Apply styling to the DialogBody slots based on the state\n */ export const useDialogBodyStyles_unstable = (state)=>{\n const resetStyles = useResetStyles();\n state.root.className = mergeClasses(dialogBodyClassNames.root, resetStyles, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAA0BC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAC1E,SAASC,UAAU,EAAEC,+BAA+B,EAAEC,eAAe,QAAQ,gBAAgB;AAC7F,SAASC,cAAc,QAAQ,gDAAgD;AAC/E,OAAO,MAAMC,oBAAoB,GAAG;EAChCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,cAAc,gBAAGT,aAAA;EAAAU,CAAA;EAAAC,CAAA;AAAA,CAa1B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,4BAA4B,GAAIC,KAAK,IAAG;EACrD,MAAMC,WAAW,GAAGL,cAAc,CAAC,CAAC;EACpCI,KAAK,CAACL,IAAI,CAACO,SAAS,GAAGd,YAAY,CAACM,oBAAoB,CAACC,IAAI,EAAEM,WAAW,EAAED,KAAK,CAACL,IAAI,CAACO,SAAS,CAAC;EACjG,OAAOF,KAAK;AAChB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __resetStyles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
2
|
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
3
|
export const dialogContentClassNames = {
|
|
4
4
|
root: 'fui-DialogContent'
|
|
@@ -6,37 +6,13 @@ export const dialogContentClassNames = {
|
|
|
6
6
|
/**
|
|
7
7
|
* Styles for the root slot
|
|
8
8
|
*/
|
|
9
|
-
const useStyles = /*#__PURE__*/
|
|
10
|
-
root: {
|
|
11
|
-
Bmxbyg5: "f5zp4f",
|
|
12
|
-
sshi5w: "f1nxs5xn",
|
|
13
|
-
B7ck84d: "f1ewtqcl",
|
|
14
|
-
Ijaq50: "faunodf",
|
|
15
|
-
nk6f5a: "f88nxoq",
|
|
16
|
-
Br312pm: "fwpfdsa",
|
|
17
|
-
Bw0ie65: "fsyjsko",
|
|
18
|
-
z8tnut: "fr4fn7s",
|
|
19
|
-
z189sj: ["f171n1a0", "f1jwbs5a"],
|
|
20
|
-
Byoj8tv: "f1ean75l",
|
|
21
|
-
uwmqm3: ["f1jwbs5a", "f171n1a0"],
|
|
22
|
-
B6of3ja: "fxlnl9e",
|
|
23
|
-
t21cq0: ["ffs23cn", "f1v5tmjd"],
|
|
24
|
-
jrapky: "f2uu7rc",
|
|
25
|
-
Frg6f3: ["f1v5tmjd", "ffs23cn"],
|
|
26
|
-
Bahqtrf: "fk6fouc",
|
|
27
|
-
Be2twd7: "fkhj508",
|
|
28
|
-
Bhrd7zp: "figsok6",
|
|
29
|
-
Bg96gwp: "f1i3iumi"
|
|
30
|
-
}
|
|
31
|
-
}, {
|
|
32
|
-
d: [".f5zp4f{overflow-y:auto;}", ".f1nxs5xn{min-height:32px;}", ".f1ewtqcl{box-sizing:border-box;}", ".faunodf{grid-row-start:2;}", ".f88nxoq{grid-row-end:2;}", ".fwpfdsa{grid-column-start:1;}", ".fsyjsko{grid-column-end:4;}", ".fr4fn7s{padding-top:var(--strokeWidthThick);}", ".f171n1a0{padding-right:var(--strokeWidthThick);}", ".f1jwbs5a{padding-left:var(--strokeWidthThick);}", ".f1ean75l{padding-bottom:var(--strokeWidthThick);}", ".fxlnl9e{margin-top:calc(var(--strokeWidthThick) * -1);}", ".ffs23cn{margin-right:calc(var(--strokeWidthThick) * -1);}", ".f1v5tmjd{margin-left:calc(var(--strokeWidthThick) * -1);}", ".f2uu7rc{margin-bottom:calc(var(--strokeWidthThick) * -1);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
|
|
33
|
-
});
|
|
9
|
+
const useStyles = /*#__PURE__*/__resetStyles("r1e0mpcm", "r1equu0b", [".r1e0mpcm{padding-top:var(--strokeWidthThick);padding-right:var(--strokeWidthThick);padding-bottom:var(--strokeWidthThick);padding-left:var(--strokeWidthThick);margin-top:calc(var(--strokeWidthThick) * -1);margin-right:calc(var(--strokeWidthThick) * -1);margin-bottom:calc(var(--strokeWidthThick) * -1);margin-left:calc(var(--strokeWidthThick) * -1);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);overflow-y:auto;min-height:32px;box-sizing:border-box;grid-row-start:2;grid-row-end:2;grid-column-start:1;grid-column-end:4;}", ".r1equu0b{padding-top:var(--strokeWidthThick);padding-left:var(--strokeWidthThick);padding-bottom:var(--strokeWidthThick);padding-right:var(--strokeWidthThick);margin-top:calc(var(--strokeWidthThick) * -1);margin-left:calc(var(--strokeWidthThick) * -1);margin-bottom:calc(var(--strokeWidthThick) * -1);margin-right:calc(var(--strokeWidthThick) * -1);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);overflow-y:auto;min-height:32px;box-sizing:border-box;grid-row-start:2;grid-row-end:2;grid-column-start:1;grid-column-end:4;}"]);
|
|
34
10
|
/**
|
|
35
11
|
* Apply styling to the DialogContent slots based on the state
|
|
36
12
|
*/
|
|
37
13
|
export const useDialogContentStyles_unstable = state => {
|
|
38
14
|
const styles = useStyles();
|
|
39
|
-
state.root.className = mergeClasses(dialogContentClassNames.root, styles
|
|
15
|
+
state.root.className = mergeClasses(dialogContentClassNames.root, styles, state.root.className);
|
|
40
16
|
return state;
|
|
41
17
|
};
|
|
42
18
|
//# sourceMappingURL=useDialogContentStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["__resetStyles","mergeClasses","shorthands","tokens","typographyStyles","dialogContentClassNames","root","useStyles","useDialogContentStyles_unstable","state","styles","className"],"sources":["useDialogContentStyles.styles.js"],"sourcesContent":["import { makeResetStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const dialogContentClassNames = {\n root: 'fui-DialogContent'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeResetStyles({\n ...shorthands.padding(tokens.strokeWidthThick),\n ...shorthands.margin(`calc(${tokens.strokeWidthThick} * -1)`),\n ...typographyStyles.body1,\n overflowY: 'auto',\n minHeight: '32px',\n boxSizing: 'border-box',\n gridRowStart: 2,\n gridRowEnd: 2,\n gridColumnStart: 1,\n gridColumnEnd: 4\n});\n/**\n * Apply styling to the DialogContent slots based on the state\n */ export const useDialogContentStyles_unstable = (state)=>{\n const styles = useStyles();\n state.root.className = mergeClasses(dialogContentClassNames.root, styles, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAA0BC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,uBAAuB,GAAG;EACnCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGP,aAAA,ivCAWrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMQ,+BAA+B,GAAIC,KAAK,IAAG;EACxD,MAAMC,MAAM,GAAGH,SAAS,CAAC,CAAC;EAC1BE,KAAK,CAACH,IAAI,CAACK,SAAS,GAAGV,YAAY,CAACI,uBAAuB,CAACC,IAAI,EAAEI,MAAM,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;EAC/F,OAAOF,KAAK;AAChB,CAAC"}
|
|
@@ -31,8 +31,8 @@ import { Escape } from '@fluentui/keyboard-keys';
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
const handleKeyDown = useEventCallback((event)=>{
|
|
34
|
-
var _props_onKeyDown
|
|
35
|
-
(_props_onKeyDown =
|
|
34
|
+
var _props_onKeyDown;
|
|
35
|
+
(_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, event);
|
|
36
36
|
if (event.key === Escape && !event.isDefaultPrevented()) {
|
|
37
37
|
requestOpenChange({
|
|
38
38
|
event,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDialogSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n slot,\n} from '@fluentui/react-utilities';\nimport type { DialogSurfaceElement, DialogSurfaceProps, DialogSurfaceState } from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\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 modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const modalAttributes = useDialogContext_unstable(ctx => ctx.modalAttributes);\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<HTMLDivElement>) => {\n props.onKeyDown?.(event);\n\n if (event.key === Escape && !event.isDefaultPrevented()) {\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 backdrop = slot.optional(props.backdrop, {\n renderByDefault: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n },\n elementType: 'div',\n });\n if (backdrop) {\n backdrop.onClick = handledBackdropClick;\n }\n return {\n components: { backdrop: 'div', root: 'div' },\n backdrop,\n mountNode: props.mountNode,\n root: slot.always(\n getNativeElementProps(props.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 { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","getNativeElementProps","useEventCallback","useMergedRefs","isResolvedShorthand","slot","useDialogContext_unstable","Escape","useDialogSurface_unstable","props","ref","modalType","ctx","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","event","backdrop","onClick","isDefaultPrevented","type","handleKeyDown","onKeyDown","key","stopPropagation","optional","renderByDefault","defaultProps","elementType","components","root","mountNode","always","as","tabIndex","role","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,qBAAqB,EACrBC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB,EACnBC,IAAI,QACC,4BAA4B;AAEnC,SAASC,yBAAyB,QAAQ,iBAAiB;AAC3D,SAASC,MAAM,QAAQ,0BAA0B;AAEjD;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,YAAYL,0BAA0BM,CAAAA,MAAOA,IAAID,SAAS;IAChE,MAAME,kBAAkBP,0BAA0BM,CAAAA,MAAOA,IAAIC,eAAe;IAC5E,MAAMC,YAAYR,0BAA0BM,CAAAA,MAAOA,IAAIE,SAAS;IAChE,MAAMC,OAAOT,0BAA0BM,CAAAA,MAAOA,IAAIG,IAAI;IACtD,MAAMC,oBAAoBV,0BAA0BM,CAAAA,MAAOA,IAAII,iBAAiB;IAChF,MAAMC,gBAAgBX,0BAA0BM,CAAAA,MAAOA,IAAIM,aAAa;IAExE,MAAMC,uBAAuBjB,iBAAiB,CAACkB;QAC7C,IAAIhB,oBAAoBK,MAAMY,QAAQ,GAAG;gBACvCZ,yBAAAA;aAAAA,0BAAAA,CAAAA,kBAAAA,MAAMY,QAAQ,EAACC,OAAO,cAAtBb,8CAAAA,6BAAAA,iBAAyBW;QAC3B;QACA,IAAIT,cAAc,WAAW,CAACS,MAAMG,kBAAkB,IAAI;YACxDP,kBAAkB;gBAChBI;gBACAL,MAAM;gBACNS,MAAM;YACR;QACF;IACF;IAEA,MAAMC,gBAAgBvB,iBAAiB,CAACkB;YACtCX
|
|
1
|
+
{"version":3,"sources":["useDialogSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n slot,\n} from '@fluentui/react-utilities';\nimport type { DialogSurfaceElement, DialogSurfaceProps, DialogSurfaceState } from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\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 modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const modalAttributes = useDialogContext_unstable(ctx => ctx.modalAttributes);\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<HTMLDivElement>) => {\n props.onKeyDown?.(event);\n\n if (event.key === Escape && !event.isDefaultPrevented()) {\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 backdrop = slot.optional(props.backdrop, {\n renderByDefault: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n },\n elementType: 'div',\n });\n if (backdrop) {\n backdrop.onClick = handledBackdropClick;\n }\n return {\n components: { backdrop: 'div', root: 'div' },\n backdrop,\n mountNode: props.mountNode,\n root: slot.always(\n getNativeElementProps(props.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 { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","getNativeElementProps","useEventCallback","useMergedRefs","isResolvedShorthand","slot","useDialogContext_unstable","Escape","useDialogSurface_unstable","props","ref","modalType","ctx","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","event","backdrop","onClick","isDefaultPrevented","type","handleKeyDown","onKeyDown","key","stopPropagation","optional","renderByDefault","defaultProps","elementType","components","root","mountNode","always","as","tabIndex","role","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,qBAAqB,EACrBC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB,EACnBC,IAAI,QACC,4BAA4B;AAEnC,SAASC,yBAAyB,QAAQ,iBAAiB;AAC3D,SAASC,MAAM,QAAQ,0BAA0B;AAEjD;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,YAAYL,0BAA0BM,CAAAA,MAAOA,IAAID,SAAS;IAChE,MAAME,kBAAkBP,0BAA0BM,CAAAA,MAAOA,IAAIC,eAAe;IAC5E,MAAMC,YAAYR,0BAA0BM,CAAAA,MAAOA,IAAIE,SAAS;IAChE,MAAMC,OAAOT,0BAA0BM,CAAAA,MAAOA,IAAIG,IAAI;IACtD,MAAMC,oBAAoBV,0BAA0BM,CAAAA,MAAOA,IAAII,iBAAiB;IAChF,MAAMC,gBAAgBX,0BAA0BM,CAAAA,MAAOA,IAAIM,aAAa;IAExE,MAAMC,uBAAuBjB,iBAAiB,CAACkB;QAC7C,IAAIhB,oBAAoBK,MAAMY,QAAQ,GAAG;gBACvCZ,yBAAAA;aAAAA,0BAAAA,CAAAA,kBAAAA,MAAMY,QAAQ,EAACC,OAAO,cAAtBb,8CAAAA,6BAAAA,iBAAyBW;QAC3B;QACA,IAAIT,cAAc,WAAW,CAACS,MAAMG,kBAAkB,IAAI;YACxDP,kBAAkB;gBAChBI;gBACAL,MAAM;gBACNS,MAAM;YACR;QACF;IACF;IAEA,MAAMC,gBAAgBvB,iBAAiB,CAACkB;YACtCX;SAAAA,mBAAAA,MAAMiB,SAAS,cAAfjB,uCAAAA,sBAAAA,OAAkBW;QAElB,IAAIA,MAAMO,GAAG,KAAKpB,UAAU,CAACa,MAAMG,kBAAkB,IAAI;YACvDP,kBAAkB;gBAChBI;gBACAL,MAAM;gBACNS,MAAM;YACR;YACA,qFAAqF;YACrF,gDAAgD;YAChDJ,MAAMQ,eAAe;QACvB;IACF;IAEA,MAAMP,WAAWhB,KAAKwB,QAAQ,CAACpB,MAAMY,QAAQ,EAAE;QAC7CS,iBAAiBf,QAAQJ,cAAc;QACvCoB,cAAc;YACZ,eAAe;QACjB;QACAC,aAAa;IACf;IACA,IAAIX,UAAU;QACZA,SAASC,OAAO,GAAGH;IACrB;QAM0BV;IAL1B,OAAO;QACLwB,YAAY;YAAEZ,UAAU;YAAOa,MAAM;QAAM;QAC3Cb;QACAc,WAAW1B,MAAM0B,SAAS;QAC1BD,MAAM7B,KAAK+B,MAAM,CACfnC,sBAAsBQ,CAAAA,YAAAA,MAAM4B,EAAE,cAAR5B,uBAAAA,YAAY,OAAO;YACvC6B,UAAU,CAAC;YACX,cAAc3B,cAAc;YAC5B4B,MAAM5B,cAAc,UAAU,gBAAgB;YAC9C,mBAAmBF,KAAK,CAAC,aAAa,GAAG+B,YAAYvB;YACrD,GAAGR,KAAK;YACR,GAAGI,eAAe;YAClBa,WAAWD;YACXf,KAAKP,cAAcO,KAAKI;QAC1B,IACA;YAAEkB,aAAa;QAAM;IAEzB;AACF,EAAE"}
|