@blockstack/ui
Version:
Blockstack UI components built using React and styled-components with styled-system.
34 lines (33 loc) • 1.47 kB
TypeScript
import StyledSystem, { Theme as StyledSystemTheme } from 'styled-system';
import { LiteralUnion } from 'type-fest';
import { TextStylesLiteral } from './typography';
import { namedSpacingUnits } from './sizes';
interface CustomTheme {
opacity?: {
[key: string]: string;
};
textStyles?: TextStylesLiteral;
fonts: {
[key: string]: string;
};
}
export declare type Theme = StyledSystemTheme & CustomTheme;
export declare type RequiredTheme = Required<Theme>;
export declare type Responsive<T, ThemeType extends Theme = RequiredTheme> = T | (T | null)[] | {
[key in keyof ThemeType['breakpoints']]?: T;
};
export declare type NamedSpacingLiteral = keyof typeof namedSpacingUnits;
export declare type Spacing = LiteralUnion<NamedSpacingLiteral, string | number>;
export declare type SpacingTypes = Spacing | Spacing[];
declare type MarginPropNames = keyof StyledSystem.MarginProps;
declare type PaddingPropNames = keyof StyledSystem.PaddingProps;
declare type Margins = LiteralUnion<NamedSpacingLiteral, string | number>;
declare type Paddings = LiteralUnion<NamedSpacingLiteral, string | number>;
declare type MarginProps = {
[key in MarginPropNames]?: Margins | StyledSystem.ResponsiveValue<Margins>;
};
declare type PaddingProps = {
[key in PaddingPropNames]?: Paddings | StyledSystem.ResponsiveValue<Paddings>;
};
export declare type SpacingProps = MarginProps & PaddingProps;
export {};