UNPKG

@geist-ui/react

Version:

Modern and minimalist React UI library.

46 lines (45 loc) 1.65 kB
import React from 'react'; export declare type ScaleableProps = { width?: string | number; height?: string | number; padding?: string | number; margin?: string | number; w?: string | number; h?: string | number; paddingLeft?: string | number; paddingRight?: string | number; paddingTop?: string | number; paddingBottom?: string | number; pl?: string | number; pr?: string | number; pt?: string | number; pb?: string | number; marginLeft?: string | number; marginRight?: string | number; marginTop?: string | number; marginBottom?: string | number; ml?: string | number; mr?: string | number; mt?: string | number; mb?: string | number; px?: string | number; py?: string | number; mx?: string | number; my?: string | number; font?: string | number; unit?: string; scale?: number; }; export declare type DynamicLayoutPipe = (scale1x: number, defaultValue?: string | number) => string; export declare type ScaleableInputKeys = 'pl' | 'pr' | 'pt' | 'pb' | 'px' | 'py' | 'ml' | 'mr' | 'mt' | 'mb' | 'mx' | 'my' | 'width' | 'height' | 'font'; export declare type DynamicScales = { [key in ScaleableInputKeys]: DynamicLayoutPipe; }; export declare type GetScaleablePropsFunction = (key: keyof ScaleableProps | Array<keyof ScaleableProps>) => ScaleableProps[keyof ScaleableProps]; export interface ScaleableConfig { SCALES: DynamicScales; getScaleableProps: GetScaleablePropsFunction; unit: string; } export declare const ScaleableContext: React.Context<ScaleableConfig>; export declare const useScaleable: () => ScaleableConfig;