@fluentui/react-provider 0.0.0-nightly65dd5f749420211213.1 → 0.0.0-nightly6a6e258c4020220125.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +71 -23
- package/CHANGELOG.md +17 -13
- package/dist/react-provider.d.ts +9 -12
- package/lib/components/FluentProvider/FluentProvider.js +8 -8
- package/lib/components/FluentProvider/FluentProvider.js.map +1 -1
- package/lib/components/FluentProvider/FluentProvider.types.d.ts +4 -4
- package/lib/components/FluentProvider/renderFluentProvider.d.ts +1 -1
- package/lib/components/FluentProvider/renderFluentProvider.js +6 -4
- package/lib/components/FluentProvider/renderFluentProvider.js.map +1 -1
- package/lib/components/FluentProvider/useFluentProvider.d.ts +4 -5
- package/lib/components/FluentProvider/useFluentProvider.js +31 -6
- package/lib/components/FluentProvider/useFluentProvider.js.map +1 -1
- package/lib/components/FluentProvider/useFluentProviderContextValues.d.ts +1 -1
- package/lib/components/FluentProvider/useFluentProviderContextValues.js +2 -1
- package/lib/components/FluentProvider/useFluentProviderContextValues.js.map +1 -1
- package/lib/components/FluentProvider/useFluentProviderStyles.d.ts +1 -1
- package/lib/components/FluentProvider/useFluentProviderStyles.js +3 -2
- package/lib/components/FluentProvider/useFluentProviderStyles.js.map +1 -1
- package/lib/components/FluentProvider/useThemeStyleTag.js +3 -6
- package/lib/components/FluentProvider/useThemeStyleTag.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/FluentProvider.js +4 -4
- package/lib-commonjs/components/FluentProvider/FluentProvider.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/FluentProvider.types.d.ts +4 -4
- package/lib-commonjs/components/FluentProvider/renderFluentProvider.d.ts +1 -1
- package/lib-commonjs/components/FluentProvider/renderFluentProvider.js +9 -7
- package/lib-commonjs/components/FluentProvider/renderFluentProvider.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProvider.d.ts +4 -5
- package/lib-commonjs/components/FluentProvider/useFluentProvider.js +36 -11
- package/lib-commonjs/components/FluentProvider/useFluentProvider.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProviderContextValues.d.ts +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProviderContextValues.js +4 -3
- package/lib-commonjs/components/FluentProvider/useFluentProviderContextValues.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProviderStyles.d.ts +1 -1
- 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 +3 -6
- package/lib-commonjs/components/FluentProvider/useThemeStyleTag.js.map +1 -1
- package/package.json +10 -12
package/CHANGELOG.json
CHANGED
@@ -2,17 +2,41 @@
|
|
2
2
|
"name": "@fluentui/react-provider",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-provider_v0.0.0-
|
7
|
-
"version": "0.0.0-
|
5
|
+
"date": "Tue, 25 Jan 2022 04:17:20 GMT",
|
6
|
+
"tag": "@fluentui/react-provider_v0.0.0-nightly6a6e258c4020220125.1",
|
7
|
+
"version": "0.0.0-nightly6a6e258c4020220125.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
11
11
|
"author": "email not defined",
|
12
12
|
"package": "@fluentui/react-provider",
|
13
|
-
"commit": "
|
13
|
+
"commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d",
|
14
14
|
"comment": "Release nightly v9"
|
15
15
|
},
|
16
|
+
{
|
17
|
+
"author": "olfedias@microsoft.com",
|
18
|
+
"package": "@fluentui/react-provider",
|
19
|
+
"commit": "706305303fcf03a82052c0a9e74d8aecb102885e",
|
20
|
+
"comment": "use Griffel packages"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "martinhochel@microsoft.com",
|
24
|
+
"package": "@fluentui/react-provider",
|
25
|
+
"commit": "ecfe4c4fdc306e9c484706f28457f440f55d3684",
|
26
|
+
"comment": "make the FluentProvider#theme TS API reflect runtime and add warning if there is a violation"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
30
|
+
"package": "@fluentui/react-provider",
|
31
|
+
"commit": "b22c4ef0eba0730286f2ed701e1b851d8a5c03b5",
|
32
|
+
"comment": "Replacing use of functions in makeStyles with direct use of tokens"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"author": "martinhochel@microsoft.com",
|
36
|
+
"package": "@fluentui/react-provider",
|
37
|
+
"commit": "1dba2fca2365f1a748505896679ae160a6fec270",
|
38
|
+
"comment": "replace mergeThemes functionality from react-theme"
|
39
|
+
},
|
16
40
|
{
|
17
41
|
"author": "bsunderhus@microsoft.com",
|
18
42
|
"package": "@fluentui/react-provider",
|
@@ -20,60 +44,84 @@
|
|
20
44
|
"comment": "Remove `themeToCSSVariables` function"
|
21
45
|
},
|
22
46
|
{
|
23
|
-
"author": "
|
47
|
+
"author": "behowell@microsoft.com",
|
24
48
|
"package": "@fluentui/react-provider",
|
25
|
-
"
|
26
|
-
"
|
49
|
+
"commit": "7cc28ed8320b00f42d91c63882f10316db2205c5",
|
50
|
+
"comment": "Remove component's shorthandProps array"
|
27
51
|
},
|
28
52
|
{
|
29
|
-
"author": "
|
53
|
+
"author": "behowell@microsoft.com",
|
30
54
|
"package": "@fluentui/react-provider",
|
31
|
-
"
|
32
|
-
"
|
55
|
+
"commit": "317209bb5cd57c40f35bc42060acb7e3cce5ec95",
|
56
|
+
"comment": "BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet"
|
33
57
|
},
|
34
58
|
{
|
35
|
-
"author": "
|
59
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
36
60
|
"package": "@fluentui/react-provider",
|
37
|
-
"
|
38
|
-
"
|
61
|
+
"commit": "00a5d945904c896a0664de6ba72c145a255f0848",
|
62
|
+
"comment": "Updating use of tokens.fontWeight now that we don't need to use casting."
|
39
63
|
},
|
40
64
|
{
|
41
65
|
"author": "beachball",
|
42
66
|
"package": "@fluentui/react-provider",
|
43
|
-
"comment": "Bump @fluentui/react-
|
44
|
-
"commit": "
|
67
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly6a6e258c4020220125.1",
|
68
|
+
"commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d"
|
45
69
|
},
|
46
70
|
{
|
47
71
|
"author": "beachball",
|
48
72
|
"package": "@fluentui/react-provider",
|
49
|
-
"comment": "Bump @fluentui/react-
|
50
|
-
"commit": "
|
73
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly6a6e258c4020220125.1",
|
74
|
+
"commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d"
|
51
75
|
},
|
52
76
|
{
|
53
77
|
"author": "beachball",
|
54
78
|
"package": "@fluentui/react-provider",
|
55
|
-
"comment": "Bump @fluentui/
|
56
|
-
"commit": "
|
79
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly6a6e258c4020220125.1",
|
80
|
+
"commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d"
|
57
81
|
},
|
58
82
|
{
|
59
83
|
"author": "beachball",
|
60
84
|
"package": "@fluentui/react-provider",
|
61
|
-
"comment": "Bump @fluentui/
|
62
|
-
"commit": "
|
85
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly6a6e258c4020220125.1",
|
86
|
+
"commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d"
|
63
87
|
},
|
64
88
|
{
|
65
89
|
"author": "beachball",
|
66
90
|
"package": "@fluentui/react-provider",
|
67
|
-
"comment": "Bump @fluentui/react-conformance-
|
68
|
-
"commit": "
|
91
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly6a6e258c4020220125.1",
|
92
|
+
"commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d"
|
69
93
|
}
|
70
94
|
],
|
71
95
|
"none": [
|
96
|
+
{
|
97
|
+
"author": "olfedias@microsoft.com",
|
98
|
+
"package": "@fluentui/react-provider",
|
99
|
+
"commit": "0fe5ae5d94918a8f8805ed3e587ed98acb17c4b2",
|
100
|
+
"comment": "add @types/react-test-renderer to devDependencies"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"author": "martinhochel@microsoft.com",
|
104
|
+
"package": "@fluentui/react-provider",
|
105
|
+
"commit": "8dfa712156b70414205b87b5b6d099367b0c297d",
|
106
|
+
"comment": "chore: use storybook runner for all vNext packages"
|
107
|
+
},
|
72
108
|
{
|
73
109
|
"author": "olfedias@microsoft.com",
|
74
110
|
"package": "@fluentui/react-provider",
|
75
111
|
"commit": "d11a238f944b891c13b3bfa56a17ddace52f37d5",
|
76
112
|
"comment": "update stories to not use CSS shorthands in styles"
|
113
|
+
},
|
114
|
+
{
|
115
|
+
"author": "martinhochel@microsoft.com",
|
116
|
+
"package": "@fluentui/react-provider",
|
117
|
+
"commit": "28ceaaa83cd92a0389c466f0b15b283e3d9b08e4",
|
118
|
+
"comment": "chore: update all jest deps to v25 + apply single version policy"
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"author": "olfedias@microsoft.com",
|
122
|
+
"package": "@fluentui/react-provider",
|
123
|
+
"commit": "c061e98be4b4a718c72a144a1f60bb5515824612",
|
124
|
+
"comment": "remove inline-style-expand-shorthand from tsconfigs"
|
77
125
|
}
|
78
126
|
]
|
79
127
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,26 +1,30 @@
|
|
1
1
|
# Change Log - @fluentui/react-provider
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Tue, 25 Jan 2022 04:17:20 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-
|
7
|
+
## [0.0.0-nightly6a6e258c4020220125.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v0.0.0-nightly6a6e258c4020220125.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.0.0-beta.5..@fluentui/react-provider_v0.0.0-
|
9
|
+
Tue, 25 Jan 2022 04:17:20 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.0.0-beta.5..@fluentui/react-provider_v0.0.0-nightly6a6e258c4020220125.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
|
-
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/
|
14
|
+
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by email not defined)
|
15
|
+
- use Griffel packages ([PR #21360](https://github.com/microsoft/fluentui/pull/21360) by olfedias@microsoft.com)
|
16
|
+
- make the FluentProvider#theme TS API reflect runtime and add warning if there is a violation ([PR #21286](https://github.com/microsoft/fluentui/pull/21286) by martinhochel@microsoft.com)
|
17
|
+
- Replacing use of functions in makeStyles with direct use of tokens ([PR #21052](https://github.com/microsoft/fluentui/pull/21052) by Humberto.Morimoto@microsoft.com)
|
18
|
+
- replace mergeThemes functionality from react-theme ([PR #21278](https://github.com/microsoft/fluentui/pull/21278) by martinhochel@microsoft.com)
|
15
19
|
- Remove `themeToCSSVariables` function ([PR #20828](https://github.com/microsoft/fluentui/pull/20828) by bsunderhus@microsoft.com)
|
16
|
-
-
|
17
|
-
-
|
18
|
-
-
|
19
|
-
- Bump @fluentui/react-
|
20
|
-
- Bump @fluentui/react-
|
21
|
-
- Bump @fluentui/
|
22
|
-
- Bump @fluentui/
|
23
|
-
- Bump @fluentui/react-conformance-
|
20
|
+
- Remove component's shorthandProps array ([PR #21134](https://github.com/microsoft/fluentui/pull/21134) by behowell@microsoft.com)
|
21
|
+
- BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet ([PR #21365](https://github.com/microsoft/fluentui/pull/21365) by behowell@microsoft.com)
|
22
|
+
- Updating use of tokens.fontWeight now that we don't need to use casting. ([PR #21217](https://github.com/microsoft/fluentui/pull/21217) by Humberto.Morimoto@microsoft.com)
|
23
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly6a6e258c4020220125.1 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by beachball)
|
24
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly6a6e258c4020220125.1 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by beachball)
|
25
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly6a6e258c4020220125.1 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by beachball)
|
26
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly6a6e258c4020220125.1 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by beachball)
|
27
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly6a6e258c4020220125.1 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by beachball)
|
24
28
|
|
25
29
|
## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.0.0-beta.5)
|
26
30
|
|
package/dist/react-provider.d.ts
CHANGED
@@ -6,7 +6,6 @@ import type { ProviderContextValue } from '@fluentui/react-shared-contexts';
|
|
6
6
|
import * as React_2 from 'react';
|
7
7
|
import type { Theme } from '@fluentui/react-theme';
|
8
8
|
import type { ThemeClassNameContextValue } from '@fluentui/react-shared-contexts';
|
9
|
-
import type { ThemeContextValue } from '@fluentui/react-shared-contexts';
|
10
9
|
import type { TooltipContextType } from '@fluentui/react-shared-contexts';
|
11
10
|
import { useFluent } from '@fluentui/react-shared-contexts';
|
12
11
|
import { useTheme } from '@fluentui/react-shared-contexts';
|
@@ -22,10 +21,10 @@ export declare interface FluentProviderCommons {
|
|
22
21
|
targetDocument: Document | undefined;
|
23
22
|
}
|
24
23
|
|
25
|
-
export declare interface FluentProviderContextValues {
|
24
|
+
export declare interface FluentProviderContextValues extends Pick<FluentProviderState, 'theme'> {
|
26
25
|
provider: ProviderContextValue;
|
27
|
-
theme: ThemeContextValue;
|
28
26
|
themeClassName: ThemeClassNameContextValue;
|
27
|
+
textDirection: 'ltr' | 'rtl';
|
29
28
|
tooltip: TooltipContextType;
|
30
29
|
}
|
31
30
|
|
@@ -33,39 +32,37 @@ export declare interface FluentProviderProps extends Omit<ComponentProps<FluentP
|
|
33
32
|
theme?: PartialTheme;
|
34
33
|
}
|
35
34
|
|
36
|
-
export declare const fluentProviderShorthandProps: (keyof FluentProviderSlots)[];
|
37
|
-
|
38
35
|
export declare type FluentProviderSlots = {
|
39
36
|
root: IntrinsicShorthandProps<'div'>;
|
40
37
|
};
|
41
38
|
|
42
39
|
export declare interface FluentProviderState extends ComponentState<FluentProviderSlots>, FluentProviderCommons {
|
43
|
-
theme: Theme;
|
40
|
+
theme: Theme | Partial<Theme> | undefined;
|
44
41
|
themeClassName: string;
|
45
42
|
}
|
46
43
|
|
47
44
|
/**
|
48
45
|
* Render the final JSX of FluentProvider
|
49
46
|
*/
|
50
|
-
export declare const
|
47
|
+
export declare const renderFluentProvider_unstable: (state: FluentProviderState, contextValues: FluentProviderContextValues) => JSX.Element;
|
51
48
|
|
52
49
|
export { useFluent }
|
53
50
|
|
54
51
|
/**
|
55
52
|
* Create the state required to render FluentProvider.
|
56
53
|
*
|
57
|
-
* The returned state can be modified with hooks such as
|
58
|
-
* before being passed to
|
54
|
+
* The returned state can be modified with hooks such as useFluentProviderStyles_unstable,
|
55
|
+
* before being passed to renderFluentProvider_unstable.
|
59
56
|
*
|
60
57
|
* @param props - props from this instance of FluentProvider
|
61
58
|
* @param ref - reference to root HTMLElement of FluentProvider
|
62
59
|
*/
|
63
|
-
export declare const
|
60
|
+
export declare const useFluentProvider_unstable: (props: FluentProviderProps, ref: React_2.Ref<HTMLElement>) => FluentProviderState;
|
64
61
|
|
65
|
-
export declare function
|
62
|
+
export declare function useFluentProviderContextValues_unstable(state: FluentProviderState): FluentProviderContextValues;
|
66
63
|
|
67
64
|
/** Applies style classnames to slots */
|
68
|
-
export declare const
|
65
|
+
export declare const useFluentProviderStyles_unstable: (state: FluentProviderState) => FluentProviderState;
|
69
66
|
|
70
67
|
export { useTheme }
|
71
68
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
2
|
+
import { renderFluentProvider_unstable } from './renderFluentProvider';
|
3
|
+
import { useFluentProvider_unstable } from './useFluentProvider';
|
4
|
+
import { useFluentProviderStyles_unstable } from './useFluentProviderStyles';
|
5
|
+
import { useFluentProviderContextValues_unstable } from './useFluentProviderContextValues';
|
6
6
|
export const FluentProvider = /*#__PURE__*/React.forwardRef((props, ref) => {
|
7
|
-
const state =
|
8
|
-
|
9
|
-
const contextValues =
|
10
|
-
return
|
7
|
+
const state = useFluentProvider_unstable(props, ref);
|
8
|
+
useFluentProviderStyles_unstable(state);
|
9
|
+
const contextValues = useFluentProviderContextValues_unstable(state);
|
10
|
+
return renderFluentProvider_unstable(state, contextValues);
|
11
11
|
});
|
12
12
|
FluentProvider.displayName = 'FluentProvider';
|
13
13
|
//# sourceMappingURL=FluentProvider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/FluentProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/FluentProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AACA,SAAS,gCAAT,QAAiD,2BAAjD;AACA,SAAS,uCAAT,QAAwD,kCAAxD;AAGA,OAAO,MAAM,cAAc,gBAAG,KAAK,CAAC,UAAN,CAAmD,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,0BAA0B,CAAC,KAAD,EAAQ,GAAR,CAAxC;AACA,EAAA,gCAAgC,CAAC,KAAD,CAAhC;AAEA,QAAM,aAAa,GAAG,uCAAuC,CAAC,KAAD,CAA7D;AAEA,SAAO,6BAA6B,CAAC,KAAD,EAAQ,aAAR,CAApC;AACD,CAP6B,CAAvB;AASP,cAAc,CAAC,WAAf,GAA6B,gBAA7B","sourceRoot":""}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
2
2
|
import type { PartialTheme, Theme } from '@fluentui/react-theme';
|
3
|
-
import type { ProviderContextValue, TooltipContextType,
|
3
|
+
import type { ProviderContextValue, TooltipContextType, ThemeClassNameContextValue } from '@fluentui/react-shared-contexts';
|
4
4
|
export declare type FluentProviderSlots = {
|
5
5
|
root: IntrinsicShorthandProps<'div'>;
|
6
6
|
};
|
@@ -14,12 +14,12 @@ export interface FluentProviderProps extends Omit<ComponentProps<FluentProviderS
|
|
14
14
|
theme?: PartialTheme;
|
15
15
|
}
|
16
16
|
export interface FluentProviderState extends ComponentState<FluentProviderSlots>, FluentProviderCommons {
|
17
|
-
theme: Theme;
|
17
|
+
theme: Theme | Partial<Theme> | undefined;
|
18
18
|
themeClassName: string;
|
19
19
|
}
|
20
|
-
export interface FluentProviderContextValues {
|
20
|
+
export interface FluentProviderContextValues extends Pick<FluentProviderState, 'theme'> {
|
21
21
|
provider: ProviderContextValue;
|
22
|
-
theme: ThemeContextValue;
|
23
22
|
themeClassName: ThemeClassNameContextValue;
|
23
|
+
textDirection: 'ltr' | 'rtl';
|
24
24
|
tooltip: TooltipContextType;
|
25
25
|
}
|
@@ -2,4 +2,4 @@ import type { FluentProviderContextValues, FluentProviderState } from './FluentP
|
|
2
2
|
/**
|
3
3
|
* Render the final JSX of FluentProvider
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderFluentProvider_unstable: (state: FluentProviderState, contextValues: FluentProviderContextValues) => JSX.Element;
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { TextDirectionProvider } from '@griffel/react';
|
2
3
|
import { ProviderContext, TooltipContext, ThemeContext, ThemeClassNameContext } from '@fluentui/react-shared-contexts';
|
3
4
|
import { getSlots } from '@fluentui/react-utilities';
|
4
|
-
import { fluentProviderShorthandProps } from './useFluentProvider';
|
5
5
|
/**
|
6
6
|
* Render the final JSX of FluentProvider
|
7
7
|
*/
|
8
8
|
|
9
|
-
export const
|
9
|
+
export const renderFluentProvider_unstable = (state, contextValues) => {
|
10
10
|
const {
|
11
11
|
slots,
|
12
12
|
slotProps
|
13
|
-
} = getSlots(state
|
13
|
+
} = getSlots(state);
|
14
14
|
return /*#__PURE__*/React.createElement(ProviderContext.Provider, {
|
15
15
|
value: contextValues.provider
|
16
16
|
}, /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
@@ -19,7 +19,9 @@ export const renderFluentProvider = (state, contextValues) => {
|
|
19
19
|
value: contextValues.themeClassName
|
20
20
|
}, /*#__PURE__*/React.createElement(TooltipContext.Provider, {
|
21
21
|
value: contextValues.tooltip
|
22
|
+
}, /*#__PURE__*/React.createElement(TextDirectionProvider, {
|
23
|
+
dir: contextValues.textDirection
|
22
24
|
}, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
23
|
-
}, state.root.children)))));
|
25
|
+
}, state.root.children))))));
|
24
26
|
};
|
25
27
|
//# sourceMappingURL=renderFluentProvider.js.map
|
@@ -1 +1 @@
|
|
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;
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/renderFluentProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,qBAAT,QAAsC,gBAAtC;AACA,SAAS,eAAT,EAA0B,cAA1B,EAA0C,YAA1C,EAAwD,qBAAxD,QAAqF,iCAArF;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,6BAA6B,GAAG,CAC3C,KAD2C,EAE3C,aAF2C,KAGzC;AACF,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAsB,KAAtB,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,qBAAD,EAAsB;AAAC,IAAA,GAAG,EAAE,aAAa,CAAC;AAApB,GAAtB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EAAiC,KAAK,CAAC,IAAN,CAAW,QAA5C,CADF,CADF,CADF,CADF,CADF,CADF;AAaD,CAnBM","sourceRoot":""}
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type { FluentProviderProps,
|
3
|
-
export declare const fluentProviderShorthandProps: (keyof FluentProviderSlots)[];
|
2
|
+
import type { FluentProviderProps, FluentProviderState } from './FluentProvider.types';
|
4
3
|
/**
|
5
4
|
* Create the state required to render FluentProvider.
|
6
5
|
*
|
7
|
-
* The returned state can be modified with hooks such as
|
8
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useFluentProviderStyles_unstable,
|
7
|
+
* before being passed to renderFluentProvider_unstable.
|
9
8
|
*
|
10
9
|
* @param props - props from this instance of FluentProvider
|
11
10
|
* @param ref - reference to root HTMLElement of FluentProvider
|
12
11
|
*/
|
13
|
-
export declare const
|
12
|
+
export declare const useFluentProvider_unstable: (props: FluentProviderProps, ref: React.Ref<HTMLElement>) => FluentProviderState;
|
@@ -1,20 +1,19 @@
|
|
1
1
|
import { useKeyboardNavAttribute } from '@fluentui/react-tabster';
|
2
|
-
import { mergeThemes } from '@fluentui/react-theme';
|
3
2
|
import { useFluent, useTheme } from '@fluentui/react-shared-contexts';
|
4
3
|
import { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';
|
4
|
+
import * as React from 'react';
|
5
5
|
import { useThemeStyleTag } from './useThemeStyleTag';
|
6
|
-
export const fluentProviderShorthandProps = ['root'];
|
7
6
|
/**
|
8
7
|
* Create the state required to render FluentProvider.
|
9
8
|
*
|
10
|
-
* The returned state can be modified with hooks such as
|
11
|
-
* before being passed to
|
9
|
+
* The returned state can be modified with hooks such as useFluentProviderStyles_unstable,
|
10
|
+
* before being passed to renderFluentProvider_unstable.
|
12
11
|
*
|
13
12
|
* @param props - props from this instance of FluentProvider
|
14
13
|
* @param ref - reference to root HTMLElement of FluentProvider
|
15
14
|
*/
|
16
15
|
|
17
|
-
export const
|
16
|
+
export const useFluentProvider_unstable = (props, ref) => {
|
18
17
|
const parentContext = useFluent();
|
19
18
|
const parentTheme = useTheme();
|
20
19
|
/**
|
@@ -26,9 +25,20 @@ export const useFluentProvider = (props, ref) => {
|
|
26
25
|
const {
|
27
26
|
dir = parentContext.dir,
|
28
27
|
targetDocument = parentContext.targetDocument,
|
29
|
-
theme
|
28
|
+
theme
|
30
29
|
} = props;
|
31
30
|
const mergedTheme = mergeThemes(parentTheme, theme);
|
31
|
+
React.useEffect(() => {
|
32
|
+
if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {
|
33
|
+
// eslint-disable-next-line no-console
|
34
|
+
console.warn(`
|
35
|
+
FluentProvider: your "theme" is not defined !
|
36
|
+
=============================================
|
37
|
+
Make sure your root FluentProvider has set a theme or you're setting the theme in your child FluentProvider.
|
38
|
+
`);
|
39
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
40
|
+
|
41
|
+
}, []);
|
32
42
|
return {
|
33
43
|
dir,
|
34
44
|
targetDocument,
|
@@ -46,4 +56,19 @@ export const useFluentProvider = (props, ref) => {
|
|
46
56
|
})
|
47
57
|
};
|
48
58
|
};
|
59
|
+
|
60
|
+
function mergeThemes(a, b) {
|
61
|
+
// Merge impacts perf: we should like to avoid it if it's possible
|
62
|
+
if (a && b) {
|
63
|
+
return { ...a,
|
64
|
+
...b
|
65
|
+
};
|
66
|
+
}
|
67
|
+
|
68
|
+
if (a) {
|
69
|
+
return a;
|
70
|
+
}
|
71
|
+
|
72
|
+
return b;
|
73
|
+
}
|
49
74
|
//# sourceMappingURL=useFluentProvider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"names":[],"mappings":"AAAA,SAAS,uBAAT,QAAwC,yBAAxC;
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"names":[],"mappings":"AAAA,SAAS,uBAAT,QAAwC,yBAAxC;AAEA,SAAS,SAAT,EAAoB,QAApB,QAAoC,iCAApC;AACA,SAAS,qBAAT,EAAgC,aAAhC,QAAqD,2BAArD;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,oBAAjC;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,0BAA0B,GAAG,CACxC,KADwC,EAExC,GAFwC,KAGjB;AACvB,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;AAA1E,MAAoF,KAA1F;AACA,QAAM,WAAW,GAAG,WAAW,CAAC,WAAD,EAAc,KAAd,CAA/B;AAEA,EAAA,KAAK,CAAC,SAAN,CAAgB,MAAK;AACnB,QAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAAzB,IAAyC,WAAW,KAAK,SAA7D,EAAwE;AACtE;AACA,MAAA,OAAO,CAAC,IAAR,CAAa;;;;AAIZ,OAJD;AAKD,KARkB,CASnB;;AACD,GAVD,EAUG,EAVH;AAYA,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,CA3CM;;AA6CP,SAAS,WAAT,CAAqB,CAArB,EAA4D,CAA5D,EAAuE;AACrE;AACA,MAAI,CAAC,IAAI,CAAT,EAAY;AACV,WAAO,EAAE,GAAG,CAAL;AAAQ,SAAG;AAAX,KAAP;AACD;;AAED,MAAI,CAAJ,EAAO;AACL,WAAO,CAAP;AACD;;AAED,SAAO,CAAP;AACD","sourceRoot":""}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import type { FluentProviderContextValues, FluentProviderState } from './FluentProvider.types';
|
2
|
-
export declare function
|
2
|
+
export declare function useFluentProviderContextValues_unstable(state: FluentProviderState): FluentProviderContextValues;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useConst } from '@fluentui/react-utilities';
|
2
2
|
import * as React from 'react';
|
3
|
-
export function
|
3
|
+
export function useFluentProviderContextValues_unstable(state) {
|
4
4
|
const {
|
5
5
|
root,
|
6
6
|
dir,
|
@@ -15,6 +15,7 @@ export function useFluentProviderContextValues(state) {
|
|
15
15
|
const tooltip = useConst({});
|
16
16
|
return {
|
17
17
|
provider,
|
18
|
+
textDirection: dir,
|
18
19
|
tooltip,
|
19
20
|
theme,
|
20
21
|
themeClassName: root.className
|
@@ -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,
|
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,uCAAV,CAAkD,KAAlD,EAA4E;AAChF,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,CAHgF,CAIhF;;AACA,QAAM,OAAO,GAAG,QAAQ,CAAC,EAAD,CAAxB;AAEA,SAAO;AACL,IAAA,QADK;AAEL,IAAA,aAAa,EAAE,GAFV;AAGL,IAAA,OAHK;AAIL,IAAA,KAJK;AAKL,IAAA,cAAc,EAAE,IAAI,CAAC;AALhB,GAAP;AAOD","sourceRoot":""}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import type { FluentProviderState } from './FluentProvider.types';
|
2
2
|
export declare const fluentProviderClassName = "fui-FluentProvider";
|
3
3
|
/** Applies style classnames to slots */
|
4
|
-
export declare const
|
4
|
+
export declare const useFluentProviderStyles_unstable: (state: FluentProviderState) => FluentProviderState;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { __styles, mergeClasses } from '@
|
1
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
2
3
|
export const fluentProviderClassName = 'fui-FluentProvider';
|
3
4
|
|
4
5
|
const useStyles = /*#__PURE__*/__styles({
|
@@ -15,7 +16,7 @@ const useStyles = /*#__PURE__*/__styles({
|
|
15
16
|
/** Applies style classnames to slots */
|
16
17
|
|
17
18
|
|
18
|
-
export const
|
19
|
+
export const useFluentProviderStyles_unstable = state => {
|
19
20
|
const styles = useStyles();
|
20
21
|
state.root.className = mergeClasses(fluentProviderClassName, state.themeClassName, styles.root, state.root.className);
|
21
22
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AACA,SAAS,MAAT,QAAuB,uBAAvB;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,gCAAgC,GAAI,KAAD,IAA+B;AAC7E,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":""}
|
@@ -24,10 +24,10 @@ export const useThemeStyleTag = options => {
|
|
24
24
|
return tag;
|
25
25
|
}, [styleTagId, targetDocument]);
|
26
26
|
const cssRule = React.useMemo(() => {
|
27
|
-
const cssVarsAsString = Object.keys(theme).reduce((cssVarRule, cssVar) => {
|
27
|
+
const cssVarsAsString = theme ? Object.keys(theme).reduce((cssVarRule, cssVar) => {
|
28
28
|
cssVarRule += `--${cssVar}: ${theme[cssVar]}; `;
|
29
29
|
return cssVarRule;
|
30
|
-
}, ''); // result: .fluent-provider1 { --css-var: '#fff' }
|
30
|
+
}, '') : ''; // result: .fluent-provider1 { --css-var: '#fff' }
|
31
31
|
|
32
32
|
return `.${styleTagId} { ${cssVarsAsString} }`;
|
33
33
|
}, [theme, styleTagId]);
|
@@ -46,11 +46,8 @@ export const useThemeStyleTag = options => {
|
|
46
46
|
|
47
47
|
React.useEffect(() => {
|
48
48
|
return () => {
|
49
|
-
var _a;
|
50
|
-
|
51
49
|
if (styleTag) {
|
52
|
-
|
53
|
-
(_a = styleTag.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(styleTag);
|
50
|
+
styleTag.remove();
|
54
51
|
}
|
55
52
|
};
|
56
53
|
}, [styleTag]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useThemeStyleTag.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,EAAgB,WAAhB,QAAmC,2BAAnC;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,eAAe,GAAG,MAAM,CAAC,IAAP,CAAY,KAAZ,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useThemeStyleTag.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,EAAgB,WAAhB,QAAmC,2BAAnC;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,eAAe,GAAG,KAAK,GACxB,MAAM,CAAC,IAAP,CAAY,KAAZ,EAA8C,MAA9C,CAAqD,CAAC,UAAD,EAAa,MAAb,KAAuB;AAC3E,MAAA,UAAU,IAAI,KAAK,MAAM,KAAK,KAAK,CAAC,MAAD,CAAQ,IAA3C;AACA,aAAO,UAAP;AACD,KAHA,EAGE,EAHF,CADwB,GAKzB,EALJ,CADiC,CAQjC;;AACA,WAAO,IAAI,UAAU,MAAM,eAAe,IAA1C;AACD,GAVe,EAUb,CAAC,KAAD,EAAQ,UAAR,CAVa,CAAhB;AAWA,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,GApCgG,CAsCjG;;;AACA,EAAA,KAAK,CAAC,SAAN,CAAgB,MAAK;AACnB,WAAO,MAAK;AACV,UAAI,QAAJ,EAAc;AACZ,QAAA,QAAQ,CAAC,MAAT;AACD;AACF,KAJD;AAKD,GAND,EAMG,CAAC,QAAD,CANH;AAQA,SAAO,UAAP;AACD,CAhDM","sourceRoot":""}
|
@@ -16,10 +16,10 @@ const useFluentProviderStyles_1 = /*#__PURE__*/require("./useFluentProviderStyle
|
|
16
16
|
const useFluentProviderContextValues_1 = /*#__PURE__*/require("./useFluentProviderContextValues");
|
17
17
|
|
18
18
|
exports.FluentProvider = /*#__PURE__*/React.forwardRef((props, ref) => {
|
19
|
-
const state = useFluentProvider_1.
|
20
|
-
useFluentProviderStyles_1.
|
21
|
-
const contextValues = useFluentProviderContextValues_1.
|
22
|
-
return renderFluentProvider_1.
|
19
|
+
const state = useFluentProvider_1.useFluentProvider_unstable(props, ref);
|
20
|
+
useFluentProviderStyles_1.useFluentProviderStyles_unstable(state);
|
21
|
+
const contextValues = useFluentProviderContextValues_1.useFluentProviderContextValues_unstable(state);
|
22
|
+
return renderFluentProvider_1.renderFluentProvider_unstable(state, contextValues);
|
23
23
|
});
|
24
24
|
exports.FluentProvider.displayName = 'FluentProvider';
|
25
25
|
//# sourceMappingURL=FluentProvider.js.map
|
@@ -1 +1 @@
|
|
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,
|
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,0BAAA,CAA2B,KAA3B,EAAkC,GAAlC,CAAd;AACA,EAAA,yBAAA,CAAA,gCAAA,CAAiC,KAAjC;AAEA,QAAM,aAAa,GAAG,gCAAA,CAAA,uCAAA,CAAwC,KAAxC,CAAtB;AAEA,SAAO,sBAAA,CAAA,6BAAA,CAA8B,KAA9B,EAAqC,aAArC,CAAP;AACD,CAP6B,CAAjB;AASb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
2
2
|
import type { PartialTheme, Theme } from '@fluentui/react-theme';
|
3
|
-
import type { ProviderContextValue, TooltipContextType,
|
3
|
+
import type { ProviderContextValue, TooltipContextType, ThemeClassNameContextValue } from '@fluentui/react-shared-contexts';
|
4
4
|
export declare type FluentProviderSlots = {
|
5
5
|
root: IntrinsicShorthandProps<'div'>;
|
6
6
|
};
|
@@ -14,12 +14,12 @@ export interface FluentProviderProps extends Omit<ComponentProps<FluentProviderS
|
|
14
14
|
theme?: PartialTheme;
|
15
15
|
}
|
16
16
|
export interface FluentProviderState extends ComponentState<FluentProviderSlots>, FluentProviderCommons {
|
17
|
-
theme: Theme;
|
17
|
+
theme: Theme | Partial<Theme> | undefined;
|
18
18
|
themeClassName: string;
|
19
19
|
}
|
20
|
-
export interface FluentProviderContextValues {
|
20
|
+
export interface FluentProviderContextValues extends Pick<FluentProviderState, 'theme'> {
|
21
21
|
provider: ProviderContextValue;
|
22
|
-
theme: ThemeContextValue;
|
23
22
|
themeClassName: ThemeClassNameContextValue;
|
23
|
+
textDirection: 'ltr' | 'rtl';
|
24
24
|
tooltip: TooltipContextType;
|
25
25
|
}
|
@@ -2,4 +2,4 @@ import type { FluentProviderContextValues, FluentProviderState } from './FluentP
|
|
2
2
|
/**
|
3
3
|
* Render the final JSX of FluentProvider
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderFluentProvider_unstable: (state: FluentProviderState, contextValues: FluentProviderContextValues) => JSX.Element;
|
@@ -3,25 +3,25 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.renderFluentProvider_unstable = void 0;
|
7
7
|
|
8
8
|
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
11
|
+
|
10
12
|
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
11
13
|
|
12
14
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
13
|
-
|
14
|
-
const useFluentProvider_1 = /*#__PURE__*/require("./useFluentProvider");
|
15
15
|
/**
|
16
16
|
* Render the final JSX of FluentProvider
|
17
17
|
*/
|
18
18
|
|
19
19
|
|
20
|
-
const
|
20
|
+
const renderFluentProvider_unstable = (state, contextValues) => {
|
21
21
|
const {
|
22
22
|
slots,
|
23
23
|
slotProps
|
24
|
-
} = react_utilities_1.getSlots(state
|
24
|
+
} = react_utilities_1.getSlots(state);
|
25
25
|
return React.createElement(react_shared_contexts_1.ProviderContext.Provider, {
|
26
26
|
value: contextValues.provider
|
27
27
|
}, React.createElement(react_shared_contexts_1.ThemeContext.Provider, {
|
@@ -30,9 +30,11 @@ const renderFluentProvider = (state, contextValues) => {
|
|
30
30
|
value: contextValues.themeClassName
|
31
31
|
}, React.createElement(react_shared_contexts_1.TooltipContext.Provider, {
|
32
32
|
value: contextValues.tooltip
|
33
|
+
}, React.createElement(react_1.TextDirectionProvider, {
|
34
|
+
dir: contextValues.textDirection
|
33
35
|
}, React.createElement(slots.root, { ...slotProps.root
|
34
|
-
}, state.root.children)))));
|
36
|
+
}, state.root.children))))));
|
35
37
|
};
|
36
38
|
|
37
|
-
exports.
|
39
|
+
exports.renderFluentProvider_unstable = renderFluentProvider_unstable;
|
38
40
|
//# sourceMappingURL=renderFluentProvider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/renderFluentProvider.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/renderFluentProvider.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,6BAA6B,GAAG,CAC3C,KAD2C,EAE3C,aAF2C,KAGzC;AACF,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA8B,KAA9B,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,OAAA,CAAA,qBAAD,EAAsB;AAAC,IAAA,GAAG,EAAE,aAAa,CAAC;AAApB,GAAtB,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EAAiC,KAAK,CAAC,IAAN,CAAW,QAA5C,CADF,CADF,CADF,CADF,CADF,CADF;AAaD,CAnBM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourceRoot":""}
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type { FluentProviderProps,
|
3
|
-
export declare const fluentProviderShorthandProps: (keyof FluentProviderSlots)[];
|
2
|
+
import type { FluentProviderProps, FluentProviderState } from './FluentProvider.types';
|
4
3
|
/**
|
5
4
|
* Create the state required to render FluentProvider.
|
6
5
|
*
|
7
|
-
* The returned state can be modified with hooks such as
|
8
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useFluentProviderStyles_unstable,
|
7
|
+
* before being passed to renderFluentProvider_unstable.
|
9
8
|
*
|
10
9
|
* @param props - props from this instance of FluentProvider
|
11
10
|
* @param ref - reference to root HTMLElement of FluentProvider
|
12
11
|
*/
|
13
|
-
export declare const
|
12
|
+
export declare const useFluentProvider_unstable: (props: FluentProviderProps, ref: React.Ref<HTMLElement>) => FluentProviderState;
|
@@ -3,30 +3,29 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useFluentProvider_unstable = void 0;
|
7
7
|
|
8
8
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
9
9
|
|
10
|
-
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
|
-
|
12
10
|
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
13
11
|
|
14
12
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
15
13
|
|
16
|
-
const
|
14
|
+
const React = /*#__PURE__*/require("react");
|
17
15
|
|
18
|
-
|
16
|
+
const useThemeStyleTag_1 = /*#__PURE__*/require("./useThemeStyleTag");
|
19
17
|
/**
|
20
18
|
* Create the state required to render FluentProvider.
|
21
19
|
*
|
22
|
-
* The returned state can be modified with hooks such as
|
23
|
-
* before being passed to
|
20
|
+
* The returned state can be modified with hooks such as useFluentProviderStyles_unstable,
|
21
|
+
* before being passed to renderFluentProvider_unstable.
|
24
22
|
*
|
25
23
|
* @param props - props from this instance of FluentProvider
|
26
24
|
* @param ref - reference to root HTMLElement of FluentProvider
|
27
25
|
*/
|
28
26
|
|
29
|
-
|
27
|
+
|
28
|
+
const useFluentProvider_unstable = (props, ref) => {
|
30
29
|
const parentContext = react_shared_contexts_1.useFluent();
|
31
30
|
const parentTheme = react_shared_contexts_1.useTheme();
|
32
31
|
/**
|
@@ -38,9 +37,20 @@ const useFluentProvider = (props, ref) => {
|
|
38
37
|
const {
|
39
38
|
dir = parentContext.dir,
|
40
39
|
targetDocument = parentContext.targetDocument,
|
41
|
-
theme
|
40
|
+
theme
|
42
41
|
} = props;
|
43
|
-
const mergedTheme =
|
42
|
+
const mergedTheme = mergeThemes(parentTheme, theme);
|
43
|
+
React.useEffect(() => {
|
44
|
+
if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {
|
45
|
+
// eslint-disable-next-line no-console
|
46
|
+
console.warn(`
|
47
|
+
FluentProvider: your "theme" is not defined !
|
48
|
+
=============================================
|
49
|
+
Make sure your root FluentProvider has set a theme or you're setting the theme in your child FluentProvider.
|
50
|
+
`);
|
51
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
52
|
+
|
53
|
+
}, []);
|
44
54
|
return {
|
45
55
|
dir,
|
46
56
|
targetDocument,
|
@@ -59,5 +69,20 @@ const useFluentProvider = (props, ref) => {
|
|
59
69
|
};
|
60
70
|
};
|
61
71
|
|
62
|
-
exports.
|
72
|
+
exports.useFluentProvider_unstable = useFluentProvider_unstable;
|
73
|
+
|
74
|
+
function mergeThemes(a, b) {
|
75
|
+
// Merge impacts perf: we should like to avoid it if it's possible
|
76
|
+
if (a && b) {
|
77
|
+
return { ...a,
|
78
|
+
...b
|
79
|
+
};
|
80
|
+
}
|
81
|
+
|
82
|
+
if (a) {
|
83
|
+
return a;
|
84
|
+
}
|
85
|
+
|
86
|
+
return b;
|
87
|
+
}
|
63
88
|
//# sourceMappingURL=useFluentProvider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAEA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,0BAA0B,GAAG,CACxC,KADwC,EAExC,GAFwC,KAGjB;AACvB,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;AAA1E,MAAoF,KAA1F;AACA,QAAM,WAAW,GAAG,WAAW,CAAC,WAAD,EAAc,KAAd,CAA/B;AAEA,EAAA,KAAK,CAAC,SAAN,CAAgB,MAAK;AACnB,QAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAAzB,IAAyC,WAAW,KAAK,SAA7D,EAAwE;AACtE;AACA,MAAA,OAAO,CAAC,IAAR,CAAa;;;;AAIZ,OAJD;AAKD,KARkB,CASnB;;AACD,GAVD,EAUG,EAVH;AAYA,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,CA3CM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B;;AA6Cb,SAAS,WAAT,CAAqB,CAArB,EAA4D,CAA5D,EAAuE;AACrE;AACA,MAAI,CAAC,IAAI,CAAT,EAAY;AACV,WAAO,EAAE,GAAG,CAAL;AAAQ,SAAG;AAAX,KAAP;AACD;;AAED,MAAI,CAAJ,EAAO;AACL,WAAO,CAAP;AACD;;AAED,SAAO,CAAP;AACD","sourceRoot":""}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import type { FluentProviderContextValues, FluentProviderState } from './FluentProvider.types';
|
2
|
-
export declare function
|
2
|
+
export declare function useFluentProviderContextValues_unstable(state: FluentProviderState): FluentProviderContextValues;
|
@@ -3,13 +3,13 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useFluentProviderContextValues_unstable = 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
|
-
function
|
12
|
+
function useFluentProviderContextValues_unstable(state) {
|
13
13
|
const {
|
14
14
|
root,
|
15
15
|
dir,
|
@@ -24,11 +24,12 @@ function useFluentProviderContextValues(state) {
|
|
24
24
|
const tooltip = react_utilities_1.useConst({});
|
25
25
|
return {
|
26
26
|
provider,
|
27
|
+
textDirection: dir,
|
27
28
|
tooltip,
|
28
29
|
theme,
|
29
30
|
themeClassName: root.className
|
30
31
|
};
|
31
32
|
}
|
32
33
|
|
33
|
-
exports.
|
34
|
+
exports.useFluentProviderContextValues_unstable = useFluentProviderContextValues_unstable;
|
34
35
|
//# sourceMappingURL=useFluentProviderContextValues.js.map
|
@@ -1 +1 @@
|
|
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,
|
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,uCAAhB,CAAwD,KAAxD,EAAkF;AAChF,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,CAHgF,CAIhF;;AACA,QAAM,OAAO,GAAG,iBAAA,CAAA,QAAA,CAAS,EAAT,CAAhB;AAEA,SAAO;AACL,IAAA,QADK;AAEL,IAAA,aAAa,EAAE,GAFV;AAGL,IAAA,OAHK;AAIL,IAAA,KAJK;AAKL,IAAA,cAAc,EAAE,IAAI,CAAC;AALhB,GAAP;AAOD;;AAdD,OAAA,CAAA,uCAAA,GAAA,uCAAA","sourceRoot":""}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import type { FluentProviderState } from './FluentProvider.types';
|
2
2
|
export declare const fluentProviderClassName = "fui-FluentProvider";
|
3
3
|
/** Applies style classnames to slots */
|
4
|
-
export declare const
|
4
|
+
export declare const useFluentProviderStyles_unstable: (state: FluentProviderState) => FluentProviderState;
|
@@ -3,13 +3,15 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useFluentProviderStyles_unstable = exports.fluentProviderClassName = void 0;
|
7
7
|
|
8
|
-
const
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
+
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
9
11
|
|
10
12
|
exports.fluentProviderClassName = 'fui-FluentProvider';
|
11
13
|
|
12
|
-
const useStyles = /*#__PURE__*/
|
14
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
13
15
|
"root": {
|
14
16
|
"sj55zd": "f19n0e5",
|
15
17
|
"De3pzq": "fxugw4r",
|
@@ -23,11 +25,11 @@ const useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
23
25
|
/** Applies style classnames to slots */
|
24
26
|
|
25
27
|
|
26
|
-
const
|
28
|
+
const useFluentProviderStyles_unstable = state => {
|
27
29
|
const styles = useStyles();
|
28
|
-
state.root.className =
|
30
|
+
state.root.className = react_1.mergeClasses(exports.fluentProviderClassName, state.themeClassName, styles.root, state.root.className);
|
29
31
|
return state;
|
30
32
|
};
|
31
33
|
|
32
|
-
exports.
|
34
|
+
exports.useFluentProviderStyles_unstable = useFluentProviderStyles_unstable;
|
33
35
|
//# sourceMappingURL=useFluentProviderStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAGa,OAAA,CAAA,uBAAA,GAA0B,oBAA1B;;AAEb,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAUA;;;AACO,MAAM,gCAAgC,GAAI,KAAD,IAA+B;AAC7E,QAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,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,gCAAA,GAAgC,gCAAhC","sourceRoot":""}
|
@@ -34,10 +34,10 @@ const useThemeStyleTag = options => {
|
|
34
34
|
return tag;
|
35
35
|
}, [styleTagId, targetDocument]);
|
36
36
|
const cssRule = React.useMemo(() => {
|
37
|
-
const cssVarsAsString = Object.keys(theme).reduce((cssVarRule, cssVar) => {
|
37
|
+
const cssVarsAsString = theme ? Object.keys(theme).reduce((cssVarRule, cssVar) => {
|
38
38
|
cssVarRule += `--${cssVar}: ${theme[cssVar]}; `;
|
39
39
|
return cssVarRule;
|
40
|
-
}, ''); // result: .fluent-provider1 { --css-var: '#fff' }
|
40
|
+
}, '') : ''; // result: .fluent-provider1 { --css-var: '#fff' }
|
41
41
|
|
42
42
|
return `.${styleTagId} { ${cssVarsAsString} }`;
|
43
43
|
}, [theme, styleTagId]);
|
@@ -56,11 +56,8 @@ const useThemeStyleTag = options => {
|
|
56
56
|
|
57
57
|
React.useEffect(() => {
|
58
58
|
return () => {
|
59
|
-
var _a;
|
60
|
-
|
61
59
|
if (styleTag) {
|
62
|
-
|
63
|
-
(_a = styleTag.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(styleTag);
|
60
|
+
styleTag.remove();
|
64
61
|
}
|
65
62
|
};
|
66
63
|
}, [styleTag]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useThemeStyleTag.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,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,eAAe,GAAG,MAAM,CAAC,IAAP,CAAY,KAAZ,
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useThemeStyleTag.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,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,eAAe,GAAG,KAAK,GACxB,MAAM,CAAC,IAAP,CAAY,KAAZ,EAA8C,MAA9C,CAAqD,CAAC,UAAD,EAAa,MAAb,KAAuB;AAC3E,MAAA,UAAU,IAAI,KAAK,MAAM,KAAK,KAAK,CAAC,MAAD,CAAQ,IAA3C;AACA,aAAO,UAAP;AACD,KAHA,EAGE,EAHF,CADwB,GAKzB,EALJ,CADiC,CAQjC;;AACA,WAAO,IAAI,UAAU,MAAM,eAAe,IAA1C;AACD,GAVe,EAUb,CAAC,KAAD,EAAQ,UAAR,CAVa,CAAhB;AAWA,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,GApCgG,CAsCjG;;;AACA,EAAA,KAAK,CAAC,SAAN,CAAgB,MAAK;AACnB,WAAO,MAAK;AACV,UAAI,QAAJ,EAAc;AACZ,QAAA,QAAQ,CAAC,MAAT;AACD;AACF,KAJD;AAKD,GAND,EAMG,CAAC,QAAD,CANH;AAQA,SAAO,UAAP;AACD,CAhDM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","sourceRoot":""}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-provider",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-nightly6a6e258c4020220125.1",
|
4
4
|
"description": "Fluent UI React provider component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -14,29 +14,27 @@
|
|
14
14
|
"scripts": {
|
15
15
|
"build": "just-scripts build",
|
16
16
|
"bundle-size": "bundle-size measure",
|
17
|
-
"test": "jest",
|
17
|
+
"test": "jest --passWithNoTests",
|
18
18
|
"clean": "just-scripts clean",
|
19
19
|
"code-style": "just-scripts code-style",
|
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
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
|
-
"storybook": "
|
24
|
+
"storybook": "node ../../scripts/storybook/runner",
|
25
25
|
"start": "yarn storybook",
|
26
26
|
"type-check": "tsc -b tsconfig.json"
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
29
|
-
"@fluentui/babel-make-styles": "0.0.0-nightly65dd5f749420211213.1",
|
30
29
|
"@fluentui/eslint-plugin": "*",
|
31
|
-
"@fluentui/jest-serializer-make-styles": "0.0.0-nightly65dd5f749420211213.1",
|
32
30
|
"@fluentui/react-conformance": "*",
|
33
|
-
"@fluentui/react-conformance-
|
31
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly6a6e258c4020220125.1",
|
34
32
|
"@fluentui/scripts": "^1.0.0",
|
35
33
|
"@types/enzyme": "3.10.3",
|
36
34
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
37
|
-
"@types/jest": "24.9.1",
|
38
35
|
"@types/react": "16.9.42",
|
39
36
|
"@types/react-dom": "16.9.10",
|
37
|
+
"@types/react-test-renderer": "^16.0.0",
|
40
38
|
"enzyme": "~3.10.0",
|
41
39
|
"enzyme-adapter-react-16": "^1.15.0",
|
42
40
|
"react": "16.8.6",
|
@@ -44,11 +42,11 @@
|
|
44
42
|
"react-test-renderer": "^16.3.0"
|
45
43
|
},
|
46
44
|
"dependencies": {
|
47
|
-
"@
|
48
|
-
"@fluentui/react-shared-contexts": "0.0.0-
|
49
|
-
"@fluentui/react-tabster": "0.0.0-
|
50
|
-
"@fluentui/react-theme": "0.0.0-
|
51
|
-
"@fluentui/react-utilities": "0.0.0-
|
45
|
+
"@griffel/react": "1.0.0",
|
46
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly6a6e258c4020220125.1",
|
47
|
+
"@fluentui/react-tabster": "0.0.0-nightly6a6e258c4020220125.1",
|
48
|
+
"@fluentui/react-theme": "0.0.0-nightly6a6e258c4020220125.1",
|
49
|
+
"@fluentui/react-utilities": "0.0.0-nightly6a6e258c4020220125.1",
|
52
50
|
"tslib": "^2.1.0"
|
53
51
|
},
|
54
52
|
"peerDependencies": {
|