@fluentui-react-native/default-theme 0.27.8 → 0.27.12
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/.cache/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +39 -0
- package/lib/__tests__/default-theme.test.js +16 -0
- package/lib/__tests__/default-theme.test.js.map +1 -1
- package/lib/createAliasTokens.js +2 -2
- package/lib/createAliasTokens.js.map +1 -1
- package/lib/createDefaultTheme.d.ts.map +1 -1
- package/lib/createDefaultTheme.js +23 -22
- package/lib/createDefaultTheme.js.map +1 -1
- package/lib/defaultTheme.d.ts +3 -5
- package/lib/defaultTheme.d.ts.map +1 -1
- package/lib/defaultTheme.js +16 -102
- package/lib/defaultTheme.js.map +1 -1
- package/lib/stockWebPalette.js +1 -1
- package/lib/stockWebPalette.js.map +1 -1
- package/lib/stockWebPalette.macos.js +1 -1
- package/lib/stockWebPalette.macos.js.map +1 -1
- package/lib/stockWebPalette.win32.js +1 -1
- package/lib/stockWebPalette.win32.js.map +1 -1
- package/package.json +3 -5
- package/src/__tests__/default-theme.test.ts +22 -0
- package/src/createAliasTokens.ts +2 -2
- package/src/createDefaultTheme.ts +28 -25
- package/src/defaultTheme.ts +19 -112
- package/src/stockWebPalette.macos.ts +1 -1
- package/src/stockWebPalette.ts +1 -1
- package/src/stockWebPalette.win32.ts +1 -1
package/src/defaultTheme.ts
CHANGED
|
@@ -1,112 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
heroLarge: globalTokens.font.size900 as FontSize,
|
|
21
|
-
} as FontSizes,
|
|
22
|
-
weights: {
|
|
23
|
-
regular: fontWeightRegular as FontWeightValue,
|
|
24
|
-
semiBold: fontWeightSemibold as FontWeightValue,
|
|
25
|
-
},
|
|
26
|
-
families: {
|
|
27
|
-
primary: 'Segoe UI',
|
|
28
|
-
secondary: 'Segoe UI',
|
|
29
|
-
cursive: 'System',
|
|
30
|
-
monospace: 'System',
|
|
31
|
-
numeric: 'System',
|
|
32
|
-
sansSerif: 'System',
|
|
33
|
-
serif: 'System',
|
|
34
|
-
},
|
|
35
|
-
variants: {
|
|
36
|
-
captionStandard: { face: 'primary', size: 'caption', weight: 'regular' },
|
|
37
|
-
secondaryStandard: { face: 'primary', size: 'secondary', weight: 'regular' },
|
|
38
|
-
secondarySemibold: { face: 'primary', size: 'secondary', weight: 'semiBold' },
|
|
39
|
-
bodyStandard: { face: 'primary', size: 'body', weight: 'regular' },
|
|
40
|
-
bodySemibold: { face: 'primary', size: 'body', weight: 'semiBold' },
|
|
41
|
-
subheaderStandard: { face: 'primary', size: 'subheader', weight: 'regular' },
|
|
42
|
-
subheaderSemibold: { face: 'primary', size: 'subheader', weight: 'semiBold' },
|
|
43
|
-
headerStandard: { face: 'primary', size: 'header', weight: 'regular' },
|
|
44
|
-
headerSemibold: { face: 'primary', size: 'header', weight: 'semiBold' },
|
|
45
|
-
heroStandard: { face: 'primary', size: 'hero', weight: 'regular' },
|
|
46
|
-
heroSemibold: { face: 'primary', size: 'hero', weight: 'semiBold' },
|
|
47
|
-
heroLargeStandard: { face: 'primary', size: 'heroLarge', weight: 'regular' },
|
|
48
|
-
heroLargeSemibold: { face: 'primary', size: 'heroLarge', weight: 'semiBold' },
|
|
49
|
-
// mocked out
|
|
50
|
-
caption1: { face: 'primary', size: 'caption', weight: 'regular' },
|
|
51
|
-
caption1Strong: { face: 'primary', size: 'caption', weight: 'semiBold' },
|
|
52
|
-
body1: { face: 'primary', size: 'secondary', weight: 'regular' },
|
|
53
|
-
body1Strong: { face: 'primary', size: 'secondary', weight: 'semiBold' },
|
|
54
|
-
body2: { face: 'primary', size: 'body', weight: 'regular' },
|
|
55
|
-
body2Strong: { face: 'primary', size: 'body', weight: 'semiBold' },
|
|
56
|
-
subtitle1: { face: 'primary', size: 'header', weight: 'regular' },
|
|
57
|
-
subtitle1Strong: { face: 'primary', size: 'header', weight: 'semiBold' },
|
|
58
|
-
subtitle2: { face: 'primary', size: 'subheader', weight: 'regular' },
|
|
59
|
-
subtitle2Strong: { face: 'primary', size: 'subheader', weight: 'semiBold' },
|
|
60
|
-
title1: { face: 'primary', size: 'hero', weight: 'regular' },
|
|
61
|
-
title1Strong: { face: 'primary', size: 'hero', weight: 'semiBold' },
|
|
62
|
-
largeTitle: { face: 'primary', size: 'heroLarge', weight: 'regular' },
|
|
63
|
-
display: { face: 'primary', size: 'heroLarge', weight: 'semiBold' },
|
|
64
|
-
} as Variants,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
if (Platform.OS === 'macos' || Platform.OS === 'ios') {
|
|
68
|
-
const familiesDictApple = {
|
|
69
|
-
primary: 'System',
|
|
70
|
-
secondary: 'System',
|
|
71
|
-
cursive: 'System',
|
|
72
|
-
monospace: 'System',
|
|
73
|
-
numeric: 'System',
|
|
74
|
-
sansSerif: 'System',
|
|
75
|
-
serif: 'System',
|
|
76
|
-
};
|
|
77
|
-
defaultsDict.families = familiesDictApple;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return defaultsDict;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function defaultSpacing(): Spacing {
|
|
84
|
-
return { s2: '4px', s1: '8px', m: '16px', l1: '20px', l2: '32px' };
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export const defaultFluentTheme: Theme = {
|
|
88
|
-
colors: getStockWebPalette(),
|
|
89
|
-
typography: _defaultTypography(),
|
|
90
|
-
spacing: defaultSpacing(),
|
|
91
|
-
shadows: createShadowAliasTokens('light'),
|
|
92
|
-
components: {},
|
|
93
|
-
host: { appearance: 'light' },
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export const defaultFluentDarkTheme: Theme = {
|
|
97
|
-
colors: getStockWebDarkPalette(),
|
|
98
|
-
typography: defaultFluentTheme.typography,
|
|
99
|
-
shadows: createShadowAliasTokens('dark'),
|
|
100
|
-
spacing: defaultFluentTheme.spacing,
|
|
101
|
-
components: {},
|
|
102
|
-
host: { appearance: 'dark' },
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const defaultFluentHighConstrastTheme: Theme = {
|
|
106
|
-
colors: getStockWebHCPalette(),
|
|
107
|
-
typography: defaultFluentTheme.typography,
|
|
108
|
-
shadows: createShadowAliasTokens('highContrast'),
|
|
109
|
-
spacing: defaultFluentTheme.spacing,
|
|
110
|
-
components: {},
|
|
111
|
-
host: { appearance: 'highContrast' },
|
|
112
|
-
};
|
|
1
|
+
import { getDefaultLegacyTheme } from '@fluentui-react-native/design/theming/compat/defaults';
|
|
2
|
+
|
|
3
|
+
export const defaultFluentTheme = getDefaultLegacyTheme({
|
|
4
|
+
colorScheme: 'light',
|
|
5
|
+
contrast: 'standard',
|
|
6
|
+
interfaceLevel: 'base',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const defaultFluentDarkTheme = getDefaultLegacyTheme({
|
|
10
|
+
colorScheme: 'dark',
|
|
11
|
+
contrast: 'standard',
|
|
12
|
+
interfaceLevel: 'base',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const defaultFluentHighConstrastTheme = getDefaultLegacyTheme({
|
|
16
|
+
colorScheme: 'dark',
|
|
17
|
+
contrast: 'highContrast',
|
|
18
|
+
interfaceLevel: 'base',
|
|
19
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { globalTokens } from '@fluentui-react-native/
|
|
1
|
+
import { globalTokens } from '@fluentui-react-native/design/tokens/legacy';
|
|
2
2
|
import type { ThemeColorDefinition } from '@fluentui-react-native/design/theming';
|
|
3
3
|
import { colorBlack, colorBurgundyPrimary, colorRedPrimary, colorWhite } from '@fluentui-react-native/design/tokens/global';
|
|
4
4
|
|
package/src/stockWebPalette.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
import { globalTokens } from '@fluentui-react-native/
|
|
2
|
+
import { globalTokens } from '@fluentui-react-native/design/tokens/legacy';
|
|
3
3
|
import type { ThemeColorDefinition } from '@fluentui-react-native/design/theming';
|
|
4
4
|
import { colorBlack, colorBurgundyPrimary, colorRedPrimary, colorWhite } from '@fluentui-react-native/design/tokens/global';
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { globalTokens } from '@fluentui-react-native/
|
|
1
|
+
import { globalTokens } from '@fluentui-react-native/design/tokens/legacy';
|
|
2
2
|
import type { ThemeColorDefinition } from '@fluentui-react-native/design/theming';
|
|
3
3
|
import { colorBlack, colorBurgundyPrimary, colorRedPrimary, colorWhite } from '@fluentui-react-native/design/tokens/global';
|
|
4
4
|
|