UNPKG

4.79 kBTypeScriptView Raw
1import type * as React from 'react';
2import type { $DeepPartial } from '@callstack/react-theme-provider';
3export declare type Font = {
4 fontFamily: string;
5 fontWeight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
6 fontStyle?: 'normal' | 'italic' | undefined;
7};
8export declare type Fonts = {
9 regular: Font;
10 medium: Font;
11 light: Font;
12 thin: Font;
13};
14declare type Mode = 'adaptive' | 'exact';
15export declare type MD2Colors = {
16 primary: string;
17 background: string;
18 surface: string;
19 accent: string;
20 error: string;
21 text: string;
22 onSurface: string;
23 disabled: string;
24 placeholder: string;
25 backdrop: string;
26 notification: string;
27 tooltip: string;
28};
29export declare type MD3Colors = {
30 primary: string;
31 primaryContainer: string;
32 secondary: string;
33 secondaryContainer: string;
34 tertiary: string;
35 tertiaryContainer: string;
36 surface: string;
37 surfaceVariant: string;
38 surfaceDisabled: string;
39 background: string;
40 error: string;
41 errorContainer: string;
42 onPrimary: string;
43 onPrimaryContainer: string;
44 onSecondary: string;
45 onSecondaryContainer: string;
46 onTertiary: string;
47 onTertiaryContainer: string;
48 onSurface: string;
49 onSurfaceVariant: string;
50 onSurfaceDisabled: string;
51 onError: string;
52 onErrorContainer: string;
53 onBackground: string;
54 outline: string;
55 outlineVariant: string;
56 inverseSurface: string;
57 inverseOnSurface: string;
58 inversePrimary: string;
59 shadow: string;
60 scrim: string;
61 backdrop: string;
62 elevation: MD3ElevationColors;
63};
64export declare type MD3AndroidColors = {
65 primary: number;
66 primaryContainer: number;
67 secondary: number;
68 secondaryContainer: number;
69 tertiary: number;
70 tertiaryContainer: number;
71 surface: number;
72 surfaceVariant: number;
73 background: number;
74 error: number;
75 errorContainer: number;
76 onPrimary: number;
77 onPrimaryContainer: number;
78 onSecondary: number;
79 onSecondaryContainer: number;
80 onTertiary: number;
81 onTertiaryContainer: number;
82 onSurface: number;
83 onSurfaceVariant: number;
84 onError: number;
85 onErrorContainer: number;
86 onBackground: number;
87 outline: number;
88 outlineVariant: number;
89 inverseSurface: number;
90 inverseOnSurface: number;
91 inversePrimary: number;
92 shadow: number;
93 scrim: number;
94};
95export declare type MD3Palette = {};
96export declare type ThemeProp = $DeepPartial<InternalTheme>;
97export declare type ThemeBase = {
98 dark: boolean;
99 mode?: Mode;
100 roundness: number;
101 animation: {
102 scale: number;
103 defaultAnimationDuration?: number;
104 };
105};
106export declare type MD3Theme = ThemeBase & {
107 version: 3;
108 isV3: true;
109 colors: MD3Colors;
110 fonts: MD3Typescale;
111};
112export declare type MD2Theme = ThemeBase & {
113 version: 2;
114 isV3: false;
115 colors: MD2Colors;
116 fonts: Fonts;
117};
118export declare type InternalTheme = MD2Theme | MD3Theme;
119export declare enum MD3TypescaleKey {
120 displayLarge = "displayLarge",
121 displayMedium = "displayMedium",
122 displaySmall = "displaySmall",
123 headlineLarge = "headlineLarge",
124 headlineMedium = "headlineMedium",
125 headlineSmall = "headlineSmall",
126 titleLarge = "titleLarge",
127 titleMedium = "titleMedium",
128 titleSmall = "titleSmall",
129 labelLarge = "labelLarge",
130 labelMedium = "labelMedium",
131 labelSmall = "labelSmall",
132 bodyLarge = "bodyLarge",
133 bodyMedium = "bodyMedium",
134 bodySmall = "bodySmall"
135}
136export declare type MD3Type = {
137 fontFamily: string;
138 letterSpacing: number;
139 fontWeight: Font['fontWeight'];
140 lineHeight: number;
141 fontSize: number;
142 fontStyle?: Font['fontStyle'];
143};
144export declare type MD3Typescale = {
145 [key in MD3TypescaleKey]: MD3Type;
146} & {
147 ['default']: Omit<MD3Type, 'lineHeight' | 'fontSize'>;
148};
149export declare type MD3Elevation = 0 | 1 | 2 | 3 | 4 | 5;
150export declare enum ElevationLevels {
151 'level0' = 0,
152 'level1' = 1,
153 'level2' = 2,
154 'level3' = 3,
155 'level4' = 4,
156 'level5' = 5
157}
158export declare type MD3ElevationColors = {
159 [key in keyof typeof ElevationLevels]: string;
160};
161export declare type $Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
162export declare type $RemoveChildren<T extends React.ComponentType<any>> = $Omit<React.ComponentPropsWithoutRef<T>, 'children'>;
163export declare type EllipsizeProp = 'head' | 'middle' | 'tail' | 'clip';
164export declare type NavigationTheme = {
165 dark: boolean;
166 colors: {
167 primary: string;
168 background: string;
169 card: string;
170 text: string;
171 border: string;
172 notification: string;
173 };
174};
175export {};
176//# sourceMappingURL=types.d.ts.map
\No newline at end of file