onecart-ui
Version:
Cross-platform React and React Native component library with white-label support
108 lines (102 loc) • 1.75 kB
text/typescript
export interface ThemeColors {
primary: string;
secondary: string;
background: string;
surface: string;
text: string;
textSecondary: string;
border: string;
error: string;
warning: string;
success: string;
}
export interface ThemeSpacing {
xs: number;
sm: number;
md: number;
lg: number;
xl: number;
}
export interface ThemeBorderRadius {
none: number;
sm: number;
md: number;
lg: number;
full: number;
}
export interface ThemeTypography {
fontSize: {
xs: number;
sm: number;
md: number;
lg: number;
xl: number;
xxl: number;
};
fontWeight: {
normal: '400' | 'normal';
medium: '500' | 'medium';
semibold: '600' | 'semibold';
bold: '700' | 'bold';
};
lineHeight: {
tight: number;
normal: number;
relaxed: number;
};
}
export interface Theme {
colors: ThemeColors;
spacing: ThemeSpacing;
borderRadius: ThemeBorderRadius;
typography: ThemeTypography;
}
export const defaultTheme: Theme = {
colors: {
primary: '#007AFF',
secondary: '#5856D6',
background: '#FFFFFF',
surface: '#F2F2F7',
text: '#000000',
textSecondary: '#8E8E93',
border: '#E5E5EA',
error: '#FF3B30',
warning: '#FF9500',
success: '#34C759',
},
spacing: {
xs: 4,
sm: 8,
md: 16,
lg: 24,
xl: 32,
},
borderRadius: {
none: 0,
sm: 4,
md: 8,
lg: 12,
full: 9999,
},
typography: {
fontSize: {
xs: 12,
sm: 14,
md: 16,
lg: 18,
xl: 20,
xxl: 24,
},
fontWeight: {
normal: '400',
medium: '500',
semibold: '600',
bold: '700',
},
lineHeight: {
tight: 1.2,
normal: 1.5,
relaxed: 1.8,
},
},
};