UNPKG

@blockstack/ui

Version:

Blockstack UI components built using React and styled-components with styled-system.

96 lines (95 loc) 5.12 kB
import * as StyledSystem from 'styled-system'; import * as React from 'react'; import { LiteralUnion } from 'type-fest'; import * as CSS from 'csstype'; import { Omit } from '../common-types'; import typography, { TextStylesLiteral } from '../theme/typography'; import { SpacingProps } from '../theme/types'; import { shadows } from '../theme/theme'; export declare type FontSizeValues = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl'; export declare type FontWeightValues = keyof typeof typography.fontWeights; export interface FontSize { fontSize?: StyledSystem.ResponsiveValue<FontSizeValues> | StyledSystem.FontSizeProps['fontSize']; } export interface FontWeight { fontWeight?: StyledSystem.ResponsiveValue<FontWeightValues> | StyledSystem.FontWeightProps['fontWeight']; } export declare type LineHeightValues = keyof typeof typography.lineHeights; export interface LineHeight { lineHeight?: StyledSystem.ResponsiveValue<LineHeightValues> | StyledSystem.LineHeightProps['lineHeight']; } export declare type LetterSpacingValues = keyof typeof typography.letterSpacings; export interface LetterSpacing { letterSpacing?: StyledSystem.ResponsiveValue<LetterSpacingValues> | StyledSystem.LetterSpacingProps['letterSpacing']; } export interface TextAlign { textAlign?: StyledSystem.ResponsiveValue<CSS.TextAlignProperty> | StyledSystem.TextAlignProps['textAlign']; } export interface TextDecoration { textDecoration?: StyledSystem.ResponsiveValue<CSS.TextDecorationProperty<any>> | CSS.TextDecorationProperty<any>; } export interface TextTransform { textTransform?: StyledSystem.ResponsiveValue<CSS.TextTransformProperty> | CSS.TextTransformProperty; } export interface TextStyle { textStyle?: StyledSystem.ResponsiveValue<LiteralUnion<TextStylesLiteral, string>>; } export declare type AsType = React.ElementType<any>; export interface As { as?: AsType; } export interface WhiteSpace { whiteSpace?: StyledSystem.ResponsiveValue<CSS.WhiteSpaceProperty>; } export declare type TypographyProps = Omit<StyledSystem.TypographyProps, 'fontWeight' | 'lineHeight' | 'fontSize' | 'letterSpacing' | 'textAlign' | 'textStyle' | 'whiteSpace' | 'textDecoration' | 'textTransform'> & WhiteSpace; export interface FlexDirectionShorthandProps { flexDir?: StyledSystem.FlexDirectionProps['flexDirection']; } export interface DisplayShorthandProps { d?: StyledSystem.DisplayProps['display']; } export declare type BoxShadow = LiteralUnion<keyof typeof shadows, CSS.BoxShadowProperty>; export interface OtherProps { children?: React.ReactNode[] | React.ReactNode; cursor?: CSS.CursorProperty | StyledSystem.ResponsiveValue<CSS.CursorProperty>; transform?: CSS.TransformProperty | StyledSystem.ResponsiveValue<CSS.TransformProperty>; transition?: CSS.TransitionProperty | StyledSystem.ResponsiveValue<CSS.TransitionProperty>; boxShadow?: BoxShadow | StyledSystem.ResponsiveValue<BoxShadow>; pointerEvents?: CSS.PointerEventsProperty | StyledSystem.ResponsiveValue<CSS.PointerEventsProperty>; outline?: CSS.OutlineProperty<any> | StyledSystem.ResponsiveValue<CSS.OutlineProperty<any>>; } export declare type ShorthandProps = FlexDirectionShorthandProps & DisplayShorthandProps; export declare type StyledSystemProps = StyledSystem.LayoutProps & StyledSystem.ColorProps & StyledSystem.SpaceProps & StyledSystem.BordersProps & StyledSystem.BackgroundProps & StyledSystem.PositionProps & StyledSystem.FlexboxProps & StyledSystem.ShadowProps & StyledSystem.GridProps & StyledSystem.OpacityProps & StyledSystem.OverflowProps; export declare type ModifiedStyledSystemProps = TypographyProps & FontSize & LetterSpacing & TextAlign & TextStyle & FontWeight & LineHeight & TextDecoration & TextTransform & OtherProps; export declare type BoxHTMLProps = React.RefAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>; export declare type BoxPropsBase = StyledSystemProps & ModifiedStyledSystemProps & ShorthandProps & As & BoxHTMLProps & SpacingProps; export declare type Box = React.FC<BoxPropsBase>; export declare type PropsOf<T extends AsType> = React.ComponentPropsWithRef<T>; declare type BoxSystemProps = Omit<BoxPropsBase, 'as'>; export interface BoxProps extends BoxPropsBase { _after?: BoxSystemProps; _before?: BoxSystemProps; _focus?: BoxSystemProps; _hover?: BoxSystemProps; _active?: BoxSystemProps; _pressed?: BoxSystemProps; _selected?: BoxSystemProps; _focusWithin?: BoxSystemProps; _invalid?: BoxSystemProps; _disabled?: BoxSystemProps; _grabbed?: BoxSystemProps; _expanded?: BoxSystemProps; _checked?: BoxSystemProps; _mixed?: BoxSystemProps; _odd?: BoxSystemProps; _even?: BoxSystemProps; _visited?: BoxSystemProps; _readOnly?: BoxSystemProps; _first?: BoxSystemProps; _last?: BoxSystemProps; _groupHover?: BoxSystemProps; _notFirst?: BoxSystemProps; _notLast?: BoxSystemProps; _placeholder?: BoxSystemProps; } export {};