@fluentui/react-provider 0.0.0-nightly-20230530-0415.1 → 0.0.0-nightly-20230601-0418.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.
Files changed (42) hide show
  1. package/CHANGELOG.json +54 -15
  2. package/CHANGELOG.md +23 -10
  3. package/lib/FluentProvider.js +0 -2
  4. package/lib/FluentProvider.js.map +1 -1
  5. package/lib/components/FluentProvider/FluentProvider.js +0 -2
  6. package/lib/components/FluentProvider/FluentProvider.js.map +1 -1
  7. package/lib/components/FluentProvider/FluentProvider.types.js +0 -2
  8. package/lib/components/FluentProvider/FluentProvider.types.js.map +1 -1
  9. package/lib/components/FluentProvider/index.js +0 -2
  10. package/lib/components/FluentProvider/index.js.map +1 -1
  11. package/lib/components/FluentProvider/renderFluentProvider.js +0 -2
  12. package/lib/components/FluentProvider/renderFluentProvider.js.map +1 -1
  13. package/lib/components/FluentProvider/useFluentProvider.js +0 -2
  14. package/lib/components/FluentProvider/useFluentProvider.js.map +1 -1
  15. package/lib/components/FluentProvider/useFluentProviderContextValues.js +0 -2
  16. package/lib/components/FluentProvider/useFluentProviderContextValues.js.map +1 -1
  17. package/lib/components/FluentProvider/useFluentProviderStyles.styles.js.map +1 -1
  18. package/lib/components/FluentProvider/useFluentProviderThemeStyleTag.js +0 -2
  19. package/lib/components/FluentProvider/useFluentProviderThemeStyleTag.js.map +1 -1
  20. package/lib/index.js +0 -2
  21. package/lib/index.js.map +1 -1
  22. package/lib-commonjs/FluentProvider.js +0 -3
  23. package/lib-commonjs/FluentProvider.js.map +1 -1
  24. package/lib-commonjs/components/FluentProvider/FluentProvider.js +1 -3
  25. package/lib-commonjs/components/FluentProvider/FluentProvider.js.map +1 -1
  26. package/lib-commonjs/components/FluentProvider/FluentProvider.types.js +0 -3
  27. package/lib-commonjs/components/FluentProvider/FluentProvider.types.js.map +1 -1
  28. package/lib-commonjs/components/FluentProvider/index.js +0 -3
  29. package/lib-commonjs/components/FluentProvider/index.js.map +1 -1
  30. package/lib-commonjs/components/FluentProvider/renderFluentProvider.js +1 -3
  31. package/lib-commonjs/components/FluentProvider/renderFluentProvider.js.map +1 -1
  32. package/lib-commonjs/components/FluentProvider/useFluentProvider.js +1 -3
  33. package/lib-commonjs/components/FluentProvider/useFluentProvider.js.map +1 -1
  34. package/lib-commonjs/components/FluentProvider/useFluentProviderContextValues.js +1 -3
  35. package/lib-commonjs/components/FluentProvider/useFluentProviderContextValues.js.map +1 -1
  36. package/lib-commonjs/components/FluentProvider/useFluentProviderStyles.styles.js +0 -2
  37. package/lib-commonjs/components/FluentProvider/useFluentProviderStyles.styles.js.map +1 -1
  38. package/lib-commonjs/components/FluentProvider/useFluentProviderThemeStyleTag.js +1 -3
  39. package/lib-commonjs/components/FluentProvider/useFluentProviderThemeStyleTag.js.map +1 -1
  40. package/lib-commonjs/index.js +0 -3
  41. package/lib-commonjs/index.js.map +1 -1
  42. package/package.json +9 -9
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-provider",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 30 May 2023 04:21:01 GMT",
6
- "tag": "@fluentui/react-provider_v0.0.0-nightly-20230530-0415.1",
7
- "version": "0.0.0-nightly-20230530-0415.1",
5
+ "date": "Thu, 01 Jun 2023 04:23:36 GMT",
6
+ "tag": "@fluentui/react-provider_v0.0.0-nightly-20230601-0418.1",
7
+ "version": "0.0.0-nightly-20230601-0418.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,38 +16,77 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-provider",
19
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230530-0415.1",
20
- "commit": "808fbe4052231d4cccf478348a770df18232f4f9"
19
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230601-0418.1",
20
+ "commit": "cff4b1279089b5951ed39ce6213d3bdd6d573d0b"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-provider",
25
- "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230530-0415.1",
26
- "commit": "808fbe4052231d4cccf478348a770df18232f4f9"
25
+ "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230601-0418.1",
26
+ "commit": "cff4b1279089b5951ed39ce6213d3bdd6d573d0b"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-provider",
31
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230530-0415.1",
32
- "commit": "808fbe4052231d4cccf478348a770df18232f4f9"
31
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230601-0418.1",
32
+ "commit": "cff4b1279089b5951ed39ce6213d3bdd6d573d0b"
33
33
  },
34
34
  {
35
35
  "author": "beachball",
36
36
  "package": "@fluentui/react-provider",
37
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230530-0415.1",
38
- "commit": "808fbe4052231d4cccf478348a770df18232f4f9"
37
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230601-0418.1",
38
+ "commit": "cff4b1279089b5951ed39ce6213d3bdd6d573d0b"
39
39
  },
40
40
  {
41
41
  "author": "beachball",
42
42
  "package": "@fluentui/react-provider",
43
- "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230530-0415.1",
44
- "commit": "808fbe4052231d4cccf478348a770df18232f4f9"
43
+ "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230601-0418.1",
44
+ "commit": "cff4b1279089b5951ed39ce6213d3bdd6d573d0b"
45
45
  },
46
46
  {
47
47
  "author": "beachball",
48
48
  "package": "@fluentui/react-provider",
49
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230530-0415.1",
50
- "commit": "808fbe4052231d4cccf478348a770df18232f4f9"
49
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230601-0418.1",
50
+ "commit": "cff4b1279089b5951ed39ce6213d3bdd6d573d0b"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "date": "Wed, 31 May 2023 06:46:17 GMT",
57
+ "tag": "@fluentui/react-provider_v9.7.2",
58
+ "version": "9.7.2",
59
+ "comments": {
60
+ "patch": [
61
+ {
62
+ "author": "seanmonahan@microsoft.com",
63
+ "package": "@fluentui/react-provider",
64
+ "commit": "d640b972d7ac86bfb76ae6c6329f12cdd33b3b7c",
65
+ "comment": "chore: Update Griffel to v1.5.7."
66
+ },
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui/react-provider",
70
+ "comment": "Bump @fluentui/react-tabster to v9.7.5",
71
+ "commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-provider",
76
+ "comment": "Bump @fluentui/react-utilities to v9.9.2",
77
+ "commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui/react-provider",
82
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.6",
83
+ "commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
84
+ },
85
+ {
86
+ "author": "beachball",
87
+ "package": "@fluentui/react-provider",
88
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22",
89
+ "commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
51
90
  }
52
91
  ]
53
92
  }
package/CHANGELOG.md CHANGED
@@ -1,23 +1,36 @@
1
1
  # Change Log - @fluentui/react-provider
2
2
 
3
- This log was last generated on Tue, 30 May 2023 04:21:01 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 01 Jun 2023 04:23:36 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230530-0415.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v0.0.0-nightly-20230530-0415.1)
7
+ ## [0.0.0-nightly-20230601-0418.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v0.0.0-nightly-20230601-0418.1)
8
8
 
9
- Tue, 30 May 2023 04:21:01 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.7.1..@fluentui/react-provider_v0.0.0-nightly-20230530-0415.1)
9
+ Thu, 01 Jun 2023 04:23:36 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.7.2..@fluentui/react-provider_v0.0.0-nightly-20230601-0418.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230530-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/808fbe4052231d4cccf478348a770df18232f4f9) by beachball)
16
- - Bump @fluentui/react-tabster to v0.0.0-nightly-20230530-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/808fbe4052231d4cccf478348a770df18232f4f9) by beachball)
17
- - Bump @fluentui/react-theme to v0.0.0-nightly-20230530-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/808fbe4052231d4cccf478348a770df18232f4f9) by beachball)
18
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20230530-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/808fbe4052231d4cccf478348a770df18232f4f9) by beachball)
19
- - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230530-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/808fbe4052231d4cccf478348a770df18232f4f9) by beachball)
20
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230530-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/808fbe4052231d4cccf478348a770df18232f4f9) by beachball)
15
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230601-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/cff4b1279089b5951ed39ce6213d3bdd6d573d0b) by beachball)
16
+ - Bump @fluentui/react-tabster to v0.0.0-nightly-20230601-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/cff4b1279089b5951ed39ce6213d3bdd6d573d0b) by beachball)
17
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20230601-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/cff4b1279089b5951ed39ce6213d3bdd6d573d0b) by beachball)
18
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20230601-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/cff4b1279089b5951ed39ce6213d3bdd6d573d0b) by beachball)
19
+ - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230601-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/cff4b1279089b5951ed39ce6213d3bdd6d573d0b) by beachball)
20
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230601-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/cff4b1279089b5951ed39ce6213d3bdd6d573d0b) by beachball)
21
+
22
+ ## [9.7.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.7.2)
23
+
24
+ Wed, 31 May 2023 06:46:17 GMT
25
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-provider_v9.7.1..@fluentui/react-provider_v9.7.2)
26
+
27
+ ### Patches
28
+
29
+ - chore: Update Griffel to v1.5.7. ([PR #27925](https://github.com/microsoft/fluentui/pull/27925) by seanmonahan@microsoft.com)
30
+ - Bump @fluentui/react-tabster to v9.7.5 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
31
+ - Bump @fluentui/react-utilities to v9.9.2 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
32
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.6 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
33
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
21
34
 
22
35
  ## [9.7.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-provider_v9.7.1)
23
36
 
@@ -1,3 +1 @@
1
1
  export * from './components/FluentProvider/index';
2
-
3
- //# sourceMappingURL=FluentProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/FluentProvider.ts"],"sourcesContent":["export * from './components/FluentProvider/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
1
+ {"version":3,"sources":["FluentProvider.ts"],"sourcesContent":["export * from './components/FluentProvider/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
@@ -10,5 +10,3 @@ export const FluentProvider = /*#__PURE__*/ React.forwardRef((props, ref)=>{
10
10
  return renderFluentProvider_unstable(state, contextValues);
11
11
  });
12
12
  FluentProvider.displayName = 'FluentProvider';
13
-
14
- //# sourceMappingURL=FluentProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/FluentProvider/FluentProvider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderFluentProvider_unstable } from './renderFluentProvider';\nimport { useFluentProvider_unstable } from './useFluentProvider';\nimport { useFluentProviderStyles_unstable } from './useFluentProviderStyles.styles';\nimport { useFluentProviderContextValues_unstable } from './useFluentProviderContextValues';\nimport type { FluentProviderProps } from './FluentProvider.types';\n\nexport const FluentProvider = React.forwardRef<HTMLElement, FluentProviderProps>((props, ref) => {\n const state = useFluentProvider_unstable(props, ref);\n useFluentProviderStyles_unstable(state);\n\n const contextValues = useFluentProviderContextValues_unstable(state);\n\n return renderFluentProvider_unstable(state, contextValues);\n});\n\nFluentProvider.displayName = 'FluentProvider';\n"],"names":["React","renderFluentProvider_unstable","useFluentProvider_unstable","useFluentProviderStyles_unstable","useFluentProviderContextValues_unstable","FluentProvider","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,gCAAgC,QAAQ,mCAAmC;AACpF,SAASC,uCAAuC,QAAQ,mCAAmC;AAG3F,OAAO,MAAMC,+BAAiBL,MAAMM,UAAU,CAAmC,CAACC,OAAOC,MAAQ;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAChDL,iCAAiCM;IAEjC,MAAMC,gBAAgBN,wCAAwCK;IAE9D,OAAOR,8BAA8BQ,OAAOC;AAC9C,GAAG;AAEHL,eAAeM,WAAW,GAAG"}
1
+ {"version":3,"sources":["FluentProvider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderFluentProvider_unstable } from './renderFluentProvider';\nimport { useFluentProvider_unstable } from './useFluentProvider';\nimport { useFluentProviderStyles_unstable } from './useFluentProviderStyles.styles';\nimport { useFluentProviderContextValues_unstable } from './useFluentProviderContextValues';\nimport type { FluentProviderProps } from './FluentProvider.types';\n\nexport const FluentProvider = React.forwardRef<HTMLElement, FluentProviderProps>((props, ref) => {\n const state = useFluentProvider_unstable(props, ref);\n useFluentProviderStyles_unstable(state);\n\n const contextValues = useFluentProviderContextValues_unstable(state);\n\n return renderFluentProvider_unstable(state, contextValues);\n});\n\nFluentProvider.displayName = 'FluentProvider';\n"],"names":["React","renderFluentProvider_unstable","useFluentProvider_unstable","useFluentProviderStyles_unstable","useFluentProviderContextValues_unstable","FluentProvider","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,gCAAgC,QAAQ,mCAAmC;AACpF,SAASC,uCAAuC,QAAQ,mCAAmC;AAG3F,OAAO,MAAMC,+BAAiBL,MAAMM,UAAU,CAAmC,CAACC,OAAOC,MAAQ;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAChDL,iCAAiCM;IAEjC,MAAMC,gBAAgBN,wCAAwCK;IAE9D,OAAOR,8BAA8BQ,OAAOC;AAC9C,GAAG;AAEHL,eAAeM,WAAW,GAAG"}
@@ -1,3 +1 @@
1
1
  export { };
2
-
3
- //# sourceMappingURL=FluentProvider.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/FluentProvider/FluentProvider.types.ts"],"sourcesContent":["import type {\n OverridesContextValue_unstable as OverridesContextValue,\n ProviderContextValue_unstable as ProviderContextValue,\n TooltipVisibilityContextValue_unstable as TooltipVisibilityContextValue,\n ThemeClassNameContextValue_unstable as ThemeClassNameContextValue,\n ThemeContextValue_unstable as ThemeContextValue,\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n} from '@fluentui/react-shared-contexts';\nimport type { PartialTheme } from '@fluentui/react-theme';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type FluentProviderSlots = {\n root: Slot<'div'>;\n};\n\n// exported for callers to avoid referencing react-shared-context\n// and applying Partial<> when passing custom style hooks.\nexport type FluentProviderCustomStyleHooks = CustomStyleHooksContextValue;\n\nexport type FluentProviderProps = Omit<ComponentProps<FluentProviderSlots>, 'dir'> & {\n /**\n * Passes styles applied to a component down to portals if enabled.\n * @default true\n */\n applyStylesToPortals?: boolean;\n\n /** Sets the hooks for custom styling components. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable?: FluentProviderCustomStyleHooks;\n\n /** Sets the direction of text & generated styles. */\n dir?: 'ltr' | 'rtl';\n\n /** Provides the document, can be undefined during SSR render. */\n targetDocument?: Document;\n\n /** Sets the theme used in a scope. */\n theme?: PartialTheme;\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable?: OverridesContextValue;\n};\n\nexport type FluentProviderState = ComponentState<FluentProviderSlots> &\n Pick<FluentProviderProps, 'targetDocument'> &\n Required<\n Pick<FluentProviderProps, 'applyStylesToPortals' | 'customStyleHooks_unstable' | 'dir' | 'overrides_unstable'>\n > & {\n theme: ThemeContextValue;\n themeClassName: string;\n /**\n * Props used to render SSR theme variables style element\n */\n serverStyleProps: {\n /**\n * CSS rule containing CSS variables\n */\n cssRule: string;\n /**\n * Additional attributes applied to the style element\n */\n attributes: Record<string, string>;\n };\n };\n\nexport type FluentProviderContextValues = Pick<\n FluentProviderState,\n 'customStyleHooks_unstable' | 'theme' | 'overrides_unstable'\n> & {\n provider: ProviderContextValue;\n themeClassName: ThemeClassNameContextValue;\n textDirection: 'ltr' | 'rtl';\n tooltip: TooltipVisibilityContextValue;\n};\n"],"names":[],"mappings":"AAAA,WAyEE"}
1
+ {"version":3,"sources":["FluentProvider.types.ts"],"sourcesContent":["import type {\n OverridesContextValue_unstable as OverridesContextValue,\n ProviderContextValue_unstable as ProviderContextValue,\n TooltipVisibilityContextValue_unstable as TooltipVisibilityContextValue,\n ThemeClassNameContextValue_unstable as ThemeClassNameContextValue,\n ThemeContextValue_unstable as ThemeContextValue,\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n} from '@fluentui/react-shared-contexts';\nimport type { PartialTheme } from '@fluentui/react-theme';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type FluentProviderSlots = {\n root: Slot<'div'>;\n};\n\n// exported for callers to avoid referencing react-shared-context\n// and applying Partial<> when passing custom style hooks.\nexport type FluentProviderCustomStyleHooks = CustomStyleHooksContextValue;\n\nexport type FluentProviderProps = Omit<ComponentProps<FluentProviderSlots>, 'dir'> & {\n /**\n * Passes styles applied to a component down to portals if enabled.\n * @default true\n */\n applyStylesToPortals?: boolean;\n\n /** Sets the hooks for custom styling components. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable?: FluentProviderCustomStyleHooks;\n\n /** Sets the direction of text & generated styles. */\n dir?: 'ltr' | 'rtl';\n\n /** Provides the document, can be undefined during SSR render. */\n targetDocument?: Document;\n\n /** Sets the theme used in a scope. */\n theme?: PartialTheme;\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable?: OverridesContextValue;\n};\n\nexport type FluentProviderState = ComponentState<FluentProviderSlots> &\n Pick<FluentProviderProps, 'targetDocument'> &\n Required<\n Pick<FluentProviderProps, 'applyStylesToPortals' | 'customStyleHooks_unstable' | 'dir' | 'overrides_unstable'>\n > & {\n theme: ThemeContextValue;\n themeClassName: string;\n /**\n * Props used to render SSR theme variables style element\n */\n serverStyleProps: {\n /**\n * CSS rule containing CSS variables\n */\n cssRule: string;\n /**\n * Additional attributes applied to the style element\n */\n attributes: Record<string, string>;\n };\n };\n\nexport type FluentProviderContextValues = Pick<\n FluentProviderState,\n 'customStyleHooks_unstable' | 'theme' | 'overrides_unstable'\n> & {\n provider: ProviderContextValue;\n themeClassName: ThemeClassNameContextValue;\n textDirection: 'ltr' | 'rtl';\n tooltip: TooltipVisibilityContextValue;\n};\n"],"names":[],"mappings":"AAAA,WAyEE"}
@@ -5,5 +5,3 @@ export * from './useFluentProvider';
5
5
  export * from './useFluentProviderStyles.styles';
6
6
  export * from './useFluentProviderContextValues';
7
7
  export * from './useFluentProviderThemeStyleTag';
8
-
9
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/FluentProvider/index.ts"],"sourcesContent":["export * from './FluentProvider';\nexport * from './FluentProvider.types';\nexport * from './renderFluentProvider';\nexport * from './useFluentProvider';\nexport * from './useFluentProviderStyles.styles';\nexport * from './useFluentProviderContextValues';\nexport * from './useFluentProviderThemeStyleTag';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,mCAAmC;AACjD,cAAc,mCAAmC;AACjD,cAAc,mCAAmC"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './FluentProvider';\nexport * from './FluentProvider.types';\nexport * from './renderFluentProvider';\nexport * from './useFluentProvider';\nexport * from './useFluentProviderStyles.styles';\nexport * from './useFluentProviderContextValues';\nexport * from './useFluentProviderThemeStyleTag';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,mCAAmC;AACjD,cAAc,mCAAmC;AACjD,cAAc,mCAAmC"}
@@ -33,5 +33,3 @@ import { OverridesProvider_unstable as OverridesProvider, Provider_unstable as P
33
33
  ...state.serverStyleProps.attributes
34
34
  }), slotProps.root.children))))))));
35
35
  };
36
-
37
- //# sourceMappingURL=renderFluentProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/FluentProvider/renderFluentProvider.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { canUseDOM, getSlotsNext } from '@fluentui/react-utilities';\nimport { TextDirectionProvider } from '@griffel/react';\nimport {\n OverridesProvider_unstable as OverridesProvider,\n Provider_unstable as Provider,\n TooltipVisibilityProvider_unstable as TooltipVisibilityProvider,\n ThemeProvider_unstable as ThemeProvider,\n ThemeClassNameProvider_unstable as ThemeClassNameProvider,\n CustomStyleHooksProvider_unstable as CustomStyleHooksProvider,\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n} from '@fluentui/react-shared-contexts';\nimport type { FluentProviderContextValues, FluentProviderState, FluentProviderSlots } from './FluentProvider.types';\n\n/**\n * Render the final JSX of FluentProvider\n */\nexport const renderFluentProvider_unstable = (\n state: FluentProviderState,\n contextValues: FluentProviderContextValues,\n) => {\n const { slots, slotProps } = getSlotsNext<FluentProviderSlots>(state);\n\n // Typescript (vscode) incorrectly references the FluentProviderProps.customStyleHooks_unstable\n // instead of FluentProviderContextValues.customStyleHooks_unstable and thinks it is\n // Partial<CustomStyleHooksContextValue>, so it needs to be cast to Required<CustomStyleHooksContextValue>\n\n return (\n <Provider value={contextValues.provider}>\n <ThemeProvider value={contextValues.theme}>\n <ThemeClassNameProvider value={contextValues.themeClassName}>\n <CustomStyleHooksProvider\n value={contextValues.customStyleHooks_unstable as Required<CustomStyleHooksContextValue>}\n >\n <TooltipVisibilityProvider value={contextValues.tooltip}>\n <TextDirectionProvider dir={contextValues.textDirection}>\n <OverridesProvider value={contextValues.overrides_unstable}>\n <slots.root {...slotProps.root}>\n {canUseDOM() ? null : (\n <style\n // Using dangerous HTML because react can escape characters\n // which can lead to invalid CSS.\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: state.serverStyleProps.cssRule }}\n {...state.serverStyleProps.attributes}\n />\n )}\n {slotProps.root.children}\n </slots.root>\n </OverridesProvider>\n </TextDirectionProvider>\n </TooltipVisibilityProvider>\n </CustomStyleHooksProvider>\n </ThemeClassNameProvider>\n </ThemeProvider>\n </Provider>\n );\n};\n"],"names":["createElement","canUseDOM","getSlotsNext","TextDirectionProvider","OverridesProvider_unstable","OverridesProvider","Provider_unstable","Provider","TooltipVisibilityProvider_unstable","TooltipVisibilityProvider","ThemeProvider_unstable","ThemeProvider","ThemeClassNameProvider_unstable","ThemeClassNameProvider","CustomStyleHooksProvider_unstable","CustomStyleHooksProvider","renderFluentProvider_unstable","state","contextValues","slots","slotProps","value","provider","theme","themeClassName","customStyleHooks_unstable","tooltip","dir","textDirection","overrides_unstable","root","style","dangerouslySetInnerHTML","__html","serverStyleProps","cssRule","attributes","children"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,SAAS,EAAEC,YAAY,QAAQ,4BAA4B;AACpE,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SACEC,8BAA8BC,iBAAiB,EAC/CC,qBAAqBC,QAAQ,EAC7BC,sCAAsCC,yBAAyB,EAC/DC,0BAA0BC,aAAa,EACvCC,mCAAmCC,sBAAsB,EACzDC,qCAAqCC,wBAAwB,QAExD,kCAAkC;AAGzC;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC,gBACG;IACH,MAAM,EAAEC,MAAK,EAAEC,UAAS,EAAE,GAAGlB,aAAkCe;IAE/D,+FAA+F;IAC/F,oFAAoF;IACpF,0GAA0G;IAE1G,qBACE,AA9BJ,cA8BKV;QAASc,OAAOH,cAAcI,QAAQ;qBACrC,AA/BN,cA+BOX;QAAcU,OAAOH,cAAcK,KAAK;qBACvC,AAhCR,cAgCSV;QAAuBQ,OAAOH,cAAcM,cAAc;qBACzD,AAjCV,cAiCWT;QACCM,OAAOH,cAAcO,yBAAyB;qBAE9C,AApCZ,cAoCahB;QAA0BY,OAAOH,cAAcQ,OAAO;qBACrD,AArCd,cAqCevB;QAAsBwB,KAAKT,cAAcU,aAAa;qBACrD,AAtChB,cAsCiBvB;QAAkBgB,OAAOH,cAAcW,kBAAkB;qBACxD,AAvClB,cAuCmBV,MAAMW,IAAI,EAAKV,UAAUU,IAAI,EAC3B7B,cAAc,IAAI,iBACjB,AAzCtB,cAyCuB8B;QACC,2DAA2D;QAC3D,iCAAiC;QACjC,2CAA2C;QAC3CC,yBAAyB;YAAEC,QAAQhB,MAAMiB,gBAAgB,CAACC,OAAO;QAAC;QACjE,GAAGlB,MAAMiB,gBAAgB,CAACE,UAAU;MAExC,EACAhB,UAAUU,IAAI,CAACO,QAAQ;AAU5C,EAAE"}
1
+ {"version":3,"sources":["renderFluentProvider.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { canUseDOM, getSlotsNext } from '@fluentui/react-utilities';\nimport { TextDirectionProvider } from '@griffel/react';\nimport {\n OverridesProvider_unstable as OverridesProvider,\n Provider_unstable as Provider,\n TooltipVisibilityProvider_unstable as TooltipVisibilityProvider,\n ThemeProvider_unstable as ThemeProvider,\n ThemeClassNameProvider_unstable as ThemeClassNameProvider,\n CustomStyleHooksProvider_unstable as CustomStyleHooksProvider,\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n} from '@fluentui/react-shared-contexts';\nimport type { FluentProviderContextValues, FluentProviderState, FluentProviderSlots } from './FluentProvider.types';\n\n/**\n * Render the final JSX of FluentProvider\n */\nexport const renderFluentProvider_unstable = (\n state: FluentProviderState,\n contextValues: FluentProviderContextValues,\n) => {\n const { slots, slotProps } = getSlotsNext<FluentProviderSlots>(state);\n\n // Typescript (vscode) incorrectly references the FluentProviderProps.customStyleHooks_unstable\n // instead of FluentProviderContextValues.customStyleHooks_unstable and thinks it is\n // Partial<CustomStyleHooksContextValue>, so it needs to be cast to Required<CustomStyleHooksContextValue>\n\n return (\n <Provider value={contextValues.provider}>\n <ThemeProvider value={contextValues.theme}>\n <ThemeClassNameProvider value={contextValues.themeClassName}>\n <CustomStyleHooksProvider\n value={contextValues.customStyleHooks_unstable as Required<CustomStyleHooksContextValue>}\n >\n <TooltipVisibilityProvider value={contextValues.tooltip}>\n <TextDirectionProvider dir={contextValues.textDirection}>\n <OverridesProvider value={contextValues.overrides_unstable}>\n <slots.root {...slotProps.root}>\n {canUseDOM() ? null : (\n <style\n // Using dangerous HTML because react can escape characters\n // which can lead to invalid CSS.\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: state.serverStyleProps.cssRule }}\n {...state.serverStyleProps.attributes}\n />\n )}\n {slotProps.root.children}\n </slots.root>\n </OverridesProvider>\n </TextDirectionProvider>\n </TooltipVisibilityProvider>\n </CustomStyleHooksProvider>\n </ThemeClassNameProvider>\n </ThemeProvider>\n </Provider>\n );\n};\n"],"names":["createElement","canUseDOM","getSlotsNext","TextDirectionProvider","OverridesProvider_unstable","OverridesProvider","Provider_unstable","Provider","TooltipVisibilityProvider_unstable","TooltipVisibilityProvider","ThemeProvider_unstable","ThemeProvider","ThemeClassNameProvider_unstable","ThemeClassNameProvider","CustomStyleHooksProvider_unstable","CustomStyleHooksProvider","renderFluentProvider_unstable","state","contextValues","slots","slotProps","value","provider","theme","themeClassName","customStyleHooks_unstable","tooltip","dir","textDirection","overrides_unstable","root","style","dangerouslySetInnerHTML","__html","serverStylePro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, b) {
89
89
  function useTheme() {
90
90
  return React.useContext(ThemeContext);
91
91
  }
92
-
93
- //# sourceMappingURL=useFluentProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/FluentProvider/useFluentProvider.ts"],"sourcesContent":["import { useFocusVisible } from '@fluentui/react-tabster';\nimport {\n ThemeContext_unstable as ThemeContext,\n useFluent_unstable as useFluent,\n useOverrides_unstable as useOverrides,\n CustomStyleHooksContext_unstable as CustomStyleHooksContext,\n} from '@fluentui/react-shared-contexts';\nimport type {\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n ThemeContextValue_unstable as ThemeContextValue,\n} from '@fluentui/react-shared-contexts';\n\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\nimport type { FluentProviderProps, FluentProviderState } from './FluentProvider.types';\nimport { useRenderer_unstable } from '@griffel/react';\n\n/**\n * Create the state required to render FluentProvider.\n *\n * The returned state can be modified with hooks such as useFluentProviderStyles_unstable,\n * before being passed to renderFluentProvider_unstable.\n *\n * @param props - props from this instance of FluentProvider\n * @param ref - reference to root HTMLElement of FluentProvider\n */\nexport const useFluentProvider_unstable = (\n props: FluentProviderProps,\n ref: React.Ref<HTMLElement>,\n): FluentProviderState => {\n const parentContext = useFluent();\n const parentTheme = useTheme();\n const parentOverrides = useOverrides();\n const parentCustomStyleHooks: CustomStyleHooksContextValue = React.useContext(CustomStyleHooksContext) || {};\n\n /**\n * TODO: add merge functions to \"dir\" merge,\n * nesting providers with the same \"dir\" should not add additional attributes to DOM\n * see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93\n */\n const {\n applyStylesToPortals = true,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n dir = parentContext.dir,\n targetDocument = parentContext.targetDocument,\n theme,\n overrides_unstable: overrides = {},\n } = props;\n const mergedTheme = shallowMerge(parentTheme, theme);\n\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n\n const mergedCustomStyleHooks = shallowMerge(\n parentCustomStyleHooks,\n customStyleHooks_unstable,\n ) as CustomStyleHooksContextValue;\n\n React.useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`\n FluentProvider: your \"theme\" is not defined !\n =============================================\n Make sure your root FluentProvider has set a theme or you're setting the theme in your child FluentProvider.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const renderer = useRenderer_unstable();\n const { styleTagId, rule } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: renderer.styleElementAttributes ?? {},\n });\n return {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable: mergedCustomStyleHooks,\n dir,\n targetDocument,\n theme: mergedTheme,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable: mergedOverrides,\n themeClassName: styleTagId,\n\n components: {\n root: 'div',\n },\n\n root: getNativeElementProps('div', {\n ...props,\n dir,\n ref: useMergedRefs(ref, useFocusVisible<HTMLDivElement>({ targetDocument })),\n }),\n\n serverStyleProps: {\n cssRule: rule,\n attributes: {\n ...renderer.styleElementAttributes,\n id: styleTagId,\n },\n },\n };\n};\n\nfunction shallowMerge<T>(a: T, b: T): T {\n // Merge impacts perf: we should like to avoid it if it's possible\n if (a && b) {\n return { ...a, ...b };\n }\n\n if (a) {\n return a;\n }\n\n return b;\n}\n\nfunction useTheme(): ThemeContextValue {\n return React.useContext(ThemeContext);\n}\n"],"names":["useFocusVisible","ThemeContext_unstable","ThemeContext","useFluent_unstable","useFluent","useOverrides_unstable","useOverrides","CustomStyleHooksContext_unstable","CustomStyleHooksContext","getNativeElementProps","useMergedRefs","React","useFluentProviderThemeStyleTag","useRenderer_unstable","useFluentProvider_unstable","props","ref","parentContext","parentTheme","useTheme","parentOverrides","parentCustomStyleHooks","useContext","applyStylesToPortals","customStyleHooks_unstable","dir","targetDocument","theme","overrides_unstable","overrides","mergedTheme","shallowMerge","mergedOverrides","mergedCustomStyleHooks","useEffect","process","env","NODE_ENV","undefined","console","warn","renderer","styleTagId","rule","rendererAttributes","styleElementAttributes","themeClassName","components","root","serverStyleProps","cssRule","attributes","id","a","b"],"mappings":"AAAA,SAASA,eAAe,QAAQ,0BAA0B;AAC1D,SACEC,yBAAyBC,YAAY,EACrCC,sBAAsBC,SAAS,EAC/BC,yBAAyBC,YAAY,EACrCC,oCAAoCC,uBAAuB,QACtD,kCAAkC;AAMzC,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,4BAA4B;AACjF,YAAYC,WAAW,QAAQ;AAC/B,SAASC,8BAA8B,QAAQ,mCAAmC;AAElF,SAASC,oBAAoB,QAAQ,iBAAiB;AAEtD;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC,MACwB;IACxB,MAAMC,gBAAgBb;IACtB,MAAMc,cAAcC;IACpB,MAAMC,kBAAkBd;IACxB,MAAMe,yBAAuDV,MAAMW,UAAU,CAACd,4BAA4B,CAAC;IAE3G;;;;GAIC,GACD,MAAM,EACJe,sBAAuB,IAAI,CAAA,EAC3B,gEAAgE;IAChEC,0BAAyB,EACzBC,KAAMR,cAAcQ,GAAG,CAAA,EACvBC,gBAAiBT,cAAcS,cAAc,CAAA,EAC7CC,MAAK,EACLC,oBAAoBC,YAAY,CAAC,CAAC,CAAA,EACnC,GAAGd;IACJ,MAAMe,cAAcC,aAAab,aAAaS;IAE9C,MAAMK,kBAAkBD,aAAaX,iBAAiBS;IAEtD,MAAMI,yBAAyBF,aAC7BV,wBACAG;IAGFb,MAAMuB,SAAS,CAAC,IAAM;QACpB,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBAAgBP,gBAAgBQ,WAAW;YACtE,sCAAsC;YACtCC,QAAQC,IAAI,CAAC,CAAC;;;;MAId,CAAC;QACH,CAAC;IACD,uDAAuD;IACzD,GAAG,EAAE;IAEL,MAAMC,WAAW5B;QAIK4B;IAHtB,MAAM,EAAEC,WAAU,EAAEC,KAAI,EAAE,GAAG/B,+BAA+B;QAC1De,OAAOG;QACPJ;QACAkB,oBAAoBH,CAAAA,mCAAAA,SAASI,sBAAsB,cAA/BJ,8CAAAA,mCAAmC,CAAC,CAAC;IAC3D;IACA,OAAO;QACLlB;QACA,gEAAgE;QAChEC,2BAA2BS;QAC3BR;QACAC;QACAC,OAAOG;QACP,gEAAgE;QAChEF,oBAAoBI;QACpBc,gBAAgBJ;QAEhBK,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMvC,sBAAsB,OAAO;YACjC,GAAGM,KAAK;YACRU;YACAT,KAAKN,cAAcM,KAAKhB,gBAAgC;gBAAE0B;YAAe;QAC3E;QAEAuB,kBAAkB;YAChBC,SAASP;YACTQ,YAAY;gBACV,GAAGV,SAASI,sBAAsB;gBAClCO,IAAIV;YACN;QACF;IACF;AACF,EAAE;AAEF,SAASX,aAAgBsB,CAAI,EAAEC,CAAI,EAAK;IACtC,kEAAkE;IAClE,IAAID,KAAKC,GAAG;QACV,OAAO;YAAE,GAAGD,CAAC;YAAE,GAAGC,CAAC;QAAC;IACtB,CAAC;IAED,IAAID,GAAG;QACL,OAAOA;IACT,CAAC;IAED,OAAOC;AACT;AAEA,SAASnC,WAA8B;IACrC,OAAOR,MAAMW,UAAU,CAACpB;AAC1B"}
1
+ {"version":3,"sources":["useFluentProvider.ts"],"sourcesContent":["import { useFocusVisible } from '@fluentui/react-tabster';\nimport {\n ThemeContext_unstable as ThemeContext,\n useFluent_unstable as useFluent,\n useOverrides_unstable as useOverrides,\n CustomStyleHooksContext_unstable as CustomStyleHooksContext,\n} from '@fluentui/react-shared-contexts';\nimport type {\n CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,\n ThemeContextValue_unstable as ThemeContextValue,\n} from '@fluentui/react-shared-contexts';\n\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\nimport type { FluentProviderProps, FluentProviderState } from './FluentProvider.types';\nimport { useRenderer_unstable } from '@griffel/react';\n\n/**\n * Create the state required to render FluentProvider.\n *\n * The returned state can be modified with hooks such as useFluentProviderStyles_unstable,\n * before being passed to renderFluentProvider_unstable.\n *\n * @param props - props from this instance of FluentProvider\n * @param ref - reference to root HTMLElement of FluentProvider\n */\nexport const useFluentProvider_unstable = (\n props: FluentProviderProps,\n ref: React.Ref<HTMLElement>,\n): FluentProviderState => {\n const parentContext = useFluent();\n const parentTheme = useTheme();\n const parentOverrides = useOverrides();\n const parentCustomStyleHooks: CustomStyleHooksContextValue = React.useContext(CustomStyleHooksContext) || {};\n\n /**\n * TODO: add merge functions to \"dir\" merge,\n * nesting providers with the same \"dir\" should not add additional attributes to DOM\n * see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93\n */\n const {\n applyStylesToPortals = true,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n dir = parentContext.dir,\n targetDocument = parentContext.targetDocument,\n theme,\n overrides_unstable: overrides = {},\n } = props;\n const mergedTheme = shallowMerge(parentTheme, theme);\n\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n\n const mergedCustomStyleHooks = shallowMerge(\n parentCustomStyleHooks,\n customStyleHooks_unstable,\n ) as CustomStyleHooksContextValue;\n\n React.useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`\n FluentProvider: your \"theme\" is not defined !\n =============================================\n Make sure your root FluentProvider has set a theme or you're setting the theme in your child FluentProvider.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const renderer = useRenderer_unstable();\n const { styleTagId, rule } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: renderer.styleElementAttributes ?? {},\n });\n return {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable: mergedCustomStyleHooks,\n dir,\n targetDocument,\n theme: mergedTheme,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable: mergedOverrides,\n themeClassName: styleTagId,\n\n components: {\n root: 'div',\n },\n\n root: getNativeElementProps('div', {\n ...props,\n dir,\n ref: useMergedRefs(ref, useFocusVisible<HTMLDivElement>({ targetDocument })),\n }),\n\n serverStyleProps: {\n cssRule: rule,\n attributes: {\n ...renderer.styleElementAttributes,\n id: styleTagId,\n },\n },\n };\n};\n\nfunction shallowMerge<T>(a: T, b: T): T {\n // Merge impacts perf: we should like to avoid it if it's possible\n if (a && b) {\n return { ...a, ...b };\n }\n\n if (a) {\n return a;\n }\n\n return b;\n}\n\nfunction useTheme(): ThemeContextValue {\n return React.useContext(ThemeContext);\n}\n"],"names":["useFocusVisible","ThemeContext_unstable","ThemeContext","useFluent_unstable","useFluent","useOverrides_unstable","useOverrides","CustomStyleHooksContext_unstable","CustomStyleHooksContext","getNativeElementProps","useMergedRefs","React","useFluentProviderThemeStyleTag","useRenderer_unstable","useFluentProvider_unstable","props","ref","parentContext","parentTheme","useTheme","parentOverrides","parentCustomStyleHooks","useContext","applyStylesToPortals","customStyleHooks_unstable","dir","targetDocument","theme","overrides_unstable","overrides","mergedTheme","shallowMerge","mergedOverrides","mergedCustomStyleHooks","useEffect","process","env","NODE_ENV","undefined","console","warn","renderer","styleTagId","rule","rendererAttributes","styleElementAttributes","themeClassName","components","root","serverStyleProps","cssRule","attributes","id","a","b"],"mappings":"AAAA,SAASA,eAAe,QAAQ,0BAA0B;AAC1D,SACEC,yBAAyBC,YAAY,EACrCC,sBAAsBC,SAAS,EAC/BC,yBAAyBC,YAAY,EACrCC,oCA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pBc,gBAAgBJ;QAEhBK,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMvC,sBAAsB,OAAO;YACjC,GAAGM,KAAK;YACRU;YACAT,KAAKN,cAAcM,KAAKhB,gBAAgC;gBAAE0B;YAAe;QAC3E;QAEAuB,kBAAkB;YAChBC,SAASP;YACTQ,YAAY;gBACV,GAAGV,SAASI,sBAAsB;gBAClCO,IAAIV;YACN;QACF;IACF;AACF,EAAE;AAEF,SAASX,aAAgBsB,CAAI,EAAEC,CAAI,EAAK;IACtC,kEAAkE;IAClE,IAAID,KAAKC,GAAG;QACV,OAAO;YAAE,GAAGD,CAAC;YAAE,GAAGC,CAAC;QAAC;IACtB,CAAC;IAED,IAAID,GAAG;QACL,OAAOA;IACT,CAAC;IAED,OAAOC;AACT;AAEA,SAASnC,WAA8B;IACrC,OAAOR,MAAMW,UAAU,CAACpB;AAC1B"}
@@ -25,5 +25,3 @@ export function useFluentProviderContextValues_unstable(state) {
25
25
  themeClassName: applyStylesToPortals ? root.className : themeClassName
26
26
  };
27
27
  }
28
-
29
- //# sourceMappingURL=useFluentProviderContextValues.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderContextValues.ts"],"sourcesContent":["import * as React from 'react';\nimport type { FluentProviderContextValues, FluentProviderState } from './FluentProvider.types';\n\nexport function useFluentProviderContextValues_unstable(state: FluentProviderState): FluentProviderContextValues {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n dir,\n root,\n targetDocument,\n theme,\n themeClassName,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable,\n } = state;\n\n const provider = React.useMemo(() => ({ dir, targetDocument }), [dir, targetDocument]);\n // \"Tooltip\" component mutates an object in this context, instance should be stable\n const [tooltip] = React.useState(() => ({}));\n\n return {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable,\n provider,\n textDirection: dir,\n tooltip,\n theme,\n themeClassName: applyStylesToPortals ? root.className! : themeClassName,\n };\n}\n"],"names":["React","useFluentProviderContextValues_unstable","state","applyStylesToPortals","customStyleHooks_unstable","dir","root","targetDocument","theme","themeClassName","overrides_unstable","provider","useMemo","tooltip","useState","textDirection","className"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,OAAO,SAASC,wCAAwCC,KAA0B,EAA+B;IAC/G,gEAAgE;IAChE,MAAM,EACJC,qBAAoB,EACpB,gEAAgE;IAChEC,0BAAyB,EACzBC,IAAG,EACHC,KAAI,EACJC,eAAc,EACdC,MAAK,EACLC,eAAc,EACd,gEAAgE;IAChEC,mBAAkB,EACnB,GAAGR;IAEJ,MAAMS,WAAWX,MAAMY,OAAO,CAAC,IAAO,CAAA;YAAEP;YAAKE;QAAe,CAAA,GAAI;QAACF;QAAKE;KAAe;IACrF,mFAAmF;IACnF,MAAM,CAACM,QAAQ,GAAGb,MAAMc,QAAQ,CAAC,IAAO,CAAA,CAAC,CAAA;IAEzC,OAAO;QACL,gEAAgE;QAChEV;QACA,gEAAgE;QAChEM;QACAC;QACAI,eAAeV;QACfQ;QACAL;QACAC,gBAAgBN,uBAAuBG,KAAKU,SAAS,GAAIP,cAAc;IACzE;AACF,CAAC"}
1
+ {"version":3,"sources":["useFluentProviderContextValues.ts"],"sourcesContent":["import * as React from 'react';\nimport type { FluentProviderContextValues, FluentProviderState } from './FluentProvider.types';\n\nexport function useFluentProviderContextValues_unstable(state: FluentProviderState): FluentProviderContextValues {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n dir,\n root,\n targetDocument,\n theme,\n themeClassName,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable,\n } = state;\n\n const provider = React.useMemo(() => ({ dir, targetDocument }), [dir, targetDocument]);\n // \"Tooltip\" component mutates an object in this context, instance should be stable\n const [tooltip] = React.useState(() => ({}));\n\n return {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable,\n provider,\n textDirection: dir,\n tooltip,\n theme,\n themeClassName: applyStylesToPortals ? root.className! : themeClassName,\n };\n}\n"],"names":["React","useFluentProviderContextValues_unstable","state","applyStylesToPortals","customStyleHooks_unstable","dir","root","targetDocument","theme","themeClassName","overrides_unstable","provider","useMemo","tooltip","useState","textDirection","className"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,OAAO,SAASC,wCAAwCC,KAA0B,EAA+B;IAC/G,gEAAgE;IAChE,MAAM,EACJC,qBAAoB,EACpB,gEAAgE;IAChEC,0BAAyB,EACzBC,IAAG,EACHC,KAAI,EACJC,eAAc,EACdC,MAAK,EACLC,eAAc,EACd,gEAAgE;IAChEC,mBAAkB,EACnB,GAAGR;IAEJ,MAAMS,WAAWX,MAAMY,OAAO,CAAC,IAAO,CAAA;YAAEP;YAAKE;QAAe,CAAA,GAAI;QAACF;QAAKE;KAAe;IACrF,mFAAmF;IACnF,MAAM,CAACM,QAAQ,GAAGb,MAAMc,QAAQ,CAAC,IAAO,CAAA,CAAC,CAAA;IAEzC,OAAO;QACL,gEAAgE;QAChEV;QACA,gEAAgE;QAChEM;QACAC;QACAI,eAAeV;QACfQ;QACAL;QACAC,gBAAgBN,uBAAuBG,KAAKU,SAAS,GAAIP,cAAc;IACzE;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","useRenderer_unstable","tokens","typographyStyles","fluentProviderClassNames","root","useStyles","sj55zd","De3pzq","fsow6f","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","useFluentProviderStyles_unstable","state","renderer","styles","dir","className","themeClassName"],"sources":["../../../src/components/FluentProvider/useFluentProviderStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/core';\nimport { useRenderer_unstable } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { FluentProviderSlots, FluentProviderState } from './FluentProvider.types';\nimport { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const fluentProviderClassNames: SlotClassNames<FluentProviderSlots> = {\n root: 'fui-FluentProvider',\n};\n\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n textAlign: 'left',\n ...typographyStyles.body1,\n },\n});\n\n/** Applies style classnames to slots */\nexport const useFluentProviderStyles_unstable = (state: FluentProviderState) => {\n const renderer = useRenderer_unstable();\n const styles = useStyles({ dir: state.dir, renderer });\n\n state.root.className = mergeClasses(\n fluentProviderClassNames.root,\n state.themeClassName,\n styles.root,\n state.root.className,\n );\n\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ;AACzC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AAIzC,OAAO,MAAMC,wBAAA,GAAgE;EAC3EC,IAAA,EAAM;AACR;AAEA,MAAMC,SAAA,gBAAYP,QAAA;EAAAM,IAAA;IAAAE,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAOlB;AAEA;AACA,OAAO,MAAMC,gCAAA,GAAoCC,KAAA,IAA+B;EAC9E,MAAMC,QAAA,GAAWhB,oBAAA;EACjB,MAAMiB,MAAA,GAASZ,SAAA,CAAU;IAAEa,GAAA,EAAKH,KAAA,CAAMG,GAAG;IAAEF;EAAS;EAEpDD,KAAA,CAAMX,IAAI,CAACe,SAAS,GAAGpB,YAAA,CACrBI,wBAAA,CAAyBC,IAAI,EAC7BW,KAAA,CAAMK,cAAc,EACpBH,MAAA,CAAOb,IAAI,EACXW,KAAA,CAAMX,IAAI,CAACe,SAAS;EAGtB,OAAOJ,KAAA;AACT"}
1
+ {"version":3,"names":["__styles","mergeClasses","useRenderer_unstable","tokens","typographyStyles","fluentProviderClassNames","root","useStyles","sj55zd","De3pzq","fsow6f","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","useFluentProviderStyles_unstable","state","renderer","styles","dir","className","themeClassName"],"sources":["useFluentProviderStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/core';\nimport { useRenderer_unstable } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const fluentProviderClassNames = {\n root: 'fui-FluentProvider'\n};\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n textAlign: 'left',\n ...typographyStyles.body1\n }\n});\n/** Applies style classnames to slots */ export const useFluentProviderStyles_unstable = (state)=>{\n const renderer = useRenderer_unstable();\n const styles = useStyles({\n dir: state.dir,\n renderer\n });\n state.root.className = mergeClasses(fluentProviderClassNames.root, state.themeClassName, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,eAAe;AACxD,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,wBAAwB,GAAG;EACpCC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,SAAS,gBAAGP,QAAA;EAAAM,IAAA;IAAAE,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAOjB,CAAC;AACF;AAAyC,OAAO,MAAMC,gCAAgC,GAAIC,KAAK,IAAG;EAC9F,MAAMC,QAAQ,GAAGhB,oBAAoB,CAAC,CAAC;EACvC,MAAMiB,MAAM,GAAGZ,SAAS,CAAC;IACrBa,GAAG,EAAEH,KAAK,CAACG,GAAG;IACdF;EACJ,CAAC,CAAC;EACFD,KAAK,CAACX,IAAI,CAACe,SAAS,GAAGpB,YAAY,CAACI,wBAAwB,CAACC,IAAI,EAAEW,KAAK,CAACK,cAAc,EAAEH,MAAM,CAACb,IAAI,EAAEW,KAAK,CAACX,IAAI,CAACe,SAAS,CAAC;EAC3H,OAAOJ,KAAK;AAChB,CAAC"}
@@ -89,5 +89,3 @@ function useHandleSSRStyleElements(targetDocument, styleTagId) {
89
89
  }
90
90
  });
91
91
  }
92
-
93
- //# sourceMappingURL=useFluentProviderThemeStyleTag.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/FluentProvider/useFluentProviderThemeStyleTag.ts"],"sourcesContent":["import { useId, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport type { FluentProviderState } from './FluentProvider.types';\nimport { fluentProviderClassNames } from './useFluentProviderStyles.styles';\n\n// String concatenation is used to prevent bundlers to complain with older versions of React\nconst useInsertionEffect = (React as never)['useInsertion' + 'Effect']\n ? (React as never)['useInsertion' + 'Effect']\n : useIsomorphicLayoutEffect;\n\nconst createStyleTag = (target: Document | undefined, elementAttributes: Record<string, string>) => {\n if (!target) {\n return undefined;\n }\n\n const tag = target.createElement('style');\n\n Object.keys(elementAttributes).forEach(attrName => {\n tag.setAttribute(attrName, elementAttributes[attrName]);\n });\n\n target.head.appendChild(tag);\n return tag;\n};\n\nconst insertSheet = (tag: HTMLStyleElement, rule: string) => {\n const sheet = tag.sheet;\n\n if (sheet) {\n if (sheet.cssRules.length > 0) {\n sheet.deleteRule(0);\n }\n sheet.insertRule(rule, 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/**\n * Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class\n * @internal\n * @returns CSS class to apply the rule\n */\nexport const useFluentProviderThemeStyleTag = (\n options: Pick<FluentProviderState, 'theme' | 'targetDocument'> & { rendererAttributes: Record<string, string> },\n) => {\n const { targetDocument, theme, rendererAttributes } = options;\n\n const styleTag = React.useRef<HTMLStyleElement | undefined | null>();\n\n const styleTagId = useId(fluentProviderClassNames.root);\n const styleElementAttributes = rendererAttributes;\n\n const cssVarsAsString = React.useMemo(() => {\n return theme\n ? (Object.keys(theme) as (keyof typeof theme)[]).reduce((cssVarRule, cssVar) => {\n cssVarRule += `--${cssVar}: ${theme[cssVar]}; `;\n return cssVarRule;\n }, '')\n : '';\n }, [theme]);\n\n const rule = `.${styleTagId} { ${cssVarsAsString} }`;\n\n useHandleSSRStyleElements(targetDocument, styleTagId);\n useInsertionEffect(() => {\n // The style element could already have been created during SSR - no need to recreate it\n const ssrStyleElement = targetDocument?.getElementById(styleTagId);\n if (ssrStyleElement) {\n styleTag.current = ssrStyleElement as HTMLStyleElement;\n } else {\n styleTag.current = createStyleTag(targetDocument, { ...styleElementAttributes, id: styleTagId });\n if (styleTag.current) {\n insertSheet(styleTag.current, rule);\n }\n }\n\n return () => {\n styleTag.current?.remove();\n };\n }, [styleTagId, targetDocument, rule, styleElementAttributes]);\n\n return { styleTagId, rule };\n};\n\nfunction useHandleSSRStyleElements(targetDocument: Document | undefined | null, styleTagId: string) {\n // Using a state factory so that this logic only runs once per render\n // Each FluentProvider can create its own style element during SSR as a slot\n // Moves all theme style elements to document head during render to avoid hydration errors.\n // Should be strict mode safe since the logic is idempotent.\n React.useState(() => {\n if (!targetDocument) {\n return;\n }\n\n const themeStyleElement = targetDocument.getElementById(styleTagId);\n if (themeStyleElement) {\n targetDocument.head.append(themeStyleElement);\n }\n });\n}\n"],"names":["useId","useIsomorphicLayoutEffect","React","fluentProviderClassNames","useInsertionEffect","createStyleTag","target","elementAttributes","undefined","tag","createElement","Object","keys","forEach","attrName","setAttribute","head","appendChild","insertSheet","rule","sheet","cssRules","length","deleteRule","insertRule","process","env","NODE_ENV","console","error","useFluentProviderThemeStyleTag","options","targetDocument","theme","rendererAttributes","styleTag","useRef","styleTagId","root","styleElementAttributes","cssVarsAsString","useMemo","reduce","cssVarRule","cssVar","useHandleSSRStyleElements","ssrStyleElement","getElementById","current","id","remove","useState","themeStyleElement","append"],"mappings":"AAAA,SAASA,KAAK,EAAEC,yBAAyB,QAAQ,4BAA4B;AAC7E,YAAYC,WAAW,QAAQ;AAG/B,SAASC,wBAAwB,QAAQ,mCAAmC;AAE5E,4FAA4F;AAC5F,MAAMC,qBAAqB,AAACF,KAAe,CAAC,iBAAiB,SAAS,GAClE,AAACA,KAAe,CAAC,iBAAiB,SAAS,GAC3CD,yBAAyB;AAE7B,MAAMI,iBAAiB,CAACC,QAA8BC,oBAA8C;IAClG,IAAI,CAACD,QAAQ;QACX,OAAOE;IACT,CAAC;IAED,MAAMC,MAAMH,OAAOI,aAAa,CAAC;IAEjCC,OAAOC,IAAI,CAACL,mBAAmBM,OAAO,CAACC,CAAAA,WAAY;QACjDL,IAAIM,YAAY,CAACD,UAAUP,iBAAiB,CAACO,SAAS;IACxD;IAEAR,OAAOU,IAAI,CAACC,WAAW,CAACR;IACxB,OAAOA;AACT;AAEA,MAAMS,cAAc,CAACT,KAAuBU,OAAiB;IAC3D,MAAMC,QAAQX,IAAIW,KAAK;IAEvB,IAAIA,OAAO;QACT,IAAIA,MAAMC,QAAQ,CAACC,MAAM,GAAG,GAAG;YAC7BF,MAAMG,UAAU,CAAC;QACnB,CAAC;QACDH,MAAMI,UAAU,CAACL,MAAM;IACzB,OAAO,IAAIM,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QAChD,sCAAsC;QACtCC,QAAQC,KAAK,CAAC;IAChB,CAAC;AACH;AAEA;;;;CAIC,GACD,OAAO,MAAMC,iCAAiC,CAC5CC,UACG;IACH,MAAM,EAAEC,eAAc,EAAEC,MAAK,EAAEC,mBAAkB,EAAE,GAAGH;IAEtD,MAAMI,WAAWjC,MAAMkC,MAAM;IAE7B,MAAMC,aA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cAAc,CAACV;QACxD,IAAIe,mBAAmB;YACrBpB,eAAehB,IAAI,CAACqC,MAAM,CAACD;QAC7B,CAAC;IACH;AACF"}
1
+ {"version":3,"sources":["useFluentProviderThemeStyleTag.ts"],"sourcesContent":["import { useId, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport type { FluentProviderState } from './FluentProvider.types';\nimport { fluentProviderClassNames } from './useFluentProviderStyles.styles';\n\n// String concatenation is used to prevent bundlers to complain with older versions of React\nconst useInsertionEffect = (React as never)['useInsertion' + 'Effect']\n ? (React as never)['useInsertion' + 'Effect']\n : useIsomorphicLayoutEffect;\n\nconst createStyleTag = (target: Document | undefined, elementAttributes: Record<string, string>) => {\n if (!target) {\n return undefined;\n }\n\n const tag = target.createElement('style');\n\n Object.keys(elementAttributes).forEach(attrName => {\n tag.setAttribute(attrName, elementAttributes[attrName]);\n });\n\n target.head.appendChild(tag);\n return tag;\n};\n\nconst insertSheet = (tag: HTMLStyleElement, rule: string) => {\n const sheet = tag.sheet;\n\n if (sheet) {\n if (sheet.cssRules.length > 0) {\n sheet.deleteRule(0);\n }\n sheet.insertRule(rule, 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/**\n * Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class\n * @internal\n * @returns CSS class to apply the rule\n */\nexport const useFluentProviderThemeStyleTag = (\n options: Pick<FluentProviderState, 'theme' | 'targetDocument'> & { rendererAttributes: Record<string, string> },\n) => {\n const { targetDocument, theme, rendererAttributes } = options;\n\n const styleTag = React.useRef<HTMLStyleElement | undefined | null>();\n\n const styleTagId = useId(fluentProviderClassNames.root);\n const styleElementAttributes = rendererAttributes;\n\n const cssVarsAsString = React.useMemo(() => {\n return theme\n ? (Object.keys(theme) as (keyof typeof theme)[]).reduce((cssVarRule, cssVar) => {\n cssVarRule += `--${cssVar}: ${theme[cssVar]}; `;\n return cssVarRule;\n }, '')\n : '';\n }, [theme]);\n\n const rule = `.${styleTagId} { ${cssVarsAsString} }`;\n\n useHandleSSRStyleElements(targetDocument, styleTagId);\n useInsertionEffect(() => {\n // The style element could already have been created during SSR - no need to recreate it\n const ssrStyleElement = targetDocument?.getElementById(styleTagId);\n if (ssrStyleElement) {\n styleTag.current = ssrStyleElement as HTMLStyleElement;\n } else {\n styleTag.current = createStyleTag(targetDocument, { ...styleElementAttributes, id: styleTagId });\n if (styleTag.current) {\n insertSheet(styleTag.current, rule);\n }\n }\n\n return () => {\n styleTag.current?.remove();\n };\n }, [styleTagId, targetDocument, rule, styleElementAttributes]);\n\n return { styleTagId, rule };\n};\n\nfunction useHandleSSRStyleElements(targetDocument: Document | undefined | null, styleTagId: string) {\n // Using a state factory so that this logic only runs once per render\n // Each FluentProvider can create its own style element during SSR as a slot\n // Moves all theme style elements to document head during render to avoid hydration errors.\n // Should be strict mode safe since the logic is idempotent.\n React.useState(() => {\n if (!targetDocument) {\n return;\n }\n\n const themeStyleElement = targetDocument.getElementById(styleTagId);\n if (themeStyleElement) {\n targetDocument.head.append(themeStyleElement);\n }\n });\n}\n"],"names":["useId","useIsomorphicLayoutEffect","React","fluentProviderClassNames","useInsertionEffect","createStyleTag","target","elementAttributes","undefined","tag","createElement","Object","keys","forEach","attrName","setAttribute","head","appendChild","insertSheet","rule","sheet","cssRules","length","deleteRule","insertRule","process","env","NODE_ENV","console","error","useFluentProviderThemeStyleTag","options","targetDocument","theme","rendererAttributes","styleTag","useRef","styleTagId","root","styleElementAttributes","cssVarsAsString","useMemo","reduce","cssVarRule","cssVar","useHandleSSRStyleElements","ssrStyleElement","getElementById","current","id","remove","useState","themeStyleElement","append"],"mappings":"AAAA,SAASA,KAAK,EAAEC,yBAAyB,QAAQ,4BAA4B;AAC7E,YAAYC,WAAW,QAAQ;AAG/B,SAASC,wBAAwB,QAAQ,mCAAmC;AAE5E,4FAA4F;AAC5F,MAAMC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;IACR,GAAG;QAACV;KAAM;IAEV,MAAMd,OAAO,CAAC,CAAC,EAAEkB,WAAW,GAAG,EAAEG,gBAAgB,EAAE,CAAC;IAEpDK,0BAA0Bb,gBAAgBK;IAC1CjC,mBAAmB,IAAM;QACvB,wFAAwF;QACxF,MAAM0C,kBAAkBd,2BAAAA,4BAAAA,KAAAA,IAAAA,eAAgBe,cAAc,CAACV;QACvD,IAAIS,iBAAiB;YACnBX,SAASa,OAAO,GAAGF;QACrB,OAAO;YACLX,SAASa,OAAO,GAAG3C,eAAe2B,gBAAgB;gBAAE,GAAGO,sBAAsB;gBAAEU,IAAIZ;YAAW;YAC9F,IAAIF,SAASa,OAAO,EAAE;gBACpB9B,YAAYiB,SAASa,OAAO,EAAE7B;YAChC,CAAC;QACH,CAAC;QAED,OAAO,IAAM;gBACXgB;YAAAA,CAAAA,oBAAAA,SAASa,OAAO,cAAhBb,+BAAAA,KAAAA,IAAAA,kBAAkBe;QACpB;IACF,GAAG;QAACb;QAAYL;QAAgBb;QAAMoB;KAAuB;IAE7D,OAAO;QAAEF;QAAYlB;IAAK;AAC5B,EAAE;AAEF,SAAS0B,0BAA0Bb,cAA2C,EAAEK,UAAkB,EAAE;IAClG,qEAAqE;IACrE,4EAA4E;IAC5E,2FAA2F;IAC3F,4DAA4D;IAC5DnC,MAAMiD,QAAQ,CAAC,IAAM;QACnB,IAAI,CAACnB,gBAAgB;YACnB;QACF,CAAC;QAED,MAAMoB,oBAAoBpB,eAAee,cAAc,CAACV;QACxD,IAAIe,mBAAmB;YACrBpB,eAAehB,IAAI,CAACqC,MAAM,CAACD;QAC7B,CAAC;IACH;AACF"}
package/lib/index.js CHANGED
@@ -1,3 +1 @@
1
1
  export { fluentProviderClassNames, FluentProvider, renderFluentProvider_unstable, useFluentProviderContextValues_unstable, useFluentProvider_unstable, useFluentProviderStyles_unstable, useFluentProviderThemeStyleTag } from './FluentProvider';
2
-
3
- //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n fluentProviderClassNames,\n FluentProvider,\n renderFluentProvider_unstable,\n useFluentProviderContextValues_unstable,\n useFluentProvider_unstable,\n useFluentProviderStyles_unstable,\n useFluentProviderThemeStyleTag,\n} from './FluentProvider';\nexport type {\n FluentProviderContextValues,\n FluentProviderCustomStyleHooks,\n FluentProviderProps,\n FluentProviderState,\n FluentProviderSlots,\n} from './FluentProvider';\n"],"names":["fluentProviderClassNames","FluentProvider","renderFluentProvider_unstable","useFluentProviderContextValues_unstable","useFluentProvider_unstable","useFluentProviderStyles_unstable","useFluentProviderThemeStyleTag"],"mappings":"AAAA,SACEA,wBAAwB,EACxBC,cAAc,EACdC,6BAA6B,EAC7BC,uCAAuC,EACvCC,0BAA0B,EAC1BC,gCAAgC,EAChCC,8BAA8B,QACzB,mBAAmB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n fluentProviderClassNames,\n FluentProvider,\n renderFluentProvider_unstable,\n useFluentProviderContextValues_unstable,\n useFluentProvider_unstable,\n useFluentProviderStyles_unstable,\n useFluentProviderThemeStyleTag,\n} from './FluentProvider';\nexport type {\n FluentProviderContextValues,\n FluentProviderCustomStyleHooks,\n FluentProviderProps,\n FluentProviderState,\n FluentProviderSlots,\n} from './FluentProvider';\n"],"names":["fluentProviderClassNames","FluentProvider","renderFluentProvider_unstable","useFluentProviderContextValues_unstable","useFluentProvider_unstable","useFluentProviderStyles_unstable","useFluentProviderThemeStyleTag"],"mappings":"AAAA,SACEA,wBAAwB,EACxBC,cAAc,EACdC,6BAA6B,EAC7BC,uCAAuC,EACvCC,0BAA0B,EAC1BC,gCAAgC,EAChCC,8BAA8B,QACzB,mBAAmB"}
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
6
  _exportStar(require("./components/FluentProvider/index"), exports);
7
- //# sourceMappingURL=FluentProvider.js.map
8
-
9
- //# sourceMappingURL=FluentProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/FluentProvider.js"],"sourcesContent":["export * from './components/FluentProvider/index';\n\n//# sourceMappingURL=FluentProvider.js.map"],"names":[],"mappings":";;;;;oBAAc;CAEd,0CAA0C"}
1
+ {"version":3,"sources":["FluentProvider.js"],"sourcesContent":["export * from './components/FluentProvider/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
@@ -18,6 +18,4 @@ const FluentProvider = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
18
18
  const contextValues = (0, _useFluentProviderContextValues.useFluentProviderContextValues_unstable)(state);
19
19
  return (0, _renderFluentProvider.renderFluentProvider_unstable)(state, contextValues);
20
20
  });
21
- FluentProvider.displayName = 'FluentProvider'; //# sourceMappingURL=FluentProvider.js.map
22
-
23
- //# sourceMappingURL=FluentProvider.js.map
21
+ FluentProvider.displayName = 'FluentProvider';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/FluentProvider/FluentProvider.js"],"sourcesContent":["import * as React from 'react';\nimport { renderFluentProvider_unstable } from './renderFluentProvider';\nimport { useFluentProvider_unstable } from './useFluentProvider';\nimport { useFluentProviderStyles_unstable } from './useFluentProviderStyles.styles';\nimport { useFluentProviderContextValues_unstable } from './useFluentProviderContextValues';\nexport const FluentProvider = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useFluentProvider_unstable(props, ref);\n useFluentProviderStyles_unstable(state);\n const contextValues = useFluentProviderContextValues_unstable(state);\n return renderFluentProvider_unstable(state, contextValues);\n});\nFluentProvider.displayName = 'FluentProvider';\n\n//# sourceMappingURL=FluentProvider.js.map"],"names":["FluentProvider","React","forwardRef","props","ref","state","useFluentProvider_unstable","useFluentProviderStyles_unstable","contextValues","useFluentProviderContextValues_unstable","renderFluentProvider_unstable","displayName"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;sCACuB;mCACH;+CACM;gDACO;AACjD,MAAMA,iBAAiB,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IACvE,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChDG,IAAAA,+DAAgC,EAACF;IACjC,MAAMG,gBAAgBC,IAAAA,uEAAuC,EAACJ;IAC9D,OAAOK,IAAAA,mDAA6B,EAACL,OAAOG;AAChD;AACAR,eAAeW,WAAW,GAAG,kBAE7B,0CAA0C"}
1
+ {"version":3,"sources":["FluentProvider.js"],"sourcesContent":["import * as React from 'react';\nimport { renderFluentProvider_unstable } from './renderFluentProvider';\nimport { useFluentProvider_unstable } from './useFluentProvider';\nimport { useFluentProviderStyles_unstable } from './useFluentProviderStyles.styles';\nimport { useFluentProviderContextValues_unstable } from './useFluentProviderContextValues';\nexport const FluentProvider = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useFluentProvider_unstable(props, ref);\n useFluentProviderStyles_unstable(state);\n const contextValues = useFluentProviderContextValues_unstable(state);\n return renderFluentProvider_unstable(state, contextValues);\n});\nFluentProvider.displayName = 'FluentProvider';\n"],"names":["FluentProvider","React","forwardRef","props","ref","state","useFluentProvider_unstable","useFluentProviderStyles_unstable","contextValues","useFluentProviderContextValues_unstable","renderFluentProvider_unstable","displayName"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;sCACuB;mCACH;+CACM;gDACO;AACjD,MAAMA,iBAAiB,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IACvE,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChDG,IAAAA,+DAAgC,EAACF;IACjC,MAAMG,gBAAgBC,IAAAA,uEAAuC,EAACJ;IAC9D,OAAOK,IAAAA,mDAA6B,EAACL,OAAOG;AAChD;AACAR,eAAeW,WAAW,GAAG"}
@@ -2,6 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- //# sourceMappingURL=FluentProvider.types.js.map
6
-
7
- //# sourceMappingURL=FluentProvider.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/FluentProvider/FluentProvider.types.js"],"sourcesContent":["export { };\n\n//# sourceMappingURL=FluentProvider.types.js.map"],"names":[],"mappings":";;;;CAEA,gDAAgD"}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -10,6 +10,3 @@ _exportStar(require("./useFluentProvider"), exports);
10
10
  _exportStar(require("./useFluentProviderStyles.styles"), exports);
11
11
  _exportStar(require("./useFluentProviderContextValues"), exports);
12
12
  _exportStar(require("./useFluentProviderThemeStyleTag"), exports);
13
- //# sourceMappingURL=index.js.map
14
-
15
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/FluentProvider/index.js"],"sourcesContent":["export * from './FluentProvider';\nexport * from './FluentProvider.types';\nexport * from './renderFluentProvider';\nexport * from './useFluentProvider';\nexport * from './useFluentProviderStyles.styles';\nexport * from './useFluentProviderContextValues';\nexport * from './useFluentProviderThemeStyleTag';\n\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;CAEd,iCAAiC"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './FluentProvider';\nexport * from './FluentProvider.types';\nexport * from './renderFluentProvider';\nexport * from './useFluentProvider';\nexport * from './useFluentProviderStyles.styles';\nexport * from './useFluentProviderContextValues';\nexport * from './useFluentProviderThemeStyleTag';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA"}
@@ -38,6 +38,4 @@ const renderFluentProvider_unstable = (state, contextValues)=>{
38
38
  },
39
39
  ...state.serverStyleProps.attributes
40
40
  }), slotProps.root.children))))))));
41
- }; //# sourceMappingURL=renderFluentProvider.js.map
42
-
43
- //# sourceMappingURL=renderFluentProvider.js.map
41
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/FluentProvider/renderFluentProvider.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { canUseDOM, getSlotsNext } from '@fluentui/react-utilities';\nimport { TextDirectionProvider } from '@griffel/react';\nimport { OverridesProvider_unstable as OverridesProvider, Provider_unstable as Provider, TooltipVisibilityProvider_unstable as TooltipVisibilityProvider, ThemeProvider_unstable as ThemeProvider, ThemeClassNameProvider_unstable as ThemeClassNameProvider, CustomStyleHooksProvider_unstable as CustomStyleHooksProvider } from '@fluentui/react-shared-contexts';\n/**\n * Render the final JSX of FluentProvider\n */ export const renderFluentProvider_unstable = (state, contextValues)=>{\n const { slots , slotProps } = getSlotsNext(state);\n // Typescript (vscode) incorrectly references the FluentProviderProps.customStyleHooks_unstable\n // instead of FluentProviderContextValues.customStyleHooks_unstable and thinks it is\n // Partial<CustomStyleHooksContextValue>, so it needs to be cast to Required<CustomStyleHooksContextValue>\n return /*#__PURE__*/ createElement(Provider, {\n value: contextValues.provider\n }, /*#__PURE__*/ createElement(ThemeProvider, {\n value: contextValues.theme\n }, /*#__PURE__*/ createElement(ThemeClassNameProvider, {\n value: contextValues.themeClassName\n }, /*#__PURE__*/ createElement(CustomStyleHooksProvider, {\n value: contextValues.customStyleHooks_unstable\n }, /*#__PURE__*/ createElement(TooltipVisibilityProvider, {\n value: contextValues.tooltip\n }, /*#__PURE__*/ createElement(TextDirectionProvider, {\n dir: contextValues.textDirection\n }, /*#__PURE__*/ createElement(OverridesProvider, {\n value: contextValues.overrides_unstable\n }, /*#__PURE__*/ createElement(slots.root, slotProps.root, canUseDOM() ? null : /*#__PURE__*/ createElement(\"style\", {\n // Using dangerous HTML because react can escape characters\n // which can lead to invalid CSS.\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML: {\n __html: state.serverStyleProps.cssRule\n },\n ...state.serverStyleProps.attributes\n }), slotProps.root.children))))))));\n};\n\n//# sourceMappingURL=renderFluentProvider.js.map"],"names":["renderFluentProvider_unstable","state","contextValues","slots","slotProps","getSlotsNext","createElement","Provider","value","provider","ThemeProvider","theme","ThemeClassNameProvider","themeClassName","CustomStyleHooksProvider","customStyleHooks_unstable","TooltipVisibilityProvider","tooltip","TextDirectionProvider","dir","textDirection","OverridesProvider","overrides_unstable","root","canUseDOM","dangerouslySetInnerHTML","__html","serverStyleProps","cssRule","attributes","children"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAMjCA;;aAAAA;;iCANkE;gCAC3C;uBACF;qCAC6R;AAGxT,MAAMA,gCAAgC,CAACC,OAAOC,gBAAgB;IACrE,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACJ;IAC5C,+FAA+F;IAC/F,oFAAoF;IACpF,0GAA0G;IAC1G,OAAO,WAAW,GAAGK,IAAAA,8BAAa,EAACC,sCAAQ,EAAE;QACzCC,OAAON,cAAcO,QAAQ;IACjC,GAAG,WAAW,GAAGH,IAAAA,8BAAa,EAACI,2CAAa,EAAE;QAC1CF,OAAON,cAAcS,KAAK;IAC9B,GAAG,WAAW,GAAGL,IAAAA,8BAAa,EAACM,oDAAsB,EAAE;QACnDJ,OAAON,cAAcW,cAAc;IACvC,GAAG,WAAW,GAAGP,IAAAA,8BAAa,EAACQ,sDAAwB,EAAE;QACrDN,OAAON,cAAca,yBAAyB;IAClD,GAAG,WAAW,GAAGT,IAAAA,8BAAa,EAACU,uDAAyB,EAAE;QACtDR,OAAON,cAAce,OAAO;IAChC,GAAG,WAAW,GAAGX,IAAAA,8BAAa,EAACY,4BAAqB,EAAE;QAClDC,KAAKjB,cAAckB,aAAa;IACpC,GAAG,WAAW,GAAGd,IAAAA,8BAAa,EAACe,+CAAiB,EAAE;QAC9Cb,OAAON,cAAcoB,kBAAkB;IAC3C,GAAG,WAAW,GAAGhB,IAAAA,8BAAa,EAACH,MAAMoB,IAAI,EAAEnB,UAAUmB,IAAI,EAAEC,IAAAA,yBAAS,MAAK,IAAI,GAAG,WAAW,GAAGlB,IAAAA,8BAAa,EAAC,SAAS;QACjH,2DAA2D;QAC3D,iCAAiC;QACjC,2CAA2C;QAC3CmB,yBAAyB;YACrBC,QAAQzB,MAAM0B,gBAAgB,CAACC,OAAO;QAC1C;QACA,GAAG3B,MAAM0B,gBAAgB,CAACE,UAAU;IACxC,EAAE,EAAEzB,UAAUmB,IAAI,CAACO,QAAQ;AAC/B,GAEA,gDAAgD"}
1
+ {"version":3,"sources":["renderFluentProvider.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { canUseDOM, getSlotsNext } from '@fluentui/react-utilities';\nimport { TextDirectionProvider } from '@griffel/react';\nimport { OverridesProvider_unstable as OverridesProvider, Provider_unstable as Provider, TooltipVisibilityProvider_unstable as TooltipVisibilityProvider, ThemeProvider_unstable as ThemeProvider, ThemeClassNameProvider_unstable as ThemeClassNameProvider, CustomStyleHooksProvider_unstable as CustomStyleHooksProvider } from '@fluentui/react-shared-contexts';\n/**\n * Render the final JSX of FluentProvider\n */ export const renderFluentProvider_unstable = (state, contextValues)=>{\n const { slots , slotProps } = getSlotsNext(state);\n // Typescript (vscode) incorrectly references the FluentProviderProps.customStyleHooks_unstable\n // instead of FluentProviderContextValues.customStyleHooks_unstable and thinks it is\n // Partial<CustomStyleHooksContextValue>, so it needs to be cast to Required<CustomStyleHooksContextValue>\n return /*#__PURE__*/ createElement(Provider, {\n value: contextValues.provider\n }, /*#__PURE__*/ createElement(ThemeProvider, {\n value: contextValues.theme\n }, /*#__PURE__*/ createElement(ThemeClassNameProvider, {\n value: contextValues.themeClassName\n }, /*#__PURE__*/ createElement(CustomStyleHooksProvider, {\n value: contextValues.customStyleHooks_unstable\n }, /*#__PURE__*/ createElement(TooltipVisibilityProvider, {\n value: contextValues.tooltip\n }, /*#__PURE__*/ createElement(TextDirectionProvider, {\n dir: contextValues.textDirection\n }, /*#__PURE__*/ createElement(OverridesProvider, {\n value: contextValues.overrides_unstable\n }, /*#__PURE__*/ createElement(slots.root, slotProps.root, canUseDOM() ? null : /*#__PURE__*/ createElement(\"style\", {\n // Using dangerous HTML because react can escape characters\n // which can lead to invalid CSS.\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML: {\n __html: state.serverStyleProps.cssRule\n },\n ...state.serverStyleProps.attributes\n }), slotProps.root.children))))))));\n};\n"],"names":["renderFluentProvider_unstable","state","contextValues","slots","slotProps","getSlotsNext","createElement","Provider","value","provider","ThemeProvider","theme","ThemeClassNameProvider","themeClassName","CustomStyleHooksProvider","customStyleHooks_unstable","TooltipVisibilityProvider","tooltip","TextDirectionProvider","dir","textDirection","OverridesProvider","overrides_unstable","root","canUseDOM","dangerouslySetInnerHTML","__html","serverStyleProps","cssRule","attributes","children"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAMjCA;;aAAAA;;iCANkE;gCAC3C;uBACF;qCAC6R;AAGxT,MAAMA,gCAAgC,CAACC,OAAOC,gBAAgB;IACrE,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACJ;IAC5C,+FAA+F;IAC/F,oFAAoF;IACpF,0GAA0G;IAC1G,OAAO,WAAW,GAAGK,IAAAA,8BAAa,EAACC,sCAAQ,EAAE;QACzCC,OAAON,cAAcO,QAAQ;IACjC,GAAG,WAAW,GAAGH,IAAAA,8BAAa,EAACI,2CAAa,EAAE;QAC1CF,OAAON,cAAcS,KAAK;IAC9B,GAAG,WAAW,GAAGL,IAAAA,8BAAa,EAACM,oDAAsB,EAAE;QACnDJ,OAAON,cAAcW,cAAc;IACvC,GAAG,WAAW,GAAGP,IAAAA,8BAAa,EAACQ,sDAAwB,EAAE;QACrDN,OAAON,cAAca,yBAAyB;IAClD,GAAG,WAAW,GAAGT,IAAAA,8BAAa,EAACU,uDAAyB,EAAE;QACtDR,OAAON,cAAce,OAAO;IAChC,GAAG,WAAW,GAAGX,IAAAA,8BAAa,EAACY,4BAAqB,EAAE;QAClDC,KAAKjB,cAAckB,aAAa;IACpC,GAAG,WAAW,GAAGd,IAAAA,8BAAa,EAACe,+CAAiB,EAAE;QAC9Cb,OAAON,cAAcoB,kBAAkB;IAC3C,GAAG,WAAW,GAAGhB,IAAAA,8BAAa,EAACH,MAAMoB,IAAI,EAAEnB,UAAUmB,IAAI,EAAEC,IAAAA,yBAAS,MAAK,IAAI,GAAG,WAAW,GAAGlB,IAAAA,8BAAa,EAAC,SAAS;QACjH,2DAA2D;QAC3D,iCAAiC;QACjC,2CAA2C;QAC3CmB,yBAAyB;YACrBC,QAAQzB,MAAM0B,gBAAgB,CAACC,OAAO;QAC1C;QACA,GAAG3B,MAAM0B,gBAAgB,CAACE,UAAU;IACxC,EAAE,EAAEzB,UAAUmB,IAAI,CAACO,QAAQ;AAC/B"}
@@ -88,6 +88,4 @@ function shallowMerge(a, b) {
88
88
  }
89
89
  function useTheme() {
90
90
  return _react.useContext(_reactSharedContexts.ThemeContext_unstable);
91
- } //# sourceMappingURL=useFluentProvider.js.map
92
-
93
- //# sourceMappingURL=useFluentProvider.js.map
91
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/FluentProvider/useFluentProvider.js"],"sourcesContent":["import { useFocusVisible } from '@fluentui/react-tabster';\nimport { ThemeContext_unstable as ThemeContext, useFluent_unstable as useFluent, useOverrides_unstable as useOverrides, CustomStyleHooksContext_unstable as CustomStyleHooksContext } from '@fluentui/react-shared-contexts';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\nimport { useRenderer_unstable } from '@griffel/react';\n/**\n * Create the state required to render FluentProvider.\n *\n * The returned state can be modified with hooks such as useFluentProviderStyles_unstable,\n * before being passed to renderFluentProvider_unstable.\n *\n * @param props - props from this instance of FluentProvider\n * @param ref - reference to root HTMLElement of FluentProvider\n */ export const useFluentProvider_unstable = (props, ref)=>{\n const parentContext = useFluent();\n const parentTheme = useTheme();\n const parentOverrides = useOverrides();\n const parentCustomStyleHooks = React.useContext(CustomStyleHooksContext) || {};\n /**\n * TODO: add merge functions to \"dir\" merge,\n * nesting providers with the same \"dir\" should not add additional attributes to DOM\n * see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93\n */ const { applyStylesToPortals =true , // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable , dir =parentContext.dir , targetDocument =parentContext.targetDocument , theme , overrides_unstable: overrides = {} } = props;\n const mergedTheme = shallowMerge(parentTheme, theme);\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n const mergedCustomStyleHooks = shallowMerge(parentCustomStyleHooks, customStyleHooks_unstable);\n React.useEffect(()=>{\n if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`\n FluentProvider: your \"theme\" is not defined !\n =============================================\n Make sure your root FluentProvider has set a theme or you're setting the theme in your child FluentProvider.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n const renderer = useRenderer_unstable();\n var _renderer_styleElementAttributes;\n const { styleTagId , rule } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: (_renderer_styleElementAttributes = renderer.styleElementAttributes) !== null && _renderer_styleElementAttributes !== void 0 ? _renderer_styleElementAttributes : {}\n });\n return {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable: mergedCustomStyleHooks,\n dir,\n targetDocument,\n theme: mergedTheme,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable: mergedOverrides,\n themeClassName: styleTagId,\n components: {\n root: 'div'\n },\n root: getNativeElementProps('div', {\n ...props,\n dir,\n ref: useMergedRefs(ref, useFocusVisible({\n targetDocument\n }))\n }),\n serverStyleProps: {\n cssRule: rule,\n attributes: {\n ...renderer.styleElementAttributes,\n id: styleTagId\n }\n }\n };\n};\nfunction shallowMerge(a, b) {\n // Merge impacts perf: we should like to avoid it if it's possible\n if (a && b) {\n return {\n ...a,\n ...b\n };\n }\n if (a) {\n return a;\n }\n return b;\n}\nfunction useTheme() {\n return React.useContext(ThemeContext);\n}\n\n//# sourceMappingURL=useFluentProvider.js.map"],"names":["useFluentProvider_unstable","props","ref","parentContext","useFluent","parentTheme","useTheme","parentOverrides","useOverrides","parentCustomStyleHooks","React","useContext","CustomStyleHooksContext","applyStylesToPortals","customStyleHooks_unstable","dir","targetDocument","theme","overrides_unstable","overrides","mergedTheme","shallowMerge","mergedOverrides","mergedCustomStyleHooks","useEffect","process","env","NODE_ENV","undefined","console","warn","renderer","useRenderer_unstable","_renderer_styleElementAttributes","styleTagId","rule","useFluentProviderThemeStyleTag","rendererAttributes","styleElementAttributes","themeClassName","components","root","getNativeElementProps","useMergedRefs","useFocusVisible","serverStyleProps","cssRule","attributes","id","a","b","ThemeContext"],"mappings":";;;;+BAciBA;;aAAAA;;;8BAde;qCAC2J;gCACtI;6DAC9B;gDACwB;wBACV;AAS1B,MAAMA,6BAA6B,CAACC,OAAOC,MAAM;IACxD,MAAMC,gBAAgBC,IAAAA,uCAAS;IAC/B,MAAMC,cAAcC;IACpB,MAAMC,kBAAkBC,IAAAA,0CAAY;IACpC,MAAMC,yBAAyBC,OAAMC,UAAU,CAACC,qDAAuB,KAAK,CAAC;IAC7E;;;;GAID,GAAG,MAAM,EAAEC,sBAAsB,IAAI,CAAA,EACpCC,0BAAyB,EAAGC,KAAKZ,cAAcY,GAAG,CAAA,EAAGC,gBAAgBb,cAAca,cAAc,CAAA,EAAGC,MAAK,EAAGC,oBAAoBC,YAAY,CAAC,CAAC,CAAA,EAAG,GAAGlB;IACpJ,MAAMmB,cAAcC,aAAahB,aAAaY;IAC9C,MAAMK,kBAAkBD,aAAad,iBAAiBY;IACtD,MAAMI,yBAAyBF,aAAaZ,wBAAwBK;IACpEJ,OAAMc,SAAS,CAAC,IAAI;QAChB,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBAAgBP,gBAAgBQ,WAAW;YACpE,sCAAsC;YACtCC,QAAQC,IAAI,CAAC,CAAC;;;;MAIpB,CAAC;QACC,CAAC;IACL,uDAAuD;IACvD,GAAG,EAAE;IACL,MAAMC,WAAWC,IAAAA,4BAAoB;IACrC,IAAIC;IACJ,MAAM,EAAEC,WAAU,EAAGC,KAAI,EAAG,GAAGC,IAAAA,8DAA8B,EAAC;QAC1DnB,OAAOG;QACPJ;QACAqB,oBAAoB,AAACJ,CAAAA,mCAAmCF,SAASO,sBAAsB,AAAD,MAAO,IAAI,IAAIL,qCAAqC,KAAK,IAAIA,mCAAmC,CAAC,CAAC;IAC5L;IACA,OAAO;QACHpB;QACA,gEAAgE;QAChEC,2BAA2BS;QAC3BR;QACAC;QACAC,OAAOG;QACP,gEAAgE;QAChEF,oBAAoBI;QACpBiB,gBAAgBL;QAChBM,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,IAAAA,qCAAqB,EAAC,OAAO;YAC/B,GAAGzC,KAAK;YACRc;YACAb,KAAKyC,IAAAA,6BAAa,EAACzC,KAAK0C,IAAAA,6BAAe,EAAC;gBACpC5B;YACJ;QACJ;QACA6B,kBAAkB;YACdC,SAASX;YACTY,YAAY;gBACR,GAAGhB,SAASO,sBAAsB;gBAClCU,IAAId;YACR;QACJ;IACJ;AACJ;AACA,SAASb,aAAa4B,CAAC,EAAEC,CAAC,EAAE;IACxB,kEAAkE;IAClE,IAAID,KAAKC,GAAG;QACR,OAAO;YACH,GAAGD,CAAC;YACJ,GAAGC,CAAC;QACR;IACJ,CAAC;IACD,IAAID,GAAG;QACH,OAAOA;IACX,CAAC;IACD,OAAOC;AACX;AACA,SAAS5C,WAAW;IAChB,OAAOI,OAAMC,UAAU,CAACwC,0CAAY;AACxC,EAEA,6CAA6C"}
1
+ {"version":3,"sources":["useFluentProvider.js"],"sourcesContent":["import { useFocusVisible } from '@fluentui/react-tabster';\nimport { ThemeContext_unstable as ThemeContext, useFluent_unstable as useFluent, useOverrides_unstable as useOverrides, CustomStyleHooksContext_unstable as CustomStyleHooksContext } from '@fluentui/react-shared-contexts';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluentProviderThemeStyleTag } from './useFluentProviderThemeStyleTag';\nimport { useRenderer_unstable } from '@griffel/react';\n/**\n * Create the state required to render FluentProvider.\n *\n * The returned state can be modified with hooks such as useFluentProviderStyles_unstable,\n * before being passed to renderFluentProvider_unstable.\n *\n * @param props - props from this instance of FluentProvider\n * @param ref - reference to root HTMLElement of FluentProvider\n */ export const useFluentProvider_unstable = (props, ref)=>{\n const parentContext = useFluent();\n const parentTheme = useTheme();\n const parentOverrides = useOverrides();\n const parentCustomStyleHooks = React.useContext(CustomStyleHooksContext) || {};\n /**\n * TODO: add merge functions to \"dir\" merge,\n * nesting providers with the same \"dir\" should not add additional attributes to DOM\n * see https://github.com/microsoft/fluentui/blob/0dc74a19f3aa5a058224c20505016fbdb84db172/packages/fluentui/react-northstar/src/utils/mergeProviderContexts.ts#L89-L93\n */ const { applyStylesToPortals =true , // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable , dir =parentContext.dir , targetDocument =parentContext.targetDocument , theme , overrides_unstable: overrides = {} } = props;\n const mergedTheme = shallowMerge(parentTheme, theme);\n const mergedOverrides = shallowMerge(parentOverrides, overrides);\n const mergedCustomStyleHooks = shallowMerge(parentCustomStyleHooks, customStyleHooks_unstable);\n React.useEffect(()=>{\n if (process.env.NODE_ENV !== 'production' && mergedTheme === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`\n FluentProvider: your \"theme\" is not defined !\n =============================================\n Make sure your root FluentProvider has set a theme or you're setting the theme in your child FluentProvider.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n const renderer = useRenderer_unstable();\n var _renderer_styleElementAttributes;\n const { styleTagId , rule } = useFluentProviderThemeStyleTag({\n theme: mergedTheme,\n targetDocument,\n rendererAttributes: (_renderer_styleElementAttributes = renderer.styleElementAttributes) !== null && _renderer_styleElementAttributes !== void 0 ? _renderer_styleElementAttributes : {}\n });\n return {\n applyStylesToPortals,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable: mergedCustomStyleHooks,\n dir,\n targetDocument,\n theme: mergedTheme,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable: mergedOverrides,\n themeClassName: styleTagId,\n components: {\n root: 'div'\n },\n root: getNativeElementProps('div', {\n ...props,\n dir,\n ref: useMergedRefs(ref, useFocusVisible({\n targetDocument\n }))\n }),\n serverStyleProps: {\n cssRule: rule,\n attributes: {\n ...renderer.styleElementAttributes,\n id: styleTagId\n }\n }\n };\n};\nfunction shallowMerge(a, b) {\n // Merge impacts perf: we should like to avoid it if it's possible\n if (a && b) {\n return {\n ...a,\n ...b\n };\n }\n if (a) {\n return a;\n }\n return b;\n}\nfunction useTheme() {\n return React.useContext(ThemeContext);\n}\n"],"names":["useFluentProvider_unstable","props","ref","parentContext","useFluent","parentTheme","useTheme","parentOverrides","useOverrides","parentCustomStyleHooks","React","useContext","CustomStyleHooksContext","applyStylesToPortals","customStyleHooks_unstable","dir","targetDocument","theme","overrides_unstable","overrides","mergedTheme","shallowMerge","mergedOverrides","mergedCustomStyleHooks","useEffect","process","env","NODE_ENV","undefined","console","warn","renderer","useRenderer_unstable","_renderer_styleElementAttributes","styleTagId","rule","useFluentProviderThemeStyleTag","rendererAttributes","styleElementAttributes","themeClassName","components","root","getNativeElementProps","useMergedRefs","useFocusVisible","serverStyleProps","cssRule","attributes","id","a","b","ThemeContext"],"mappings":";;;;+BAciBA;;aAAAA;;;8BAde;qCAC2J;gCACtI;6DAC9B;gDACwB;wBACV;AAS1B,MAAMA,6BAA6B,CAACC,OAAOC,MAAM;IACxD,MAAMC,gBAAgBC,IAAAA,uCAAS;IAC/B,MAAMC,cAAcC;IACpB,MAA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C,SAASX;YACTY,YAAY;gBACR,GAAGhB,SAASO,sBAAsB;gBAClCU,IAAId;YACR;QACJ;IACJ;AACJ;AACA,SAASb,aAAa4B,CAAC,EAAEC,CAAC,EAAE;IACxB,kEAAkE;IAClE,IAAID,KAAKC,GAAG;QACR,OAAO;YACH,GAAGD,CAAC;YACJ,GAAGC,CAAC;QACR;IACJ,CAAC;IACD,IAAID,GAAG;QACH,OAAOA;IACX,CAAC;IACD,OAAOC;AACX;AACA,SAAS5C,WAAW;IAChB,OAAOI,OAAMC,UAAU,CAACwC,0CAAY;AACxC"}
@@ -31,6 +31,4 @@ function useFluentProviderContextValues_unstable(state) {
31
31
  theme,
32
32
  themeClassName: applyStylesToPortals ? root.className : themeClassName
33
33
  };
34
- } //# sourceMappingURL=useFluentProviderContextValues.js.map
35
-
36
- //# sourceMappingURL=useFluentProviderContextValues.js.map
34
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/FluentProvider/useFluentProviderContextValues.js"],"sourcesContent":["import * as React from 'react';\nexport function useFluentProviderContextValues_unstable(state) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { applyStylesToPortals , // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable , dir , root , targetDocument , theme , themeClassName , // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable } = state;\n const provider = React.useMemo(()=>({\n dir,\n targetDocument\n }), [\n dir,\n targetDocument\n ]);\n // \"Tooltip\" component mutates an object in this context, instance should be stable\n const [tooltip] = React.useState(()=>({}));\n return {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable,\n provider,\n textDirection: dir,\n tooltip,\n theme,\n themeClassName: applyStylesToPortals ? root.className : themeClassName\n };\n}\n\n//# sourceMappingURL=useFluentProviderContextValues.js.map"],"names":["useFluentProviderContextValues_unstable","state","applyStylesToPortals","customStyleHooks_unstable","dir","root","targetDocument","theme","themeClassName","overrides_unstable","provider","React","useMemo","tooltip","useState","textDirection","className"],"mappings":";;;;+BACgBA;;aAAAA;;;6DADO;AAChB,SAASA,wCAAwCC,KAAK,EAAE;IAC3D,gEAAgE;IAChE,MAAM,EAAEC,qBAAoB,EAC5BC,0BAAyB,EAAGC,IAAG,EAAGC,KAAI,EAAGC,eAAc,EAAGC,MAAK,EAAGC,eAAc,EAChFC,mBAAkB,EAAG,GAAGR;IACxB,MAAMS,WAAWC,OAAMC,OAAO,CAAC,IAAK,CAAA;YAC5BR;YACAE;QACJ,CAAA,GAAI;QACJF;QACAE;KACH;IACD,mFAAmF;IACnF,MAAM,CAACO,QAAQ,GAAGF,OAAMG,QAAQ,CAAC,IAAK,CAAA,CAAC,CAAA;IACvC,OAAO;QACH,gEAAgE;QAChEX;QACA,gEAAgE;QAChEM;QACAC;QACAK,eAAeX;QACfS;QACAN;QACAC,gBAAgBN,uBAAuBG,KAAKW,SAAS,GAAGR,cAAc;IAC1E;AACJ,EAEA,0DAA0D"}
1
+ {"version":3,"sources":["useFluentProviderContextValues.js"],"sourcesContent":["import * as React from 'react';\nexport function useFluentProviderContextValues_unstable(state) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { applyStylesToPortals , // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable , dir , root , targetDocument , theme , themeClassName , // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable } = state;\n const provider = React.useMemo(()=>({\n dir,\n targetDocument\n }), [\n dir,\n targetDocument\n ]);\n // \"Tooltip\" component mutates an object in this context, instance should be stable\n const [tooltip] = React.useState(()=>({}));\n return {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n customStyleHooks_unstable,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n overrides_unstable,\n provider,\n textDirection: dir,\n tooltip,\n theme,\n themeClassName: applyStylesToPortals ? root.className : themeClassName\n };\n}\n"],"names":["useFluentProviderContextValues_unstable","state","applyStylesToPortals","customStyleHooks_unstable","dir","root","targetDocument","theme","themeClassName","overrides_unstable","provider","React","useMemo","tooltip","useState","textDirection","className"],"mappings":";;;;+BACgBA;;aAAAA;;;6DADO;AAChB,SAASA,wCAAwCC,KAAK,EAAE;IAC3D,gEAAgE;IAChE,MAAM,EAAEC,qBAAoB,EAC5BC,0BAAyB,EAAGC,IAAG,EAAGC,KAAI,EAAGC,eAAc,EAAGC,MAAK,EAAGC,eAAc,EAChFC,mBAAkB,EAAG,GAAGR;IACxB,MAAMS,WAAWC,OAAMC,OAAO,CAAC,IAAK,CAAA;YAC5BR;YACAE;QACJ,CAAA,GAAI;QACJF;QACAE;KACH;IACD,mFAAmF;IACnF,MAAM,CAACO,QAAQ,GAAGF,OAAMG,QAAQ,CAAC,IAAK,CAAA,CAAC,CAAA;IACvC,OAAO;QACH,gEAAgE;QAChEX;QACA,gEAAgE;QAChEM;QACAC;QACAK,eAAeX;QACfS;QACAN;QACAC,gBAAgBN,uBAAuBG,KAAKW,SAAS,GAAGR,cAAc;IAC1E;AACJ"}
@@ -51,5 +51,3 @@ const useFluentProviderStyles_unstable = (state)=>{
51
51
  state.root.className = (0, _core.mergeClasses)(fluentProviderClassNames.root, state.themeClassName, styles.root, state.root.className);
52
52
  return state;
53
53
  }; //# sourceMappingURL=useFluentProviderStyles.styles.js.map
54
-
55
- //# sourceMappingURL=useFluentProviderStyles.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/FluentProvider/useFluentProviderStyles.styles.js"],"sourcesContent":["import { __styles, mergeClasses } from '@griffel/core';\nimport { useRenderer_unstable } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const fluentProviderClassNames = {\n root: 'fui-FluentProvider'\n};\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f19n0e5\",\n De3pzq: \"fxugw4r\",\n fsow6f: [\"f1o700av\", \"fes3tcz\"],\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fkhj508\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"f1i3iumi\"\n }\n}, {\n d: [\".f19n0e5{color:var(--colorNeutralForeground1);}\", \".fxugw4r{background-color:var(--colorNeutralBackground1);}\", \".f1o700av{text-align:left;}\", \".fes3tcz{text-align:right;}\", \".fk6fouc{font-family:var(--fontFamilyBase);}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".figsok6{font-weight:var(--fontWeightRegular);}\", \".f1i3iumi{line-height:var(--lineHeightBase300);}\"]\n});\n/** Applies style classnames to slots */\nexport const useFluentProviderStyles_unstable = state => {\n const renderer = useRenderer_unstable();\n const styles = useStyles({\n dir: state.dir,\n renderer\n });\n state.root.className = mergeClasses(fluentProviderClassNames.root, state.themeClassName, styles.root, state.root.className);\n return state;\n};\n//# sourceMappingURL=useFluentProviderStyles.styles.js.map"],"names":["fluentProviderClassNames","useFluentProviderStyles_unstable","root","useStyles","__styles","sj55zd","De3pzq","fsow6f","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","state","renderer","useRenderer_unstable","styles","dir","className","mergeClasses","themeClassName"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB,MAAxBA;IAiBAC,gCAAgC,MAAhCA;;sBApB0B;uBACF;AAE9B,MAAMD,2BAA2B;IACtCE,MAAM;AACR;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,iBAAQ,EAAC;IACtCF,MAAM;QACJG,QAAQ;QACRC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAU;QAC/BC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAAmD;QAA8D;QAA+B;QAA+B;QAAgD;QAA+C;QAAmD;KAAmD;AAC1X;AAEO,MAAMX,mCAAmCY,CAAAA,QAAS;IACvD,MAAMC,WAAWC,IAAAA,2BAAoB;IACrC,MAAMC,SAASb,UAAU;QACvBc,KAAKJ,MAAMI,GAAG;QACdH;IACF;IACAD,MAAMX,IAAI,CAACgB,SAAS,GAAGC,IAAAA,kBAAY,EAACnB,yBAAyBE,IAAI,EAAEW,MAAMO,cAAc,EAAEJ,OAAOd,IAAI,EAAEW,MAAMX,IAAI,CAACgB,SAAS;IAC1H,OAAOL;AACT,GACA,0DAA0D"}
1
+ {"version":3,"sources":["useFluentProviderStyles.styles.js"],"sourcesContent":["import { __styles, mergeClasses } from '@griffel/core';\nimport { useRenderer_unstable } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const fluentProviderClassNames = {\n root: 'fui-FluentProvider'\n};\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f19n0e5\",\n De3pzq: \"fxugw4r\",\n fsow6f: [\"f1o700av\", \"fes3tcz\"],\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fkhj508\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"f1i3iumi\"\n }\n}, {\n d: [\".f19n0e5{color:var(--colorNeutralForeground1);}\", \".fxugw4r{background-color:var(--colorNeutralBackground1);}\", \".f1o700av{text-align:left;}\", \".fes3tcz{text-align:right;}\", \".fk6fouc{font-family:var(--fontFamilyBase);}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".figsok6{font-weight:var(--fontWeightRegular);}\", \".f1i3iumi{line-height:var(--lineHeightBase300);}\"]\n});\n/** Applies style classnames to slots */\nexport const useFluentProviderStyles_unstable = state => {\n const renderer = useRenderer_unstable();\n const styles = useStyles({\n dir: state.dir,\n renderer\n });\n state.root.className = mergeClasses(fluentProviderClassNames.root, state.themeClassName, styles.root, state.root.className);\n return state;\n};\n//# sourceMappingURL=useFluentProviderStyles.styles.js.map"],"names":["fluentProviderClassNames","useFluentProviderStyles_unstable","root","useStyles","__styles","sj55zd","De3pzq","fsow6f","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","state","renderer","useRenderer_unstable","styles","dir","className","mergeClasses","themeClassName"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB,MAAxBA;IAiBAC,gCAAgC,MAAhCA;;sBApB0B;uBACF;AAE9B,MAAMD,2BAA2B;IACtCE,MAAM;AACR;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,iBAAQ,EAAC;IACtCF,MAAM;QACJG,QAAQ;QACRC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAU;QAC/BC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAAmD;QAA8D;QAA+B;QAA+B;QAAgD;QAA+C;QAAmD;KAAmD;AAC1X;AAEO,MAAMX,mCAAmCY,CAAAA,QAAS;IACvD,MAAMC,WAAWC,IAAAA,2BAAoB;IACrC,MAAMC,SAASb,UAAU;QACvBc,KAAKJ,MAAMI,GAAG;QACdH;IACF;IACAD,MAAMX,IAAI,CAACgB,SAAS,GAAGC,IAAAA,kBAAY,EAACnB,yBAAyBE,IAAI,EAAEW,MAAMO,cAAc,EAAEJ,OAAOd,IAAI,EAAEW,MAAMX,IAAI,CAACgB,SAAS;IAC1H,OAAOL;AACT,GACA,0DAA0D"}
@@ -93,6 +93,4 @@ function useHandleSSRStyleElements(targetDocument, styleTagId) {
93
93
  targetDocument.head.append(themeStyleElement);
94
94
  }
95
95
  });
96
- } //# sourceMappingURL=useFluentProviderThemeStyleTag.js.map
97
-
98
- //# sourceMappingURL=useFluentProviderThemeStyleTag.js.map
96
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/FluentProvider/useFluentProviderThemeStyleTag.js"],"sourcesContent":["import { useId, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { fluentProviderClassNames } from './useFluentProviderStyles.styles';\n// String concatenation is used to prevent bundlers to complain with older versions of React\nconst useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : useIsomorphicLayoutEffect;\nconst createStyleTag = (target, elementAttributes)=>{\n if (!target) {\n return undefined;\n }\n const tag = target.createElement('style');\n Object.keys(elementAttributes).forEach((attrName)=>{\n tag.setAttribute(attrName, elementAttributes[attrName]);\n });\n target.head.appendChild(tag);\n return tag;\n};\nconst insertSheet = (tag, rule)=>{\n const sheet = tag.sheet;\n if (sheet) {\n if (sheet.cssRules.length > 0) {\n sheet.deleteRule(0);\n }\n sheet.insertRule(rule, 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 * Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class\n * @internal\n * @returns CSS class to apply the rule\n */ export const useFluentProviderThemeStyleTag = (options)=>{\n const { targetDocument , theme , rendererAttributes } = options;\n const styleTag = React.useRef();\n const styleTagId = useId(fluentProviderClassNames.root);\n const styleElementAttributes = rendererAttributes;\n const cssVarsAsString = React.useMemo(()=>{\n return theme ? Object.keys(theme).reduce((cssVarRule, cssVar)=>{\n cssVarRule += `--${cssVar}: ${theme[cssVar]}; `;\n return cssVarRule;\n }, '') : '';\n }, [\n theme\n ]);\n const rule = `.${styleTagId} { ${cssVarsAsString} }`;\n useHandleSSRStyleElements(targetDocument, styleTagId);\n useInsertionEffect(()=>{\n // The style element could already have been created during SSR - no need to recreate it\n const ssrStyleElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.getElementById(styleTagId);\n if (ssrStyleElement) {\n styleTag.current = ssrStyleElement;\n } else {\n styleTag.current = createStyleTag(targetDocument, {\n ...styleElementAttributes,\n id: styleTagId\n });\n if (styleTag.current) {\n insertSheet(styleTag.current, rule);\n }\n }\n return ()=>{\n var _styleTag_current;\n (_styleTag_current = styleTag.current) === null || _styleTag_current === void 0 ? void 0 : _styleTag_current.remove();\n };\n }, [\n styleTagId,\n targetDocument,\n rule,\n styleElementAttributes\n ]);\n return {\n styleTagId,\n rule\n };\n};\nfunction useHandleSSRStyleElements(targetDocument, styleTagId) {\n // Using a state factory so that this logic only runs once per render\n // Each FluentProvider can create its own style element during SSR as a slot\n // Moves all theme style elements to document head during render to avoid hydration errors.\n // Should be strict mode safe since the logic is idempotent.\n React.useState(()=>{\n if (!targetDocument) {\n return;\n }\n const themeStyleElement = targetDocument.getElementById(styleTagId);\n if (themeStyleElement) {\n targetDocument.head.append(themeStyleElement);\n }\n });\n}\n\n//# sourceMappingURL=useFluentProviderThemeStyleTag.js.map"],"names":["useFluentProviderThemeStyleTag","useInsertionEffect","React","useIsomorphicLayoutEffect","createStyleTag","target","elementAttributes","undefined","tag","createElement","Object","keys","forEach","attrName","setAttribute","head","appendChild","insertSheet","rule","sheet","cssRules","length","deleteRule","insertRule","process","env","NODE_ENV","console","error","options","targetDocument","theme","rendererAttributes","styleTag","useRef","styleTagId","useId","fluentProviderClassNames","root","styleElementAttributes","cssVarsAsString","useMemo","reduce","cssVarRule","cssVar","useHandleSSRStyleElements","ssrStyleElement","getElementById","current","id","_styleTag_current","remove","useState","themeStyleElement","append"],"mappings":";;;;+BAgCiBA;;aAAAA;;;gCAhCgC;6DAC1B;+CACkB;AACzC,4FAA4F;AAC5F,MAAMC,qBAAqBC,MAAK,CAAC,iBAAiB,SAAS,GAAGA,MAAK,CAAC,iBAAiB,SAAS,GAAGC,yCAAyB;AAC1H,MAAMC,iBAAiB,CAACC,QAAQC,oBAAoB;IAChD,IAAI,CAACD,QAAQ;QACT,OAAOE;IACX,CAAC;IACD,MAAMC,MAAMH,OAAOI,aAAa,CAAC;IACjCC,OAAOC,IAAI,CAACL,mBAAmBM,OAAO,CAAC,CAACC,WAAW;QAC/CL,IAAIM,YAAY,CAACD,UAAUP,iBAAiB,CAACO,SAAS;IAC1D;IACAR,OAAOU,IAAI,CAACC,WAAW,CAACR;IACxB,OAAOA;AACX;AACA,MAAMS,cAAc,CAACT,KAAKU,OAAO;IAC7B,MAAMC,QAAQX,IAAIW,KAAK;IACvB,IAAIA,OAAO;QACP,IAAIA,MAAMC,QAAQ,CAACC,MAAM,GAAG,GAAG;YAC3BF,MAAMG,UAAU,CAAC;QACrB,C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IAAI,IAAIE,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBC,MAAM,EAAE;QACzH;IACJ,GAAG;QACChB;QACAL;QACAZ;QACAqB;KACH;IACD,OAAO;QACHJ;QACAjB;IACJ;AACJ;AACA,SAAS2B,0BAA0Bf,cAAc,EAAEK,UAAU,EAAE;IAC3D,qEAAqE;IACrE,4EAA4E;IAC5E,2FAA2F;IAC3F,4DAA4D;IAC5DjC,OAAMkD,QAAQ,CAAC,IAAI;QACf,IAAI,CAACtB,gBAAgB;YACjB;QACJ,CAAC;QACD,MAAMuB,oBAAoBvB,eAAeiB,cAAc,CAACZ;QACxD,IAAIkB,mBAAmB;YACnBvB,eAAef,IAAI,CAACuC,MAAM,CAACD;QAC/B,CAAC;IACL;AACJ,EAEA,0DAA0D"}
1
+ {"version":3,"sources":["useFluentProviderThemeStyleTag.js"],"sourcesContent":["import { useId, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { fluentProviderClassNames } from './useFluentProviderStyles.styles';\n// String concatenation is used to prevent bundlers to complain with older versions of React\nconst useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : useIsomorphicLayoutEffect;\nconst createStyleTag = (target, elementAttributes)=>{\n if (!target) {\n return undefined;\n }\n const tag = target.createElement('style');\n Object.keys(elementAttributes).forEach((attrName)=>{\n tag.setAttribute(attrName, elementAttributes[attrName]);\n });\n target.head.appendChild(tag);\n return tag;\n};\nconst insertSheet = (tag, rule)=>{\n const sheet = tag.sheet;\n if (sheet) {\n if (sheet.cssRules.length > 0) {\n sheet.deleteRule(0);\n }\n sheet.insertRule(rule, 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 * Writes a theme as css variables in a style tag on the provided targetDocument as a rule applied to a CSS class\n * @internal\n * @returns CSS class to apply the rule\n */ export const useFluentProviderThemeStyleTag = (options)=>{\n const { targetDocument , theme , rendererAttributes } = options;\n const styleTag = React.useRef();\n const styleTagId = useId(fluentProviderClassNames.root);\n const styleElementAttributes = rendererAttributes;\n const cssVarsAsString = React.useMemo(()=>{\n return theme ? Object.keys(theme).reduce((cssVarRule, cssVar)=>{\n cssVarRule += `--${cssVar}: ${theme[cssVar]}; `;\n return cssVarRule;\n }, '') : '';\n }, [\n theme\n ]);\n const rule = `.${styleTagId} { ${cssVarsAsString} }`;\n useHandleSSRStyleElements(targetDocument, styleTagId);\n useInsertionEffect(()=>{\n // The style element could already have been created during SSR - no need to recreate it\n const ssrStyleElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.getElementById(styleTagId);\n if (ssrStyleElement) {\n styleTag.current = ssrStyleElement;\n } else {\n styleTag.current = createStyleTag(targetDocument, {\n ...styleElementAttributes,\n id: styleTagId\n });\n if (styleTag.current) {\n insertSheet(styleTag.current, rule);\n }\n }\n return ()=>{\n var _styleTag_current;\n (_styleTag_current = styleTag.current) === null || _styleTag_current === void 0 ? void 0 : _styleTag_current.remove();\n };\n }, [\n styleTagId,\n targetDocument,\n rule,\n styleElementAttributes\n ]);\n return {\n styleTagId,\n rule\n };\n};\nfunction useHandleSSRStyleElements(targetDocument, styleTagId) {\n // Using a state factory so that this logic only runs once per render\n // Each FluentProvider can create its own style element during SSR as a slot\n // Moves all theme style elements to document head during render to avoid hydration errors.\n // Should be strict mode safe since the logic is idempotent.\n React.useState(()=>{\n if (!targetDocument) {\n return;\n }\n const themeStyleElement = targetDocument.getElementById(styleTagId);\n if (themeStyleElement) {\n targetDocument.head.append(themeStyleElement);\n }\n });\n}\n"],"names":["useFluentProviderThemeStyleTag","useInsertionEffect","React","useIsomorphicLayoutEffect","createStyleTag","target","elementAttributes","undefined","tag","createElement","Object","keys","forEach","attrName","setAttribute","head","appendChild","insertSheet","rule","sheet","cssRules","length","deleteRule","insertRule","process","env","NODE_ENV","console","error","options","targetDocument","theme","rendererAttributes","styleTag","useRef","styleTagId","useId","fluentProviderClassNames","root","styleElementAttributes","cssVarsAsString","useMemo","reduce","cssVarRule","cssVar","useHandleSSRStyleElements","ssrStyleElement","getElementById","current","id","_styleTag_current","remove","useState","themeStyleElement","append"],"mappings":";;;;+BAgCiBA;;aAAAA;;;gCAhCgC;6DAC1B;+CACkB;AACzC,4FAA4F;AAC5F,MAAMC,qBAAqBC,MAAK,CAAC,iBAAiB,SAAS,GAAGA,MAAK,CAAC,iBAAiB,SAAS,GAAGC,yCAAyB;AAC1H,MAAMC,iBAAiB,CAACC,QAAQC,oBAAoB;IAChD,IAAI,CAACD,QAAQ;QACT,OAAOE;IACX,CAAC;IACD,MAAMC,MAAMH,OAAOI,aAAa,CAAC;IACjCC,OAAOC,IAAI,CAACL,mBAAmBM,OAAO,CAAC,CAACC,WAAW;QAC/CL,IAAIM,YAAY,CAACD,UAAUP,iBAAiB,CAACO,SAAS;IAC1D;IACAR,OAAOU,IAAI,CAACC,WAAW,CAACR;IACxB,OAAOA;AACX;AACA,MAAMS,cAAc,CAACT,KAAKU,OAAO;IAC7B,MAAMC,QAAQX,IAAIW,KAAK;IACvB,IAAIA,OAAO;QACP,IAAIA,MAAMC,QAAQ,CAACC,MAAM,GAAG,GAAG;YAC3BF,MAAMG,UAAU,CAAC;QACrB,CAAC;QACDH,MAAMI,UAAU,CAACL,MAAM;IAC3B,OAAO,IAAIM,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QAC9C,sCAAsC;QACtCC,QAAQC,KAAK,CAAC;IAClB,CAAC;AACL;AAKW,MAAM5B,iCAAiC,CAAC6B,UAAU;IACzD,MAAM,EAAEC,eAAc,EAAGC,MAAK,EAAGC,mBAAkB,EAAG,GAAGH;IACzD,MAAMI,WAAW/B,OAAMgC,MAAM;IAC7B,MAAMC,aAAaC,IAAAA,qBAAK,EAACC,uDAAwB,CAACC,IAAI;IACtD,MAAMC,yBAAyBP;IAC/B,MAAMQ,kBAAkBtC,OAAMuC,OAAO,CAAC,IAAI;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AI,CAACuC,MAAM,CAACD;QAC/B,CAAC;IACL;AACJ"}
@@ -18,6 +18,3 @@ _export(exports, {
18
18
  useFluentProviderThemeStyleTag: ()=>_fluentProvider.useFluentProviderThemeStyleTag
19
19
  });
20
20
  const _fluentProvider = require("./FluentProvider");
21
- //# sourceMappingURL=index.js.map
22
-
23
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { fluentProviderClassNames, FluentProvider, renderFluentProvider_unstable, useFluentProviderContextValues_unstable, useFluentProvider_unstable, useFluentProviderStyles_unstable, useFluentProviderThemeStyleTag } from './FluentProvider';\n\n//# sourceMappingURL=index.js.map"],"names":["fluentProviderClassNames","FluentProvider","renderFluentProvider_unstable","useFluentProviderContextValues_unstable","useFluentProvider_unstable","useFluentProviderStyles_unstable","useFluentProviderThemeStyleTag"],"mappings":";;;;;;;;;;;IAASA,wBAAwB,MAAxBA,wCAAwB;IAAEC,cAAc,MAAdA,8BAAc;IAAEC,6BAA6B,MAA7BA,6CAA6B;IAAEC,uCAAuC,MAAvCA,uDAAuC;IAAEC,0BAA0B,MAA1BA,0CAA0B;IAAEC,gCAAgC,MAAhCA,gDAAgC;IAAEC,8BAA8B,MAA9BA,8CAA8B;;gCAAQ;CAE/N,iCAAiC"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export { fluentProviderClassNames, FluentProvider, renderFluentProvider_unstable, useFluentProviderContextValues_unstable, useFluentProvider_unstable, useFluentProviderStyles_unstable, useFluentProviderThemeStyleTag } from './FluentProvider';\n"],"names":["fluentProviderClassNames","FluentProvider","renderFluentProvider_unstable","useFluentProviderContextValues_unstable","useFluentProvider_unstable","useFluentProviderStyles_unstable","useFluentProviderThemeStyleTag"],"mappings":";;;;;;;;;;;IAASA,wBAAwB,MAAxBA,wCAAwB;IAAEC,cAAc,MAAdA,8BAAc;IAAEC,6BAA6B,MAA7BA,6CAA6B;IAAEC,uCAAuC,MAAvCA,uDAAuC;IAAEC,0BAA0B,MAA1BA,0CAA0B;IAAEC,gCAAgC,MAAhCA,gDAAgC;IAAEC,8BAA8B,MAA9BA,8CAA8B;;gCAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-provider",
3
- "version": "0.0.0-nightly-20230530-0415.1",
3
+ "version": "0.0.0-nightly-20230601-0418.1",
4
4
  "description": "Fluent UI React provider component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -28,18 +28,18 @@
28
28
  "devDependencies": {
29
29
  "@fluentui/eslint-plugin": "*",
30
30
  "@fluentui/react-conformance": "*",
31
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230530-0415.1",
31
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230601-0418.1",
32
32
  "@fluentui/scripts-api-extractor": "*",
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@griffel/core": "^1.9.0",
37
- "@griffel/react": "^1.5.2",
38
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20230530-0415.1",
39
- "@fluentui/react-tabster": "0.0.0-nightly-20230530-0415.1",
40
- "@fluentui/react-theme": "0.0.0-nightly-20230530-0415.1",
41
- "@fluentui/react-utilities": "0.0.0-nightly-20230530-0415.1",
42
- "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230530-0415.1",
36
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20230601-0418.1",
37
+ "@fluentui/react-tabster": "0.0.0-nightly-20230601-0418.1",
38
+ "@fluentui/react-theme": "0.0.0-nightly-20230601-0418.1",
39
+ "@fluentui/react-utilities": "0.0.0-nightly-20230601-0418.1",
40
+ "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230601-0418.1",
41
+ "@griffel/core": "^1.11.0",
42
+ "@griffel/react": "^1.5.7",
43
43
  "@swc/helpers": "^0.4.14"
44
44
  },
45
45
  "peerDependencies": {