@fluentui/react-provider 0.0.0-nightlyecca467a8920220110.1 → 0.0.0-nightlyf6116328d620220124.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 +56 -20
- package/CHANGELOG.md +17 -13
- package/dist/react-provider.d.ts +2 -6
- package/lib/components/FluentProvider/FluentProvider.types.d.ts +3 -4
- package/lib/components/FluentProvider/renderFluentProvider.js +1 -2
- package/lib/components/FluentProvider/renderFluentProvider.js.map +1 -1
- package/lib/components/FluentProvider/useFluentProvider.d.ts +1 -2
- package/lib/components/FluentProvider/useFluentProvider.js +28 -3
- package/lib/components/FluentProvider/useFluentProvider.js.map +1 -1
- 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.types.d.ts +3 -4
- package/lib-commonjs/components/FluentProvider/renderFluentProvider.js +1 -3
- package/lib-commonjs/components/FluentProvider/renderFluentProvider.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProvider.d.ts +1 -2
- package/lib-commonjs/components/FluentProvider/useFluentProvider.js +32 -7
- package/lib-commonjs/components/FluentProvider/useFluentProvider.js.map +1 -1
- 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 +11 -11
package/CHANGELOG.json
CHANGED
@@ -2,79 +2,109 @@
|
|
2
2
|
"name": "@fluentui/react-provider",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "Mon,
|
6
|
-
"tag": "@fluentui/react-provider_v0.0.0-
|
7
|
-
"version": "0.0.0-
|
5
|
+
"date": "Mon, 24 Jan 2022 04:14:09 GMT",
|
6
|
+
"tag": "@fluentui/react-provider_v0.0.0-nightlyf6116328d620220124.1",
|
7
|
+
"version": "0.0.0-nightlyf6116328d620220124.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": "7e40e770b133f0e9b5a0ba356e78ea25a8647941",
|
14
14
|
"comment": "Release nightly v9"
|
15
15
|
},
|
16
|
+
{
|
17
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
18
|
+
"package": "@fluentui/react-provider",
|
19
|
+
"commit": "00a5d945904c896a0664de6ba72c145a255f0848",
|
20
|
+
"comment": "Updating use of tokens.fontWeight now that we don't need to use casting."
|
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
|
+
},
|
16
28
|
{
|
17
29
|
"author": "Humberto.Morimoto@microsoft.com",
|
18
30
|
"package": "@fluentui/react-provider",
|
19
31
|
"commit": "b22c4ef0eba0730286f2ed701e1b851d8a5c03b5",
|
20
32
|
"comment": "Replacing use of functions in makeStyles with direct use of tokens"
|
21
33
|
},
|
34
|
+
{
|
35
|
+
"author": "martinhochel@microsoft.com",
|
36
|
+
"package": "@fluentui/react-provider",
|
37
|
+
"commit": "1dba2fca2365f1a748505896679ae160a6fec270",
|
38
|
+
"comment": "replace mergeThemes functionality from react-theme"
|
39
|
+
},
|
22
40
|
{
|
23
41
|
"author": "bsunderhus@microsoft.com",
|
24
42
|
"package": "@fluentui/react-provider",
|
25
43
|
"commit": "c9a03954ffd5d1a85284fb36ef4cd103ed8aa927",
|
26
44
|
"comment": "Remove `themeToCSSVariables` function"
|
27
45
|
},
|
46
|
+
{
|
47
|
+
"author": "behowell@microsoft.com",
|
48
|
+
"package": "@fluentui/react-provider",
|
49
|
+
"commit": "7cc28ed8320b00f42d91c63882f10316db2205c5",
|
50
|
+
"comment": "Remove component's shorthandProps array"
|
51
|
+
},
|
28
52
|
{
|
29
53
|
"author": "beachball",
|
30
54
|
"package": "@fluentui/react-provider",
|
31
|
-
"comment": "Bump @fluentui/react-make-styles to v0.0.0-
|
32
|
-
"commit": "
|
55
|
+
"comment": "Bump @fluentui/react-make-styles to v0.0.0-nightlyf6116328d620220124.1",
|
56
|
+
"commit": "7e40e770b133f0e9b5a0ba356e78ea25a8647941"
|
33
57
|
},
|
34
58
|
{
|
35
59
|
"author": "beachball",
|
36
60
|
"package": "@fluentui/react-provider",
|
37
|
-
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-
|
38
|
-
"commit": "
|
61
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightlyf6116328d620220124.1",
|
62
|
+
"commit": "7e40e770b133f0e9b5a0ba356e78ea25a8647941"
|
39
63
|
},
|
40
64
|
{
|
41
65
|
"author": "beachball",
|
42
66
|
"package": "@fluentui/react-provider",
|
43
|
-
"comment": "Bump @fluentui/react-tabster to v0.0.0-
|
44
|
-
"commit": "
|
67
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightlyf6116328d620220124.1",
|
68
|
+
"commit": "7e40e770b133f0e9b5a0ba356e78ea25a8647941"
|
45
69
|
},
|
46
70
|
{
|
47
71
|
"author": "beachball",
|
48
72
|
"package": "@fluentui/react-provider",
|
49
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-
|
50
|
-
"commit": "
|
73
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightlyf6116328d620220124.1",
|
74
|
+
"commit": "7e40e770b133f0e9b5a0ba356e78ea25a8647941"
|
51
75
|
},
|
52
76
|
{
|
53
77
|
"author": "beachball",
|
54
78
|
"package": "@fluentui/react-provider",
|
55
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-
|
56
|
-
"commit": "
|
79
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyf6116328d620220124.1",
|
80
|
+
"commit": "7e40e770b133f0e9b5a0ba356e78ea25a8647941"
|
57
81
|
},
|
58
82
|
{
|
59
83
|
"author": "beachball",
|
60
84
|
"package": "@fluentui/react-provider",
|
61
|
-
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-
|
62
|
-
"commit": "
|
85
|
+
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightlyf6116328d620220124.1",
|
86
|
+
"commit": "7e40e770b133f0e9b5a0ba356e78ea25a8647941"
|
63
87
|
},
|
64
88
|
{
|
65
89
|
"author": "beachball",
|
66
90
|
"package": "@fluentui/react-provider",
|
67
|
-
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-
|
68
|
-
"commit": "
|
91
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlyf6116328d620220124.1",
|
92
|
+
"commit": "7e40e770b133f0e9b5a0ba356e78ea25a8647941"
|
69
93
|
},
|
70
94
|
{
|
71
95
|
"author": "beachball",
|
72
96
|
"package": "@fluentui/react-provider",
|
73
|
-
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-
|
74
|
-
"commit": "
|
97
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlyf6116328d620220124.1",
|
98
|
+
"commit": "7e40e770b133f0e9b5a0ba356e78ea25a8647941"
|
75
99
|
}
|
76
100
|
],
|
77
101
|
"none": [
|
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
|
+
},
|
78
108
|
{
|
79
109
|
"author": "olfedias@microsoft.com",
|
80
110
|
"package": "@fluentui/react-provider",
|
@@ -86,6 +116,12 @@
|
|
86
116
|
"package": "@fluentui/react-provider",
|
87
117
|
"commit": "28ceaaa83cd92a0389c466f0b15b283e3d9b08e4",
|
88
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"
|
89
125
|
}
|
90
126
|
]
|
91
127
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,27 +1,31 @@
|
|
1
1
|
# Change Log - @fluentui/react-provider
|
2
2
|
|
3
|
-
This log was last generated on Mon,
|
3
|
+
This log was last generated on Mon, 24 Jan 2022 04:14:09 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-
|
7
|
+
## [0.0.0-nightlyf6116328d620220124.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v0.0.0-nightlyf6116328d620220124.1)
|
8
8
|
|
9
|
-
Mon,
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.0.0-beta.5..@fluentui/react-provider_v0.0.0-
|
9
|
+
Mon, 24 Jan 2022 04:14:09 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.0.0-beta.5..@fluentui/react-provider_v0.0.0-nightlyf6116328d620220124.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/7e40e770b133f0e9b5a0ba356e78ea25a8647941) by email not defined)
|
15
|
+
- 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)
|
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)
|
15
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)
|
16
19
|
- Remove `themeToCSSVariables` function ([PR #20828](https://github.com/microsoft/fluentui/pull/20828) by bsunderhus@microsoft.com)
|
17
|
-
-
|
18
|
-
- Bump @fluentui/react-
|
19
|
-
- Bump @fluentui/react-
|
20
|
-
- Bump @fluentui/react-
|
21
|
-
- Bump @fluentui/react-
|
22
|
-
- Bump @fluentui/
|
23
|
-
- Bump @fluentui/
|
24
|
-
- Bump @fluentui/
|
20
|
+
- Remove component's shorthandProps array ([PR #21134](https://github.com/microsoft/fluentui/pull/21134) by behowell@microsoft.com)
|
21
|
+
- Bump @fluentui/react-make-styles to v0.0.0-nightlyf6116328d620220124.1 ([commit](https://github.com/microsoft/fluentui/commit/7e40e770b133f0e9b5a0ba356e78ea25a8647941) by beachball)
|
22
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightlyf6116328d620220124.1 ([commit](https://github.com/microsoft/fluentui/commit/7e40e770b133f0e9b5a0ba356e78ea25a8647941) by beachball)
|
23
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightlyf6116328d620220124.1 ([commit](https://github.com/microsoft/fluentui/commit/7e40e770b133f0e9b5a0ba356e78ea25a8647941) by beachball)
|
24
|
+
- Bump @fluentui/react-theme to v0.0.0-nightlyf6116328d620220124.1 ([commit](https://github.com/microsoft/fluentui/commit/7e40e770b133f0e9b5a0ba356e78ea25a8647941) by beachball)
|
25
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightlyf6116328d620220124.1 ([commit](https://github.com/microsoft/fluentui/commit/7e40e770b133f0e9b5a0ba356e78ea25a8647941) by beachball)
|
26
|
+
- Bump @fluentui/babel-make-styles to v0.0.0-nightlyf6116328d620220124.1 ([commit](https://github.com/microsoft/fluentui/commit/7e40e770b133f0e9b5a0ba356e78ea25a8647941) by beachball)
|
27
|
+
- Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlyf6116328d620220124.1 ([commit](https://github.com/microsoft/fluentui/commit/7e40e770b133f0e9b5a0ba356e78ea25a8647941) by beachball)
|
28
|
+
- Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlyf6116328d620220124.1 ([commit](https://github.com/microsoft/fluentui/commit/7e40e770b133f0e9b5a0ba356e78ea25a8647941) by beachball)
|
25
29
|
|
26
30
|
## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.0.0-beta.5)
|
27
31
|
|
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,9 +21,8 @@ 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;
|
29
27
|
tooltip: TooltipContextType;
|
30
28
|
}
|
@@ -33,14 +31,12 @@ export declare interface FluentProviderProps extends Omit<ComponentProps<FluentP
|
|
33
31
|
theme?: PartialTheme;
|
34
32
|
}
|
35
33
|
|
36
|
-
export declare const fluentProviderShorthandProps: (keyof FluentProviderSlots)[];
|
37
|
-
|
38
34
|
export declare type FluentProviderSlots = {
|
39
35
|
root: IntrinsicShorthandProps<'div'>;
|
40
36
|
};
|
41
37
|
|
42
38
|
export declare interface FluentProviderState extends ComponentState<FluentProviderSlots>, FluentProviderCommons {
|
43
|
-
theme: Theme;
|
39
|
+
theme: Theme | Partial<Theme> | undefined;
|
44
40
|
themeClassName: string;
|
45
41
|
}
|
46
42
|
|
@@ -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,11 @@ 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;
|
24
23
|
tooltip: TooltipContextType;
|
25
24
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { ProviderContext, TooltipContext, ThemeContext, ThemeClassNameContext } from '@fluentui/react-shared-contexts';
|
3
3
|
import { getSlots } from '@fluentui/react-utilities';
|
4
|
-
import { fluentProviderShorthandProps } from './useFluentProvider';
|
5
4
|
/**
|
6
5
|
* Render the final JSX of FluentProvider
|
7
6
|
*/
|
@@ -10,7 +9,7 @@ export const renderFluentProvider = (state, contextValues) => {
|
|
10
9
|
const {
|
11
10
|
slots,
|
12
11
|
slotProps
|
13
|
-
} = getSlots(state
|
12
|
+
} = getSlots(state);
|
14
13
|
return /*#__PURE__*/React.createElement(ProviderContext.Provider, {
|
15
14
|
value: contextValues.provider
|
16
15
|
}, /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
@@ -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,eAAT,EAA0B,cAA1B,EAA0C,YAA1C,EAAwD,qBAAxD,QAAqF,iCAArF;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAAG,CAAC,KAAD,EAA6B,aAA7B,KAA2E;AAC7G,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,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EAAiC,KAAK,CAAC,IAAN,CAAW,QAA5C,CADF,CADF,CADF,CADF,CADF;AAWD,CAdM","sourceRoot":""}
|
@@ -1,6 +1,5 @@
|
|
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
|
*
|
@@ -1,9 +1,8 @@
|
|
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
|
*
|
@@ -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,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;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,CAxCM;;AA0CP,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 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;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,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":""}
|
@@ -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"],"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ceRoot":""}
|
@@ -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,11 @@ 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;
|
24
23
|
tooltip: TooltipContextType;
|
25
24
|
}
|
@@ -10,8 +10,6 @@ const React = /*#__PURE__*/require("react");
|
|
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
|
-
|
14
|
-
const useFluentProvider_1 = /*#__PURE__*/require("./useFluentProvider");
|
15
13
|
/**
|
16
14
|
* Render the final JSX of FluentProvider
|
17
15
|
*/
|
@@ -21,7 +19,7 @@ const renderFluentProvider = (state, contextValues) => {
|
|
21
19
|
const {
|
22
20
|
slots,
|
23
21
|
slotProps
|
24
|
-
} = react_utilities_1.getSlots(state
|
22
|
+
} = react_utilities_1.getSlots(state);
|
25
23
|
return React.createElement(react_shared_contexts_1.ProviderContext.Provider, {
|
26
24
|
value: contextValues.provider
|
27
25
|
}, React.createElement(react_shared_contexts_1.ThemeContext.Provider, {
|
@@ -1 +1 @@
|
|
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
|
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;AAGA;;AAEG;;;AACI,MAAM,oBAAoB,GAAG,CAAC,KAAD,EAA6B,aAA7B,KAA2E;AAC7G,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,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EAAiC,KAAK,CAAC,IAAN,CAAW,QAA5C,CADF,CADF,CADF,CADF,CADF;AAWD,CAdM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
|
@@ -1,6 +1,5 @@
|
|
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
|
*
|
@@ -3,19 +3,17 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useFluentProvider =
|
6
|
+
exports.useFluentProvider = 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
|
*
|
@@ -26,6 +24,7 @@ exports.fluentProviderShorthandProps = ['root'];
|
|
26
24
|
* @param ref - reference to root HTMLElement of FluentProvider
|
27
25
|
*/
|
28
26
|
|
27
|
+
|
29
28
|
const useFluentProvider = (props, ref) => {
|
30
29
|
const parentContext = react_shared_contexts_1.useFluent();
|
31
30
|
const parentTheme = react_shared_contexts_1.useTheme();
|
@@ -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,
|
@@ -60,4 +70,19 @@ const useFluentProvider = (props, ref) => {
|
|
60
70
|
};
|
61
71
|
|
62
72
|
exports.useFluentProvider = useFluentProvider;
|
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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,uBAAA,EAAnB;AAH4B,KAA7B;AAVD,GAAP;AAgBD,CAxCM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB;;AA0Cb,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 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":";;;;;;;
|
1
|
+
{"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,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":""}
|
@@ -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,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A8C,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-nightlyf6116328d620220124.1",
|
4
4
|
"description": "Fluent UI React provider component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -14,23 +14,23 @@
|
|
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-
|
29
|
+
"@fluentui/babel-make-styles": "0.0.0-nightlyf6116328d620220124.1",
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
31
|
-
"@fluentui/jest-serializer-make-styles": "0.0.0-
|
31
|
+
"@fluentui/jest-serializer-make-styles": "0.0.0-nightlyf6116328d620220124.1",
|
32
32
|
"@fluentui/react-conformance": "*",
|
33
|
-
"@fluentui/react-conformance-make-styles": "0.0.0-
|
33
|
+
"@fluentui/react-conformance-make-styles": "0.0.0-nightlyf6116328d620220124.1",
|
34
34
|
"@fluentui/scripts": "^1.0.0",
|
35
35
|
"@types/enzyme": "3.10.3",
|
36
36
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
@@ -43,11 +43,11 @@
|
|
43
43
|
"react-test-renderer": "^16.3.0"
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
|
-
"@fluentui/react-make-styles": "0.0.0-
|
47
|
-
"@fluentui/react-shared-contexts": "0.0.0-
|
48
|
-
"@fluentui/react-tabster": "0.0.0-
|
49
|
-
"@fluentui/react-theme": "0.0.0-
|
50
|
-
"@fluentui/react-utilities": "0.0.0-
|
46
|
+
"@fluentui/react-make-styles": "0.0.0-nightlyf6116328d620220124.1",
|
47
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightlyf6116328d620220124.1",
|
48
|
+
"@fluentui/react-tabster": "0.0.0-nightlyf6116328d620220124.1",
|
49
|
+
"@fluentui/react-theme": "0.0.0-nightlyf6116328d620220124.1",
|
50
|
+
"@fluentui/react-utilities": "0.0.0-nightlyf6116328d620220124.1",
|
51
51
|
"tslib": "^2.1.0"
|
52
52
|
},
|
53
53
|
"peerDependencies": {
|