@fluentui-react-native/default-theme 0.27.6 → 0.27.11

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.
@@ -1,112 +1,19 @@
1
- import { Platform } from 'react-native';
2
-
3
- import { globalTokens } from '@fluentui-react-native/theme-tokens';
4
- import type { Theme, Typography, Spacing, FontWeightValue, FontSize, FontSizes, Variants } from '@fluentui-react-native/design/theming';
5
- import { fontWeightRegular, fontWeightSemibold } from '@fluentui-react-native/design/tokens/global';
6
-
7
- import { createShadowAliasTokens } from './createAliasTokens';
8
- import { getStockWebHCPalette } from './defaultColors';
9
- import { getStockWebPalette, getStockWebDarkPalette } from './stockWebPalette';
10
-
11
- function _defaultTypography(): Typography {
12
- const defaultsDict = {
13
- sizes: {
14
- caption: globalTokens.font.size100 as FontSize,
15
- secondary: globalTokens.font.size200 as FontSize,
16
- body: globalTokens.font.size300 as FontSize,
17
- subheader: globalTokens.font.size400 as FontSize,
18
- header: globalTokens.font.size500 as FontSize,
19
- hero: globalTokens.font.size700 as FontSize,
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/theme-tokens';
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
 
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/ban-ts-comment */
2
- import { globalTokens } from '@fluentui-react-native/theme-tokens';
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/theme-tokens';
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