@fluentui/react-provider 9.0.0-beta.1 → 9.0.0-beta.5
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 +233 -1
- package/CHANGELOG.md +62 -2
- package/dist/react-provider.d.ts +5 -0
- package/lib/components/FluentProvider/FluentProvider.js +3 -3
- package/lib/components/FluentProvider/FluentProvider.js.map +1 -1
- package/lib/components/FluentProvider/index.d.ts +1 -0
- package/lib/components/FluentProvider/index.js +1 -0
- package/lib/components/FluentProvider/index.js.map +1 -1
- package/lib/components/FluentProvider/renderFluentProvider.js +6 -7
- package/lib/components/FluentProvider/renderFluentProvider.js.map +1 -1
- package/lib/components/FluentProvider/useFluentProvider.js +16 -18
- package/lib/components/FluentProvider/useFluentProvider.js.map +1 -1
- package/lib/components/FluentProvider/useFluentProviderContextValues.js +14 -14
- package/lib/components/FluentProvider/useFluentProviderContextValues.js.map +1 -1
- package/lib/components/FluentProvider/useFluentProviderStyles.d.ts +1 -0
- package/lib/components/FluentProvider/useFluentProviderStyles.js +5 -4
- package/lib/components/FluentProvider/useFluentProviderStyles.js.map +1 -1
- package/lib/components/FluentProvider/useThemeStyleTag.js +18 -15
- package/lib/components/FluentProvider/useThemeStyleTag.js.map +1 -1
- package/lib-commonjs/FluentProvider.js +1 -1
- package/lib-commonjs/components/FluentProvider/FluentProvider.js +8 -8
- package/lib-commonjs/components/FluentProvider/FluentProvider.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/index.d.ts +1 -0
- package/lib-commonjs/components/FluentProvider/index.js +3 -1
- package/lib-commonjs/components/FluentProvider/index.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/renderFluentProvider.js +10 -12
- package/lib-commonjs/components/FluentProvider/renderFluentProvider.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProvider.js +20 -23
- package/lib-commonjs/components/FluentProvider/useFluentProvider.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProviderContextValues.js +16 -16
- package/lib-commonjs/components/FluentProvider/useFluentProviderContextValues.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProviderStyles.d.ts +1 -0
- package/lib-commonjs/components/FluentProvider/useFluentProviderStyles.js +8 -6
- package/lib-commonjs/components/FluentProvider/useFluentProviderStyles.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useThemeStyleTag.js +22 -18
- package/lib-commonjs/components/FluentProvider/useThemeStyleTag.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/package.json +12 -12
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -12
- package/lib/common/isConformant.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -23
- package/lib-commonjs/common/isConformant.js.map +0 -1
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,239 @@
|
|
2
2
|
"name": "@fluentui/react-provider",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Thu, 25 Nov 2021 08:31:34 GMT",
|
6
|
+
"tag": "@fluentui/react-provider_v9.0.0-beta.5",
|
7
|
+
"version": "9.0.0-beta.5",
|
8
|
+
"comments": {
|
9
|
+
"none": [
|
10
|
+
{
|
11
|
+
"author": "olfedias@microsoft.com",
|
12
|
+
"package": "@fluentui/react-provider",
|
13
|
+
"commit": "14b1e35b8da2f04538c2183a9be6c6b76dad3cca",
|
14
|
+
"comment": "update tooling configs"
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"prerelease": [
|
18
|
+
{
|
19
|
+
"author": "beachball",
|
20
|
+
"package": "@fluentui/react-provider",
|
21
|
+
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.4",
|
22
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"author": "beachball",
|
26
|
+
"package": "@fluentui/react-provider",
|
27
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-beta.4",
|
28
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"author": "beachball",
|
32
|
+
"package": "@fluentui/react-provider",
|
33
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-beta.5",
|
34
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"author": "beachball",
|
38
|
+
"package": "@fluentui/react-provider",
|
39
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-beta.4",
|
40
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"author": "beachball",
|
44
|
+
"package": "@fluentui/react-provider",
|
45
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.4",
|
46
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"author": "beachball",
|
50
|
+
"package": "@fluentui/react-provider",
|
51
|
+
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.4",
|
52
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"author": "beachball",
|
56
|
+
"package": "@fluentui/react-provider",
|
57
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4",
|
58
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"author": "beachball",
|
62
|
+
"package": "@fluentui/react-provider",
|
63
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4",
|
64
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
65
|
+
}
|
66
|
+
]
|
67
|
+
}
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"date": "Fri, 12 Nov 2021 13:25:31 GMT",
|
71
|
+
"tag": "@fluentui/react-provider_v9.0.0-beta.4",
|
72
|
+
"version": "9.0.0-beta.4",
|
73
|
+
"comments": {
|
74
|
+
"prerelease": [
|
75
|
+
{
|
76
|
+
"author": "olfedias@microsoft.com",
|
77
|
+
"package": "@fluentui/react-provider",
|
78
|
+
"commit": "825ea92aae027295a94048368157c180358260f2",
|
79
|
+
"comment": "export static classes for components"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"author": "gcox@microsoft.com",
|
83
|
+
"package": "@fluentui/react-provider",
|
84
|
+
"commit": "c9bd5b5a02ae94a8239ce1b56cac2f0d0dbd3586",
|
85
|
+
"comment": "Updated beta and RC components to ES2019"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"author": "beachball",
|
89
|
+
"package": "@fluentui/react-provider",
|
90
|
+
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.3",
|
91
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"author": "beachball",
|
95
|
+
"package": "@fluentui/react-provider",
|
96
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-beta.3",
|
97
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"author": "beachball",
|
101
|
+
"package": "@fluentui/react-provider",
|
102
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-beta.4",
|
103
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"author": "beachball",
|
107
|
+
"package": "@fluentui/react-provider",
|
108
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-beta.3",
|
109
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"author": "beachball",
|
113
|
+
"package": "@fluentui/react-provider",
|
114
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.3",
|
115
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"author": "beachball",
|
119
|
+
"package": "@fluentui/react-provider",
|
120
|
+
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.3",
|
121
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"author": "beachball",
|
125
|
+
"package": "@fluentui/react-provider",
|
126
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3",
|
127
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
128
|
+
},
|
129
|
+
{
|
130
|
+
"author": "beachball",
|
131
|
+
"package": "@fluentui/react-provider",
|
132
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3",
|
133
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
134
|
+
}
|
135
|
+
],
|
136
|
+
"none": [
|
137
|
+
{
|
138
|
+
"author": "me@levithomason.com",
|
139
|
+
"package": "@fluentui/react-provider",
|
140
|
+
"commit": "cdbe0769d2a6ee91a98a3e62c6ac9329a714355c",
|
141
|
+
"comment": "Docs update"
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"author": "gcox@microsoft.com",
|
145
|
+
"package": "@fluentui/react-provider",
|
146
|
+
"commit": "f32855d6039f4049b69b005fe6dde0686eed503c",
|
147
|
+
"comment": "Refactored stories"
|
148
|
+
},
|
149
|
+
{
|
150
|
+
"author": "lingfangao@hotmail.com",
|
151
|
+
"package": "@fluentui/react-provider",
|
152
|
+
"commit": "00f70581480b536e723fb69edf0ae617beac4807",
|
153
|
+
"comment": "Remove beta release tag"
|
154
|
+
}
|
155
|
+
]
|
156
|
+
}
|
157
|
+
},
|
158
|
+
{
|
159
|
+
"date": "Wed, 27 Oct 2021 12:14:21 GMT",
|
160
|
+
"tag": "@fluentui/react-provider_v9.0.0-beta.3",
|
161
|
+
"version": "9.0.0-beta.3",
|
162
|
+
"comments": {
|
163
|
+
"prerelease": [
|
164
|
+
{
|
165
|
+
"author": "peter@draxler.ml",
|
166
|
+
"package": "@fluentui/react-provider",
|
167
|
+
"commit": "f6db7c8d6b7db0902775e7857b62b745be35b59a",
|
168
|
+
"comment": "added styling of documentation"
|
169
|
+
},
|
170
|
+
{
|
171
|
+
"author": "beachball",
|
172
|
+
"package": "@fluentui/react-provider",
|
173
|
+
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.2",
|
174
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
175
|
+
},
|
176
|
+
{
|
177
|
+
"author": "beachball",
|
178
|
+
"package": "@fluentui/react-provider",
|
179
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-beta.2",
|
180
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
"author": "beachball",
|
184
|
+
"package": "@fluentui/react-provider",
|
185
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-beta.3",
|
186
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
187
|
+
},
|
188
|
+
{
|
189
|
+
"author": "beachball",
|
190
|
+
"package": "@fluentui/react-provider",
|
191
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-beta.2",
|
192
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
193
|
+
},
|
194
|
+
{
|
195
|
+
"author": "beachball",
|
196
|
+
"package": "@fluentui/react-provider",
|
197
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.2",
|
198
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
199
|
+
},
|
200
|
+
{
|
201
|
+
"author": "beachball",
|
202
|
+
"package": "@fluentui/react-provider",
|
203
|
+
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.2",
|
204
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
205
|
+
},
|
206
|
+
{
|
207
|
+
"author": "beachball",
|
208
|
+
"package": "@fluentui/react-provider",
|
209
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.2",
|
210
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
211
|
+
},
|
212
|
+
{
|
213
|
+
"author": "beachball",
|
214
|
+
"package": "@fluentui/react-provider",
|
215
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.2",
|
216
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
217
|
+
}
|
218
|
+
]
|
219
|
+
}
|
220
|
+
},
|
221
|
+
{
|
222
|
+
"date": "Tue, 12 Oct 2021 19:45:58 GMT",
|
223
|
+
"tag": "@fluentui/react-provider_v9.0.0-beta.2",
|
224
|
+
"version": "9.0.0-beta.2",
|
225
|
+
"comments": {
|
226
|
+
"prerelease": [
|
227
|
+
{
|
228
|
+
"author": "beachball",
|
229
|
+
"package": "@fluentui/react-provider",
|
230
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-beta.2",
|
231
|
+
"commit": "bdd19e2bb827fc1d8eb329e6ed48cd0542048358"
|
232
|
+
}
|
233
|
+
]
|
234
|
+
}
|
235
|
+
},
|
236
|
+
{
|
237
|
+
"date": "Wed, 06 Oct 2021 10:37:22 GMT",
|
6
238
|
"tag": "@fluentui/react-provider_v9.0.0-beta.1",
|
7
239
|
"version": "9.0.0-beta.1",
|
8
240
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,72 @@
|
|
1
1
|
# Change Log - @fluentui/react-provider
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Thu, 25 Nov 2021 08:31:34 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.0.0-beta.5)
|
8
|
+
|
9
|
+
Thu, 25 Nov 2021 08:31:34 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.0.0-beta.4..@fluentui/react-provider_v9.0.0-beta.5)
|
11
|
+
|
12
|
+
### Changes
|
13
|
+
|
14
|
+
- Bump @fluentui/react-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
15
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
16
|
+
- Bump @fluentui/react-tabster to v9.0.0-beta.5 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
17
|
+
- Bump @fluentui/react-theme to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
18
|
+
- Bump @fluentui/react-utilities to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
19
|
+
- Bump @fluentui/babel-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
20
|
+
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
21
|
+
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
22
|
+
|
23
|
+
## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.0.0-beta.4)
|
24
|
+
|
25
|
+
Fri, 12 Nov 2021 13:25:31 GMT
|
26
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.0.0-beta.3..@fluentui/react-provider_v9.0.0-beta.4)
|
27
|
+
|
28
|
+
### Changes
|
29
|
+
|
30
|
+
- export static classes for components ([PR #20451](https://github.com/microsoft/fluentui/pull/20451) by olfedias@microsoft.com)
|
31
|
+
- Updated beta and RC components to ES2019 ([PR #20405](https://github.com/microsoft/fluentui/pull/20405) by gcox@microsoft.com)
|
32
|
+
- Bump @fluentui/react-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
33
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
34
|
+
- Bump @fluentui/react-tabster to v9.0.0-beta.4 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
35
|
+
- Bump @fluentui/react-theme to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
36
|
+
- Bump @fluentui/react-utilities to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
37
|
+
- Bump @fluentui/babel-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
38
|
+
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
39
|
+
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
40
|
+
|
41
|
+
## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.0.0-beta.3)
|
42
|
+
|
43
|
+
Wed, 27 Oct 2021 12:14:21 GMT
|
44
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.0.0-beta.2..@fluentui/react-provider_v9.0.0-beta.3)
|
45
|
+
|
46
|
+
### Changes
|
47
|
+
|
48
|
+
- added styling of documentation ([PR #20193](https://github.com/microsoft/fluentui/pull/20193) by peter@draxler.ml)
|
49
|
+
- Bump @fluentui/react-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
50
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
51
|
+
- Bump @fluentui/react-tabster to v9.0.0-beta.3 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
52
|
+
- Bump @fluentui/react-theme to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
53
|
+
- Bump @fluentui/react-utilities to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
54
|
+
- Bump @fluentui/babel-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
55
|
+
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
56
|
+
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
57
|
+
|
58
|
+
## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.0.0-beta.2)
|
59
|
+
|
60
|
+
Tue, 12 Oct 2021 19:45:58 GMT
|
61
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.0.0-beta.1..@fluentui/react-provider_v9.0.0-beta.2)
|
62
|
+
|
63
|
+
### Changes
|
64
|
+
|
65
|
+
- Bump @fluentui/react-tabster to v9.0.0-beta.2 ([PR #20132](https://github.com/microsoft/fluentui/pull/20132) by beachball)
|
66
|
+
|
7
67
|
## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.0.0-beta.1)
|
8
68
|
|
9
|
-
Wed, 06 Oct 2021 10:
|
69
|
+
Wed, 06 Oct 2021 10:37:22 GMT
|
10
70
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.0.0-alpha.90..@fluentui/react-provider_v9.0.0-beta.1)
|
11
71
|
|
12
72
|
### Changes
|
package/dist/react-provider.d.ts
CHANGED
@@ -13,6 +13,8 @@ import { useTheme } from '@fluentui/react-shared-contexts';
|
|
13
13
|
|
14
14
|
export declare const FluentProvider: React_2.ForwardRefExoticComponent<FluentProviderProps & React_2.RefAttributes<HTMLElement>>;
|
15
15
|
|
16
|
+
export declare const fluentProviderClassName = "fui-FluentProvider";
|
17
|
+
|
16
18
|
export declare interface FluentProviderCommons {
|
17
19
|
/** Sets the direction of text & generated styles. */
|
18
20
|
dir: 'ltr' | 'rtl';
|
@@ -62,6 +64,9 @@ export declare const useFluentProvider: (props: FluentProviderProps, ref: React_
|
|
62
64
|
|
63
65
|
export declare function useFluentProviderContextValues(state: FluentProviderState): FluentProviderContextValues;
|
64
66
|
|
67
|
+
/** Applies style classnames to slots */
|
68
|
+
export declare const useFluentProviderStyles: (state: FluentProviderState) => FluentProviderState;
|
69
|
+
|
65
70
|
export { useTheme }
|
66
71
|
|
67
72
|
export { }
|
@@ -3,10 +3,10 @@ import { renderFluentProvider } from './renderFluentProvider';
|
|
3
3
|
import { useFluentProvider } from './useFluentProvider';
|
4
4
|
import { useFluentProviderStyles } from './useFluentProviderStyles';
|
5
5
|
import { useFluentProviderContextValues } from './useFluentProviderContextValues';
|
6
|
-
export
|
7
|
-
|
6
|
+
export const FluentProvider = /*#__PURE__*/React.forwardRef((props, ref) => {
|
7
|
+
const state = useFluentProvider(props, ref);
|
8
8
|
useFluentProviderStyles(state);
|
9
|
-
|
9
|
+
const contextValues = useFluentProviderContextValues(state);
|
10
10
|
return renderFluentProvider(state, contextValues);
|
11
11
|
});
|
12
12
|
FluentProvider.displayName = 'FluentProvider';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/FluentProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,oBAAT,QAAqC,wBAArC;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AACA,SAAS,uBAAT,QAAwC,2BAAxC;AACA,SAAS,8BAAT,QAA+C,kCAA/C;AAGA,OAAO,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/FluentProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,oBAAT,QAAqC,wBAArC;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AACA,SAAS,uBAAT,QAAwC,2BAAxC;AACA,SAAS,8BAAT,QAA+C,kCAA/C;AAGA,OAAO,MAAM,cAAc,gBAAG,KAAK,CAAC,UAAN,CAAmD,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,CAA/B;AACA,EAAA,uBAAuB,CAAC,KAAD,CAAvB;AAEA,QAAM,aAAa,GAAG,8BAA8B,CAAC,KAAD,CAApD;AAEA,SAAO,oBAAoB,CAAC,KAAD,EAAQ,aAAR,CAA3B;AACD,CAP6B,CAAvB;AASP,cAAc,CAAC,WAAf,GAA6B,gBAA7B","sourceRoot":""}
|
@@ -2,5 +2,6 @@ export * from './FluentProvider';
|
|
2
2
|
export * from './FluentProvider.types';
|
3
3
|
export * from './renderFluentProvider';
|
4
4
|
export * from './useFluentProvider';
|
5
|
+
export * from './useFluentProviderStyles';
|
5
6
|
export * from './useFluentProviderContextValues';
|
6
7
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FluentProvider/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FluentProvider/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
2
|
import { ProviderContext, TooltipContext, ThemeContext, ThemeClassNameContext } from '@fluentui/react-shared-contexts';
|
4
3
|
import { getSlots } from '@fluentui/react-utilities';
|
@@ -7,11 +6,11 @@ import { fluentProviderShorthandProps } from './useFluentProvider';
|
|
7
6
|
* Render the final JSX of FluentProvider
|
8
7
|
*/
|
9
8
|
|
10
|
-
export
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
export const renderFluentProvider = (state, contextValues) => {
|
10
|
+
const {
|
11
|
+
slots,
|
12
|
+
slotProps
|
13
|
+
} = getSlots(state, fluentProviderShorthandProps);
|
15
14
|
return /*#__PURE__*/React.createElement(ProviderContext.Provider, {
|
16
15
|
value: contextValues.provider
|
17
16
|
}, /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
@@ -20,6 +19,6 @@ export var renderFluentProvider = function (state, contextValues) {
|
|
20
19
|
value: contextValues.themeClassName
|
21
20
|
}, /*#__PURE__*/React.createElement(TooltipContext.Provider, {
|
22
21
|
value: contextValues.tooltip
|
23
|
-
}, /*#__PURE__*/React.createElement(slots.root,
|
22
|
+
}, /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root), state.root.children)))));
|
24
23
|
};
|
25
24
|
//# sourceMappingURL=renderFluentProvider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/renderFluentProvider.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/renderFluentProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,eAAT,EAA0B,cAA1B,EAA0C,YAA1C,EAAwD,qBAAxD,QAAqF,iCAArF;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,4BAAT,QAA6C,qBAA7C;AAEA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAAG,CAAC,KAAD,EAA6B,aAA7B,KAA2E;AAC7G,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAsB,KAAtB,EAA6B,4BAA7B,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,eAAe,CAAC,QAAjB,EAAyB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAzB,eACE,KAAA,CAAA,aAAA,CAAC,YAAY,CAAC,QAAd,EAAsB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAtB,eACE,KAAA,CAAA,aAAA,CAAC,qBAAqB,CAAC,QAAvB,EAA+B;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAA/B,eACE,KAAA,CAAA,aAAA,CAAC,cAAc,CAAC,QAAhB,EAAwB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAxB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EAAiC,KAAK,CAAC,IAAN,CAAW,QAA5C,CADF,CADF,CADF,CADF,CADF;AAWD,CAdM","sourceRoot":""}
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import { useKeyboardNavAttribute } from '@fluentui/react-tabster';
|
3
2
|
import { mergeThemes } from '@fluentui/react-theme';
|
4
3
|
import { useFluent, useTheme } from '@fluentui/react-shared-contexts';
|
5
4
|
import { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';
|
6
5
|
import { useThemeStyleTag } from './useThemeStyleTag';
|
7
|
-
export
|
6
|
+
export const fluentProviderShorthandProps = ['root'];
|
8
7
|
/**
|
9
8
|
* Create the state required to render FluentProvider.
|
10
9
|
*
|
@@ -15,37 +14,36 @@ export var fluentProviderShorthandProps = ['root'];
|
|
15
14
|
* @param ref - reference to root HTMLElement of FluentProvider
|
16
15
|
*/
|
17
16
|
|
18
|
-
export
|
19
|
-
|
20
|
-
|
17
|
+
export const useFluentProvider = (props, ref) => {
|
18
|
+
const parentContext = useFluent();
|
19
|
+
const parentTheme = useTheme();
|
21
20
|
/**
|
22
21
|
* TODO: add merge functions to "dir" merge,
|
23
22
|
* nesting providers with the same "dir" should not add additional attributes to DOM
|
24
23
|
* see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93
|
25
24
|
*/
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
var mergedTheme = mergeThemes(parentTheme, theme);
|
26
|
+
const {
|
27
|
+
dir = parentContext.dir,
|
28
|
+
targetDocument = parentContext.targetDocument,
|
29
|
+
theme = {}
|
30
|
+
} = props;
|
31
|
+
const mergedTheme = mergeThemes(parentTheme, theme);
|
34
32
|
return {
|
35
|
-
dir
|
36
|
-
targetDocument
|
33
|
+
dir,
|
34
|
+
targetDocument,
|
37
35
|
theme: mergedTheme,
|
38
36
|
themeClassName: useThemeStyleTag({
|
39
37
|
theme: mergedTheme,
|
40
|
-
targetDocument
|
38
|
+
targetDocument
|
41
39
|
}),
|
42
40
|
components: {
|
43
41
|
root: 'div'
|
44
42
|
},
|
45
|
-
root: getNativeElementProps('div',
|
46
|
-
dir
|
43
|
+
root: getNativeElementProps('div', { ...props,
|
44
|
+
dir,
|
47
45
|
ref: useMergedRefs(ref, useKeyboardNavAttribute())
|
48
|
-
})
|
46
|
+
})
|
49
47
|
};
|
50
48
|
};
|
51
49
|
//# sourceMappingURL=useFluentProvider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"names":[],"mappings":"AAAA,SAAS,uBAAT,QAAwC,yBAAxC;AACA,SAAS,WAAT,QAA4B,uBAA5B;AACA,SAAS,SAAT,EAAoB,QAApB,QAAoC,iCAApC;AACA,SAAS,qBAAT,EAAgC,aAAhC,QAAqD,2BAArD;AAEA,SAAS,gBAAT,QAAiC,oBAAjC;AAGA,OAAO,MAAM,4BAA4B,GAAkC,CAAC,MAAD,CAApE;AAEP;;;;;;;;AAQG;;AACH,OAAO,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAA6B,GAA7B,KAAiF;AAChH,QAAM,aAAa,GAAG,SAAS,EAA/B;AACA,QAAM,WAAW,GAAG,QAAQ,EAA5B;AAEA;;;;AAIG;;AACH,QAAM;AAAE,IAAA,GAAG,GAAG,aAAa,CAAC,GAAtB;AAA2B,IAAA,cAAc,GAAG,aAAa,CAAC,cAA1D;AAA0E,IAAA,KAAK,GAAG;AAAlF,MAAyF,KAA/F;AACA,QAAM,WAAW,GAAG,WAAW,CAAC,WAAD,EAAc,KAAd,CAA/B;AAEA,SAAO;AACL,IAAA,GADK;AAEL,IAAA,cAFK;AAGL,IAAA,KAAK,EAAE,WAHF;AAIL,IAAA,cAAc,EAAE,gBAAgB,CAAC;AAAE,MAAA,KAAK,EAAE,WAAT;AAAsB,MAAA;AAAtB,KAAD,CAJ3B;AAML,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KANP;AAUL,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ,EACjC,GAAG,KAD8B;AAEjC,MAAA,GAFiC;AAGjC,MAAA,GAAG,EAAE,aAAa,CAAC,GAAD,EAAM,uBAAuB,EAA7B;AAHe,KAAR;AAVtB,GAAP;AAgBD,CA5BM","sourceRoot":""}
|
@@ -1,22 +1,22 @@
|
|
1
1
|
import { useConst } from '@fluentui/react-utilities';
|
2
2
|
import * as React from 'react';
|
3
3
|
export function useFluentProviderContextValues(state) {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
}, [dir, targetDocument]); // "Tooltip" component mutates an object in this context, instance should be stable
|
4
|
+
const {
|
5
|
+
root,
|
6
|
+
dir,
|
7
|
+
targetDocument,
|
8
|
+
theme
|
9
|
+
} = state;
|
10
|
+
const provider = React.useMemo(() => ({
|
11
|
+
dir,
|
12
|
+
targetDocument
|
13
|
+
}), [dir, targetDocument]); // "Tooltip" component mutates an object in this context, instance should be stable
|
14
14
|
|
15
|
-
|
15
|
+
const tooltip = useConst({});
|
16
16
|
return {
|
17
|
-
provider
|
18
|
-
tooltip
|
19
|
-
theme
|
17
|
+
provider,
|
18
|
+
tooltip,
|
19
|
+
theme,
|
20
20
|
themeClassName: root.className
|
21
21
|
};
|
22
22
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderContextValues.ts"],"names":[],"mappings":"AAAA,SAAS,QAAT,QAAyB,2BAAzB;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,OAAM,SAAU,8BAAV,CAAyC,KAAzC,EAAmE;
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderContextValues.ts"],"names":[],"mappings":"AAAA,SAAS,QAAT,QAAyB,2BAAzB;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,OAAM,SAAU,8BAAV,CAAyC,KAAzC,EAAmE;AACvE,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA,GAAR;AAAa,IAAA,cAAb;AAA6B,IAAA;AAA7B,MAAuC,KAA7C;AAEA,QAAM,QAAQ,GAAG,KAAK,CAAC,OAAN,CAAc,OAAO;AAAE,IAAA,GAAF;AAAO,IAAA;AAAP,GAAP,CAAd,EAA+C,CAAC,GAAD,EAAM,cAAN,CAA/C,CAAjB,CAHuE,CAIvE;;AACA,QAAM,OAAO,GAAG,QAAQ,CAAC,EAAD,CAAxB;AAEA,SAAO;AACL,IAAA,QADK;AAEL,IAAA,OAFK;AAGL,IAAA,KAHK;AAIL,IAAA,cAAc,EAAE,IAAI,CAAC;AAJhB,GAAP;AAMD","sourceRoot":""}
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import type { FluentProviderState } from './FluentProvider.types';
|
2
|
+
export declare const fluentProviderClassName = "fui-FluentProvider";
|
2
3
|
/** Applies style classnames to slots */
|
3
4
|
export declare const useFluentProviderStyles: (state: FluentProviderState) => FluentProviderState;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { __styles, mergeClasses } from '@fluentui/react-make-styles';
|
2
|
+
export const fluentProviderClassName = 'fui-FluentProvider';
|
2
3
|
|
3
|
-
|
4
|
+
const useStyles = /*#__PURE__*/__styles({
|
4
5
|
"root": {
|
5
6
|
"sj55zd": "f19n0e5",
|
6
7
|
"De3pzq": "fxugw4r",
|
@@ -14,9 +15,9 @@ var useStyles = /*#__PURE__*/__styles({
|
|
14
15
|
/** Applies style classnames to slots */
|
15
16
|
|
16
17
|
|
17
|
-
export
|
18
|
-
|
19
|
-
state.root.className = mergeClasses(state.themeClassName, styles.root, state.root.className);
|
18
|
+
export const useFluentProviderStyles = state => {
|
19
|
+
const styles = useStyles();
|
20
|
+
state.root.className = mergeClasses(fluentProviderClassName, state.themeClassName, styles.root, state.root.className);
|
20
21
|
return state;
|
21
22
|
};
|
22
23
|
//# sourceMappingURL=useFluentProviderStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AAGA,OAAO,MAAM,uBAAuB,GAAG,oBAAhC;;AAEP,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAUA;;;AACA,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAA+B;AACpE,QAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,uBAAD,EAA0B,KAAK,CAAC,cAAhC,EAAgD,MAAM,CAAC,IAAvD,EAA6D,KAAK,CAAC,IAAN,CAAW,SAAxE,CAAnC;AAEA,SAAO,KAAP;AACD,CANM","sourceRoot":""}
|
@@ -1,39 +1,42 @@
|
|
1
1
|
import { useId, usePrevious } from '@fluentui/react-utilities';
|
2
2
|
import { themeToCSSVariables } from '@fluentui/react-theme';
|
3
3
|
import * as React from 'react';
|
4
|
+
import { fluentProviderClassName } from './useFluentProviderStyles';
|
4
5
|
/**
|
5
6
|
* Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class
|
6
7
|
*
|
7
8
|
* @returns CSS class to apply the rule
|
8
9
|
*/
|
9
10
|
|
10
|
-
export
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
export const useThemeStyleTag = options => {
|
12
|
+
const {
|
13
|
+
targetDocument,
|
14
|
+
theme
|
15
|
+
} = options;
|
16
|
+
const styleTagId = useId(fluentProviderClassName);
|
17
|
+
const styleTag = React.useMemo(() => {
|
15
18
|
if (!targetDocument) {
|
16
19
|
return null;
|
17
20
|
}
|
18
21
|
|
19
|
-
|
22
|
+
const tag = targetDocument.createElement('style');
|
20
23
|
tag.setAttribute('id', styleTagId);
|
21
24
|
targetDocument.head.appendChild(tag);
|
22
25
|
return tag;
|
23
26
|
}, [styleTagId, targetDocument]);
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
cssVarRule += cssVar
|
27
|
+
const cssRule = React.useMemo(() => {
|
28
|
+
const cssVars = themeToCSSVariables(theme);
|
29
|
+
const cssVarsAsString = Object.keys(cssVars).reduce((cssVarRule, cssVar) => {
|
30
|
+
cssVarRule += `${cssVar}: ${cssVars[cssVar]}; `;
|
28
31
|
return cssVarRule;
|
29
32
|
}, ''); // result: .fluent-provider1 { --css-var: '#fff' }
|
30
33
|
|
31
|
-
return
|
34
|
+
return `.${styleTagId} { ${cssVarsAsString} }`;
|
32
35
|
}, [theme, styleTagId]);
|
33
|
-
|
36
|
+
const previousCssRule = usePrevious(cssRule);
|
34
37
|
|
35
38
|
if (styleTag && previousCssRule !== cssRule) {
|
36
|
-
|
39
|
+
const sheet = styleTag.sheet;
|
37
40
|
|
38
41
|
if (sheet.cssRules.length > 0) {
|
39
42
|
sheet.deleteRule(0);
|
@@ -43,8 +46,8 @@ export var useThemeStyleTag = function (options) {
|
|
43
46
|
} // Removes the style tag from the targetDocument on unmount or change
|
44
47
|
|
45
48
|
|
46
|
-
React.useEffect(
|
47
|
-
return
|
49
|
+
React.useEffect(() => {
|
50
|
+
return () => {
|
48
51
|
var _a;
|
49
52
|
|
50
53
|
if (styleTag) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useThemeStyleTag.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,EAAgB,WAAhB,QAAmC,2BAAnC;AACA,SAAS,mBAAT,QAAoC,uBAApC;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useThemeStyleTag.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,EAAgB,WAAhB,QAAmC,2BAAnC;AACA,SAAS,mBAAT,QAAoC,uBAApC;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,uBAAT,QAAwC,2BAAxC;AAEA;;;;AAIG;;AACH,OAAO,MAAM,gBAAgB,GAAI,OAAD,IAAmE;AACjG,QAAM;AAAE,IAAA,cAAF;AAAkB,IAAA;AAAlB,MAA4B,OAAlC;AAEA,QAAM,UAAU,GAAG,KAAK,CAAC,uBAAD,CAAxB;AACA,QAAM,QAAQ,GAAG,KAAK,CAAC,OAAN,CAAc,MAAK;AAClC,QAAI,CAAC,cAAL,EAAqB;AACnB,aAAO,IAAP;AACD;;AAED,UAAM,GAAG,GAAG,cAAc,CAAC,aAAf,CAA6B,OAA7B,CAAZ;AACA,IAAA,GAAG,CAAC,YAAJ,CAAiB,IAAjB,EAAuB,UAAvB;AACA,IAAA,cAAc,CAAC,IAAf,CAAoB,WAApB,CAAgC,GAAhC;AACA,WAAO,GAAP;AACD,GATgB,EASd,CAAC,UAAD,EAAa,cAAb,CATc,CAAjB;AAWA,QAAM,OAAO,GAAG,KAAK,CAAC,OAAN,CAAc,MAAK;AACjC,UAAM,OAAO,GAAG,mBAAmB,CAAC,KAAD,CAAnC;AACA,UAAM,eAAe,GAAG,MAAM,CAAC,IAAP,CAAY,OAAZ,EAAqB,MAArB,CAA4B,CAAC,UAAD,EAAa,MAAb,KAAuB;AACzE,MAAA,UAAU,IAAI,GAAG,MAAM,KAAK,OAAO,CAAC,MAAD,CAAQ,IAA3C;AACA,aAAO,UAAP;AACD,KAHuB,EAGrB,EAHqB,CAAxB,CAFiC,CAOjC;;AACA,WAAO,IAAI,UAAU,MAAM,eAAe,IAA1C;AACD,GATe,EASb,CAAC,KAAD,EAAQ,UAAR,CATa,CAAhB;AAUA,QAAM,eAAe,GAAG,WAAW,CAAC,OAAD,CAAnC;;AAEA,MAAI,QAAQ,IAAI,eAAe,KAAK,OAApC,EAA6C;AAC3C,UAAM,KAAK,GAAG,QAAQ,CAAC,KAAvB;;AAEA,QAAI,KAAK,CAAC,QAAN,CAAe,MAAf,GAAwB,CAA5B,EAA+B;AAC7B,MAAA,KAAK,CAAC,UAAN,CAAiB,CAAjB;AACD;;AAED,IAAA,KAAK,CAAC,UAAN,CAAiB,OAAjB,EAA0B,CAA1B;AACD,GAnCgG,CAqCjG;;;AACA,EAAA,KAAK,CAAC,SAAN,CAAgB,MAAK;AACnB,WAAO,MAAK;;;AACV,UAAI,QAAJ,EAAc;AACZ;AACA,SAAA,EAAA,GAAA,QAAQ,CAAC,aAAT,MAAsB,IAAtB,IAAsB,EAAA,KAAA,KAAA,CAAtB,GAAsB,KAAA,CAAtB,GAAsB,EAAA,CAAE,WAAF,CAAc,QAAd,CAAtB;AACD;AACF,KALD;AAMD,GAPD,EAOG,CAAC,QAAD,CAPH;AASA,SAAO,UAAP;AACD,CAhDM","sourceRoot":""}
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/FluentProvider/index"), exports);
|
10
10
|
//# sourceMappingURL=FluentProvider.js.map
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.FluentProvider = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const renderFluentProvider_1 = /*#__PURE__*/require("./renderFluentProvider");
|
11
11
|
|
12
|
-
|
12
|
+
const useFluentProvider_1 = /*#__PURE__*/require("./useFluentProvider");
|
13
13
|
|
14
|
-
|
14
|
+
const useFluentProviderStyles_1 = /*#__PURE__*/require("./useFluentProviderStyles");
|
15
15
|
|
16
|
-
|
16
|
+
const useFluentProviderContextValues_1 = /*#__PURE__*/require("./useFluentProviderContextValues");
|
17
17
|
|
18
|
-
exports.FluentProvider = /*#__PURE__*/React.forwardRef(
|
19
|
-
|
18
|
+
exports.FluentProvider = /*#__PURE__*/React.forwardRef((props, ref) => {
|
19
|
+
const state = useFluentProvider_1.useFluentProvider(props, ref);
|
20
20
|
useFluentProviderStyles_1.useFluentProviderStyles(state);
|
21
|
-
|
21
|
+
const contextValues = useFluentProviderContextValues_1.useFluentProviderContextValues(state);
|
22
22
|
return renderFluentProvider_1.renderFluentProvider(state, contextValues);
|
23
23
|
});
|
24
24
|
exports.FluentProvider.displayName = 'FluentProvider';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/FluentProvider.tsx"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/FluentProvider.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,gCAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAGa,OAAA,CAAA,cAAA,gBAAiB,KAAK,CAAC,UAAN,CAAmD,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;AACA,EAAA,yBAAA,CAAA,uBAAA,CAAwB,KAAxB;AAEA,QAAM,aAAa,GAAG,gCAAA,CAAA,8BAAA,CAA+B,KAA/B,CAAtB;AAEA,SAAO,sBAAA,CAAA,oBAAA,CAAqB,KAArB,EAA4B,aAA5B,CAAP;AACD,CAP6B,CAAjB;AASb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./FluentProvider"), exports);
|
10
10
|
|
@@ -14,5 +14,7 @@ tslib_1.__exportStar(require("./renderFluentProvider"), exports);
|
|
14
14
|
|
15
15
|
tslib_1.__exportStar(require("./useFluentProvider"), exports);
|
16
16
|
|
17
|
+
tslib_1.__exportStar(require("./useFluentProviderStyles"), exports);
|
18
|
+
|
17
19
|
tslib_1.__exportStar(require("./useFluentProviderContextValues"), exports);
|
18
20
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kCAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,2BAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kCAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -5,25 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.renderFluentProvider = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
11
11
|
|
12
|
-
|
12
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
var useFluentProvider_1 = /*#__PURE__*/require("./useFluentProvider");
|
14
|
+
const useFluentProvider_1 = /*#__PURE__*/require("./useFluentProvider");
|
17
15
|
/**
|
18
16
|
* Render the final JSX of FluentProvider
|
19
17
|
*/
|
20
18
|
|
21
19
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
const renderFluentProvider = (state, contextValues) => {
|
21
|
+
const {
|
22
|
+
slots,
|
23
|
+
slotProps
|
24
|
+
} = react_utilities_1.getSlots(state, useFluentProvider_1.fluentProviderShorthandProps);
|
27
25
|
return React.createElement(react_shared_contexts_1.ProviderContext.Provider, {
|
28
26
|
value: contextValues.provider
|
29
27
|
}, React.createElement(react_shared_contexts_1.ThemeContext.Provider, {
|
@@ -32,7 +30,7 @@ var renderFluentProvider = function (state, contextValues) {
|
|
32
30
|
value: contextValues.themeClassName
|
33
31
|
}, React.createElement(react_shared_contexts_1.TooltipContext.Provider, {
|
34
32
|
value: contextValues.tooltip
|
35
|
-
}, React.createElement(slots.root,
|
33
|
+
}, React.createElement(slots.root, Object.assign({}, slotProps.root), state.root.children)))));
|
36
34
|
};
|
37
35
|
|
38
36
|
exports.renderFluentProvider = renderFluentProvider;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/renderFluentProvider.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/renderFluentProvider.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,oBAAoB,GAAG,CAAC,KAAD,EAA6B,aAA7B,KAA2E;AAC7G,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA8B,KAA9B,EAAqC,mBAAA,CAAA,4BAArC,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,uBAAA,CAAA,eAAA,CAAgB,QAAjB,EAAyB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAzB,EACE,KAAA,CAAA,aAAA,CAAC,uBAAA,CAAA,YAAA,CAAa,QAAd,EAAsB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAtB,EACE,KAAA,CAAA,aAAA,CAAC,uBAAA,CAAA,qBAAA,CAAsB,QAAvB,EAA+B;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAA/B,EACE,KAAA,CAAA,aAAA,CAAC,uBAAA,CAAA,cAAA,CAAe,QAAhB,EAAwB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAxB,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EAAiC,KAAK,CAAC,IAAN,CAAW,QAA5C,CADF,CADF,CADF,CADF,CADF;AAWD,CAdM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
|
@@ -5,17 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useFluentProvider = exports.fluentProviderShorthandProps = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
9
9
|
|
10
|
-
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
11
|
|
12
|
-
|
12
|
+
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
13
13
|
|
14
|
-
|
14
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
var useThemeStyleTag_1 = /*#__PURE__*/require("./useThemeStyleTag");
|
16
|
+
const useThemeStyleTag_1 = /*#__PURE__*/require("./useThemeStyleTag");
|
19
17
|
|
20
18
|
exports.fluentProviderShorthandProps = ['root'];
|
21
19
|
/**
|
@@ -28,37 +26,36 @@ exports.fluentProviderShorthandProps = ['root'];
|
|
28
26
|
* @param ref - reference to root HTMLElement of FluentProvider
|
29
27
|
*/
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
const useFluentProvider = (props, ref) => {
|
30
|
+
const parentContext = react_shared_contexts_1.useFluent();
|
31
|
+
const parentTheme = react_shared_contexts_1.useTheme();
|
34
32
|
/**
|
35
33
|
* TODO: add merge functions to "dir" merge,
|
36
34
|
* nesting providers with the same "dir" should not add additional attributes to DOM
|
37
35
|
* see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93
|
38
36
|
*/
|
39
37
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
var mergedTheme = react_theme_1.mergeThemes(parentTheme, theme);
|
38
|
+
const {
|
39
|
+
dir = parentContext.dir,
|
40
|
+
targetDocument = parentContext.targetDocument,
|
41
|
+
theme = {}
|
42
|
+
} = props;
|
43
|
+
const mergedTheme = react_theme_1.mergeThemes(parentTheme, theme);
|
47
44
|
return {
|
48
|
-
dir
|
49
|
-
targetDocument
|
45
|
+
dir,
|
46
|
+
targetDocument,
|
50
47
|
theme: mergedTheme,
|
51
48
|
themeClassName: useThemeStyleTag_1.useThemeStyleTag({
|
52
49
|
theme: mergedTheme,
|
53
|
-
targetDocument
|
50
|
+
targetDocument
|
54
51
|
}),
|
55
52
|
components: {
|
56
53
|
root: 'div'
|
57
54
|
},
|
58
|
-
root: react_utilities_1.getNativeElementProps('div',
|
59
|
-
dir
|
55
|
+
root: react_utilities_1.getNativeElementProps('div', { ...props,
|
56
|
+
dir,
|
60
57
|
ref: react_utilities_1.useMergedRefs(ref, react_tabster_1.useKeyboardNavAttribute())
|
61
|
-
})
|
58
|
+
})
|
62
59
|
};
|
63
60
|
};
|
64
61
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AAGa,OAAA,CAAA,4BAAA,GAA8D,CAAC,MAAD,CAA9D;AAEb;;;;;;;;AAQG;;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAA6B,GAA7B,KAAiF;AAChH,QAAM,aAAa,GAAG,uBAAA,CAAA,SAAA,EAAtB;AACA,QAAM,WAAW,GAAG,uBAAA,CAAA,QAAA,EAApB;AAEA;;;;AAIG;;AACH,QAAM;AAAE,IAAA,GAAG,GAAG,aAAa,CAAC,GAAtB;AAA2B,IAAA,cAAc,GAAG,aAAa,CAAC,cAA1D;AAA0E,IAAA,KAAK,GAAG;AAAlF,MAAyF,KAA/F;AACA,QAAM,WAAW,GAAG,aAAA,CAAA,WAAA,CAAY,WAAZ,EAAyB,KAAzB,CAApB;AAEA,SAAO;AACL,IAAA,GADK;AAEL,IAAA,cAFK;AAGL,IAAA,KAAK,EAAE,WAHF;AAIL,IAAA,cAAc,EAAE,kBAAA,CAAA,gBAAA,CAAiB;AAAE,MAAA,KAAK,EAAE,WAAT;AAAsB,MAAA;AAAtB,KAAjB,CAJX;AAML,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KANP;AAUL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B,EACjC,GAAG,KAD8B;AAEjC,MAAA,GAFiC;AAGjC,MAAA,GAAG,EAAE,iBAAA,CAAA,aAAA,CAAc,GAAd,EAAmB,eAAA,CAAA,uBAAA,EAAnB;AAH4B,KAA7B;AAVD,GAAP;AAgBD,CA5BM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
|
@@ -5,27 +5,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useFluentProviderContextValues = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
9
|
|
10
|
-
|
10
|
+
const React = /*#__PURE__*/require("react");
|
11
11
|
|
12
12
|
function useFluentProviderContextValues(state) {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}, [dir, targetDocument]); // "Tooltip" component mutates an object in this context, instance should be stable
|
13
|
+
const {
|
14
|
+
root,
|
15
|
+
dir,
|
16
|
+
targetDocument,
|
17
|
+
theme
|
18
|
+
} = state;
|
19
|
+
const provider = React.useMemo(() => ({
|
20
|
+
dir,
|
21
|
+
targetDocument
|
22
|
+
}), [dir, targetDocument]); // "Tooltip" component mutates an object in this context, instance should be stable
|
23
23
|
|
24
|
-
|
24
|
+
const tooltip = react_utilities_1.useConst({});
|
25
25
|
return {
|
26
|
-
provider
|
27
|
-
tooltip
|
28
|
-
theme
|
26
|
+
provider,
|
27
|
+
tooltip,
|
28
|
+
theme,
|
29
29
|
themeClassName: root.className
|
30
30
|
};
|
31
31
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderContextValues.ts"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderContextValues.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAGA,SAAgB,8BAAhB,CAA+C,KAA/C,EAAyE;AACvE,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA,GAAR;AAAa,IAAA,cAAb;AAA6B,IAAA;AAA7B,MAAuC,KAA7C;AAEA,QAAM,QAAQ,GAAG,KAAK,CAAC,OAAN,CAAc,OAAO;AAAE,IAAA,GAAF;AAAO,IAAA;AAAP,GAAP,CAAd,EAA+C,CAAC,GAAD,EAAM,cAAN,CAA/C,CAAjB,CAHuE,CAIvE;;AACA,QAAM,OAAO,GAAG,iBAAA,CAAA,QAAA,CAAS,EAAT,CAAhB;AAEA,SAAO;AACL,IAAA,QADK;AAEL,IAAA,OAFK;AAGL,IAAA,KAHK;AAIL,IAAA,cAAc,EAAE,IAAI,CAAC;AAJhB,GAAP;AAMD;;AAbD,OAAA,CAAA,8BAAA,GAAA,8BAAA","sourceRoot":""}
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import type { FluentProviderState } from './FluentProvider.types';
|
2
|
+
export declare const fluentProviderClassName = "fui-FluentProvider";
|
2
3
|
/** Applies style classnames to slots */
|
3
4
|
export declare const useFluentProviderStyles: (state: FluentProviderState) => FluentProviderState;
|
@@ -3,11 +3,13 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useFluentProviderStyles = void 0;
|
6
|
+
exports.useFluentProviderStyles = exports.fluentProviderClassName = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
|
9
9
|
|
10
|
-
|
10
|
+
exports.fluentProviderClassName = 'fui-FluentProvider';
|
11
|
+
|
12
|
+
const useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
11
13
|
"root": {
|
12
14
|
"sj55zd": "f19n0e5",
|
13
15
|
"De3pzq": "fxugw4r",
|
@@ -21,9 +23,9 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
21
23
|
/** Applies style classnames to slots */
|
22
24
|
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
state.root.className = react_make_styles_1.mergeClasses(state.themeClassName, styles.root, state.root.className);
|
26
|
+
const useFluentProviderStyles = state => {
|
27
|
+
const styles = useStyles();
|
28
|
+
state.root.className = react_make_styles_1.mergeClasses(exports.fluentProviderClassName, state.themeClassName, styles.root, state.root.className);
|
27
29
|
return state;
|
28
30
|
};
|
29
31
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGa,OAAA,CAAA,uBAAA,GAA0B,oBAA1B;;AAEb,MAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAUA;;;AACO,MAAM,uBAAuB,GAAI,KAAD,IAA+B;AACpE,QAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,OAAA,CAAA,uBAAb,EAAsC,KAAK,CAAC,cAA5C,EAA4D,MAAM,CAAC,IAAnE,EAAyE,KAAK,CAAC,IAAN,CAAW,SAApF,CAAvB;AAEA,SAAO,KAAP;AACD,CANM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourceRoot":""}
|
@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useThemeStyleTag = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
9
|
|
10
|
-
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
11
|
|
12
|
-
|
12
|
+
const React = /*#__PURE__*/require("react");
|
13
|
+
|
14
|
+
const useFluentProviderStyles_1 = /*#__PURE__*/require("./useFluentProviderStyles");
|
13
15
|
/**
|
14
16
|
* Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class
|
15
17
|
*
|
@@ -17,33 +19,35 @@ var React = /*#__PURE__*/require("react");
|
|
17
19
|
*/
|
18
20
|
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
const useThemeStyleTag = options => {
|
23
|
+
const {
|
24
|
+
targetDocument,
|
25
|
+
theme
|
26
|
+
} = options;
|
27
|
+
const styleTagId = react_utilities_1.useId(useFluentProviderStyles_1.fluentProviderClassName);
|
28
|
+
const styleTag = React.useMemo(() => {
|
25
29
|
if (!targetDocument) {
|
26
30
|
return null;
|
27
31
|
}
|
28
32
|
|
29
|
-
|
33
|
+
const tag = targetDocument.createElement('style');
|
30
34
|
tag.setAttribute('id', styleTagId);
|
31
35
|
targetDocument.head.appendChild(tag);
|
32
36
|
return tag;
|
33
37
|
}, [styleTagId, targetDocument]);
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
cssVarRule += cssVar
|
38
|
+
const cssRule = React.useMemo(() => {
|
39
|
+
const cssVars = react_theme_1.themeToCSSVariables(theme);
|
40
|
+
const cssVarsAsString = Object.keys(cssVars).reduce((cssVarRule, cssVar) => {
|
41
|
+
cssVarRule += `${cssVar}: ${cssVars[cssVar]}; `;
|
38
42
|
return cssVarRule;
|
39
43
|
}, ''); // result: .fluent-provider1 { --css-var: '#fff' }
|
40
44
|
|
41
|
-
return
|
45
|
+
return `.${styleTagId} { ${cssVarsAsString} }`;
|
42
46
|
}, [theme, styleTagId]);
|
43
|
-
|
47
|
+
const previousCssRule = react_utilities_1.usePrevious(cssRule);
|
44
48
|
|
45
49
|
if (styleTag && previousCssRule !== cssRule) {
|
46
|
-
|
50
|
+
const sheet = styleTag.sheet;
|
47
51
|
|
48
52
|
if (sheet.cssRules.length > 0) {
|
49
53
|
sheet.deleteRule(0);
|
@@ -53,8 +57,8 @@ var useThemeStyleTag = function (options) {
|
|
53
57
|
} // Removes the style tag from the targetDocument on unmount or change
|
54
58
|
|
55
59
|
|
56
|
-
React.useEffect(
|
57
|
-
return
|
60
|
+
React.useEffect(() => {
|
61
|
+
return () => {
|
58
62
|
var _a;
|
59
63
|
|
60
64
|
if (styleTag) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useThemeStyleTag.ts"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useThemeStyleTag.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,MAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAEA;;;;AAIG;;;AACI,MAAM,gBAAgB,GAAI,OAAD,IAAmE;AACjG,QAAM;AAAE,IAAA,cAAF;AAAkB,IAAA;AAAlB,MAA4B,OAAlC;AAEA,QAAM,UAAU,GAAG,iBAAA,CAAA,KAAA,CAAM,yBAAA,CAAA,uBAAN,CAAnB;AACA,QAAM,QAAQ,GAAG,KAAK,CAAC,OAAN,CAAc,MAAK;AAClC,QAAI,CAAC,cAAL,EAAqB;AACnB,aAAO,IAAP;AACD;;AAED,UAAM,GAAG,GAAG,cAAc,CAAC,aAAf,CAA6B,OAA7B,CAAZ;AACA,IAAA,GAAG,CAAC,YAAJ,CAAiB,IAAjB,EAAuB,UAAvB;AACA,IAAA,cAAc,CAAC,IAAf,CAAoB,WAApB,CAAgC,GAAhC;AACA,WAAO,GAAP;AACD,GATgB,EASd,CAAC,UAAD,EAAa,cAAb,CATc,CAAjB;AAWA,QAAM,OAAO,GAAG,KAAK,CAAC,OAAN,CAAc,MAAK;AACjC,UAAM,OAAO,GAAG,aAAA,CAAA,mBAAA,CAAoB,KAApB,CAAhB;AACA,UAAM,eAAe,GAAG,MAAM,CAAC,IAAP,CAAY,OAAZ,EAAqB,MAArB,CAA4B,CAAC,UAAD,EAAa,MAAb,KAAuB;AACzE,MAAA,UAAU,IAAI,GAAG,MAAM,KAAK,OAAO,CAAC,MAAD,CAAQ,IAA3C;AACA,aAAO,UAAP;AACD,KAHuB,EAGrB,EAHqB,CAAxB,CAFiC,CAOjC;;AACA,WAAO,IAAI,UAAU,MAAM,eAAe,IAA1C;AACD,GATe,EASb,CAAC,KAAD,EAAQ,UAAR,CATa,CAAhB;AAUA,QAAM,eAAe,GAAG,iBAAA,CAAA,WAAA,CAAY,OAAZ,CAAxB;;AAEA,MAAI,QAAQ,IAAI,eAAe,KAAK,OAApC,EAA6C;AAC3C,UAAM,KAAK,GAAG,QAAQ,CAAC,KAAvB;;AAEA,QAAI,KAAK,CAAC,QAAN,CAAe,MAAf,GAAwB,CAA5B,EAA+B;AAC7B,MAAA,KAAK,CAAC,UAAN,CAAiB,CAAjB;AACD;;AAED,IAAA,KAAK,CAAC,UAAN,CAAiB,OAAjB,EAA0B,CAA1B;AACD,GAnCgG,CAqCjG;;;AACA,EAAA,KAAK,CAAC,SAAN,CAAgB,MAAK;AACnB,WAAO,MAAK;;;AACV,UAAI,QAAJ,EAAc;AACZ;AACA,SAAA,EAAA,GAAA,QAAQ,CAAC,aAAT,MAAsB,IAAtB,IAAsB,EAAA,KAAA,KAAA,CAAtB,GAAsB,KAAA,CAAtB,GAAsB,EAAA,CAAE,WAAF,CAAc,QAAd,CAAtB;AACD;AACF,KALD;AAMD,GAPD,EAOG,CAAC,QAAD,CAPH;AASA,SAAO,UAAP;AACD,CAhDM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","sourceRoot":""}
|
package/lib-commonjs/index.js
CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useTheme = exports.useFluent = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
9
9
|
|
10
10
|
tslib_1.__exportStar(require("./FluentProvider"), exports);
|
11
11
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-provider",
|
3
|
-
"version": "9.0.0-beta.
|
3
|
+
"version": "9.0.0-beta.5",
|
4
4
|
"description": "Fluent UI React provider component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -20,16 +20,17 @@
|
|
20
20
|
"just": "just-scripts",
|
21
21
|
"lint": "just-scripts lint",
|
22
22
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
23
|
-
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-provider/src && yarn docs",
|
23
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-provider/src && yarn docs",
|
24
24
|
"storybook": "start-storybook",
|
25
|
-
"start": "yarn storybook"
|
25
|
+
"start": "yarn storybook",
|
26
|
+
"type-check": "tsc -b tsconfig.json"
|
26
27
|
},
|
27
28
|
"devDependencies": {
|
28
|
-
"@fluentui/babel-make-styles": "9.0.0-beta.
|
29
|
+
"@fluentui/babel-make-styles": "9.0.0-beta.4",
|
29
30
|
"@fluentui/eslint-plugin": "*",
|
30
|
-
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.
|
31
|
+
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.4",
|
31
32
|
"@fluentui/react-conformance": "*",
|
32
|
-
"@fluentui/react-conformance-make-styles": "9.0.0-beta.
|
33
|
+
"@fluentui/react-conformance-make-styles": "9.0.0-beta.4",
|
33
34
|
"@fluentui/scripts": "^1.0.0",
|
34
35
|
"@types/enzyme": "3.10.3",
|
35
36
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
@@ -43,11 +44,11 @@
|
|
43
44
|
"react-test-renderer": "^16.3.0"
|
44
45
|
},
|
45
46
|
"dependencies": {
|
46
|
-
"@fluentui/react-make-styles": "9.0.0-beta.
|
47
|
-
"@fluentui/react-shared-contexts": "9.0.0-beta.
|
48
|
-
"@fluentui/react-tabster": "9.0.0-beta.
|
49
|
-
"@fluentui/react-theme": "9.0.0-beta.
|
50
|
-
"@fluentui/react-utilities": "9.0.0-beta.
|
47
|
+
"@fluentui/react-make-styles": "9.0.0-beta.4",
|
48
|
+
"@fluentui/react-shared-contexts": "9.0.0-beta.4",
|
49
|
+
"@fluentui/react-tabster": "9.0.0-beta.5",
|
50
|
+
"@fluentui/react-theme": "9.0.0-beta.4",
|
51
|
+
"@fluentui/react-utilities": "9.0.0-beta.4",
|
51
52
|
"tslib": "^2.1.0"
|
52
53
|
},
|
53
54
|
"peerDependencies": {
|
@@ -57,7 +58,6 @@
|
|
57
58
|
"react-dom": ">=16.8.0 <18.0.0"
|
58
59
|
},
|
59
60
|
"beachball": {
|
60
|
-
"tag": "beta",
|
61
61
|
"disallowedChangeTypes": [
|
62
62
|
"major",
|
63
63
|
"minor",
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
2
|
-
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
3
|
-
export function isConformant(testInfo) {
|
4
|
-
var defaultOptions = {
|
5
|
-
disabledTests: ['has-docblock'],
|
6
|
-
asPropHandlesRef: true,
|
7
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
8
|
-
extraTests: makeStylesTests
|
9
|
-
};
|
10
|
-
baseIsConformant(defaultOptions, testInfo);
|
11
|
-
}
|
12
|
-
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,aAAa,EAAE,CAAC,cAAD,CAD4C;AAE3D,IAAA,gBAAgB,EAAE,IAFyC;AAG3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAH4C;AAI3D,IAAA,UAAU,EAAE;AAJ+C,GAA7D;AAOA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.isConformant = void 0;
|
7
|
-
|
8
|
-
var react_conformance_1 = /*#__PURE__*/require("@fluentui/react-conformance");
|
9
|
-
|
10
|
-
var react_conformance_make_styles_1 = /*#__PURE__*/require("@fluentui/react-conformance-make-styles");
|
11
|
-
|
12
|
-
function isConformant(testInfo) {
|
13
|
-
var defaultOptions = {
|
14
|
-
disabledTests: ['has-docblock'],
|
15
|
-
asPropHandlesRef: true,
|
16
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
17
|
-
extraTests: react_conformance_make_styles_1.default
|
18
|
-
};
|
19
|
-
react_conformance_1.isConformant(defaultOptions, testInfo);
|
20
|
-
}
|
21
|
-
|
22
|
-
exports.isConformant = isConformant;
|
23
|
-
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,IAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAEA,SAAgB,YAAhB,CACE,QADF,EAC2F;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,aAAa,EAAE,CAAC,cAAD,CAD4C;AAE3D,IAAA,gBAAgB,EAAE,IAFyC;AAG3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAH4C;AAI3D,IAAA,UAAU,EAAE,+BAAA,CAAA;AAJ+C,GAA7D;AAOA,EAAA,mBAAA,CAAA,YAAA,CAAiB,cAAjB,EAAiC,QAAjC;AACD;;AAXD,OAAA,CAAA,YAAA,GAAA,YAAA","sourceRoot":""}
|