Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -1,65 +1,84 @@
import { Color, Contrast } from '..';
import commonColors from '../colors/common';
import { Color, PaletteType } from '..';
import { CommonColors } from '../colors/common';
type ShadeText = {
interface TypeText {
primary: string;
secondary: string;
disabled: string;
hint: string;
icon: string;
divider: string;
lightDivider: string;
};
}
type ShadeInput = {
bottomLine: string;
helperText: string;
labelText: string;
inputText: string;
disabled: string;
};
type ShadeAction = {
interface TypeAction {
active: string;
hover: string;
selected: string;
disabled: string;
};
disabledBackground: string;
}
type ShadeBackground = {
interface TypeBackground {
default: string;
paper: string;
appBar: string;
contentFrame: string;
status: string;
};
}
export type Shade = {
text: ShadeText;
input: ShadeInput;
action: ShadeAction;
background: ShadeBackground;
};
export type PaletteColorOptions = SimplePaletteColorOptions | Partial<Color>;
export const light: Shade;
export const dark: Shade;
export interface SimplePaletteColorOptions {
light?: string;
main: string;
dark?: string;
contrastText?: string;
}
export type Palette = {
common: typeof commonColors;
type: Contrast;
primary: Color;
secondary: Color;
error: Color;
export interface PaletteColor {
light: string;
main: string;
dark: string;
contrastText: string;
}
export interface TypeObject {
text: TypeText;
action: TypeAction;
background: TypeBackground;
}
export const light: TypeObject;
export const dark: TypeObject;
export interface Palette {
common: CommonColors;
type: PaletteType;
contrastThreshold: number;
tonalOffset: number;
primary: PaletteColor;
secondary: PaletteColor;
error: PaletteColor;
grey: Color;
shades: {
dark: Shade;
light: Shade;
};
text: ShadeText;
input: ShadeInput;
action: ShadeAction;
background: ShadeBackground;
text: TypeText;
divider: string;
action: TypeAction;
background: TypeBackground;
getContrastText: (color: string) => string;
};
}
export default function createPalette(
palette: Partial<Palette>
): Palette;
type PartialTypeObject = { [P in keyof TypeObject]?: Partial<TypeObject[P]> };
type ColorPartial = Partial<Color>;
export interface PaletteOptions {
common?: Partial<CommonColors>;
type?: PaletteType;
primary?: PaletteColorOptions;
secondary?: PaletteColorOptions;
error?: PaletteColorOptions;
grey?: ColorPartial;
text?: Partial<TypeText>;
divider?: string;
action?: Partial<TypeAction>;
background?: Partial<TypeBackground>;
getContrastText?: (color: string) => string;
}
//export type PaletteOptions = DeepPartial<Palette>;
export default function createPalette(palette: PaletteOptions): Palette;