@fluentui-react-native/theme-types 0.42.1 → 0.44.0
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 +16 -1
- package/CHANGELOG.md +44 -3
- package/lib/Color.types.d.ts +1040 -1040
- package/lib/Color.types.js +1 -1
- package/lib/Shadow.types.d.ts +21 -21
- package/lib/Shadow.types.js +1 -1
- package/lib/Theme.types.d.ts +40 -40
- package/lib/Theme.types.js +1 -1
- package/lib/Typography.types.d.ts +58 -58
- package/lib/Typography.types.js +1 -1
- package/lib/context.d.ts +1 -1
- package/lib/context.js +1 -1
- package/lib/index.d.ts +29 -3
- package/lib/index.js +1 -1
- package/lib/palette.types.d.ts +203 -203
- package/lib/palette.types.d.ts.map +1 -1
- package/lib/palette.types.js +1 -1
- package/lib-commonjs/Color.types.d.ts +1040 -1040
- package/lib-commonjs/Color.types.js +3 -3
- package/lib-commonjs/Shadow.types.d.ts +21 -21
- package/lib-commonjs/Shadow.types.js +3 -3
- package/lib-commonjs/Theme.types.d.ts +40 -40
- package/lib-commonjs/Theme.types.js +3 -3
- package/lib-commonjs/Typography.types.d.ts +58 -58
- package/lib-commonjs/Typography.types.js +3 -3
- package/lib-commonjs/context.d.ts +1 -1
- package/lib-commonjs/context.js +54 -27
- package/lib-commonjs/context.js.map +1 -1
- package/lib-commonjs/index.d.ts +29 -3
- package/lib-commonjs/index.js +16 -6
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/palette.types.d.ts +203 -203
- package/lib-commonjs/palette.types.d.ts.map +1 -1
- package/lib-commonjs/palette.types.js +3 -3
- package/package.json +36 -37
- package/src/palette.types.ts +1 -1
package/lib/Color.types.js
CHANGED
package/lib/Shadow.types.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import type { ColorValue } from 'react-native';
|
|
|
3
3
|
* Base structure of a shadow style, which has x and y offset, blur amount, and color specified
|
|
4
4
|
*/
|
|
5
5
|
export interface ShadowValue {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
blur: number;
|
|
9
|
+
color: ColorValue;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* In FluentUI a shadow is specified as having two parts - an ambient shadow and a key shadow.
|
|
@@ -14,36 +14,36 @@ export interface ShadowValue {
|
|
|
14
14
|
* The key shadow is the offset shadow which gives the control a sense of elevation or distance from the page
|
|
15
15
|
*/
|
|
16
16
|
export interface ShadowToken {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
ambient: ShadowValue;
|
|
18
|
+
key: ShadowValue;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Shadows alias tokens as defined by FluentUI v2 design system
|
|
22
22
|
*/
|
|
23
23
|
export interface BaseShadowAliasTokens {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
shadow2: ShadowToken;
|
|
25
|
+
shadow4: ShadowToken;
|
|
26
|
+
shadow8: ShadowToken;
|
|
27
|
+
shadow16: ShadowToken;
|
|
28
|
+
shadow28: ShadowToken;
|
|
29
|
+
shadow64: ShadowToken;
|
|
30
|
+
shadow2brand: ShadowToken;
|
|
31
|
+
shadow4brand: ShadowToken;
|
|
32
|
+
shadow8brand: ShadowToken;
|
|
33
|
+
shadow16brand: ShadowToken;
|
|
34
|
+
shadow28brand: ShadowToken;
|
|
35
|
+
shadow64brand: ShadowToken;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Shadows on the theme object. This allows for flexibility on entries but retains base alias tokens
|
|
39
39
|
*/
|
|
40
40
|
export type ThemeShadowDefinition = BaseShadowAliasTokens & {
|
|
41
|
-
|
|
41
|
+
[key: string]: ShadowToken;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* A partially specified shadow definition.
|
|
45
45
|
*/
|
|
46
46
|
export type PartialShadowDefinition = {
|
|
47
|
-
|
|
47
|
+
[P in keyof ThemeShadowDefinition]?: Partial<ThemeShadowDefinition[P]>;
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=Shadow.types.d.ts.map
|
|
49
|
+
//# sourceMappingURL=Shadow.types.d.ts.map
|
package/lib/Shadow.types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=Shadow.types.js.map
|
|
2
|
+
//# sourceMappingURL=Shadow.types.js.map
|
package/lib/Theme.types.d.ts
CHANGED
|
@@ -4,62 +4,62 @@ import type { OfficePalette } from './palette.types';
|
|
|
4
4
|
import type { PartialShadowDefinition, ThemeShadowDefinition } from './Shadow.types';
|
|
5
5
|
import type { Typography, PartialTypography } from './Typography.types';
|
|
6
6
|
type TwoLevelPartial<T> = {
|
|
7
|
-
|
|
7
|
+
[K in keyof T]?: Partial<T[K]>;
|
|
8
8
|
};
|
|
9
9
|
export interface Spacing {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
s2: `${number}px`;
|
|
11
|
+
s1: `${number}px`;
|
|
12
|
+
m?: `${number}px`;
|
|
13
|
+
l1: `${number}px`;
|
|
14
|
+
l2: `${number}px`;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A fully specified theme.
|
|
18
18
|
*/
|
|
19
19
|
export interface Theme {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
20
|
+
name?: string;
|
|
21
|
+
colors: ThemeColorDefinition;
|
|
22
|
+
typography: Typography;
|
|
23
|
+
components: {
|
|
24
|
+
[key: string]: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
shadows: ThemeShadowDefinition;
|
|
27
|
+
readonly spacing: Spacing;
|
|
28
|
+
host: {
|
|
29
|
+
appearance: AppearanceOptions | 'dynamic';
|
|
30
|
+
palette?: OfficePalette;
|
|
31
|
+
colors?: {
|
|
32
|
+
[key: string]: ColorValue;
|
|
34
33
|
};
|
|
34
|
+
};
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Generally a partial theme is comprised of partial versions of the objects within the theme, with the exception of shadow and typography
|
|
38
38
|
* which has additional levels of hierarchy
|
|
39
39
|
*/
|
|
40
40
|
export type PartialTheme = Omit<TwoLevelPartial<Theme>, 'shadows' | 'typography' | 'host'> & {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
shadows?: PartialShadowDefinition;
|
|
42
|
+
typography?: PartialTypography;
|
|
43
|
+
host?: TwoLevelPartial<Theme['host']>;
|
|
44
44
|
};
|
|
45
45
|
export type AppearanceOptions = 'light' | 'dark' | 'darkElevated' | 'highContrast';
|
|
46
46
|
export interface ThemeOptions {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Should the baseline colors be light, dark, or use the values from the Appearance API from react-native.
|
|
49
|
+
*/
|
|
50
|
+
appearance?: AppearanceOptions | 'dynamic';
|
|
51
|
+
/**
|
|
52
|
+
* Default appearance should the library to request this from native not be available
|
|
53
|
+
*/
|
|
54
|
+
defaultAppearance?: AppearanceOptions;
|
|
55
|
+
/**
|
|
56
|
+
* If in a host that supports multiple areas within the app that use different palettes, this specifies the palette name to
|
|
57
|
+
* load.
|
|
58
|
+
*
|
|
59
|
+
* In Office this corresponds to regions like taskpanes, the ribbon, left navigation, and so on, but that concept could be extended
|
|
60
|
+
* to any host that wants to support this.
|
|
61
|
+
*/
|
|
62
|
+
paletteName?: string;
|
|
63
63
|
}
|
|
64
64
|
export {};
|
|
65
|
-
//# sourceMappingURL=Theme.types.d.ts.map
|
|
65
|
+
//# sourceMappingURL=Theme.types.d.ts.map
|
package/lib/Theme.types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=Theme.types.js.map
|
|
2
|
+
//# sourceMappingURL=Theme.types.js.map
|
|
@@ -22,13 +22,13 @@ export type FontFamilyValue = string;
|
|
|
22
22
|
* **NOTE:** `primary` and `secondary` are both meant to be assigned a 'normal' family.
|
|
23
23
|
*/
|
|
24
24
|
export interface FontFamilies {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
primary: FontFamilyValue;
|
|
26
|
+
secondary: FontFamilyValue;
|
|
27
|
+
cursive: FontFamilyValue;
|
|
28
|
+
monospace: FontFamilyValue;
|
|
29
|
+
numeric: FontFamilyValue;
|
|
30
|
+
sansSerif: FontFamilyValue;
|
|
31
|
+
serif: FontFamilyValue;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* A font family, used when defining a visual element in a theme.
|
|
@@ -48,13 +48,13 @@ export type FontSizeValuePoints = number;
|
|
|
48
48
|
* These names should be used when defining a theme.
|
|
49
49
|
*/
|
|
50
50
|
export interface FontSizes {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
caption: FontSizeValuePoints;
|
|
52
|
+
secondary: FontSizeValuePoints;
|
|
53
|
+
body: FontSizeValuePoints;
|
|
54
|
+
subheader: FontSizeValuePoints;
|
|
55
|
+
header: FontSizeValuePoints;
|
|
56
|
+
hero: FontSizeValuePoints;
|
|
57
|
+
heroLarge: FontSizeValuePoints;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* A font size, used when defining a visual element in a theme.
|
|
@@ -77,8 +77,8 @@ export type FontWeightValue = TextStyle['fontWeight'];
|
|
|
77
77
|
* These names should be used when defining a theme.
|
|
78
78
|
*/
|
|
79
79
|
export interface FontWeights {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
regular: FontWeightValue;
|
|
81
|
+
semiBold: FontWeightValue;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* A font weight, used when defining a visual element in a theme.
|
|
@@ -100,47 +100,47 @@ export type FontDynamicTypeRamp = TextProps['dynamicTypeRamp'];
|
|
|
100
100
|
* A font variant value.
|
|
101
101
|
*/
|
|
102
102
|
export type VariantValue = {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
face: FontFamily;
|
|
104
|
+
size: FontSize;
|
|
105
|
+
weight: FontWeight;
|
|
106
|
+
lineHeight?: FontLineHeight;
|
|
107
|
+
letterSpacing?: FontLetterSpacing;
|
|
108
|
+
dynamicTypeRamp?: FontDynamicTypeRamp;
|
|
109
109
|
};
|
|
110
110
|
/**
|
|
111
111
|
* A collection of named font variants.
|
|
112
112
|
*/
|
|
113
113
|
export interface Variants {
|
|
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
|
-
|
|
114
|
+
captionStandard: VariantValue;
|
|
115
|
+
secondaryStandard: VariantValue;
|
|
116
|
+
secondarySemibold: VariantValue;
|
|
117
|
+
bodyStandard: VariantValue;
|
|
118
|
+
bodySemibold: VariantValue;
|
|
119
|
+
subheaderStandard: VariantValue;
|
|
120
|
+
subheaderSemibold: VariantValue;
|
|
121
|
+
headerStandard: VariantValue;
|
|
122
|
+
headerSemibold: VariantValue;
|
|
123
|
+
heroStandard: VariantValue;
|
|
124
|
+
heroSemibold: VariantValue;
|
|
125
|
+
heroLargeStandard: VariantValue;
|
|
126
|
+
heroLargeSemibold: VariantValue;
|
|
127
|
+
caption1?: VariantValue;
|
|
128
|
+
caption1Strong?: VariantValue;
|
|
129
|
+
caption2?: VariantValue;
|
|
130
|
+
body1?: VariantValue;
|
|
131
|
+
body1Strong?: VariantValue;
|
|
132
|
+
body2?: VariantValue;
|
|
133
|
+
body2Strong?: VariantValue;
|
|
134
|
+
subtitle1?: VariantValue;
|
|
135
|
+
subtitle1Strong?: VariantValue;
|
|
136
|
+
subtitle2?: VariantValue;
|
|
137
|
+
subtitle2Strong?: VariantValue;
|
|
138
|
+
title1?: VariantValue;
|
|
139
|
+
title1Strong?: VariantValue;
|
|
140
|
+
title2?: VariantValue;
|
|
141
|
+
title3?: VariantValue;
|
|
142
|
+
largeTitle?: VariantValue;
|
|
143
|
+
display?: VariantValue;
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
146
146
|
* A font variant, used when defining a visual element in a theme.
|
|
@@ -153,16 +153,16 @@ export type Variant = keyof Variants | VariantValue;
|
|
|
153
153
|
* this collection.
|
|
154
154
|
*/
|
|
155
155
|
export interface TextStyling {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
families: FontFamilies;
|
|
157
|
+
sizes: FontSizes;
|
|
158
|
+
weights: FontWeights;
|
|
159
|
+
variants: Variants;
|
|
160
160
|
}
|
|
161
161
|
export type Typography = TextStyling;
|
|
162
162
|
/**
|
|
163
163
|
* A partially specified typography.
|
|
164
164
|
*/
|
|
165
165
|
export type PartialTypography = {
|
|
166
|
-
|
|
166
|
+
[P in keyof Typography]?: Partial<Typography[P]>;
|
|
167
167
|
};
|
|
168
|
-
//# sourceMappingURL=Typography.types.d.ts.map
|
|
168
|
+
//# sourceMappingURL=Typography.types.d.ts.map
|
package/lib/Typography.types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=Typography.types.js.map
|
|
2
|
+
//# sourceMappingURL=Typography.types.js.map
|
package/lib/context.d.ts
CHANGED
package/lib/context.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type {
|
|
2
|
+
AliasColorTokens,
|
|
3
|
+
Color,
|
|
4
|
+
FabricWebPalette,
|
|
5
|
+
Palette,
|
|
6
|
+
PaletteBackgroundColors,
|
|
7
|
+
PaletteTextColors,
|
|
8
|
+
PartialPalette,
|
|
9
|
+
ThemeColorDefinition,
|
|
10
|
+
} from './Color.types';
|
|
2
11
|
export type { ShadowValue, ShadowToken, BaseShadowAliasTokens, ThemeShadowDefinition, PartialShadowDefinition } from './Shadow.types';
|
|
3
12
|
export type { AppearanceOptions, PartialTheme, Spacing, Theme, ThemeOptions } from './Theme.types';
|
|
4
|
-
export type {
|
|
13
|
+
export type {
|
|
14
|
+
FontDynamicTypeRamp,
|
|
15
|
+
FontFamilies,
|
|
16
|
+
FontFamily,
|
|
17
|
+
FontFamilyValue,
|
|
18
|
+
FontSize,
|
|
19
|
+
FontSizeValuePoints,
|
|
20
|
+
FontSizes,
|
|
21
|
+
FontWeight,
|
|
22
|
+
FontWeightValue,
|
|
23
|
+
FontWeights,
|
|
24
|
+
PartialTypography,
|
|
25
|
+
TextStyling,
|
|
26
|
+
Typography,
|
|
27
|
+
Variant,
|
|
28
|
+
VariantValue,
|
|
29
|
+
Variants,
|
|
30
|
+
} from './Typography.types';
|
|
5
31
|
export { ThemeContext, useTheme } from './context';
|
|
6
32
|
export type { OfficePalette } from './palette.types';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ThemeContext, useTheme } from './context';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|