@fluentui-react-native/apple-theme 0.11.5 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +94 -1
- package/CHANGELOG.md +34 -2
- package/lib/appleColors.macos.js +2 -2
- package/lib/appleColors.macos.js.map +1 -1
- package/lib/appleShadows.macos.d.ts +3 -0
- package/lib/appleShadows.macos.d.ts.map +1 -0
- package/lib/appleShadows.macos.js +10 -0
- package/lib/appleShadows.macos.js.map +1 -0
- package/lib/appleTheme.ios.d.ts.map +1 -1
- package/lib/appleTheme.ios.js +53 -0
- package/lib/appleTheme.ios.js.map +1 -1
- package/lib/appleTheme.macos.d.ts.map +1 -1
- package/lib/appleTheme.macos.js +2 -0
- package/lib/appleTheme.macos.js.map +1 -1
- package/lib/appleTypography.ios.d.ts.map +1 -1
- package/lib/appleTypography.ios.js +14 -0
- package/lib/appleTypography.ios.js.map +1 -1
- package/lib/appleTypography.macos.d.ts.map +1 -1
- package/lib/appleTypography.macos.js +14 -0
- package/lib/appleTypography.macos.js.map +1 -1
- package/lib/createMacOSAliasTokens.d.ts +5 -2
- package/lib/createMacOSAliasTokens.d.ts.map +1 -1
- package/lib/createMacOSAliasTokens.js +9 -4
- package/lib/createMacOSAliasTokens.js.map +1 -1
- package/lib/{getMacOSAliasTokens.d.ts → getMacOSTokens.d.ts} +77 -1
- package/lib/getMacOSTokens.d.ts.map +1 -0
- package/lib/getMacOSTokens.js +58 -0
- package/lib/getMacOSTokens.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/appleColors.macos.js +1 -1
- package/lib-commonjs/appleColors.macos.js.map +1 -1
- package/lib-commonjs/appleShadows.macos.d.ts +3 -0
- package/lib-commonjs/appleShadows.macos.d.ts.map +1 -0
- package/lib-commonjs/appleShadows.macos.js +14 -0
- package/lib-commonjs/appleShadows.macos.js.map +1 -0
- package/lib-commonjs/appleTheme.ios.d.ts.map +1 -1
- package/lib-commonjs/appleTheme.ios.js +53 -0
- package/lib-commonjs/appleTheme.ios.js.map +1 -1
- package/lib-commonjs/appleTheme.macos.d.ts.map +1 -1
- package/lib-commonjs/appleTheme.macos.js +2 -0
- package/lib-commonjs/appleTheme.macos.js.map +1 -1
- package/lib-commonjs/appleTypography.ios.d.ts.map +1 -1
- package/lib-commonjs/appleTypography.ios.js +14 -0
- package/lib-commonjs/appleTypography.ios.js.map +1 -1
- package/lib-commonjs/appleTypography.macos.d.ts.map +1 -1
- package/lib-commonjs/appleTypography.macos.js +14 -0
- package/lib-commonjs/appleTypography.macos.js.map +1 -1
- package/lib-commonjs/createMacOSAliasTokens.d.ts +5 -2
- package/lib-commonjs/createMacOSAliasTokens.d.ts.map +1 -1
- package/lib-commonjs/createMacOSAliasTokens.js +10 -5
- package/lib-commonjs/createMacOSAliasTokens.js.map +1 -1
- package/lib-commonjs/{getMacOSAliasTokens.d.ts → getMacOSTokens.d.ts} +77 -1
- package/lib-commonjs/getMacOSTokens.d.ts.map +1 -0
- package/lib-commonjs/{getMacOSAliasTokens.js → getMacOSTokens.js} +31 -2
- package/lib-commonjs/getMacOSTokens.js.map +1 -0
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.d.ts.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -6
- package/src/appleColors.macos.ts +2 -2
- package/src/appleShadows.macos.ts +11 -0
- package/src/appleTheme.ios.ts +54 -0
- package/src/appleTheme.macos.ts +2 -0
- package/src/appleTypography.ios.ts +14 -0
- package/src/appleTypography.macos.ts +14 -0
- package/src/createMacOSAliasTokens.ts +12 -4
- package/src/{getMacOSAliasTokens.ts → getMacOSTokens.ts} +24 -0
- package/src/index.ts +1 -1
- package/lib/getMacOSAliasTokens.d.ts.map +0 -1
- package/lib/getMacOSAliasTokens.js +0 -30
- package/lib/getMacOSAliasTokens.js.map +0 -1
- package/lib-commonjs/getMacOSAliasTokens.d.ts.map +0 -1
- package/lib-commonjs/getMacOSAliasTokens.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,2BAA2B,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.setIsHighContrast = exports.getIsHighContrast = exports.createMacOSAlias
|
|
|
4
4
|
var createAppleTheme_1 = require("./createAppleTheme");
|
|
5
5
|
Object.defineProperty(exports, "createAppleTheme", { enumerable: true, get: function () { return createAppleTheme_1.createAppleTheme; } });
|
|
6
6
|
var createMacOSAliasTokens_1 = require("./createMacOSAliasTokens");
|
|
7
|
-
Object.defineProperty(exports, "createMacOSAliasTokens", { enumerable: true, get: function () { return createMacOSAliasTokens_1.
|
|
7
|
+
Object.defineProperty(exports, "createMacOSAliasTokens", { enumerable: true, get: function () { return createMacOSAliasTokens_1.createMacOSColorAliasTokens; } });
|
|
8
8
|
var appleHighContrast_macos_1 = require("./appleHighContrast.macos");
|
|
9
9
|
Object.defineProperty(exports, "getIsHighContrast", { enumerable: true, get: function () { return appleHighContrast_macos_1.getIsHighContrast; } });
|
|
10
10
|
Object.defineProperty(exports, "setIsHighContrast", { enumerable: true, get: function () { return appleHighContrast_macos_1.setIsHighContrast; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,mEAAiG;AAAxF,gIAAA,2BAA2B,OAA0B;AAC9D,qEAAiF;AAAxE,4HAAA,iBAAiB,OAAA;AAAE,4HAAA,iBAAiB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/apple-theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "A FluentUI React Native theme that pulls constants from FluentUI Apple",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Microsoft <fluentuinativeowners@microsoft.com>",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"directory": "packages/theming/apple-theme"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@fluentui-react-native/default-theme": ">=0.
|
|
31
|
-
"@fluentui-react-native/design-tokens-macos": "^0.
|
|
30
|
+
"@fluentui-react-native/default-theme": ">=0.12.0 <1.0.0",
|
|
31
|
+
"@fluentui-react-native/design-tokens-macos": "^0.13.0",
|
|
32
32
|
"@fluentui-react-native/memo-cache": "^1.1.7",
|
|
33
|
-
"@fluentui-react-native/theme": ">=0.6.
|
|
34
|
-
"@fluentui-react-native/theme-types": ">=0.
|
|
35
|
-
"@fluentui-react-native/theming-utils": "^0.
|
|
33
|
+
"@fluentui-react-native/theme": ">=0.6.10 <1.0.0",
|
|
34
|
+
"@fluentui-react-native/theme-types": ">=0.16.0 <1.0.0",
|
|
35
|
+
"@fluentui-react-native/theming-utils": "^0.12.0",
|
|
36
36
|
"assert-never": "^1.2.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
package/src/appleColors.macos.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { getCurrentAppearance } from '@fluentui-react-native/theming-utils';
|
|
|
3
3
|
import { AppleSemanticPalette, FluentUIApplePalette } from './appleColors.types.macos';
|
|
4
4
|
import { PlatformColor, DynamicColorMacOS, ColorWithSystemEffectMacOS } from 'react-native-macos';
|
|
5
5
|
import { Appearance } from 'react-native';
|
|
6
|
-
import {
|
|
6
|
+
import { createMacOSColorAliasTokens } from './createMacOSAliasTokens';
|
|
7
7
|
import { getIsHighContrast } from './appleHighContrast.macos';
|
|
8
8
|
|
|
9
9
|
/** Creates a Palette of PlatformColors defined for macOS */
|
|
@@ -258,7 +258,7 @@ function getFluentUIApplePalette(): FluentUIApplePalette {
|
|
|
258
258
|
function getMacOSAliasTokens(): AliasColorTokens {
|
|
259
259
|
const appearance = Appearance.getColorScheme();
|
|
260
260
|
const mode = getCurrentAppearance(appearance, 'light');
|
|
261
|
-
return
|
|
261
|
+
return createMacOSColorAliasTokens(mode, getIsHighContrast());
|
|
262
262
|
}
|
|
263
263
|
/** Creates a palette of colors for the apple theme, given the FluentUI Apple Palette and Apple Semantic Palette
|
|
264
264
|
* The fallback palette is loaded while we wait for the native theming module to load, or if the module is not found
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ThemeShadowDefinition } from '@fluentui-react-native/theme-types';
|
|
2
|
+
import { getCurrentAppearance } from '@fluentui-react-native/theming-utils';
|
|
3
|
+
import { Appearance } from 'react-native';
|
|
4
|
+
import { getIsHighContrast } from './appleHighContrast.macos';
|
|
5
|
+
import { createMacOSShadowAliasTokens } from './createMacOSAliasTokens';
|
|
6
|
+
|
|
7
|
+
export function fallbackAppleShadows(): ThemeShadowDefinition {
|
|
8
|
+
const appearance = Appearance.getColorScheme();
|
|
9
|
+
const mode = getCurrentAppearance(appearance, 'light');
|
|
10
|
+
return createMacOSShadowAliasTokens(mode, getIsHighContrast());
|
|
11
|
+
}
|
package/src/appleTheme.ios.ts
CHANGED
|
@@ -121,9 +121,62 @@ const appleComponents = {
|
|
|
121
121
|
},
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
+
// mocked out
|
|
125
|
+
const iOSShadows = {
|
|
126
|
+
shadow2: {
|
|
127
|
+
ambient: { x: 0, y: 0, blur: 2, color: '#0000001f' },
|
|
128
|
+
key: { x: 0, y: 1, blur: 2, color: '#00000024' },
|
|
129
|
+
},
|
|
130
|
+
shadow4: {
|
|
131
|
+
ambient: { x: 0, y: 0, blur: 2, color: '#0000001f' },
|
|
132
|
+
key: { x: 0, y: 2, blur: 4, color: '#00000024' },
|
|
133
|
+
},
|
|
134
|
+
shadow8: {
|
|
135
|
+
ambient: { x: 0, y: 0, blur: 2, color: '#0000001f' },
|
|
136
|
+
key: { x: 0, y: 4, blur: 8, color: '#00000024' },
|
|
137
|
+
},
|
|
138
|
+
shadow16: {
|
|
139
|
+
ambient: { x: 0, y: 0, blur: 2, color: '#0000001f' },
|
|
140
|
+
key: { x: 0, y: 8, blur: 16, color: '#00000024' },
|
|
141
|
+
},
|
|
142
|
+
shadow28: {
|
|
143
|
+
ambient: { x: 0, y: 0, blur: 8, color: '#00000033' },
|
|
144
|
+
key: { x: 0, y: 14, blur: 28, color: '#0000003d' },
|
|
145
|
+
},
|
|
146
|
+
shadow64: {
|
|
147
|
+
ambient: { x: 0, y: 0, blur: 8, color: '#00000033' },
|
|
148
|
+
key: { x: 0, y: 32, blur: 64, color: '#0000003d' },
|
|
149
|
+
},
|
|
150
|
+
shadow2brand: {
|
|
151
|
+
ambient: { x: 0, y: 0, blur: 2, color: '#0000004d' },
|
|
152
|
+
key: { x: 0, y: 1, blur: 2, color: '#00000040' },
|
|
153
|
+
},
|
|
154
|
+
shadow4brand: {
|
|
155
|
+
ambient: { x: 0, y: 0, blur: 2, color: '#0000004d' },
|
|
156
|
+
key: { x: 0, y: 2, blur: 4, color: '#00000040' },
|
|
157
|
+
},
|
|
158
|
+
shadow8brand: {
|
|
159
|
+
ambient: { x: 0, y: 0, blur: 2, color: '#0000004d' },
|
|
160
|
+
key: { x: 0, y: 4, blur: 8, color: '#00000040' },
|
|
161
|
+
},
|
|
162
|
+
shadow16brand: {
|
|
163
|
+
ambient: { x: 0, y: 0, blur: 2, color: '#0000004d' },
|
|
164
|
+
key: { x: 0, y: 8, blur: 16, color: '#00000040' },
|
|
165
|
+
},
|
|
166
|
+
shadow28brand: {
|
|
167
|
+
ambient: { x: 0, y: 0, blur: 8, color: '#0000004d' },
|
|
168
|
+
key: { x: 0, y: 14, blur: 28, color: '#00000040' },
|
|
169
|
+
},
|
|
170
|
+
shadow64brand: {
|
|
171
|
+
ambient: { x: 0, y: 0, blur: 8, color: '#0000004d' },
|
|
172
|
+
key: { x: 0, y: 32, blur: 64, color: '#00000040' },
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
|
|
124
176
|
export const BaseAppleLightThemeIOS: Theme = {
|
|
125
177
|
colors: paletteFromAppleColors(false),
|
|
126
178
|
typography: appleTypography(),
|
|
179
|
+
shadows: iOSShadows,
|
|
127
180
|
spacing: appleSpacing(),
|
|
128
181
|
components: appleComponents,
|
|
129
182
|
host: { appearance: 'light' },
|
|
@@ -132,6 +185,7 @@ export const BaseAppleLightThemeIOS: Theme = {
|
|
|
132
185
|
export const BaseAppleDarkThemeIOS: Theme = {
|
|
133
186
|
colors: paletteFromAppleColors(true),
|
|
134
187
|
typography: appleTypography(),
|
|
188
|
+
shadows: iOSShadows,
|
|
135
189
|
spacing: appleSpacing(),
|
|
136
190
|
components: appleComponents,
|
|
137
191
|
host: { appearance: 'dark' },
|
package/src/appleTheme.macos.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Spacing, Theme } from '@fluentui-react-native/theme-types';
|
|
2
2
|
import { fallbackApplePalette } from './appleColors.macos';
|
|
3
|
+
import { fallbackAppleShadows } from './appleShadows.macos';
|
|
3
4
|
import { fallbackAppleTypography } from './appleTypography.macos';
|
|
4
5
|
|
|
5
6
|
export function appleSpacing(): Spacing {
|
|
@@ -74,6 +75,7 @@ export function getBaseAppleThemeMacOS(): Theme {
|
|
|
74
75
|
return {
|
|
75
76
|
colors: fallbackApplePalette(),
|
|
76
77
|
typography: fallbackAppleTypography(),
|
|
78
|
+
shadows: fallbackAppleShadows(),
|
|
77
79
|
spacing: appleSpacing(),
|
|
78
80
|
components: appleComponents,
|
|
79
81
|
host: { appearance: 'dynamic' },
|
|
@@ -45,6 +45,20 @@ export function appleTypography(): Typography {
|
|
|
45
45
|
heroSemibold: { face: 'primary', size: 'hero', weight: '600' },
|
|
46
46
|
heroLargeStandard: { face: 'primary', size: 'heroLarge', weight: '400' },
|
|
47
47
|
heroLargeSemibold: { face: 'primary', size: 'heroLarge', weight: '600' },
|
|
48
|
+
// mocked out
|
|
49
|
+
caption1: { face: 'primary', size: 'caption', weight: '400' },
|
|
50
|
+
body1: { face: 'primary', size: 'secondary', weight: '400' },
|
|
51
|
+
body1Strong: { face: 'primary', size: 'secondary', weight: '600' },
|
|
52
|
+
body2: { face: 'primary', size: 'body', weight: '400' },
|
|
53
|
+
body2Strong: { face: 'primary', size: 'body', weight: '600' },
|
|
54
|
+
subtitle1: { face: 'primary', size: 'header', weight: '400' },
|
|
55
|
+
subtitle1Strong: { face: 'primary', size: 'header', weight: '600' },
|
|
56
|
+
subtitle2: { face: 'primary', size: 'subheader', weight: '400' },
|
|
57
|
+
subtitle2Strong: { face: 'primary', size: 'subheader', weight: '600' },
|
|
58
|
+
title1: { face: 'primary', size: 'hero', weight: '400' },
|
|
59
|
+
title1Strong: { face: 'primary', size: 'hero', weight: '600' },
|
|
60
|
+
largeTitle: { face: 'primary', size: 'heroLarge', weight: '400' },
|
|
61
|
+
display: { face: 'primary', size: 'heroLarge', weight: '600' },
|
|
48
62
|
} as Variants,
|
|
49
63
|
};
|
|
50
64
|
|
|
@@ -51,6 +51,20 @@ export function fallbackAppleTypography(): Typography {
|
|
|
51
51
|
heroSemibold: { face: 'primary', size: 'hero', weight: '700' },
|
|
52
52
|
heroLargeStandard: { face: 'primary', size: 'heroLarge', weight: '400' },
|
|
53
53
|
heroLargeSemibold: { face: 'primary', size: 'heroLarge', weight: '700' },
|
|
54
|
+
// mocked out
|
|
55
|
+
caption1: { face: 'primary', size: 'caption', weight: '500' },
|
|
56
|
+
body1: { face: 'primary', size: 'secondary', weight: '400' },
|
|
57
|
+
body1Strong: { face: 'primary', size: 'secondary', weight: '600' },
|
|
58
|
+
body2: { face: 'primary', size: 'body', weight: '400' },
|
|
59
|
+
body2Strong: { face: 'primary', size: 'body', weight: '600' },
|
|
60
|
+
subtitle1: { face: 'primary', size: 'header', weight: '700' },
|
|
61
|
+
subtitle1Strong: { face: 'primary', size: 'header', weight: '800' },
|
|
62
|
+
subtitle2: { face: 'primary', size: 'subheader', weight: '400' },
|
|
63
|
+
subtitle2Strong: { face: 'primary', size: 'subheader', weight: '600' },
|
|
64
|
+
title1: { face: 'primary', size: 'hero', weight: '400' },
|
|
65
|
+
title1Strong: { face: 'primary', size: 'hero', weight: '700' },
|
|
66
|
+
largeTitle: { face: 'primary', size: 'heroLarge', weight: '400' },
|
|
67
|
+
display: { face: 'primary', size: 'heroLarge', weight: '700' },
|
|
54
68
|
} as Variants,
|
|
55
69
|
};
|
|
56
70
|
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { getMacOSAliasTokens } from './
|
|
1
|
+
import { getMacOSAliasTokens, getMacOSShadowTokens } from './getMacOSTokens';
|
|
2
2
|
import { AliasColorTokens, AppearanceOptions } from '@fluentui-react-native/theme-types';
|
|
3
|
-
import { mapPipelineToTheme } from '@fluentui-react-native/theming-utils';
|
|
3
|
+
import { mapPipelineToTheme, mapPipelineToShadow } from '@fluentui-react-native/theming-utils';
|
|
4
4
|
import { memoize } from '@fluentui-react-native/memo-cache';
|
|
5
|
+
import { ThemeShadowDefinition } from '@fluentui-react-native/theme-types/lib/Shadow.types';
|
|
5
6
|
|
|
6
|
-
function
|
|
7
|
+
function createMacOSColorAliasTokensWorker(mode: AppearanceOptions, isHighContrast: boolean): AliasColorTokens {
|
|
7
8
|
const aliasTokens = getMacOSAliasTokens(mode, isHighContrast);
|
|
8
9
|
return mapPipelineToTheme(aliasTokens);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
export const
|
|
12
|
+
export const createMacOSColorAliasTokens = memoize(createMacOSColorAliasTokensWorker);
|
|
13
|
+
|
|
14
|
+
function createMacOSShadowAliasTokensWorker(mode: AppearanceOptions, isHighContrast: boolean): ThemeShadowDefinition {
|
|
15
|
+
const aliasTokens = getMacOSShadowTokens(mode, isHighContrast);
|
|
16
|
+
return mapPipelineToShadow(aliasTokens);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const createMacOSShadowAliasTokens = memoize(createMacOSShadowAliasTokensWorker);
|
|
@@ -2,6 +2,10 @@ import macOSLightAliasTokens from '@fluentui-react-native/design-tokens-macos/li
|
|
|
2
2
|
import macOSDarkAliasTokens from '@fluentui-react-native/design-tokens-macos/dark/tokens-aliases.json';
|
|
3
3
|
import macOSLightHCAliasTokens from '@fluentui-react-native/design-tokens-macos/hclight/tokens-aliases.json';
|
|
4
4
|
import macOSDarkHCAliasTokens from '@fluentui-react-native/design-tokens-macos/hcdark/tokens-aliases.json';
|
|
5
|
+
import macOSLightShadowTokens from '@fluentui-react-native/design-tokens-macos/light/tokens-shadow.json';
|
|
6
|
+
import macOSDarkShadowTokens from '@fluentui-react-native/design-tokens-macos/dark/tokens-shadow.json';
|
|
7
|
+
import macOSLightHCShadowTokens from '@fluentui-react-native/design-tokens-macos/hclight/tokens-shadow.json';
|
|
8
|
+
import macOSDarkHCShadowTokens from '@fluentui-react-native/design-tokens-macos/hcdark/tokens-shadow.json';
|
|
5
9
|
import { AppearanceOptions } from '@fluentui-react-native/theme-types';
|
|
6
10
|
import { assertNever } from 'assert-never';
|
|
7
11
|
|
|
@@ -24,3 +28,23 @@ export function getMacOSAliasTokens(mode: AppearanceOptions, isHighContrast: boo
|
|
|
24
28
|
assertNever(mode);
|
|
25
29
|
}
|
|
26
30
|
}
|
|
31
|
+
|
|
32
|
+
export function getMacOSShadowTokens(mode: AppearanceOptions, isHighContrast: boolean) {
|
|
33
|
+
if (mode === 'light') {
|
|
34
|
+
if (isHighContrast) {
|
|
35
|
+
return macOSLightHCShadowTokens.shadow;
|
|
36
|
+
} else {
|
|
37
|
+
return macOSLightShadowTokens.shadow;
|
|
38
|
+
}
|
|
39
|
+
} else if (mode === 'dark') {
|
|
40
|
+
if (isHighContrast) {
|
|
41
|
+
return macOSDarkHCShadowTokens.shadow;
|
|
42
|
+
} else {
|
|
43
|
+
return macOSDarkShadowTokens.shadow;
|
|
44
|
+
}
|
|
45
|
+
} else if (mode === 'highContrast') {
|
|
46
|
+
throw new Error('highContrast is not a valid AppearanceOptions on macOS');
|
|
47
|
+
} else {
|
|
48
|
+
assertNever(mode);
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { createAppleTheme } from './createAppleTheme';
|
|
2
|
-
export { createMacOSAliasTokens } from './createMacOSAliasTokens';
|
|
2
|
+
export { createMacOSColorAliasTokens as createMacOSAliasTokens } from './createMacOSAliasTokens';
|
|
3
3
|
export { getIsHighContrast, setIsHighContrast } from './appleHighContrast.macos';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMacOSAliasTokens.d.ts","sourceRoot":"","sources":["../src/getMacOSAliasTokens.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBnF"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import macOSLightAliasTokens from '@fluentui-react-native/design-tokens-macos/light/tokens-aliases.json';
|
|
2
|
-
import macOSDarkAliasTokens from '@fluentui-react-native/design-tokens-macos/dark/tokens-aliases.json';
|
|
3
|
-
import macOSLightHCAliasTokens from '@fluentui-react-native/design-tokens-macos/hclight/tokens-aliases.json';
|
|
4
|
-
import macOSDarkHCAliasTokens from '@fluentui-react-native/design-tokens-macos/hcdark/tokens-aliases.json';
|
|
5
|
-
import { assertNever } from 'assert-never';
|
|
6
|
-
export function getMacOSAliasTokens(mode, isHighContrast) {
|
|
7
|
-
if (mode === 'light') {
|
|
8
|
-
if (isHighContrast) {
|
|
9
|
-
return macOSLightHCAliasTokens;
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
return macOSLightAliasTokens;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
else if (mode === 'dark') {
|
|
16
|
-
if (isHighContrast) {
|
|
17
|
-
return macOSDarkHCAliasTokens;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
return macOSDarkAliasTokens;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
else if (mode === 'highContrast') {
|
|
24
|
-
throw new Error('highContrast is not a valid AppearanceOptions on macOS');
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
assertNever(mode);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=getMacOSAliasTokens.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMacOSAliasTokens.js","sourceRoot":"","sources":["../src/getMacOSAliasTokens.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,sEAAsE,CAAC;AACzG,OAAO,oBAAoB,MAAM,qEAAqE,CAAC;AACvG,OAAO,uBAAuB,MAAM,wEAAwE,CAAC;AAC7G,OAAO,sBAAsB,MAAM,uEAAuE,CAAC;AAE3G,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,UAAU,mBAAmB,CAAC,IAAuB,EAAE,cAAuB;IAClF,IAAI,IAAI,KAAK,OAAO,EAAE;QACpB,IAAI,cAAc,EAAE;YAClB,OAAO,uBAAuB,CAAC;SAChC;aAAM;YACL,OAAO,qBAAqB,CAAC;SAC9B;KACF;SAAM,IAAI,IAAI,KAAK,MAAM,EAAE;QAC1B,IAAI,cAAc,EAAE;YAClB,OAAO,sBAAsB,CAAC;SAC/B;aAAM;YACL,OAAO,oBAAoB,CAAC;SAC7B;KACF;SAAM,IAAI,IAAI,KAAK,cAAc,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;KAC3E;SAAM;QACL,WAAW,CAAC,IAAI,CAAC,CAAC;KACnB;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMacOSAliasTokens.d.ts","sourceRoot":"","sources":["../src/getMacOSAliasTokens.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBnF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMacOSAliasTokens.js","sourceRoot":"","sources":["../src/getMacOSAliasTokens.ts"],"names":[],"mappings":";;;;;;AAAA,6HAAyG;AACzG,4HAAuG;AACvG,+HAA6G;AAC7G,8HAA2G;AAE3G,6CAA2C;AAE3C,SAAgB,mBAAmB,CAAC,IAAuB,EAAE,cAAuB;IAClF,IAAI,IAAI,KAAK,OAAO,EAAE;QACpB,IAAI,cAAc,EAAE;YAClB,OAAO,6BAAuB,CAAC;SAChC;aAAM;YACL,OAAO,6BAAqB,CAAC;SAC9B;KACF;SAAM,IAAI,IAAI,KAAK,MAAM,EAAE;QAC1B,IAAI,cAAc,EAAE;YAClB,OAAO,6BAAsB,CAAC;SAC/B;aAAM;YACL,OAAO,6BAAoB,CAAC;SAC7B;KACF;SAAM,IAAI,IAAI,KAAK,cAAc,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;KAC3E;SAAM;QACL,IAAA,0BAAW,EAAC,IAAI,CAAC,CAAC;KACnB;AACH,CAAC;AAlBD,kDAkBC"}
|