@fluentui-react-native/apple-theme 0.29.0 → 0.29.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 (95) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +1 -1
  3. package/lib/__tests__/apple-theme.test.d.ts +1 -1
  4. package/lib/__tests__/apple-theme.test.js +41 -42
  5. package/lib/appleColors.ios.d.ts +1 -1
  6. package/lib/appleColors.ios.js +174 -174
  7. package/lib/appleColors.macos.d.ts +1 -1
  8. package/lib/appleColors.macos.d.ts.map +1 -1
  9. package/lib/appleColors.macos.js +367 -369
  10. package/lib/appleColors.macos.js.map +1 -1
  11. package/lib/appleColors.types.ios.d.ts +15 -15
  12. package/lib/appleColors.types.ios.js +1 -1
  13. package/lib/appleColors.types.macos.d.ts +146 -146
  14. package/lib/appleColors.types.macos.js +1 -1
  15. package/lib/appleHighContrast.macos.d.ts +1 -1
  16. package/lib/appleHighContrast.macos.js +3 -3
  17. package/lib/appleShadows.ios.d.ts +1 -1
  18. package/lib/appleShadows.ios.js +4 -4
  19. package/lib/appleShadows.macos.d.ts +1 -1
  20. package/lib/appleShadows.macos.js +2 -2
  21. package/lib/appleTheme.ios.d.ts +1 -1
  22. package/lib/appleTheme.ios.js +122 -122
  23. package/lib/appleTheme.macos.d.ts +53 -53
  24. package/lib/appleTheme.macos.js +68 -68
  25. package/lib/appleTypography.ios.d.ts +1 -1
  26. package/lib/appleTypography.ios.js +50 -50
  27. package/lib/appleTypography.macos.d.ts +2 -2
  28. package/lib/appleTypography.macos.js +63 -63
  29. package/lib/createAppleTheme.d.ts +1 -1
  30. package/lib/createAppleTheme.ios.d.ts +1 -1
  31. package/lib/createAppleTheme.ios.js +14 -14
  32. package/lib/createAppleTheme.js +3 -3
  33. package/lib/createAppleTheme.macos.d.ts +1 -1
  34. package/lib/createAppleTheme.macos.d.ts.map +1 -1
  35. package/lib/createAppleTheme.macos.js +19 -23
  36. package/lib/createAppleTheme.macos.js.map +1 -1
  37. package/lib/createFontAliasTokens.ios.d.ts +1 -1
  38. package/lib/createFontAliasTokens.ios.js +2 -2
  39. package/lib/createMacOSAliasTokens.d.ts +1 -1
  40. package/lib/createMacOSAliasTokens.js +5 -5
  41. package/lib/createiOSAliasTokens.d.ts +1 -1
  42. package/lib/createiOSAliasTokens.js +5 -5
  43. package/lib/getMacOSTokens.d.ts +435 -443
  44. package/lib/getMacOSTokens.js +45 -35
  45. package/lib/index.d.ts +1 -1
  46. package/lib/index.js +1 -1
  47. package/lib-commonjs/__tests__/apple-theme.test.d.ts +1 -1
  48. package/lib-commonjs/__tests__/apple-theme.test.js +46 -47
  49. package/lib-commonjs/appleColors.ios.d.ts +1 -1
  50. package/lib-commonjs/appleColors.ios.js +180 -180
  51. package/lib-commonjs/appleColors.macos.d.ts +1 -1
  52. package/lib-commonjs/appleColors.macos.d.ts.map +1 -1
  53. package/lib-commonjs/appleColors.macos.js +372 -380
  54. package/lib-commonjs/appleColors.macos.js.map +1 -1
  55. package/lib-commonjs/appleColors.types.ios.d.ts +15 -15
  56. package/lib-commonjs/appleColors.types.ios.js +3 -3
  57. package/lib-commonjs/appleColors.types.macos.d.ts +146 -146
  58. package/lib-commonjs/appleColors.types.macos.js +3 -3
  59. package/lib-commonjs/appleHighContrast.macos.d.ts +1 -1
  60. package/lib-commonjs/appleHighContrast.macos.js +6 -6
  61. package/lib-commonjs/appleShadows.ios.d.ts +1 -1
  62. package/lib-commonjs/appleShadows.ios.js +9 -9
  63. package/lib-commonjs/appleShadows.macos.d.ts +1 -1
  64. package/lib-commonjs/appleShadows.macos.js +6 -6
  65. package/lib-commonjs/appleTheme.ios.d.ts +1 -1
  66. package/lib-commonjs/appleTheme.ios.js +128 -128
  67. package/lib-commonjs/appleTheme.macos.d.ts +53 -53
  68. package/lib-commonjs/appleTheme.macos.js +74 -74
  69. package/lib-commonjs/appleTypography.ios.d.ts +1 -1
  70. package/lib-commonjs/appleTypography.ios.js +53 -53
  71. package/lib-commonjs/appleTypography.macos.d.ts +2 -2
  72. package/lib-commonjs/appleTypography.macos.js +65 -65
  73. package/lib-commonjs/createAppleTheme.d.ts +1 -1
  74. package/lib-commonjs/createAppleTheme.ios.d.ts +1 -1
  75. package/lib-commonjs/createAppleTheme.ios.js +20 -20
  76. package/lib-commonjs/createAppleTheme.js +7 -7
  77. package/lib-commonjs/createAppleTheme.macos.d.ts +1 -1
  78. package/lib-commonjs/createAppleTheme.macos.d.ts.map +1 -1
  79. package/lib-commonjs/createAppleTheme.macos.js +27 -31
  80. package/lib-commonjs/createAppleTheme.macos.js.map +1 -1
  81. package/lib-commonjs/createFontAliasTokens.ios.d.ts +1 -1
  82. package/lib-commonjs/createFontAliasTokens.ios.js +10 -12
  83. package/lib-commonjs/createMacOSAliasTokens.d.ts +1 -1
  84. package/lib-commonjs/createMacOSAliasTokens.js +10 -10
  85. package/lib-commonjs/createiOSAliasTokens.d.ts +1 -1
  86. package/lib-commonjs/createiOSAliasTokens.js +10 -10
  87. package/lib-commonjs/getMacOSTokens.d.ts +435 -443
  88. package/lib-commonjs/getMacOSTokens.js +59 -51
  89. package/lib-commonjs/index.d.ts +1 -1
  90. package/lib-commonjs/index.js +10 -30
  91. package/package.json +27 -26
  92. package/src/appleColors.macos.ts +0 -2
  93. package/src/appleTypography.macos.ts +1 -1
  94. package/src/createAppleTheme.macos.ts +0 -4
  95. package/eslint.config.js +0 -3
@@ -8,41 +8,51 @@ import macOSLightAliasTokens from '@fluentui-react-native/design-tokens-macos/li
8
8
  import macOSLightShadowTokens from '@fluentui-react-native/design-tokens-macos/light/tokens-shadow.json';
9
9
  import { assertNever } from 'assert-never';
10
10
  export function getMacOSAliasTokens(mode, isHighContrast) {
11
- if (mode === 'light') {
12
- if (isHighContrast) {
13
- return macOSLightHCAliasTokens;
14
- } else {
15
- return macOSLightAliasTokens;
16
- }
17
- } else if (mode === 'dark' || mode === 'darkElevated') {
18
- if (isHighContrast) {
19
- return macOSDarkHCAliasTokens;
20
- } else {
21
- return macOSDarkAliasTokens;
22
- }
23
- } else if (mode === 'highContrast') {
24
- throw new Error('highContrast is not a valid AppearanceOptions on macOS');
25
- } else {
26
- assertNever(mode);
27
- }
11
+ if (mode === 'light') {
12
+ if (isHighContrast) {
13
+ return macOSLightHCAliasTokens;
14
+ }
15
+ else {
16
+ return macOSLightAliasTokens;
17
+ }
18
+ }
19
+ else if (mode === 'dark' || mode === 'darkElevated') {
20
+ if (isHighContrast) {
21
+ return macOSDarkHCAliasTokens;
22
+ }
23
+ else {
24
+ return macOSDarkAliasTokens;
25
+ }
26
+ }
27
+ else if (mode === 'highContrast') {
28
+ throw new Error('highContrast is not a valid AppearanceOptions on macOS');
29
+ }
30
+ else {
31
+ assertNever(mode);
32
+ }
28
33
  }
29
34
  export function getMacOSShadowTokens(mode, isHighContrast) {
30
- if (mode === 'light') {
31
- if (isHighContrast) {
32
- return macOSLightHCShadowTokens;
33
- } else {
34
- return macOSLightShadowTokens;
35
- }
36
- } else if (mode === 'dark' || mode === 'darkElevated') {
37
- if (isHighContrast) {
38
- return macOSDarkHCShadowTokens;
39
- } else {
40
- return macOSDarkShadowTokens;
41
- }
42
- } else if (mode === 'highContrast') {
43
- throw new Error('highContrast is not a valid AppearanceOptions on macOS');
44
- } else {
45
- assertNever(mode);
46
- }
35
+ if (mode === 'light') {
36
+ if (isHighContrast) {
37
+ return macOSLightHCShadowTokens;
38
+ }
39
+ else {
40
+ return macOSLightShadowTokens;
41
+ }
42
+ }
43
+ else if (mode === 'dark' || mode === 'darkElevated') {
44
+ if (isHighContrast) {
45
+ return macOSDarkHCShadowTokens;
46
+ }
47
+ else {
48
+ return macOSDarkShadowTokens;
49
+ }
50
+ }
51
+ else if (mode === 'highContrast') {
52
+ throw new Error('highContrast is not a valid AppearanceOptions on macOS');
53
+ }
54
+ else {
55
+ assertNever(mode);
56
+ }
47
57
  }
48
- //# sourceMappingURL=getMacOSTokens.js.map
58
+ //# sourceMappingURL=getMacOSTokens.js.map
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { createAppleTheme } from './createAppleTheme';
2
2
  export { createMacOSColorAliasTokens as createMacOSAliasTokens } from './createMacOSAliasTokens';
3
3
  export { getIsHighContrast, setIsHighContrast } from './appleHighContrast.macos';
4
- //# sourceMappingURL=index.d.ts.map
4
+ //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { createAppleTheme } from './createAppleTheme';
2
2
  export { createMacOSColorAliasTokens as createMacOSAliasTokens } from './createMacOSAliasTokens';
3
3
  export { getIsHighContrast, setIsHighContrast } from './appleHighContrast.macos';
4
- //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=apple-theme.test.d.ts.map
2
+ //# sourceMappingURL=apple-theme.test.d.ts.map
@@ -1,59 +1,58 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
3
- const appleHighContrast_macos_1 = require('../appleHighContrast.macos');
4
- const createAppleTheme_1 = require('../createAppleTheme');
5
- const createMacOSAliasTokens_1 = require('../createMacOSAliasTokens');
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const appleHighContrast_macos_1 = require("../appleHighContrast.macos");
4
+ const createAppleTheme_1 = require("../createAppleTheme");
5
+ const createMacOSAliasTokens_1 = require("../createMacOSAliasTokens");
6
6
  jest.mock('react-native-macos/Libraries/Components/AccessibilityInfo/AccessibilityInfo', () => ({
7
- __esModule: true,
8
- default: {
9
- addEventListener: jest.fn(),
10
- announceForAccessibility: jest.fn(),
11
- isAccessibilityServiceEnabled: jest.fn(),
12
- isBoldTextEnabled: jest.fn(),
13
- isGrayscaleEnabled: jest.fn(),
14
- isInvertColorsEnabled: jest.fn(),
15
- isReduceMotionEnabled: jest.fn(),
16
- prefersCrossFadeTransitions: jest.fn(),
17
- isReduceTransparencyEnabled: jest.fn(),
18
- isScreenReaderEnabled: jest.fn(() => Promise.resolve(false)),
19
- setAccessibilityFocus: jest.fn(),
20
- sendAccessibilityEvent: jest.fn(),
21
- getRecommendedTimeoutMillis: jest.fn(),
22
- isHighContrastEnabled: () => Promise.resolve(false),
23
- },
7
+ __esModule: true,
8
+ default: {
9
+ addEventListener: jest.fn(),
10
+ announceForAccessibility: jest.fn(),
11
+ isAccessibilityServiceEnabled: jest.fn(),
12
+ isBoldTextEnabled: jest.fn(),
13
+ isGrayscaleEnabled: jest.fn(),
14
+ isInvertColorsEnabled: jest.fn(),
15
+ isReduceMotionEnabled: jest.fn(),
16
+ prefersCrossFadeTransitions: jest.fn(),
17
+ isReduceTransparencyEnabled: jest.fn(),
18
+ isScreenReaderEnabled: jest.fn(() => Promise.resolve(false)),
19
+ setAccessibilityFocus: jest.fn(),
20
+ sendAccessibilityEvent: jest.fn(),
21
+ getRecommendedTimeoutMillis: jest.fn(),
22
+ isHighContrastEnabled: () => Promise.resolve(false),
23
+ },
24
24
  }));
25
25
  const macOSAliasTokensTable = [
26
- ['light', true],
27
- ['light', false],
28
- ['dark', true],
29
- ['dark', false],
30
- ['highContrast', null],
26
+ ['light', true],
27
+ ['light', false],
28
+ ['dark', true],
29
+ ['dark', false],
30
+ ['highContrast', null],
31
31
  ];
32
32
  it('createAppleTheme test', () => {
33
- const appleTheme = (0, createAppleTheme_1.createAppleTheme)().theme;
34
- expect(appleTheme).toMatchSnapshot();
33
+ const appleTheme = (0, createAppleTheme_1.createAppleTheme)().theme;
34
+ expect(appleTheme).toMatchSnapshot();
35
35
  });
36
36
  it('IsHighContrast test', () => {
37
- (0, appleHighContrast_macos_1.setIsHighContrast)(false);
38
- expect((0, appleHighContrast_macos_1.getIsHighContrast)()).toBe(false);
39
- (0, appleHighContrast_macos_1.setIsHighContrast)(true);
40
- expect((0, appleHighContrast_macos_1.getIsHighContrast)()).toBe(true);
37
+ (0, appleHighContrast_macos_1.setIsHighContrast)(false);
38
+ expect((0, appleHighContrast_macos_1.getIsHighContrast)()).toBe(false);
39
+ (0, appleHighContrast_macos_1.setIsHighContrast)(true);
40
+ expect((0, appleHighContrast_macos_1.getIsHighContrast)()).toBe(true);
41
41
  });
42
42
  it.concurrent.each(macOSAliasTokensTable)('createMacOSColorAliasTokens test mode: %s, isHighContrast: %p', async (mode, isHighContrast) => {
43
- if (mode === 'highContrast') {
44
- expect(() => (0, createMacOSAliasTokens_1.createMacOSColorAliasTokens)(mode, isHighContrast)).toThrow();
45
- } else {
46
- expect((0, createMacOSAliasTokens_1.createMacOSColorAliasTokens)(mode, isHighContrast)).toMatchSnapshot();
47
- }
43
+ if (mode === 'highContrast') {
44
+ expect(() => (0, createMacOSAliasTokens_1.createMacOSColorAliasTokens)(mode, isHighContrast)).toThrow();
45
+ }
46
+ else {
47
+ expect((0, createMacOSAliasTokens_1.createMacOSColorAliasTokens)(mode, isHighContrast)).toMatchSnapshot();
48
+ }
48
49
  });
49
- it.concurrent.each(macOSAliasTokensTable)(
50
- 'createMacOSShadowAliasTokens test mode: %s, isHighContrast: %p',
51
- async (mode, isHighContrast) => {
50
+ it.concurrent.each(macOSAliasTokensTable)('createMacOSShadowAliasTokens test mode: %s, isHighContrast: %p', async (mode, isHighContrast) => {
52
51
  if (mode === 'highContrast') {
53
- expect(() => (0, createMacOSAliasTokens_1.createMacOSShadowAliasTokens)(mode, isHighContrast)).toThrow();
54
- } else {
55
- expect((0, createMacOSAliasTokens_1.createMacOSShadowAliasTokens)(mode, isHighContrast)).toMatchSnapshot();
52
+ expect(() => (0, createMacOSAliasTokens_1.createMacOSShadowAliasTokens)(mode, isHighContrast)).toThrow();
56
53
  }
57
- },
58
- );
59
- //# sourceMappingURL=apple-theme.test.js.map
54
+ else {
55
+ expect((0, createMacOSAliasTokens_1.createMacOSShadowAliasTokens)(mode, isHighContrast)).toMatchSnapshot();
56
+ }
57
+ });
58
+ //# sourceMappingURL=apple-theme.test.js.map
@@ -1,4 +1,4 @@
1
1
  import type { ThemeColorDefinition } from '@fluentui-react-native/theme-types';
2
2
  /** Creates a palette of colors for the apple theme, using the appropriate FluentUI Apple Palette based on appearance */
3
3
  export declare function paletteFromAppleColors(isLightMode: boolean, isElevated: boolean): ThemeColorDefinition;
4
- //# sourceMappingURL=appleColors.ios.d.ts.map
4
+ //# sourceMappingURL=appleColors.ios.d.ts.map
@@ -1,190 +1,190 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paletteFromAppleColors = paletteFromAppleColors;
4
- const react_native_1 = require('react-native');
5
- const theme_tokens_1 = require('@fluentui-react-native/theme-tokens');
6
- const theming_utils_1 = require('@fluentui-react-native/theming-utils');
7
- const createiOSAliasTokens_1 = require('./createiOSAliasTokens');
4
+ const react_native_1 = require("react-native");
5
+ const theme_tokens_1 = require("@fluentui-react-native/theme-tokens");
6
+ const theming_utils_1 = require("@fluentui-react-native/theming-utils");
7
+ const createiOSAliasTokens_1 = require("./createiOSAliasTokens");
8
8
  //TODO: remove and replace with Fluent 2 alias color tokens
9
9
  function getFluentUIAppleLightPalette() {
10
- return {
11
- communicationBlue: '#0078D4',
12
- communicationBlueTint10: '#2B88D8',
13
- communicationBlueTint20: '#C7E0F4',
14
- communicationBlueTint30: '#DEECF9',
15
- dangerPrimary: '#D92C2C',
16
- dangerTint10: '#DD4242',
17
- gray20: '#69797E',
18
- gray30: '#7A7574',
19
- gray40: '#393939',
20
- successTint10: '#27AC22',
21
- warningPrimary: '#FFD335',
22
- warningTint10: '#FFD94E',
23
- buttonBackgroundFilledPressed: '#2B88D8', //UIColor(light: Colors.primaryTint10(for: window), dark: Colors.primaryTint20(for: window))
24
- buttonTitleDisabled: '#ACACAC', //textDisabled
25
- };
10
+ return {
11
+ communicationBlue: '#0078D4',
12
+ communicationBlueTint10: '#2B88D8',
13
+ communicationBlueTint20: '#C7E0F4',
14
+ communicationBlueTint30: '#DEECF9',
15
+ dangerPrimary: '#D92C2C',
16
+ dangerTint10: '#DD4242',
17
+ gray20: '#69797E',
18
+ gray30: '#7A7574',
19
+ gray40: '#393939',
20
+ successTint10: '#27AC22',
21
+ warningPrimary: '#FFD335',
22
+ warningTint10: '#FFD94E',
23
+ buttonBackgroundFilledPressed: '#2B88D8', //UIColor(light: Colors.primaryTint10(for: window), dark: Colors.primaryTint20(for: window))
24
+ buttonTitleDisabled: '#ACACAC', //textDisabled
25
+ };
26
26
  }
27
27
  //TODO: remove and replace with Fluent 2 alias color tokens
28
28
  function getFluentUIAppleDarkPalette() {
29
- return {
30
- communicationBlue: '#0086F0',
31
- communicationBlueTint10: '#0078D4',
32
- communicationBlueTint20: '#004C87',
33
- communicationBlueTint30: '#043862',
34
- dangerPrimary: '#E83A3A',
35
- dangerTint10: '#CC3333',
36
- gray20: '#69797E',
37
- gray30: '#7A7574',
38
- gray40: '#393939',
39
- successTint10: '#0D9D3D',
40
- warningPrimary: '#FFC328',
41
- warningTint10: '#E0AB24',
42
- buttonBackgroundFilledPressed: '#004C87', //UIColor(light: Colors.primaryTint10(for: window), dark: Colors.primaryTint20(for: window))
43
- buttonTitleDisabled: '#404040', //textDisabled
44
- };
29
+ return {
30
+ communicationBlue: '#0086F0',
31
+ communicationBlueTint10: '#0078D4',
32
+ communicationBlueTint20: '#004C87',
33
+ communicationBlueTint30: '#043862',
34
+ dangerPrimary: '#E83A3A',
35
+ dangerTint10: '#CC3333',
36
+ gray20: '#69797E',
37
+ gray30: '#7A7574',
38
+ gray40: '#393939',
39
+ successTint10: '#0D9D3D',
40
+ warningPrimary: '#FFC328',
41
+ warningTint10: '#E0AB24',
42
+ buttonBackgroundFilledPressed: '#004C87', //UIColor(light: Colors.primaryTint10(for: window), dark: Colors.primaryTint20(for: window))
43
+ buttonTitleDisabled: '#404040', //textDisabled
44
+ };
45
45
  }
46
46
  /** Creates a palette of colors for the apple theme, using the appropriate FluentUI Apple Palette based on appearance */
47
47
  function paletteFromAppleColors(isLightMode, isElevated) {
48
- const fluentApple = isLightMode ? getFluentUIAppleLightPalette() : getFluentUIAppleDarkPalette();
49
- const appearance = react_native_1.Appearance.getColorScheme();
50
- let mode = (0, theming_utils_1.getCurrentAppearance)(appearance, 'light');
51
- if (mode === 'dark' && isElevated) {
52
- mode = 'darkElevated';
53
- }
54
- const fluent2AliasColorTokens = (0, createiOSAliasTokens_1.createiOSColorAliasTokens)(mode);
55
- return {
56
- /* Color Alias Tokens */
57
- ...fluent2AliasColorTokens,
58
- /* PaletteBackgroundColors & PaletteTextColors */
59
- background: fluent2AliasColorTokens.neutralBackground1,
60
- bodyStandoutBackground: fluent2AliasColorTokens.neutralBackground4,
61
- bodyFrameBackground: fluent2AliasColorTokens.neutralBackground1,
62
- bodyFrameDivider: fluent2AliasColorTokens.neutralStroke2,
63
- bodyText: fluent2AliasColorTokens.neutralForeground1,
64
- bodyTextChecked: fluent2AliasColorTokens.neutralForeground1,
65
- subText: fluent2AliasColorTokens.neutralForeground3,
66
- bodyDivider: fluent2AliasColorTokens.neutralStroke1,
67
- disabledBackground: fluent2AliasColorTokens.neutralBackgroundDisabled,
68
- disabledText: fluent2AliasColorTokens.neutralForegroundDisabled1,
69
- disabledBodyText: fluent2AliasColorTokens.neutralForegroundDisabled1,
70
- focusBorder: 'transparent',
71
- variantBorder: fluent2AliasColorTokens.neutralStroke2,
72
- errorText: fluentApple.dangerPrimary,
73
- inputBorder: fluent2AliasColorTokens.neutralStroke2,
74
- inputBackground: fluent2AliasColorTokens.neutralBackground1,
75
- inputFocusBorderAlt: fluent2AliasColorTokens.neutralStroke1,
76
- inputText: fluent2AliasColorTokens.neutralForeground1,
77
- inputPlaceholderText: fluent2AliasColorTokens.neutralForeground3,
78
- // Default values without any style
79
- // on FluentUI Apple iOS, this is the buttonStyle "Secondary Outline"
80
- buttonBackground: 'transparent',
81
- buttonBackgroundChecked: 'transparent',
82
- buttonBackgroundHovered: 'transparent',
83
- buttonBackgroundPressed: 'transparent',
84
- buttonBackgroundDisabled: 'transparent',
85
- buttonBorder: fluentApple.communicationBlueTint10,
86
- buttonText: fluentApple.communicationBlue,
87
- buttonTextHovered: fluentApple.communicationBlue,
88
- buttonTextChecked: fluentApple.communicationBlue,
89
- buttonTextPressed: fluentApple.communicationBlueTint20,
90
- buttonTextDisabled: fluentApple.buttonTitleDisabled,
91
- buttonBorderDisabled: fluent2AliasColorTokens.neutralBackgroundDisabled,
92
- buttonBorderFocused: fluentApple.communicationBlueTint10,
93
- primaryButtonBackground: fluentApple.communicationBlue,
94
- primaryButtonBackgroundHovered: fluentApple.communicationBlue,
95
- primaryButtonBackgroundPressed: fluentApple.buttonBackgroundFilledPressed,
96
- primaryButtonBackgroundDisabled: fluent2AliasColorTokens.neutralBackgroundDisabled,
97
- primaryButtonBorder: 'transparent',
98
- primaryButtonBorderFocused: 'transparent',
99
- primaryButtonText: fluent2AliasColorTokens.neutralForegroundOnColor,
100
- primaryButtonTextHovered: fluent2AliasColorTokens.neutralForegroundOnColor,
101
- primaryButtonTextPressed: fluent2AliasColorTokens.neutralForegroundOnColor,
102
- primaryButtonTextDisabled: fluent2AliasColorTokens.neutralForegroundOnColor,
103
- accentButtonBackground: fluentApple.communicationBlue,
104
- menuBackground: fluent2AliasColorTokens.neutralBackground1,
105
- menuDivider: fluent2AliasColorTokens.neutralStroke2,
106
- menuIcon: fluent2AliasColorTokens.neutralForeground3,
107
- menuItemBackgroundHovered: fluent2AliasColorTokens.neutralBackground1,
108
- menuItemBackgroundPressed: fluent2AliasColorTokens.neutralBackground1,
109
- menuItemText: fluent2AliasColorTokens.neutralForeground1,
110
- menuItemTextHovered: fluent2AliasColorTokens.neutralForeground1,
111
- listHeaderBackgroundHovered: fluent2AliasColorTokens.neutralForeground1,
112
- listHeaderBackgroundPressed: fluent2AliasColorTokens.neutralForeground1,
113
- actionLink: fluentApple.communicationBlue,
114
- link: fluentApple.communicationBlue,
115
- linkHovered: fluentApple.communicationBlue,
116
- linkPressed: fluentApple.communicationBlueTint10,
117
- /* ControlColorTokens */
118
- // Default values without any style
119
- // on FluentUI Apple iOS, this is the buttonStyle "Secondary Outline"
120
- defaultBackground: 'transparent',
121
- defaultBorder: fluentApple.communicationBlueTint10,
122
- defaultContent: fluentApple.communicationBlue,
123
- defaultIcon: fluentApple.communicationBlue,
124
- defaultHoveredBackground: 'transparent',
125
- defaultHoveredBorder: fluentApple.communicationBlueTint10,
126
- defaultHoveredContent: fluentApple.communicationBlue,
127
- defaultHoveredIcon: fluentApple.communicationBlue,
128
- defaultFocusedBackground: 'transparent',
129
- defaultFocusedBorder: fluentApple.communicationBlueTint10,
130
- defaultFocusedContent: fluentApple.communicationBlue,
131
- defaultFocusedIcon: fluentApple.communicationBlue,
132
- defaultPressedBackground: 'transparent',
133
- defaultPressedBorder: fluentApple.communicationBlueTint30,
134
- defaultPressedContent: fluentApple.communicationBlueTint20,
135
- defaultPressedIcon: fluentApple.communicationBlueTint20,
136
- defaultDisabledBackground: 'transparent',
137
- defaultDisabledBorder: fluent2AliasColorTokens.neutralBackgroundDisabled,
138
- defaultDisabledContent: fluentApple.buttonTitleDisabled,
139
- defaultDisabledIcon: fluentApple.buttonTitleDisabled,
140
- ghostBackground: 'transparent',
141
- ghostBorder: 'transparent',
142
- ghostContent: fluentApple.communicationBlue,
143
- ghostIcon: fluentApple.communicationBlue,
144
- ghostHoveredBackground: 'transparent',
145
- ghostHoveredBorder: 'transparent',
146
- ghostHoveredContent: fluentApple.communicationBlue,
147
- ghostHoveredIcon: fluentApple.communicationBlue,
148
- ghostFocusedBackground: 'transparent',
149
- ghostFocusedBorder: 'transparent',
150
- ghostFocusedContent: fluentApple.communicationBlue,
151
- ghostFocusedIcon: fluentApple.communicationBlue,
152
- ghostPressedBackground: 'transparent',
153
- ghostPressedBorder: 'transparent',
154
- ghostPressedContent: fluentApple.communicationBlueTint20,
155
- ghostPressedIcon: fluentApple.communicationBlueTint20,
156
- ghostDisabledBackground: 'transparent',
157
- ghostDisabledBorder: 'transparent',
158
- ghostDisabledContent: fluentApple.buttonTitleDisabled,
159
- ghostDisabledIcon: fluentApple.buttonTitleDisabled,
160
- brandedBackground: fluentApple.communicationBlue,
161
- brandedDisabledBorder: 'transparent',
162
- defaultCheckedBackground: 'transparent',
163
- defaultCheckedContent: fluentApple.communicationBlue,
164
- defaultCheckedHoveredBackground: 'transparent',
165
- defaultCheckedHoveredContent: fluentApple.communicationBlue,
166
- ghostCheckedBackground: 'transparent',
167
- ghostCheckedContent: fluentApple.communicationBlue,
168
- ghostCheckedHoveredBackground: 'transparent',
169
- ghostCheckedHoveredContent: fluentApple.communicationBlue,
170
- ghostCheckedHoveredBorder: 'transparent',
171
- // Buttons on iOS don't have secondary text, so map these to be the same as the normal content
172
- ghostSecondaryContent: fluentApple.communicationBlue,
173
- ghostFocusedSecondaryContent: fluentApple.communicationBlue,
174
- ghostHoveredSecondaryContent: fluentApple.communicationBlue,
175
- ghostPressedSecondaryContent: fluentApple.communicationBlueTint20,
176
- brandedSecondaryContent: fluent2AliasColorTokens.neutralForegroundOnColor,
177
- brandedFocusedSecondaryContent: fluent2AliasColorTokens.neutralForegroundOnColor,
178
- brandedHoveredSecondaryContent: fluent2AliasColorTokens.neutralForegroundOnColor,
179
- brandedPressedSecondaryContent: fluent2AliasColorTokens.neutralForegroundOnColor,
180
- defaultHoveredSecondaryContent: fluentApple.communicationBlue,
181
- defaultPressedSecondaryContent: fluentApple.communicationBlueTint20,
182
- checkboxBackground: fluentApple.communicationBlue,
183
- checkboxBackgroundDisabled: fluent2AliasColorTokens.neutralBackground1,
184
- checkboxBorderColor: theme_tokens_1.globalTokens.color.grey26,
185
- checkmarkColor: fluent2AliasColorTokens.neutralForegroundOnColor,
186
- personaActivityGlow: 'transparent',
187
- personaActivityRing: fluent2AliasColorTokens.neutralBackground1,
188
- };
48
+ const fluentApple = isLightMode ? getFluentUIAppleLightPalette() : getFluentUIAppleDarkPalette();
49
+ const appearance = react_native_1.Appearance.getColorScheme();
50
+ let mode = (0, theming_utils_1.getCurrentAppearance)(appearance, 'light');
51
+ if (mode === 'dark' && isElevated) {
52
+ mode = 'darkElevated';
53
+ }
54
+ const fluent2AliasColorTokens = (0, createiOSAliasTokens_1.createiOSColorAliasTokens)(mode);
55
+ return {
56
+ /* Color Alias Tokens */
57
+ ...fluent2AliasColorTokens,
58
+ /* PaletteBackgroundColors & PaletteTextColors */
59
+ background: fluent2AliasColorTokens.neutralBackground1,
60
+ bodyStandoutBackground: fluent2AliasColorTokens.neutralBackground4,
61
+ bodyFrameBackground: fluent2AliasColorTokens.neutralBackground1,
62
+ bodyFrameDivider: fluent2AliasColorTokens.neutralStroke2,
63
+ bodyText: fluent2AliasColorTokens.neutralForeground1,
64
+ bodyTextChecked: fluent2AliasColorTokens.neutralForeground1,
65
+ subText: fluent2AliasColorTokens.neutralForeground3,
66
+ bodyDivider: fluent2AliasColorTokens.neutralStroke1,
67
+ disabledBackground: fluent2AliasColorTokens.neutralBackgroundDisabled,
68
+ disabledText: fluent2AliasColorTokens.neutralForegroundDisabled1,
69
+ disabledBodyText: fluent2AliasColorTokens.neutralForegroundDisabled1,
70
+ focusBorder: 'transparent',
71
+ variantBorder: fluent2AliasColorTokens.neutralStroke2,
72
+ errorText: fluentApple.dangerPrimary,
73
+ inputBorder: fluent2AliasColorTokens.neutralStroke2,
74
+ inputBackground: fluent2AliasColorTokens.neutralBackground1,
75
+ inputFocusBorderAlt: fluent2AliasColorTokens.neutralStroke1,
76
+ inputText: fluent2AliasColorTokens.neutralForeground1,
77
+ inputPlaceholderText: fluent2AliasColorTokens.neutralForeground3,
78
+ // Default values without any style
79
+ // on FluentUI Apple iOS, this is the buttonStyle "Secondary Outline"
80
+ buttonBackground: 'transparent',
81
+ buttonBackgroundChecked: 'transparent',
82
+ buttonBackgroundHovered: 'transparent',
83
+ buttonBackgroundPressed: 'transparent',
84
+ buttonBackgroundDisabled: 'transparent',
85
+ buttonBorder: fluentApple.communicationBlueTint10,
86
+ buttonText: fluentApple.communicationBlue,
87
+ buttonTextHovered: fluentApple.communicationBlue,
88
+ buttonTextChecked: fluentApple.communicationBlue,
89
+ buttonTextPressed: fluentApple.communicationBlueTint20,
90
+ buttonTextDisabled: fluentApple.buttonTitleDisabled,
91
+ buttonBorderDisabled: fluent2AliasColorTokens.neutralBackgroundDisabled,
92
+ buttonBorderFocused: fluentApple.communicationBlueTint10,
93
+ primaryButtonBackground: fluentApple.communicationBlue,
94
+ primaryButtonBackgroundHovered: fluentApple.communicationBlue,
95
+ primaryButtonBackgroundPressed: fluentApple.buttonBackgroundFilledPressed,
96
+ primaryButtonBackgroundDisabled: fluent2AliasColorTokens.neutralBackgroundDisabled,
97
+ primaryButtonBorder: 'transparent',
98
+ primaryButtonBorderFocused: 'transparent',
99
+ primaryButtonText: fluent2AliasColorTokens.neutralForegroundOnColor,
100
+ primaryButtonTextHovered: fluent2AliasColorTokens.neutralForegroundOnColor,
101
+ primaryButtonTextPressed: fluent2AliasColorTokens.neutralForegroundOnColor,
102
+ primaryButtonTextDisabled: fluent2AliasColorTokens.neutralForegroundOnColor,
103
+ accentButtonBackground: fluentApple.communicationBlue,
104
+ menuBackground: fluent2AliasColorTokens.neutralBackground1,
105
+ menuDivider: fluent2AliasColorTokens.neutralStroke2,
106
+ menuIcon: fluent2AliasColorTokens.neutralForeground3,
107
+ menuItemBackgroundHovered: fluent2AliasColorTokens.neutralBackground1,
108
+ menuItemBackgroundPressed: fluent2AliasColorTokens.neutralBackground1,
109
+ menuItemText: fluent2AliasColorTokens.neutralForeground1,
110
+ menuItemTextHovered: fluent2AliasColorTokens.neutralForeground1,
111
+ listHeaderBackgroundHovered: fluent2AliasColorTokens.neutralForeground1,
112
+ listHeaderBackgroundPressed: fluent2AliasColorTokens.neutralForeground1,
113
+ actionLink: fluentApple.communicationBlue,
114
+ link: fluentApple.communicationBlue,
115
+ linkHovered: fluentApple.communicationBlue,
116
+ linkPressed: fluentApple.communicationBlueTint10,
117
+ /* ControlColorTokens */
118
+ // Default values without any style
119
+ // on FluentUI Apple iOS, this is the buttonStyle "Secondary Outline"
120
+ defaultBackground: 'transparent',
121
+ defaultBorder: fluentApple.communicationBlueTint10,
122
+ defaultContent: fluentApple.communicationBlue,
123
+ defaultIcon: fluentApple.communicationBlue,
124
+ defaultHoveredBackground: 'transparent',
125
+ defaultHoveredBorder: fluentApple.communicationBlueTint10,
126
+ defaultHoveredContent: fluentApple.communicationBlue,
127
+ defaultHoveredIcon: fluentApple.communicationBlue,
128
+ defaultFocusedBackground: 'transparent',
129
+ defaultFocusedBorder: fluentApple.communicationBlueTint10,
130
+ defaultFocusedContent: fluentApple.communicationBlue,
131
+ defaultFocusedIcon: fluentApple.communicationBlue,
132
+ defaultPressedBackground: 'transparent',
133
+ defaultPressedBorder: fluentApple.communicationBlueTint30,
134
+ defaultPressedContent: fluentApple.communicationBlueTint20,
135
+ defaultPressedIcon: fluentApple.communicationBlueTint20,
136
+ defaultDisabledBackground: 'transparent',
137
+ defaultDisabledBorder: fluent2AliasColorTokens.neutralBackgroundDisabled,
138
+ defaultDisabledContent: fluentApple.buttonTitleDisabled,
139
+ defaultDisabledIcon: fluentApple.buttonTitleDisabled,
140
+ ghostBackground: 'transparent',
141
+ ghostBorder: 'transparent',
142
+ ghostContent: fluentApple.communicationBlue,
143
+ ghostIcon: fluentApple.communicationBlue,
144
+ ghostHoveredBackground: 'transparent',
145
+ ghostHoveredBorder: 'transparent',
146
+ ghostHoveredContent: fluentApple.communicationBlue,
147
+ ghostHoveredIcon: fluentApple.communicationBlue,
148
+ ghostFocusedBackground: 'transparent',
149
+ ghostFocusedBorder: 'transparent',
150
+ ghostFocusedContent: fluentApple.communicationBlue,
151
+ ghostFocusedIcon: fluentApple.communicationBlue,
152
+ ghostPressedBackground: 'transparent',
153
+ ghostPressedBorder: 'transparent',
154
+ ghostPressedContent: fluentApple.communicationBlueTint20,
155
+ ghostPressedIcon: fluentApple.communicationBlueTint20,
156
+ ghostDisabledBackground: 'transparent',
157
+ ghostDisabledBorder: 'transparent',
158
+ ghostDisabledContent: fluentApple.buttonTitleDisabled,
159
+ ghostDisabledIcon: fluentApple.buttonTitleDisabled,
160
+ brandedBackground: fluentApple.communicationBlue,
161
+ brandedDisabledBorder: 'transparent',
162
+ defaultCheckedBackground: 'transparent',
163
+ defaultCheckedContent: fluentApple.communicationBlue,
164
+ defaultCheckedHoveredBackground: 'transparent',
165
+ defaultCheckedHoveredContent: fluentApple.communicationBlue,
166
+ ghostCheckedBackground: 'transparent',
167
+ ghostCheckedContent: fluentApple.communicationBlue,
168
+ ghostCheckedHoveredBackground: 'transparent',
169
+ ghostCheckedHoveredContent: fluentApple.communicationBlue,
170
+ ghostCheckedHoveredBorder: 'transparent',
171
+ // Buttons on iOS don't have secondary text, so map these to be the same as the normal content
172
+ ghostSecondaryContent: fluentApple.communicationBlue,
173
+ ghostFocusedSecondaryContent: fluentApple.communicationBlue,
174
+ ghostHoveredSecondaryContent: fluentApple.communicationBlue,
175
+ ghostPressedSecondaryContent: fluentApple.communicationBlueTint20,
176
+ brandedSecondaryContent: fluent2AliasColorTokens.neutralForegroundOnColor,
177
+ brandedFocusedSecondaryContent: fluent2AliasColorTokens.neutralForegroundOnColor,
178
+ brandedHoveredSecondaryContent: fluent2AliasColorTokens.neutralForegroundOnColor,
179
+ brandedPressedSecondaryContent: fluent2AliasColorTokens.neutralForegroundOnColor,
180
+ defaultHoveredSecondaryContent: fluentApple.communicationBlue,
181
+ defaultPressedSecondaryContent: fluentApple.communicationBlueTint20,
182
+ checkboxBackground: fluentApple.communicationBlue,
183
+ checkboxBackgroundDisabled: fluent2AliasColorTokens.neutralBackground1,
184
+ checkboxBorderColor: theme_tokens_1.globalTokens.color.grey26,
185
+ checkmarkColor: fluent2AliasColorTokens.neutralForegroundOnColor,
186
+ personaActivityGlow: 'transparent',
187
+ personaActivityRing: fluent2AliasColorTokens.neutralBackground1,
188
+ };
189
189
  }
190
- //# sourceMappingURL=appleColors.ios.js.map
190
+ //# sourceMappingURL=appleColors.ios.js.map
@@ -3,4 +3,4 @@ import type { ThemeColorDefinition, AppearanceOptions } from '@fluentui-react-na
3
3
  * The fallback palette is loaded while we wait for the native theming module to load, or if the module is not found
4
4
  */
5
5
  export declare function fallbackApplePalette(mode: AppearanceOptions): ThemeColorDefinition;
6
- //# sourceMappingURL=appleColors.macos.d.ts.map
6
+ //# sourceMappingURL=appleColors.macos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appleColors.macos.d.ts","sourceRoot":"","sources":["../src/appleColors.macos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAkQlG;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,oBAAoB,CAuKlF"}
1
+ {"version":3,"file":"appleColors.macos.d.ts","sourceRoot":"","sources":["../src/appleColors.macos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAgQlG;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,oBAAoB,CAuKlF"}