@fluentui/react-provider 9.0.0-rc.7 → 9.0.0-rc.8
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 +54 -1
- package/CHANGELOG.md +124 -110
- package/dist/{react-provider.d.ts → index.d.ts} +0 -0
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/FluentProvider/useFluentProviderThemeStyleTag.js +9 -4
- package/lib/components/FluentProvider/useFluentProviderThemeStyleTag.js.map +1 -1
- package/lib-commonjs/components/FluentProvider/useFluentProviderThemeStyleTag.js +9 -4
- package/lib-commonjs/components/FluentProvider/useFluentProviderThemeStyleTag.js.map +1 -1
- package/package.json +8 -8
- package/lib/FluentProvider.d.ts +0 -1
- package/lib/components/FluentProvider/FluentProvider.d.ts +0 -3
- package/lib/components/FluentProvider/FluentProvider.types.d.ts +0 -26
- package/lib/components/FluentProvider/index.d.ts +0 -7
- package/lib/components/FluentProvider/renderFluentProvider.d.ts +0 -5
- package/lib/components/FluentProvider/useFluentProvider.d.ts +0 -12
- package/lib/components/FluentProvider/useFluentProviderContextValues.d.ts +0 -2
- package/lib/components/FluentProvider/useFluentProviderStyles.d.ts +0 -9
- package/lib/components/FluentProvider/useFluentProviderThemeStyleTag.d.ts +0 -7
- package/lib/index.d.ts +0 -3
- package/lib-commonjs/FluentProvider.d.ts +0 -1
- package/lib-commonjs/components/FluentProvider/FluentProvider.d.ts +0 -3
- package/lib-commonjs/components/FluentProvider/FluentProvider.types.d.ts +0 -26
- package/lib-commonjs/components/FluentProvider/index.d.ts +0 -7
- package/lib-commonjs/components/FluentProvider/renderFluentProvider.d.ts +0 -5
- package/lib-commonjs/components/FluentProvider/useFluentProvider.d.ts +0 -12
- package/lib-commonjs/components/FluentProvider/useFluentProviderContextValues.d.ts +0 -2
- package/lib-commonjs/components/FluentProvider/useFluentProviderStyles.d.ts +0 -9
- package/lib-commonjs/components/FluentProvider/useFluentProviderThemeStyleTag.d.ts +0 -7
- package/lib-commonjs/index.d.ts +0 -3
File without changes
|
File without changes
|
@@ -36,11 +36,16 @@ export const useFluentProviderThemeStyleTag = options => {
|
|
36
36
|
if (styleTag && previousCssRule !== cssRule) {
|
37
37
|
const sheet = styleTag.sheet;
|
38
38
|
|
39
|
-
if (sheet
|
40
|
-
sheet.
|
41
|
-
|
39
|
+
if (sheet) {
|
40
|
+
if (sheet.cssRules.length > 0) {
|
41
|
+
sheet.deleteRule(0);
|
42
|
+
}
|
42
43
|
|
43
|
-
|
44
|
+
sheet.insertRule(cssRule, 0);
|
45
|
+
} else if (process.env.NODE_ENV !== 'production') {
|
46
|
+
// eslint-disable-next-line no-console
|
47
|
+
console.error('FluentProvider: No sheet available on styleTag, styles will not be inserted into DOM.');
|
48
|
+
}
|
44
49
|
} // Removes the style tag from the targetDocument on unmount or change
|
45
50
|
|
46
51
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/FluentProvider/useFluentProviderThemeStyleTag.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,EAAgB,WAAhB,QAAmC,2BAAnC;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,wBAAT,QAAyC,2BAAzC;AAEA;;;;AAIG;;AACH,OAAO,MAAM,8BAA8B,GAAI,OAAD,IAAmE;AAC/G,QAAM;AAAE,IAAA,cAAF;AAAkB,IAAA;AAAlB,MAA4B,OAAlC;AAEA,QAAM,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,IAA1B,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,GA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QAAA,QAAQ,CAAC,MAAT;AACD;AACF,KAJD;AAKD,GAND,EAMG,CAAC,QAAD,CANH;AAQA,SAAO,UAAP;AACD,CApDM","sourcesContent":["import { useId, usePrevious } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type { FluentProviderState } from './FluentProvider.types';\nimport { fluentProviderClassNames } from './useFluentProviderStyles';\n\n/**\n * Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class\n *\n * @returns CSS class to apply the rule\n */\nexport const useFluentProviderThemeStyleTag = (options: Pick<FluentProviderState, 'theme' | 'targetDocument'>) => {\n const { targetDocument, theme } = options;\n\n const styleTagId = useId(fluentProviderClassNames.root);\n const styleTag = React.useMemo(() => {\n if (!targetDocument) {\n return null;\n }\n\n const tag = targetDocument.createElement('style');\n tag.setAttribute('id', styleTagId);\n targetDocument.head.appendChild(tag);\n return tag;\n }, [styleTagId, targetDocument]);\n\n const cssRule = React.useMemo(() => {\n const cssVarsAsString = theme\n ? (Object.keys(theme) as (keyof typeof theme)[]).reduce((cssVarRule, cssVar) => {\n cssVarRule += `--${cssVar}: ${theme[cssVar]}; `;\n return cssVarRule;\n }, '')\n : '';\n\n // result: .fluent-provider1 { --css-var: '#fff' }\n return `.${styleTagId} { ${cssVarsAsString} }`;\n }, [theme, styleTagId]);\n const previousCssRule = usePrevious(cssRule);\n\n if (styleTag && previousCssRule !== cssRule) {\n const sheet = styleTag.sheet;\n\n if (sheet) {\n if (sheet.cssRules.length > 0) {\n sheet.deleteRule(0);\n }\n sheet.insertRule(cssRule, 0);\n } else if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('FluentProvider: No sheet available on styleTag, styles will not be inserted into DOM.');\n }\n }\n\n // Removes the style tag from the targetDocument on unmount or change\n React.useEffect(() => {\n return () => {\n if (styleTag) {\n styleTag.remove();\n }\n };\n }, [styleTag]);\n\n return styleTagId;\n};\n"],"sourceRoot":"../src/"}
|
@@ -46,11 +46,16 @@ const useFluentProviderThemeStyleTag = options => {
|
|
46
46
|
if (styleTag && previousCssRule !== cssRule) {
|
47
47
|
const sheet = styleTag.sheet;
|
48
48
|
|
49
|
-
if (sheet
|
50
|
-
sheet.
|
51
|
-
|
49
|
+
if (sheet) {
|
50
|
+
if (sheet.cssRules.length > 0) {
|
51
|
+
sheet.deleteRule(0);
|
52
|
+
}
|
52
53
|
|
53
|
-
|
54
|
+
sheet.insertRule(cssRule, 0);
|
55
|
+
} else if (process.env.NODE_ENV !== 'production') {
|
56
|
+
// eslint-disable-next-line no-console
|
57
|
+
console.error('FluentProvider: No sheet available on styleTag, styles will not be inserted into DOM.');
|
58
|
+
}
|
54
59
|
} // Removes the style tag from the targetDocument on unmount or change
|
55
60
|
|
56
61
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/FluentProvider/useFluentProviderThemeStyleTag.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,8BAA8B,GAAI,OAAD,IAAmE;AAC/G,QAAM;AAAE,IAAA,cAAF;AAAkB,IAAA;AAAlB,MAA4B,OAAlC;AAEA,QAAM,UAAU,GAAG,iBAAA,CAAA,KAAA,CAAM,yBAAA,CAAA,wBAAA,CAAyB,IAA/B,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,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N,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,CApDM;;AAAM,OAAA,CAAA,8BAAA,GAA8B,8BAA9B","sourcesContent":["import { useId, usePrevious } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type { FluentProviderState } from './FluentProvider.types';\nimport { fluentProviderClassNames } from './useFluentProviderStyles';\n\n/**\n * Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class\n *\n * @returns CSS class to apply the rule\n */\nexport const useFluentProviderThemeStyleTag = (options: Pick<FluentProviderState, 'theme' | 'targetDocument'>) => {\n const { targetDocument, theme } = options;\n\n const styleTagId = useId(fluentProviderClassNames.root);\n const styleTag = React.useMemo(() => {\n if (!targetDocument) {\n return null;\n }\n\n const tag = targetDocument.createElement('style');\n tag.setAttribute('id', styleTagId);\n targetDocument.head.appendChild(tag);\n return tag;\n }, [styleTagId, targetDocument]);\n\n const cssRule = React.useMemo(() => {\n const cssVarsAsString = theme\n ? (Object.keys(theme) as (keyof typeof theme)[]).reduce((cssVarRule, cssVar) => {\n cssVarRule += `--${cssVar}: ${theme[cssVar]}; `;\n return cssVarRule;\n }, '')\n : '';\n\n // result: .fluent-provider1 { --css-var: '#fff' }\n return `.${styleTagId} { ${cssVarsAsString} }`;\n }, [theme, styleTagId]);\n const previousCssRule = usePrevious(cssRule);\n\n if (styleTag && previousCssRule !== cssRule) {\n const sheet = styleTag.sheet;\n\n if (sheet) {\n if (sheet.cssRules.length > 0) {\n sheet.deleteRule(0);\n }\n sheet.insertRule(cssRule, 0);\n } else if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('FluentProvider: No sheet available on styleTag, styles will not be inserted into DOM.');\n }\n }\n\n // Removes the style tag from the targetDocument on unmount or change\n React.useEffect(() => {\n return () => {\n if (styleTag) {\n styleTag.remove();\n }\n };\n }, [styleTag]);\n\n return styleTagId;\n};\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-provider",
|
3
|
-
"version": "9.0.0-rc.
|
3
|
+
"version": "9.0.0-rc.8",
|
4
4
|
"description": "Fluent UI React provider component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
7
|
-
"typings": "
|
7
|
+
"typings": "dist/index.d.ts",
|
8
8
|
"sideEffects": false,
|
9
9
|
"repository": {
|
10
10
|
"type": "git",
|
@@ -20,8 +20,8 @@
|
|
20
20
|
"just": "just-scripts",
|
21
21
|
"lint": "just-scripts lint",
|
22
22
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
23
|
-
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node
|
24
|
-
"storybook": "node
|
23
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-provider/src && yarn docs",
|
24
|
+
"storybook": "node ../../../scripts/storybook/runner",
|
25
25
|
"start": "yarn storybook",
|
26
26
|
"type-check": "tsc -b tsconfig.json"
|
27
27
|
},
|
@@ -33,10 +33,10 @@
|
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
35
|
"@griffel/react": "1.0.3",
|
36
|
-
"@fluentui/react-shared-contexts": "9.0.0-rc.
|
37
|
-
"@fluentui/react-tabster": "9.0.0-rc.
|
38
|
-
"@fluentui/react-theme": "9.0.0-rc.
|
39
|
-
"@fluentui/react-utilities": "9.0.0-rc.
|
36
|
+
"@fluentui/react-shared-contexts": "9.0.0-rc.6",
|
37
|
+
"@fluentui/react-tabster": "9.0.0-rc.8",
|
38
|
+
"@fluentui/react-theme": "9.0.0-rc.6",
|
39
|
+
"@fluentui/react-utilities": "9.0.0-rc.7",
|
40
40
|
"tslib": "^2.1.0"
|
41
41
|
},
|
42
42
|
"peerDependencies": {
|
package/lib/FluentProvider.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/FluentProvider/index';
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import type { ProviderContextValue, TooltipContextType, ThemeClassNameContextValue } from '@fluentui/react-shared-contexts';
|
2
|
-
import type { PartialTheme, Theme } from '@fluentui/react-theme';
|
3
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
4
|
-
export declare type FluentProviderSlots = {
|
5
|
-
root: Slot<'div'>;
|
6
|
-
};
|
7
|
-
interface FluentProviderCommons {
|
8
|
-
/** Sets the direction of text & generated styles. */
|
9
|
-
dir: 'ltr' | 'rtl';
|
10
|
-
/** Provides the document, can be undefined during SSR render. */
|
11
|
-
targetDocument: Document | undefined;
|
12
|
-
}
|
13
|
-
export interface FluentProviderProps extends Omit<ComponentProps<FluentProviderSlots>, 'dir'>, Partial<FluentProviderCommons> {
|
14
|
-
theme?: PartialTheme;
|
15
|
-
}
|
16
|
-
export interface FluentProviderState extends ComponentState<FluentProviderSlots>, FluentProviderCommons {
|
17
|
-
theme: Theme | Partial<Theme> | undefined;
|
18
|
-
themeClassName: string;
|
19
|
-
}
|
20
|
-
export interface FluentProviderContextValues extends Pick<FluentProviderState, 'theme'> {
|
21
|
-
provider: ProviderContextValue;
|
22
|
-
themeClassName: ThemeClassNameContextValue;
|
23
|
-
textDirection: 'ltr' | 'rtl';
|
24
|
-
tooltip: TooltipContextType;
|
25
|
-
}
|
26
|
-
export {};
|
@@ -1,7 +0,0 @@
|
|
1
|
-
export * from './FluentProvider';
|
2
|
-
export * from './FluentProvider.types';
|
3
|
-
export * from './renderFluentProvider';
|
4
|
-
export * from './useFluentProvider';
|
5
|
-
export * from './useFluentProviderStyles';
|
6
|
-
export * from './useFluentProviderContextValues';
|
7
|
-
export * from './useFluentProviderThemeStyleTag';
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import type { FluentProviderContextValues, FluentProviderState } from './FluentProvider.types';
|
2
|
-
/**
|
3
|
-
* Render the final JSX of FluentProvider
|
4
|
-
*/
|
5
|
-
export declare const renderFluentProvider_unstable: (state: FluentProviderState, contextValues: FluentProviderContextValues) => JSX.Element;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { FluentProviderProps, FluentProviderState } from './FluentProvider.types';
|
3
|
-
/**
|
4
|
-
* Create the state required to render FluentProvider.
|
5
|
-
*
|
6
|
-
* The returned state can be modified with hooks such as useFluentProviderStyles_unstable,
|
7
|
-
* before being passed to renderFluentProvider_unstable.
|
8
|
-
*
|
9
|
-
* @param props - props from this instance of FluentProvider
|
10
|
-
* @param ref - reference to root HTMLElement of FluentProvider
|
11
|
-
*/
|
12
|
-
export declare const useFluentProvider_unstable: (props: FluentProviderProps, ref: React.Ref<HTMLElement>) => FluentProviderState;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import type { FluentProviderSlots, FluentProviderState } from './FluentProvider.types';
|
2
|
-
import { SlotClassNames } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* @deprecated Use `fluentProviderClassNames.root` instead.
|
5
|
-
*/
|
6
|
-
export declare const fluentProviderClassName = "fui-FluentProvider";
|
7
|
-
export declare const fluentProviderClassNames: SlotClassNames<FluentProviderSlots>;
|
8
|
-
/** Applies style classnames to slots */
|
9
|
-
export declare const useFluentProviderStyles_unstable: (state: FluentProviderState) => FluentProviderState;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { FluentProviderState } from './FluentProvider.types';
|
2
|
-
/**
|
3
|
-
* Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class
|
4
|
-
*
|
5
|
-
* @returns CSS class to apply the rule
|
6
|
-
*/
|
7
|
-
export declare const useFluentProviderThemeStyleTag: (options: Pick<FluentProviderState, 'theme' | 'targetDocument'>) => string;
|
package/lib/index.d.ts
DELETED
@@ -1,3 +0,0 @@
|
|
1
|
-
export { fluentProviderClassName, fluentProviderClassNames, FluentProvider, renderFluentProvider_unstable, useFluentProviderContextValues_unstable, useFluentProvider_unstable, useFluentProviderStyles_unstable, useFluentProviderThemeStyleTag, } from './FluentProvider';
|
2
|
-
export type { FluentProviderContextValues, FluentProviderProps, FluentProviderState, FluentProviderSlots, } from './FluentProvider';
|
3
|
-
export { useFluent, useTheme } from '@fluentui/react-shared-contexts';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/FluentProvider/index';
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import type { ProviderContextValue, TooltipContextType, ThemeClassNameContextValue } from '@fluentui/react-shared-contexts';
|
2
|
-
import type { PartialTheme, Theme } from '@fluentui/react-theme';
|
3
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
4
|
-
export declare type FluentProviderSlots = {
|
5
|
-
root: Slot<'div'>;
|
6
|
-
};
|
7
|
-
interface FluentProviderCommons {
|
8
|
-
/** Sets the direction of text & generated styles. */
|
9
|
-
dir: 'ltr' | 'rtl';
|
10
|
-
/** Provides the document, can be undefined during SSR render. */
|
11
|
-
targetDocument: Document | undefined;
|
12
|
-
}
|
13
|
-
export interface FluentProviderProps extends Omit<ComponentProps<FluentProviderSlots>, 'dir'>, Partial<FluentProviderCommons> {
|
14
|
-
theme?: PartialTheme;
|
15
|
-
}
|
16
|
-
export interface FluentProviderState extends ComponentState<FluentProviderSlots>, FluentProviderCommons {
|
17
|
-
theme: Theme | Partial<Theme> | undefined;
|
18
|
-
themeClassName: string;
|
19
|
-
}
|
20
|
-
export interface FluentProviderContextValues extends Pick<FluentProviderState, 'theme'> {
|
21
|
-
provider: ProviderContextValue;
|
22
|
-
themeClassName: ThemeClassNameContextValue;
|
23
|
-
textDirection: 'ltr' | 'rtl';
|
24
|
-
tooltip: TooltipContextType;
|
25
|
-
}
|
26
|
-
export {};
|
@@ -1,7 +0,0 @@
|
|
1
|
-
export * from './FluentProvider';
|
2
|
-
export * from './FluentProvider.types';
|
3
|
-
export * from './renderFluentProvider';
|
4
|
-
export * from './useFluentProvider';
|
5
|
-
export * from './useFluentProviderStyles';
|
6
|
-
export * from './useFluentProviderContextValues';
|
7
|
-
export * from './useFluentProviderThemeStyleTag';
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import type { FluentProviderContextValues, FluentProviderState } from './FluentProvider.types';
|
2
|
-
/**
|
3
|
-
* Render the final JSX of FluentProvider
|
4
|
-
*/
|
5
|
-
export declare const renderFluentProvider_unstable: (state: FluentProviderState, contextValues: FluentProviderContextValues) => JSX.Element;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { FluentProviderProps, FluentProviderState } from './FluentProvider.types';
|
3
|
-
/**
|
4
|
-
* Create the state required to render FluentProvider.
|
5
|
-
*
|
6
|
-
* The returned state can be modified with hooks such as useFluentProviderStyles_unstable,
|
7
|
-
* before being passed to renderFluentProvider_unstable.
|
8
|
-
*
|
9
|
-
* @param props - props from this instance of FluentProvider
|
10
|
-
* @param ref - reference to root HTMLElement of FluentProvider
|
11
|
-
*/
|
12
|
-
export declare const useFluentProvider_unstable: (props: FluentProviderProps, ref: React.Ref<HTMLElement>) => FluentProviderState;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import type { FluentProviderSlots, FluentProviderState } from './FluentProvider.types';
|
2
|
-
import { SlotClassNames } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* @deprecated Use `fluentProviderClassNames.root` instead.
|
5
|
-
*/
|
6
|
-
export declare const fluentProviderClassName = "fui-FluentProvider";
|
7
|
-
export declare const fluentProviderClassNames: SlotClassNames<FluentProviderSlots>;
|
8
|
-
/** Applies style classnames to slots */
|
9
|
-
export declare const useFluentProviderStyles_unstable: (state: FluentProviderState) => FluentProviderState;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { FluentProviderState } from './FluentProvider.types';
|
2
|
-
/**
|
3
|
-
* Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class
|
4
|
-
*
|
5
|
-
* @returns CSS class to apply the rule
|
6
|
-
*/
|
7
|
-
export declare const useFluentProviderThemeStyleTag: (options: Pick<FluentProviderState, 'theme' | 'targetDocument'>) => string;
|
package/lib-commonjs/index.d.ts
DELETED
@@ -1,3 +0,0 @@
|
|
1
|
-
export { fluentProviderClassName, fluentProviderClassNames, FluentProvider, renderFluentProvider_unstable, useFluentProviderContextValues_unstable, useFluentProvider_unstable, useFluentProviderStyles_unstable, useFluentProviderThemeStyleTag, } from './FluentProvider';
|
2
|
-
export type { FluentProviderContextValues, FluentProviderProps, FluentProviderState, FluentProviderSlots, } from './FluentProvider';
|
3
|
-
export { useFluent, useTheme } from '@fluentui/react-shared-contexts';
|