@fluentui-react-native/apple-theme 0.29.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/lib/__tests__/apple-theme.test.d.ts +1 -1
- package/lib/__tests__/apple-theme.test.js +41 -42
- package/lib/appleColors.ios.d.ts +1 -1
- package/lib/appleColors.ios.js +174 -174
- package/lib/appleColors.macos.d.ts +1 -1
- package/lib/appleColors.macos.js +367 -367
- package/lib/appleColors.types.ios.d.ts +15 -15
- package/lib/appleColors.types.ios.js +1 -1
- package/lib/appleColors.types.macos.d.ts +146 -146
- package/lib/appleColors.types.macos.js +1 -1
- package/lib/appleHighContrast.macos.d.ts +1 -1
- package/lib/appleHighContrast.macos.js +3 -3
- package/lib/appleShadows.ios.d.ts +1 -1
- package/lib/appleShadows.ios.js +4 -4
- package/lib/appleShadows.macos.d.ts +1 -1
- package/lib/appleShadows.macos.js +2 -2
- package/lib/appleTheme.ios.d.ts +1 -1
- package/lib/appleTheme.ios.js +122 -122
- package/lib/appleTheme.macos.d.ts +53 -53
- package/lib/appleTheme.macos.js +68 -68
- package/lib/appleTypography.ios.d.ts +1 -1
- package/lib/appleTypography.ios.js +50 -50
- package/lib/appleTypography.macos.d.ts +2 -2
- package/lib/appleTypography.macos.js +63 -63
- package/lib/createAppleTheme.d.ts +1 -1
- package/lib/createAppleTheme.ios.d.ts +1 -1
- package/lib/createAppleTheme.ios.js +14 -14
- package/lib/createAppleTheme.js +3 -3
- package/lib/createAppleTheme.macos.d.ts +1 -1
- package/lib/createAppleTheme.macos.js +23 -23
- package/lib/createFontAliasTokens.ios.d.ts +1 -1
- package/lib/createFontAliasTokens.ios.js +2 -2
- package/lib/createMacOSAliasTokens.d.ts +1 -1
- package/lib/createMacOSAliasTokens.js +5 -5
- package/lib/createiOSAliasTokens.d.ts +1 -1
- package/lib/createiOSAliasTokens.js +5 -5
- package/lib/getMacOSTokens.d.ts +435 -443
- package/lib/getMacOSTokens.js +45 -35
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib-commonjs/__tests__/apple-theme.test.d.ts +1 -1
- package/lib-commonjs/__tests__/apple-theme.test.js +46 -47
- package/lib-commonjs/appleColors.ios.d.ts +1 -1
- package/lib-commonjs/appleColors.ios.js +180 -180
- package/lib-commonjs/appleColors.macos.d.ts +1 -1
- package/lib-commonjs/appleColors.macos.js +372 -378
- package/lib-commonjs/appleColors.types.ios.d.ts +15 -15
- package/lib-commonjs/appleColors.types.ios.js +3 -3
- package/lib-commonjs/appleColors.types.macos.d.ts +146 -146
- package/lib-commonjs/appleColors.types.macos.js +3 -3
- package/lib-commonjs/appleHighContrast.macos.d.ts +1 -1
- package/lib-commonjs/appleHighContrast.macos.js +6 -6
- package/lib-commonjs/appleShadows.ios.d.ts +1 -1
- package/lib-commonjs/appleShadows.ios.js +9 -9
- package/lib-commonjs/appleShadows.macos.d.ts +1 -1
- package/lib-commonjs/appleShadows.macos.js +6 -6
- package/lib-commonjs/appleTheme.ios.d.ts +1 -1
- package/lib-commonjs/appleTheme.ios.js +128 -128
- package/lib-commonjs/appleTheme.macos.d.ts +53 -53
- package/lib-commonjs/appleTheme.macos.js +74 -74
- package/lib-commonjs/appleTypography.ios.d.ts +1 -1
- package/lib-commonjs/appleTypography.ios.js +53 -53
- package/lib-commonjs/appleTypography.macos.d.ts +2 -2
- package/lib-commonjs/appleTypography.macos.js +65 -65
- package/lib-commonjs/createAppleTheme.d.ts +1 -1
- package/lib-commonjs/createAppleTheme.ios.d.ts +1 -1
- package/lib-commonjs/createAppleTheme.ios.js +20 -20
- package/lib-commonjs/createAppleTheme.js +7 -7
- package/lib-commonjs/createAppleTheme.macos.d.ts +1 -1
- package/lib-commonjs/createAppleTheme.macos.js +31 -31
- package/lib-commonjs/createFontAliasTokens.ios.d.ts +1 -1
- package/lib-commonjs/createFontAliasTokens.ios.js +10 -12
- package/lib-commonjs/createMacOSAliasTokens.d.ts +1 -1
- package/lib-commonjs/createMacOSAliasTokens.js +10 -10
- package/lib-commonjs/createiOSAliasTokens.d.ts +1 -1
- package/lib-commonjs/createiOSAliasTokens.js +10 -10
- package/lib-commonjs/getMacOSTokens.d.ts +435 -443
- package/lib-commonjs/getMacOSTokens.js +59 -51
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js +10 -30
- package/package.json +20 -19
- package/src/appleTypography.macos.ts +1 -1
package/lib/getMacOSTokens.js
CHANGED
|
@@ -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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const appleHighContrast_macos_1 = require(
|
|
4
|
-
const createAppleTheme_1 = require(
|
|
5
|
-
const createMacOSAliasTokens_1 = require(
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
['light', true],
|
|
27
|
+
['light', false],
|
|
28
|
+
['dark', true],
|
|
29
|
+
['dark', false],
|
|
30
|
+
['highContrast', null],
|
|
31
31
|
];
|
|
32
32
|
it('createAppleTheme test', () => {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const appleTheme = (0, createAppleTheme_1.createAppleTheme)().theme;
|
|
34
|
+
expect(appleTheme).toMatchSnapshot();
|
|
35
35
|
});
|
|
36
36
|
it('IsHighContrast test', () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.paletteFromAppleColors = paletteFromAppleColors;
|
|
4
|
-
const react_native_1 = require(
|
|
5
|
-
const theme_tokens_1 = require(
|
|
6
|
-
const theming_utils_1 = require(
|
|
7
|
-
const createiOSAliasTokens_1 = require(
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|