@fluentui-react-native/theme-types 0.44.0 → 0.44.3

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.
@@ -12,4 +12,4 @@
12
12
  * `{semantic: "windowBackgroundColor"}`
13
13
  */
14
14
  export {};
15
- //# sourceMappingURL=Color.types.js.map
15
+ //# sourceMappingURL=Color.types.js.map
@@ -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
- x: number;
7
- y: number;
8
- blur: number;
9
- color: ColorValue;
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
- ambient: ShadowValue;
18
- key: ShadowValue;
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
- 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;
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
- [key: string]: ShadowToken;
41
+ [key: string]: ShadowToken;
42
42
  };
43
43
  /**
44
44
  * A partially specified shadow definition.
45
45
  */
46
46
  export type PartialShadowDefinition = {
47
- [P in keyof ThemeShadowDefinition]?: Partial<ThemeShadowDefinition[P]>;
47
+ [P in keyof ThemeShadowDefinition]?: Partial<ThemeShadowDefinition[P]>;
48
48
  };
49
- //# sourceMappingURL=Shadow.types.d.ts.map
49
+ //# sourceMappingURL=Shadow.types.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=Shadow.types.js.map
2
+ //# sourceMappingURL=Shadow.types.js.map
@@ -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
- [K in keyof T]?: Partial<T[K]>;
7
+ [K in keyof T]?: Partial<T[K]>;
8
8
  };
9
9
  export interface Spacing {
10
- s2: `${number}px`;
11
- s1: `${number}px`;
12
- m?: `${number}px`;
13
- l1: `${number}px`;
14
- l2: `${number}px`;
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
- 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;
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;
33
+ };
33
34
  };
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
- shadows?: PartialShadowDefinition;
42
- typography?: PartialTypography;
43
- host?: TwoLevelPartial<Theme['host']>;
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
- * 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;
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
@@ -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
- primary: FontFamilyValue;
26
- secondary: FontFamilyValue;
27
- cursive: FontFamilyValue;
28
- monospace: FontFamilyValue;
29
- numeric: FontFamilyValue;
30
- sansSerif: FontFamilyValue;
31
- serif: FontFamilyValue;
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
- caption: FontSizeValuePoints;
52
- secondary: FontSizeValuePoints;
53
- body: FontSizeValuePoints;
54
- subheader: FontSizeValuePoints;
55
- header: FontSizeValuePoints;
56
- hero: FontSizeValuePoints;
57
- heroLarge: FontSizeValuePoints;
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
- regular: FontWeightValue;
81
- semiBold: FontWeightValue;
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
- face: FontFamily;
104
- size: FontSize;
105
- weight: FontWeight;
106
- lineHeight?: FontLineHeight;
107
- letterSpacing?: FontLetterSpacing;
108
- dynamicTypeRamp?: FontDynamicTypeRamp;
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
- 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;
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
- families: FontFamilies;
157
- sizes: FontSizes;
158
- weights: FontWeights;
159
- variants: Variants;
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
- [P in keyof Typography]?: Partial<Typography[P]>;
166
+ [P in keyof Typography]?: Partial<Typography[P]>;
167
167
  };
168
- //# sourceMappingURL=Typography.types.d.ts.map
168
+ //# sourceMappingURL=Typography.types.d.ts.map
@@ -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
@@ -2,4 +2,4 @@ import * as React from 'react';
2
2
  import type { Theme } from './Theme.types';
3
3
  export declare const ThemeContext: React.Context<Theme>;
4
4
  export declare const useTheme: () => Theme;
5
- //# sourceMappingURL=context.d.ts.map
5
+ //# sourceMappingURL=context.d.ts.map
package/lib/context.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  export const ThemeContext = React.createContext(undefined);
3
3
  export const useTheme = () => React.useContext(ThemeContext);
4
- //# sourceMappingURL=context.js.map
4
+ //# sourceMappingURL=context.js.map
package/lib/index.d.ts CHANGED
@@ -1,33 +1,7 @@
1
- export type {
2
- AliasColorTokens,
3
- Color,
4
- FabricWebPalette,
5
- Palette,
6
- PaletteBackgroundColors,
7
- PaletteTextColors,
8
- PartialPalette,
9
- ThemeColorDefinition,
10
- } from './Color.types';
1
+ export type { AliasColorTokens, Color, FabricWebPalette, Palette, PaletteBackgroundColors, PaletteTextColors, PartialPalette, ThemeColorDefinition, } from './Color.types';
11
2
  export type { ShadowValue, ShadowToken, BaseShadowAliasTokens, ThemeShadowDefinition, PartialShadowDefinition } from './Shadow.types';
12
3
  export type { AppearanceOptions, PartialTheme, Spacing, Theme, ThemeOptions } from './Theme.types';
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';
4
+ export type { FontDynamicTypeRamp, FontFamilies, FontFamily, FontFamilyValue, FontSize, FontSizeValuePoints, FontSizes, FontWeight, FontWeightValue, FontWeights, PartialTypography, TextStyling, Typography, Variant, VariantValue, Variants, } from './Typography.types';
31
5
  export { ThemeContext, useTheme } from './context';
32
6
  export type { OfficePalette } from './palette.types';
33
- //# sourceMappingURL=index.d.ts.map
7
+ //# 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