@fluentui-react-native/win32-theme 0.39.0 → 0.39.3

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 (79) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/lib/NativeModule/_mocks_/getThemingModule.native.d.ts +1 -1
  3. package/lib/NativeModule/_mocks_/getThemingModule.native.js +2 -2
  4. package/lib/NativeModule/fallbackOfficeModule.d.ts +1 -1
  5. package/lib/NativeModule/fallbackOfficeModule.js +163 -163
  6. package/lib/NativeModule/getThemingModule.d.ts +1 -1
  7. package/lib/NativeModule/getThemingModule.js +2 -2
  8. package/lib/NativeModule/getThemingModule.native.d.ts +1 -1
  9. package/lib/NativeModule/getThemingModule.native.js +30 -28
  10. package/lib/NativeModule/hostThemeSetting.d.ts +1 -1
  11. package/lib/NativeModule/hostThemeSetting.js +3 -3
  12. package/lib/NativeModule/index.d.ts +2 -10
  13. package/lib/NativeModule/index.js +1 -1
  14. package/lib/NativeModule/officeThemingModule.d.ts +21 -21
  15. package/lib/NativeModule/officeThemingModule.js +1 -1
  16. package/lib/__tests__/win32-theme.test.d.ts +1 -1
  17. package/lib/__tests__/win32-theme.test.js +47 -47
  18. package/lib/createAliasesFromPalette.d.ts +1 -1
  19. package/lib/createAliasesFromPalette.js +56 -56
  20. package/lib/createBrandedThemeWithAlias.d.ts +1 -1
  21. package/lib/createBrandedThemeWithAlias.js +61 -56
  22. package/lib/createFontAliasTokens.d.ts +1 -1
  23. package/lib/createFontAliasTokens.js +3 -3
  24. package/lib/createOfficeAliasTokens.d.ts +1 -1
  25. package/lib/createOfficeAliasTokens.js +5 -5
  26. package/lib/createOfficeTheme.d.ts +1 -1
  27. package/lib/createOfficeTheme.js +46 -53
  28. package/lib/createPartialOfficeTheme.d.ts +1 -1
  29. package/lib/createPartialOfficeTheme.js +19 -22
  30. package/lib/getOfficeTokens.d.ts +227 -229
  31. package/lib/getOfficeTokens.js +26 -20
  32. package/lib/getThemeTypography.d.ts +1 -1
  33. package/lib/getThemeTypography.js +32 -32
  34. package/lib/highContrast/tokens-alias.d.ts +1 -1
  35. package/lib/highContrast/tokens-alias.js +11 -11
  36. package/lib/index.d.ts +2 -10
  37. package/lib/index.js +1 -1
  38. package/lib/paletteFromOfficeColors.d.ts +1 -1
  39. package/lib/paletteFromOfficeColors.js +114 -114
  40. package/lib-commonjs/NativeModule/_mocks_/getThemingModule.native.d.ts +1 -1
  41. package/lib-commonjs/NativeModule/_mocks_/getThemingModule.native.js +5 -5
  42. package/lib-commonjs/NativeModule/fallbackOfficeModule.d.ts +1 -1
  43. package/lib-commonjs/NativeModule/fallbackOfficeModule.js +165 -165
  44. package/lib-commonjs/NativeModule/getThemingModule.d.ts +1 -1
  45. package/lib-commonjs/NativeModule/getThemingModule.js +5 -5
  46. package/lib-commonjs/NativeModule/getThemingModule.native.d.ts +1 -1
  47. package/lib-commonjs/NativeModule/getThemingModule.native.js +35 -33
  48. package/lib-commonjs/NativeModule/hostThemeSetting.d.ts +1 -1
  49. package/lib-commonjs/NativeModule/hostThemeSetting.js +5 -5
  50. package/lib-commonjs/NativeModule/index.d.ts +2 -10
  51. package/lib-commonjs/NativeModule/index.js +8 -23
  52. package/lib-commonjs/NativeModule/officeThemingModule.d.ts +21 -21
  53. package/lib-commonjs/NativeModule/officeThemingModule.js +3 -3
  54. package/lib-commonjs/__tests__/win32-theme.test.d.ts +1 -1
  55. package/lib-commonjs/__tests__/win32-theme.test.js +57 -57
  56. package/lib-commonjs/createAliasesFromPalette.d.ts +1 -1
  57. package/lib-commonjs/createAliasesFromPalette.js +58 -58
  58. package/lib-commonjs/createBrandedThemeWithAlias.d.ts +1 -1
  59. package/lib-commonjs/createBrandedThemeWithAlias.js +64 -59
  60. package/lib-commonjs/createFontAliasTokens.d.ts +1 -1
  61. package/lib-commonjs/createFontAliasTokens.js +8 -8
  62. package/lib-commonjs/createOfficeAliasTokens.d.ts +1 -1
  63. package/lib-commonjs/createOfficeAliasTokens.js +10 -10
  64. package/lib-commonjs/createOfficeTheme.d.ts +1 -1
  65. package/lib-commonjs/createOfficeTheme.js +57 -66
  66. package/lib-commonjs/createPartialOfficeTheme.d.ts +1 -1
  67. package/lib-commonjs/createPartialOfficeTheme.js +22 -25
  68. package/lib-commonjs/getOfficeTokens.d.ts +227 -229
  69. package/lib-commonjs/getOfficeTokens.js +39 -35
  70. package/lib-commonjs/getThemeTypography.d.ts +1 -1
  71. package/lib-commonjs/getThemeTypography.js +36 -36
  72. package/lib-commonjs/highContrast/tokens-alias.d.ts +1 -1
  73. package/lib-commonjs/highContrast/tokens-alias.js +18 -20
  74. package/lib-commonjs/index.d.ts +2 -10
  75. package/lib-commonjs/index.js +23 -89
  76. package/lib-commonjs/paletteFromOfficeColors.d.ts +1 -1
  77. package/lib-commonjs/paletteFromOfficeColors.js +116 -116
  78. package/package.json +26 -25
  79. package/eslint.config.js +0 -3
@@ -1,81 +1,81 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
3
- const createBrandedThemeWithAlias_1 = require('../createBrandedThemeWithAlias');
4
- const createFontAliasTokens_1 = require('../createFontAliasTokens');
5
- const createOfficeAliasTokens_1 = require('../createOfficeAliasTokens');
6
- const createOfficeTheme_1 = require('../createOfficeTheme');
7
- const createPartialOfficeTheme_1 = require('../createPartialOfficeTheme');
8
- const getThemeTypography_1 = require('../getThemeTypography');
9
- const hostThemeSetting_1 = require('../NativeModule/hostThemeSetting');
10
- const index_1 = require('../NativeModule/index');
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const createBrandedThemeWithAlias_1 = require("../createBrandedThemeWithAlias");
4
+ const createFontAliasTokens_1 = require("../createFontAliasTokens");
5
+ const createOfficeAliasTokens_1 = require("../createOfficeAliasTokens");
6
+ const createOfficeTheme_1 = require("../createOfficeTheme");
7
+ const createPartialOfficeTheme_1 = require("../createPartialOfficeTheme");
8
+ const getThemeTypography_1 = require("../getThemeTypography");
9
+ const hostThemeSetting_1 = require("../NativeModule/hostThemeSetting");
10
+ const index_1 = require("../NativeModule/index");
11
11
  const officeThemes = ['White', 'Colorful', 'DarkGray', 'Black', 'HighContrast'];
12
12
  const appPrimaries = ['#185abd', '#107c41', '#d83b01', '#80397b', '#0078d4', '#c43e1c'];
13
13
  it('win32Typography test', () => {
14
- expect(getThemeTypography_1.win32Typography).toMatchSnapshot();
14
+ expect(getThemeTypography_1.win32Typography).toMatchSnapshot();
15
15
  });
16
16
  it('fallbackOfficeModule test', () => {
17
- expect(index_1.fallbackOfficeModule).toMatchSnapshot();
18
- expect(index_1.fallbackOfficeModule.getConstants()).toMatchSnapshot();
17
+ expect(index_1.fallbackOfficeModule).toMatchSnapshot();
18
+ expect(index_1.fallbackOfficeModule.getConstants()).toMatchSnapshot();
19
19
  });
20
20
  it('getThemingModule test', () => {
21
- const themingModule = (0, index_1.getThemingModule)();
22
- expect(themingModule).toMatchSnapshot();
23
- expect(themingModule[0].getConstants()).toMatchSnapshot();
21
+ const themingModule = (0, index_1.getThemingModule)();
22
+ expect(themingModule).toMatchSnapshot();
23
+ expect(themingModule[0].getConstants()).toMatchSnapshot();
24
24
  });
25
25
  it('createPartialOfficeTheme test', () => {
26
- const themingModule = (0, index_1.getThemingModule)();
27
- const partialOfficeTheme = (0, createPartialOfficeTheme_1.createPartialOfficeTheme)(themingModule[0]);
28
- expect(partialOfficeTheme).toMatchSnapshot;
26
+ const themingModule = (0, index_1.getThemingModule)();
27
+ const partialOfficeTheme = (0, createPartialOfficeTheme_1.createPartialOfficeTheme)(themingModule[0]);
28
+ expect(partialOfficeTheme).toMatchSnapshot;
29
29
  });
30
30
  it('createFontAliasTokens test', () => {
31
- const fontAliasToken = (0, createFontAliasTokens_1.createFontAliasTokens)();
32
- expect(fontAliasToken).toMatchSnapshot();
31
+ const fontAliasToken = (0, createFontAliasTokens_1.createFontAliasTokens)();
32
+ expect(fontAliasToken).toMatchSnapshot();
33
33
  });
34
34
  it('createOfficeTheme test', () => {
35
- const officeTheme = (0, createOfficeTheme_1.createOfficeTheme)({ paletteName: 'TaskPane', appearance: 'light' }).theme;
36
- expect(officeTheme).toMatchSnapshot();
35
+ const officeTheme = (0, createOfficeTheme_1.createOfficeTheme)({ paletteName: 'TaskPane', appearance: 'light' }).theme;
36
+ expect(officeTheme).toMatchSnapshot();
37
37
  });
38
38
  it.concurrent.each(officeThemes)('createBrandedThemeWithAlias test themeName: %s', async (themeName) => {
39
- (0, hostThemeSetting_1.setCurrentHostThemeSetting)('Colorful');
40
- const officeTheme = (0, createOfficeTheme_1.createOfficeTheme)({ paletteName: 'TaskPane', appearance: 'light' }).theme;
41
- const brandedTheme = (0, createBrandedThemeWithAlias_1.createBrandedThemeWithAlias)(themeName, officeTheme);
42
- expect(brandedTheme).toMatchSnapshot();
39
+ (0, hostThemeSetting_1.setCurrentHostThemeSetting)('Colorful');
40
+ const officeTheme = (0, createOfficeTheme_1.createOfficeTheme)({ paletteName: 'TaskPane', appearance: 'light' }).theme;
41
+ const brandedTheme = (0, createBrandedThemeWithAlias_1.createBrandedThemeWithAlias)(themeName, officeTheme);
42
+ expect(brandedTheme).toMatchSnapshot();
43
43
  });
44
44
  it.concurrent.each(officeThemes)('createOfficeColorAliasTokens test officeTheme: %s', async (themeName) => {
45
- const colorAliasToken = (0, createOfficeAliasTokens_1.createOfficeColorAliasTokens)(themeName);
46
- expect(colorAliasToken).toMatchSnapshot();
45
+ const colorAliasToken = (0, createOfficeAliasTokens_1.createOfficeColorAliasTokens)(themeName);
46
+ expect(colorAliasToken).toMatchSnapshot();
47
47
  });
48
48
  it.concurrent.each(officeThemes)('createOfficeShadowAliasTokens test officeTheme: %s', async (themeName) => {
49
- const shadowAliasToken = (0, createOfficeAliasTokens_1.createOfficeShadowAliasTokens)(themeName);
50
- expect(shadowAliasToken).toMatchSnapshot();
49
+ const shadowAliasToken = (0, createOfficeAliasTokens_1.createOfficeShadowAliasTokens)(themeName);
50
+ expect(shadowAliasToken).toMatchSnapshot();
51
51
  });
52
52
  describe('fallbackGetPalette test', () => {
53
- it('TaskPane palette', () => {
54
- const fallbackPalette = (0, index_1.fallbackGetPalette)('TaskPane');
55
- expect(fallbackPalette).toMatchSnapshot();
56
- });
57
- it('Random palette', () => {
58
- /**
59
- * RedColors is just a random pallette, we're just testing to see what happens
60
- * if we use anything other than the TaskPane palette.
61
- * */
62
- const fallbackPalette = (0, index_1.fallbackGetPalette)('RedColors');
63
- expect(fallbackPalette).toMatchSnapshot();
64
- });
53
+ it('TaskPane palette', () => {
54
+ const fallbackPalette = (0, index_1.fallbackGetPalette)('TaskPane');
55
+ expect(fallbackPalette).toMatchSnapshot();
56
+ });
57
+ it('Random palette', () => {
58
+ /**
59
+ * RedColors is just a random pallette, we're just testing to see what happens
60
+ * if we use anything other than the TaskPane palette.
61
+ * */
62
+ const fallbackPalette = (0, index_1.fallbackGetPalette)('RedColors');
63
+ expect(fallbackPalette).toMatchSnapshot();
64
+ });
65
65
  });
66
66
  describe('getCurrentBrandAliasTokens test', () => {
67
- it.concurrent.each(appPrimaries)('themeName: White, appPrimary: %s', async (appPrimary) => {
68
- const brandAliasTokens = (0, createBrandedThemeWithAlias_1.getCurrentBrandAliasTokens)('White', appPrimary);
69
- expect(brandAliasTokens).toMatchSnapshot();
70
- });
71
- it.concurrent.each(appPrimaries)('themeName: Colorful, appPrimary: %s', async (appPrimary) => {
72
- const brandAliasTokens = (0, createBrandedThemeWithAlias_1.getCurrentBrandAliasTokens)('Colorful', appPrimary);
73
- expect(brandAliasTokens).toMatchSnapshot();
74
- });
75
- // Tests the variation of the alias tokens for when isWhiteOrColorfulTheme is not true
76
- it.concurrent.each(appPrimaries)('themeName: null, appPrimary: %s', async (appPrimary) => {
77
- const brandAliasTokens = (0, createBrandedThemeWithAlias_1.getCurrentBrandAliasTokens)(null, appPrimary);
78
- expect(brandAliasTokens).toMatchSnapshot();
79
- });
67
+ it.concurrent.each(appPrimaries)('themeName: White, appPrimary: %s', async (appPrimary) => {
68
+ const brandAliasTokens = (0, createBrandedThemeWithAlias_1.getCurrentBrandAliasTokens)('White', appPrimary);
69
+ expect(brandAliasTokens).toMatchSnapshot();
70
+ });
71
+ it.concurrent.each(appPrimaries)('themeName: Colorful, appPrimary: %s', async (appPrimary) => {
72
+ const brandAliasTokens = (0, createBrandedThemeWithAlias_1.getCurrentBrandAliasTokens)('Colorful', appPrimary);
73
+ expect(brandAliasTokens).toMatchSnapshot();
74
+ });
75
+ // Tests the variation of the alias tokens for when isWhiteOrColorfulTheme is not true
76
+ it.concurrent.each(appPrimaries)('themeName: null, appPrimary: %s', async (appPrimary) => {
77
+ const brandAliasTokens = (0, createBrandedThemeWithAlias_1.getCurrentBrandAliasTokens)(null, appPrimary);
78
+ expect(brandAliasTokens).toMatchSnapshot();
79
+ });
80
80
  });
81
- //# sourceMappingURL=win32-theme.test.js.map
81
+ //# sourceMappingURL=win32-theme.test.js.map
@@ -1,3 +1,3 @@
1
1
  import type { AliasColorTokens, OfficePalette } from '@fluentui-react-native/theme-types';
2
2
  export declare function createAliasesFromPalette(palette: OfficePalette, isHighContrast: boolean): Partial<AliasColorTokens>;
3
- //# sourceMappingURL=createAliasesFromPalette.d.ts.map
3
+ //# sourceMappingURL=createAliasesFromPalette.d.ts.map
@@ -1,61 +1,61 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createAliasesFromPalette = createAliasesFromPalette;
4
4
  function createAliasesFromPalette(palette, isHighContrast) {
5
- // Workaround for getting checkmark to have correct color in HC
6
- // while native code doesn't support PlatformColor
7
- if (isHighContrast) {
8
- return {};
9
- }
10
- return {
11
- neutralForeground1: palette.Text,
12
- neutralForeground1Hover: palette.TextHover,
13
- neutralForeground1Pressed: palette.TextPressed,
14
- neutralForeground1Selected: palette.TextSelected,
15
- neutralForeground2: palette.TextSecondary,
16
- neutralForeground2Hover: palette.TextSecondaryHover,
17
- neutralForeground2Pressed: palette.TextSecondaryPressed,
18
- neutralForeground2Selected: palette.TextSecondarySelected,
19
- neutralForeground4: palette.TextTextBoxPlaceholder,
20
- neutralForegroundDisabled: palette.TextDisabled,
21
- compoundBrandForeground1: palette.TextEmphasis,
22
- compoundBrandForeground1Hover: palette.TextEmphasisHover,
23
- compoundBrandForeground1Pressed: palette.TextEmphasisPressed,
24
- neutralForegroundOnBrand: palette.TextCtlEmphasis,
25
- neutralForegroundOnBrandHover: palette.TextCtlEmphasisHover,
26
- neutralForegroundOnBrandPressed: palette.TextCtlEmphasisPressed,
27
- neutralForegroundInvertedLink: palette.BkgToggleSwitchOff,
28
- neutralForegroundInvertedLinkHover: palette.BkgToggleSwitchOffHover,
29
- neutralForegroundInvertedLinkPressed: palette.BkgToggleSwitchOffPressed,
30
- neutralBackground1: palette.Bkg,
31
- neutralBackground1Hover: palette.BkgHover,
32
- neutralBackground1Pressed: palette.BkgPressed,
33
- neutralBackground1Selected: palette.BkgSelected,
34
- neutralBackground2: palette.BkgHeader,
35
- neutralBackground2Hover: palette.BkgSubtle,
36
- neutralBackground3: palette.BkgSubtle,
37
- neutralBackgroundInverted: palette.BkgSelectionHighlight,
38
- neutralBackgroundDisabled: palette.BkgCtlDisabled,
39
- neutralStencil1: palette.SliderBuffer,
40
- brandBackground: palette.BkgCtlEmphasis,
41
- brandBackgroundHover: palette.BkgCtlEmphasisHover,
42
- brandBackgroundPressed: palette.BkgCtlEmphasisPressed,
43
- compoundBrandBackground1: palette.BkgToggleSwitchOn,
44
- compoundBrandBackground1Hover: palette.BkgToggleSwitchOnHover,
45
- compoundBrandBackground1Pressed: palette.BkgToggleSwitchOnPressed,
46
- neutralStrokeAccessible: palette.StrokeOnlySelected,
47
- neutralStrokeAccessibleHover: palette.StrokeOnlyHover,
48
- neutralStrokeAccessiblePressed: palette.StrokeOnlyPressed,
49
- neutralStroke1: palette.StrokeCtl,
50
- neutralStroke1Hover: palette.StrokeSelectedHover,
51
- neutralStroke1Pressed: palette.StrokeOverPressed,
52
- neutralStroke2: palette.SliderBuffer,
53
- brandStroke1: palette.AccentEmphasis,
54
- compoundBrandStroke1: palette.StrokeToggleSwitchOn,
55
- compoundBrandStroke1Hover: palette.StrokeToggleSwitchOnHover,
56
- compoundBrandStroke1Pressed: palette.StrokeToggleSwitchOnPressed,
57
- neutralStrokeDisabled: palette.StrokeCtlDisabled,
58
- strokeFocus2: palette.StrokeKeyboard,
59
- };
5
+ // Workaround for getting checkmark to have correct color in HC
6
+ // while native code doesn't support PlatformColor
7
+ if (isHighContrast) {
8
+ return {};
9
+ }
10
+ return {
11
+ neutralForeground1: palette.Text,
12
+ neutralForeground1Hover: palette.TextHover,
13
+ neutralForeground1Pressed: palette.TextPressed,
14
+ neutralForeground1Selected: palette.TextSelected,
15
+ neutralForeground2: palette.TextSecondary,
16
+ neutralForeground2Hover: palette.TextSecondaryHover,
17
+ neutralForeground2Pressed: palette.TextSecondaryPressed,
18
+ neutralForeground2Selected: palette.TextSecondarySelected,
19
+ neutralForeground4: palette.TextTextBoxPlaceholder,
20
+ neutralForegroundDisabled: palette.TextDisabled,
21
+ compoundBrandForeground1: palette.TextEmphasis,
22
+ compoundBrandForeground1Hover: palette.TextEmphasisHover,
23
+ compoundBrandForeground1Pressed: palette.TextEmphasisPressed,
24
+ neutralForegroundOnBrand: palette.TextCtlEmphasis,
25
+ neutralForegroundOnBrandHover: palette.TextCtlEmphasisHover,
26
+ neutralForegroundOnBrandPressed: palette.TextCtlEmphasisPressed,
27
+ neutralForegroundInvertedLink: palette.BkgToggleSwitchOff,
28
+ neutralForegroundInvertedLinkHover: palette.BkgToggleSwitchOffHover,
29
+ neutralForegroundInvertedLinkPressed: palette.BkgToggleSwitchOffPressed,
30
+ neutralBackground1: palette.Bkg,
31
+ neutralBackground1Hover: palette.BkgHover,
32
+ neutralBackground1Pressed: palette.BkgPressed,
33
+ neutralBackground1Selected: palette.BkgSelected,
34
+ neutralBackground2: palette.BkgHeader,
35
+ neutralBackground2Hover: palette.BkgSubtle,
36
+ neutralBackground3: palette.BkgSubtle,
37
+ neutralBackgroundInverted: palette.BkgSelectionHighlight,
38
+ neutralBackgroundDisabled: palette.BkgCtlDisabled,
39
+ neutralStencil1: palette.SliderBuffer,
40
+ brandBackground: palette.BkgCtlEmphasis,
41
+ brandBackgroundHover: palette.BkgCtlEmphasisHover,
42
+ brandBackgroundPressed: palette.BkgCtlEmphasisPressed,
43
+ compoundBrandBackground1: palette.BkgToggleSwitchOn,
44
+ compoundBrandBackground1Hover: palette.BkgToggleSwitchOnHover,
45
+ compoundBrandBackground1Pressed: palette.BkgToggleSwitchOnPressed,
46
+ neutralStrokeAccessible: palette.StrokeOnlySelected,
47
+ neutralStrokeAccessibleHover: palette.StrokeOnlyHover,
48
+ neutralStrokeAccessiblePressed: palette.StrokeOnlyPressed,
49
+ neutralStroke1: palette.StrokeCtl,
50
+ neutralStroke1Hover: palette.StrokeSelectedHover,
51
+ neutralStroke1Pressed: palette.StrokeOverPressed,
52
+ neutralStroke2: palette.SliderBuffer,
53
+ brandStroke1: palette.AccentEmphasis,
54
+ compoundBrandStroke1: palette.StrokeToggleSwitchOn,
55
+ compoundBrandStroke1Hover: palette.StrokeToggleSwitchOnHover,
56
+ compoundBrandStroke1Pressed: palette.StrokeToggleSwitchOnPressed,
57
+ neutralStrokeDisabled: palette.StrokeCtlDisabled,
58
+ strokeFocus2: palette.StrokeKeyboard,
59
+ };
60
60
  }
61
- //# sourceMappingURL=createAliasesFromPalette.js.map
61
+ //# sourceMappingURL=createAliasesFromPalette.js.map
@@ -2,4 +2,4 @@ import type { ColorValue } from 'react-native';
2
2
  import type { Theme, PartialTheme, AliasColorTokens } from '@fluentui-react-native/theme-types';
3
3
  export declare function createBrandedThemeWithAlias(themeName: string, theme: Theme): PartialTheme;
4
4
  export declare function getCurrentBrandAliasTokens(themeName: string, appPrimary: ColorValue): Partial<AliasColorTokens>;
5
- //# sourceMappingURL=createBrandedThemeWithAlias.d.ts.map
5
+ //# sourceMappingURL=createBrandedThemeWithAlias.d.ts.map
@@ -1,68 +1,73 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createBrandedThemeWithAlias = createBrandedThemeWithAlias;
4
4
  exports.getCurrentBrandAliasTokens = getCurrentBrandAliasTokens;
5
- const theme_tokens_1 = require('@fluentui-react-native/theme-tokens');
5
+ const theme_tokens_1 = require("@fluentui-react-native/theme-tokens");
6
6
  function createBrandedThemeWithAlias(themeName, theme) {
7
- if (themeName === 'HighContrast' || !theme.host.colors) {
8
- return {};
9
- }
10
- return {
11
- colors: getCurrentBrandAliasTokens(themeName, theme.host.colors.AppPrimary),
12
- };
7
+ if (themeName === 'HighContrast' || !theme.host.colors) {
8
+ return {};
9
+ }
10
+ return {
11
+ colors: getCurrentBrandAliasTokens(themeName, theme.host.colors.AppPrimary),
12
+ };
13
13
  }
14
14
  function getCurrentBrandAliasTokens(themeName, appPrimary) {
15
- const appColors = getAppColors(appPrimary);
16
- const isWhiteOrColorfulTheme = themeName === 'White' || themeName === 'Colorful';
17
- return {
18
- neutralForeground2BrandHover: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
19
- neutralForeground2BrandPressed: isWhiteOrColorfulTheme ? appColors.shade30 : appColors.tint10,
20
- neutralForeground2BrandSelected: isWhiteOrColorfulTheme ? appColors.shade20 : appColors.tint40,
21
- neutralForeground3BrandHover: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
22
- neutralForeground3BrandPressed: isWhiteOrColorfulTheme ? appColors.shade30 : appColors.tint10,
23
- neutralForeground3BrandSelected: isWhiteOrColorfulTheme ? appColors.shade20 : appColors.tint40,
24
- brandForegroundLink: isWhiteOrColorfulTheme ? appColors.primary : appColors.tint30,
25
- brandForegroundLinkHover: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
26
- brandForegroundLinkPressed: isWhiteOrColorfulTheme ? appColors.shade30 : appColors.tint10,
27
- brandForegroundLinkSelected: isWhiteOrColorfulTheme ? appColors.shade20 : appColors.tint40,
28
- compoundBrandForeground1: isWhiteOrColorfulTheme ? appColors.primary : appColors.tint30,
29
- compoundBrandForeground1Hover: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
30
- compoundBrandForeground1Pressed: isWhiteOrColorfulTheme ? appColors.shade30 : appColors.tint10,
31
- brandForeground1: isWhiteOrColorfulTheme ? appColors.primary : appColors.tint30,
32
- brandForeground2: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
33
- brandBackground: appColors.primary,
34
- brandBackgroundHover: appColors.shade10,
35
- brandBackgroundPressed: appColors.shade30,
36
- brandBackgroundSelected: appColors.shade20,
37
- compoundBrandBackground1: appColors.primary,
38
- compoundBrandBackground1Hover: appColors.shade10,
39
- compoundBrandBackground1Pressed: appColors.shade20,
40
- brandBackgroundStatic: appColors.primary,
41
- brandBackground2: appColors.tint40,
42
- neutralStrokeAccessibleSelected: appColors.primary,
43
- brandStroke1: appColors.primary,
44
- brandStroke2: appColors.tint40,
45
- compoundBrandStroke1: appColors.primary,
46
- compoundBrandStroke1Hover: appColors.shade10,
47
- compoundBrandStroke1Pressed: appColors.shade20,
48
- };
15
+ const appColors = getAppColors(appPrimary);
16
+ const isWhiteOrColorfulTheme = themeName === 'White' || themeName === 'Colorful';
17
+ return {
18
+ neutralForeground2BrandHover: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
19
+ neutralForeground2BrandPressed: isWhiteOrColorfulTheme ? appColors.shade30 : appColors.tint10,
20
+ neutralForeground2BrandSelected: isWhiteOrColorfulTheme ? appColors.shade20 : appColors.tint40,
21
+ neutralForeground3BrandHover: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
22
+ neutralForeground3BrandPressed: isWhiteOrColorfulTheme ? appColors.shade30 : appColors.tint10,
23
+ neutralForeground3BrandSelected: isWhiteOrColorfulTheme ? appColors.shade20 : appColors.tint40,
24
+ brandForegroundLink: isWhiteOrColorfulTheme ? appColors.primary : appColors.tint30,
25
+ brandForegroundLinkHover: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
26
+ brandForegroundLinkPressed: isWhiteOrColorfulTheme ? appColors.shade30 : appColors.tint10,
27
+ brandForegroundLinkSelected: isWhiteOrColorfulTheme ? appColors.shade20 : appColors.tint40,
28
+ compoundBrandForeground1: isWhiteOrColorfulTheme ? appColors.primary : appColors.tint30,
29
+ compoundBrandForeground1Hover: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
30
+ compoundBrandForeground1Pressed: isWhiteOrColorfulTheme ? appColors.shade30 : appColors.tint10,
31
+ brandForeground1: isWhiteOrColorfulTheme ? appColors.primary : appColors.tint30,
32
+ brandForeground2: isWhiteOrColorfulTheme ? appColors.shade10 : appColors.tint40,
33
+ brandBackground: appColors.primary,
34
+ brandBackgroundHover: appColors.shade10,
35
+ brandBackgroundPressed: appColors.shade30,
36
+ brandBackgroundSelected: appColors.shade20,
37
+ compoundBrandBackground1: appColors.primary,
38
+ compoundBrandBackground1Hover: appColors.shade10,
39
+ compoundBrandBackground1Pressed: appColors.shade20,
40
+ brandBackgroundStatic: appColors.primary,
41
+ brandBackground2: appColors.tint40,
42
+ neutralStrokeAccessibleSelected: appColors.primary,
43
+ brandStroke1: appColors.primary,
44
+ brandStroke2: appColors.tint40,
45
+ compoundBrandStroke1: appColors.primary,
46
+ compoundBrandStroke1Hover: appColors.shade10,
47
+ compoundBrandStroke1Pressed: appColors.shade20,
48
+ };
49
49
  }
50
50
  function getAppColors(primaryColor) {
51
- if (typeof primaryColor === 'string') {
52
- if (primaryColor.toLowerCase() === '#185abd') {
53
- return theme_tokens_1.globalTokens.color.word;
54
- } else if (primaryColor.toLowerCase() === '#107c41') {
55
- return theme_tokens_1.globalTokens.color.excel;
56
- } else if (primaryColor.toLowerCase() === '#d83b01') {
57
- return theme_tokens_1.globalTokens.color.office;
58
- } else if (primaryColor.toLowerCase() === '#80397b' || primaryColor.toLowerCase() === '#7719aa') {
59
- return theme_tokens_1.globalTokens.color.oneNote;
60
- } else if (primaryColor.toLowerCase() === '#0078d4') {
61
- return theme_tokens_1.globalTokens.color.outlook;
62
- } else if (primaryColor.toLowerCase() === '#c43e1c') {
63
- return theme_tokens_1.globalTokens.color.powerPoint;
51
+ if (typeof primaryColor === 'string') {
52
+ if (primaryColor.toLowerCase() === '#185abd') {
53
+ return theme_tokens_1.globalTokens.color.word;
54
+ }
55
+ else if (primaryColor.toLowerCase() === '#107c41') {
56
+ return theme_tokens_1.globalTokens.color.excel;
57
+ }
58
+ else if (primaryColor.toLowerCase() === '#d83b01') {
59
+ return theme_tokens_1.globalTokens.color.office;
60
+ }
61
+ else if (primaryColor.toLowerCase() === '#80397b' || primaryColor.toLowerCase() === '#7719aa') {
62
+ return theme_tokens_1.globalTokens.color.oneNote;
63
+ }
64
+ else if (primaryColor.toLowerCase() === '#0078d4') {
65
+ return theme_tokens_1.globalTokens.color.outlook;
66
+ }
67
+ else if (primaryColor.toLowerCase() === '#c43e1c') {
68
+ return theme_tokens_1.globalTokens.color.powerPoint;
69
+ }
64
70
  }
65
- }
66
- return theme_tokens_1.globalTokens.color.brand;
71
+ return theme_tokens_1.globalTokens.color.brand;
67
72
  }
68
- //# sourceMappingURL=createBrandedThemeWithAlias.js.map
73
+ //# sourceMappingURL=createBrandedThemeWithAlias.js.map
@@ -2,4 +2,4 @@ import type { Variants } from '@fluentui-react-native/theme-types';
2
2
  declare function createFontAliasTokensWorker(): Partial<Variants>;
3
3
  export declare const createFontAliasTokens: typeof createFontAliasTokensWorker;
4
4
  export {};
5
- //# sourceMappingURL=createFontAliasTokens.d.ts.map
5
+ //# sourceMappingURL=createFontAliasTokens.d.ts.map
@@ -1,12 +1,12 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createFontAliasTokens = void 0;
4
- const framework_base_1 = require('@fluentui-react-native/framework-base');
5
- const theming_utils_1 = require('@fluentui-react-native/theming-utils');
6
- const getOfficeTokens_1 = require('./getOfficeTokens');
4
+ const framework_base_1 = require("@fluentui-react-native/framework-base");
5
+ const theming_utils_1 = require("@fluentui-react-native/theming-utils");
6
+ const getOfficeTokens_1 = require("./getOfficeTokens");
7
7
  function createFontAliasTokensWorker() {
8
- const aliasTokens = (0, getOfficeTokens_1.getOfficeAliasTokens)('Colorful');
9
- return (0, theming_utils_1.mapFontPipelineToTheme)(aliasTokens);
8
+ const aliasTokens = (0, getOfficeTokens_1.getOfficeAliasTokens)('Colorful');
9
+ return (0, theming_utils_1.mapFontPipelineToTheme)(aliasTokens);
10
10
  }
11
11
  exports.createFontAliasTokens = (0, framework_base_1.memoize)(createFontAliasTokensWorker);
12
- //# sourceMappingURL=createFontAliasTokens.js.map
12
+ //# sourceMappingURL=createFontAliasTokens.js.map
@@ -4,4 +4,4 @@ export declare const createOfficeColorAliasTokens: typeof createOfficeColorAlias
4
4
  declare function createOfficeShadowAliasTokensWorker(officeTheme: string): ThemeShadowDefinition;
5
5
  export declare const createOfficeShadowAliasTokens: typeof createOfficeShadowAliasTokensWorker;
6
6
  export {};
7
- //# sourceMappingURL=createOfficeAliasTokens.d.ts.map
7
+ //# sourceMappingURL=createOfficeAliasTokens.d.ts.map
@@ -1,17 +1,17 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createOfficeShadowAliasTokens = exports.createOfficeColorAliasTokens = void 0;
4
- const framework_base_1 = require('@fluentui-react-native/framework-base');
5
- const theming_utils_1 = require('@fluentui-react-native/theming-utils');
6
- const getOfficeTokens_1 = require('./getOfficeTokens');
4
+ const framework_base_1 = require("@fluentui-react-native/framework-base");
5
+ const theming_utils_1 = require("@fluentui-react-native/theming-utils");
6
+ const getOfficeTokens_1 = require("./getOfficeTokens");
7
7
  function createOfficeColorAliasTokensWorker(officeTheme) {
8
- const aliasTokens = (0, getOfficeTokens_1.getOfficeAliasTokens)(officeTheme);
9
- return (0, theming_utils_1.mapPipelineToTheme)(aliasTokens);
8
+ const aliasTokens = (0, getOfficeTokens_1.getOfficeAliasTokens)(officeTheme);
9
+ return (0, theming_utils_1.mapPipelineToTheme)(aliasTokens);
10
10
  }
11
11
  exports.createOfficeColorAliasTokens = (0, framework_base_1.memoize)(createOfficeColorAliasTokensWorker);
12
12
  function createOfficeShadowAliasTokensWorker(officeTheme) {
13
- const aliasTokens = (0, getOfficeTokens_1.getOfficeShadowTokens)(officeTheme);
14
- return (0, theming_utils_1.mapPipelineToShadow)(aliasTokens);
13
+ const aliasTokens = (0, getOfficeTokens_1.getOfficeShadowTokens)(officeTheme);
14
+ return (0, theming_utils_1.mapPipelineToShadow)(aliasTokens);
15
15
  }
16
16
  exports.createOfficeShadowAliasTokens = (0, framework_base_1.memoize)(createOfficeShadowAliasTokensWorker);
17
- //# sourceMappingURL=createOfficeAliasTokens.js.map
17
+ //# sourceMappingURL=createOfficeAliasTokens.js.map
@@ -10,4 +10,4 @@ import type { ThemeOptions } from '@fluentui-react-native/theme-types';
10
10
  * @param paletteName - optional specifier for the currently active office palette
11
11
  */
12
12
  export declare function createOfficeTheme(options?: ThemeOptions): ThemeReference;
13
- //# sourceMappingURL=createOfficeTheme.d.ts.map
13
+ //# sourceMappingURL=createOfficeTheme.d.ts.map
@@ -1,18 +1,18 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createOfficeTheme = createOfficeTheme;
4
- const default_theme_1 = require('@fluentui-react-native/default-theme');
5
- const theme_1 = require('@fluentui-react-native/theme');
6
- const createAliasesFromPalette_1 = require('./createAliasesFromPalette');
7
- const createBrandedThemeWithAlias_1 = require('./createBrandedThemeWithAlias');
8
- const createOfficeAliasTokens_1 = require('./createOfficeAliasTokens');
9
- const createPartialOfficeTheme_1 = require('./createPartialOfficeTheme');
10
- const getThemeTypography_1 = require('./getThemeTypography');
11
- const getThemingModule_1 = require('./NativeModule/getThemingModule');
12
- const hostThemeSetting_1 = require('./NativeModule/hostThemeSetting');
4
+ const default_theme_1 = require("@fluentui-react-native/default-theme");
5
+ const theme_1 = require("@fluentui-react-native/theme");
6
+ const createAliasesFromPalette_1 = require("./createAliasesFromPalette");
7
+ const createBrandedThemeWithAlias_1 = require("./createBrandedThemeWithAlias");
8
+ const createOfficeAliasTokens_1 = require("./createOfficeAliasTokens");
9
+ const createPartialOfficeTheme_1 = require("./createPartialOfficeTheme");
10
+ const getThemeTypography_1 = require("./getThemeTypography");
11
+ const getThemingModule_1 = require("./NativeModule/getThemingModule");
12
+ const hostThemeSetting_1 = require("./NativeModule/hostThemeSetting");
13
13
  function handlePaletteCall(palette) {
14
- const exception = palette;
15
- return exception && exception.message !== undefined ? undefined : palette;
14
+ const exception = palette;
15
+ return exception && exception.message !== undefined ? undefined : palette;
16
16
  }
17
17
  /**
18
18
  * create a theme reference for an Office win32 theme. This will be based upon the standard
@@ -24,57 +24,48 @@ function handlePaletteCall(palette) {
24
24
  * @param paletteName - optional specifier for the currently active office palette
25
25
  */
26
26
  function createOfficeTheme(options = {}) {
27
- const [module, emitter] = (0, getThemingModule_1.getThemingModule)();
28
- const ref = { module, emitter, themeName: (0, hostThemeSetting_1.getCurrentHostThemeSetting)() || '' };
29
- const { paletteName } = options;
30
- const themeRef = new theme_1.ThemeReference(
31
- (0, default_theme_1.createDefaultTheme)(options),
32
- () => {
33
- const name = paletteName || 'WhiteColors';
34
- const palette = handlePaletteCall(ref.module.getPalette(name));
35
- return (0, createPartialOfficeTheme_1.createPartialOfficeTheme)(module, ref.themeName, palette);
36
- },
37
- () => {
38
- if (!ref.themeName || ref.themeName === '') {
39
- return {};
40
- }
41
- return {
42
- shadows: { ...(0, createOfficeAliasTokens_1.createOfficeShadowAliasTokens)(ref.themeName) },
43
- typography: (0, getThemeTypography_1.win32Typography)(),
44
- };
45
- },
46
- () => {
47
- if (!ref.themeName || ref.themeName === '') {
48
- return {};
49
- }
50
- return {
51
- colors: { ...(0, createOfficeAliasTokens_1.createOfficeColorAliasTokens)(ref.themeName) },
52
- typography: (0, getThemeTypography_1.win32Typography)(),
53
- };
54
- },
55
- (theme) => {
56
- return (0, createBrandedThemeWithAlias_1.createBrandedThemeWithAlias)(ref.themeName, theme);
57
- },
58
- (theme) => {
59
- if (!theme.host.palette) {
60
- return {};
61
- }
62
- return {
63
- ...(paletteName !== undefined && {
64
- colors: (0, createAliasesFromPalette_1.createAliasesFromPalette)(theme.host.palette, ref.themeName === 'HighContrast'),
65
- }),
66
- typography: (0, getThemeTypography_1.win32Typography)(),
67
- };
68
- },
69
- );
70
- // set up the callback for theme changes on the native side
71
- const onPlatformDefaultsChanged = (args) => {
72
- ref.themeName = (args && args.hostThemeSetting) || ref.themeName;
73
- (0, hostThemeSetting_1.setCurrentHostThemeSetting)(ref.themeName);
74
- themeRef.invalidate();
75
- };
76
- emitter && emitter.addListener('onPlatformDefaultsChanged', onPlatformDefaultsChanged);
77
- // now return the theme reference
78
- return themeRef;
27
+ const [module, emitter] = (0, getThemingModule_1.getThemingModule)();
28
+ const ref = { module, emitter, themeName: (0, hostThemeSetting_1.getCurrentHostThemeSetting)() || '' };
29
+ const { paletteName } = options;
30
+ const themeRef = new theme_1.ThemeReference((0, default_theme_1.createDefaultTheme)(options), () => {
31
+ const name = paletteName || 'WhiteColors';
32
+ const palette = handlePaletteCall(ref.module.getPalette(name));
33
+ return (0, createPartialOfficeTheme_1.createPartialOfficeTheme)(module, ref.themeName, palette);
34
+ }, () => {
35
+ if (!ref.themeName || ref.themeName === '') {
36
+ return {};
37
+ }
38
+ return {
39
+ shadows: { ...(0, createOfficeAliasTokens_1.createOfficeShadowAliasTokens)(ref.themeName) },
40
+ typography: (0, getThemeTypography_1.win32Typography)(),
41
+ };
42
+ }, () => {
43
+ if (!ref.themeName || ref.themeName === '') {
44
+ return {};
45
+ }
46
+ return {
47
+ colors: { ...(0, createOfficeAliasTokens_1.createOfficeColorAliasTokens)(ref.themeName) },
48
+ typography: (0, getThemeTypography_1.win32Typography)(),
49
+ };
50
+ }, (theme) => {
51
+ return (0, createBrandedThemeWithAlias_1.createBrandedThemeWithAlias)(ref.themeName, theme);
52
+ }, (theme) => {
53
+ if (!theme.host.palette) {
54
+ return {};
55
+ }
56
+ return {
57
+ ...(paletteName !== undefined && { colors: (0, createAliasesFromPalette_1.createAliasesFromPalette)(theme.host.palette, ref.themeName === 'HighContrast') }),
58
+ typography: (0, getThemeTypography_1.win32Typography)(),
59
+ };
60
+ });
61
+ // set up the callback for theme changes on the native side
62
+ const onPlatformDefaultsChanged = (args) => {
63
+ ref.themeName = (args && args.hostThemeSetting) || ref.themeName;
64
+ (0, hostThemeSetting_1.setCurrentHostThemeSetting)(ref.themeName);
65
+ themeRef.invalidate();
66
+ };
67
+ emitter && emitter.addListener('onPlatformDefaultsChanged', onPlatformDefaultsChanged);
68
+ // now return the theme reference
69
+ return themeRef;
79
70
  }
80
- //# sourceMappingURL=createOfficeTheme.js.map
71
+ //# sourceMappingURL=createOfficeTheme.js.map