import * as StyledSystem from "styled-system"; // import * as Emotion from "@emotion/styled"; import * as React from "react"; import { Omit } from "../common-types"; type CSS = React.CSSProperties; type borderRadius = StyledSystem.BorderRadiusProps["borderRadius"]; type borderColor = StyledSystem.BorderColorProps["borderColor"]; interface ICustomConfig { // Custom borderRadius alias rounded?: borderRadius; roundedTop?: borderRadius; roundedBottom?: borderRadius; roundedLeft?: borderRadius; roundedRight?: borderRadius; roundedTopRight?: borderRadius; roundedTopLeft?: borderRadius; roundedBottomRight?: borderRadius; roundedBottomLeft?: borderRadius; // Custom borderColor alias borderBottomColor?: borderColor; borderTopColor?: borderColor; borderRightColor?: borderColor; borderLeftColor?: borderColor; // Custom width alias w?: StyledSystem.WidthProps["width"]; minW?: StyledSystem.MinWidthProps["minWidth"]; maxW?: StyledSystem.MaxWidthProps["maxWidth"]; // Custom height alias h?: StyledSystem.HeightProps["height"]; minH?: StyledSystem.MinHeightProps["minHeight"]; maxH?: StyledSystem.MaxHeightProps["maxHeight"]; // Custom display alias d?: StyledSystem.DisplayProps["display"]; // Custom background alias backgroundAttachment?: StyledSystem.ResponsiveValue< CSS["backgroundAttachment"] >; bgImg?: StyledSystem.BackgroundImageProps["backgroundImage"]; bgImage?: StyledSystem.BackgroundImageProps["backgroundImage"]; bgSize?: StyledSystem.BackgroundSizeProps["backgroundSize"]; bgPos?: StyledSystem.BackgroundPositionProps["backgroundPosition"]; pos?: StyledSystem.PositionProps["position"]; flexDir?: StyledSystem.FlexDirectionProps["flexDirection"]; // CSS properties textDecoration?: StyledSystem.ResponsiveValue; textDecor?: StyledSystem.ResponsiveValue; textTransform?: StyledSystem.ResponsiveValue; overflowX?: StyledSystem.OverflowProps["overflow"]; overflowY?: StyledSystem.OverflowProps["overflow"]; appearance?: StyledSystem.ResponsiveValue; transform?: StyledSystem.ResponsiveValue; transformOrigin?: StyledSystem.ResponsiveValue; animation?: StyledSystem.ResponsiveValue; userSelect?: StyledSystem.ResponsiveValue; pointerEvents?: StyledSystem.ResponsiveValue; boxSizing?: StyledSystem.ResponsiveValue; cursor?: StyledSystem.ResponsiveValue; resize?: StyledSystem.ResponsiveValue; transition?: StyledSystem.ResponsiveValue; objectFit?: StyledSystem.ResponsiveValue; objectPosition?: StyledSystem.ResponsiveValue; visibility?: StyledSystem.ResponsiveValue; // Ellipsis alias wordBreak?: StyledSystem.ResponsiveValue; overflowWrap?: StyledSystem.ResponsiveValue; whiteSpace?: StyledSystem.ResponsiveValue; // SVG color properties fill?: StyledSystem.ColorProps["color"]; stroke?: StyledSystem.ColorProps["color"]; bgAttachment?: StyledSystem.ResponsiveValue; shadow?: StyledSystem.BoxShadowProps["boxShadow"]; // List properties listStyleType?: StyledSystem.ResponsiveValue; listStylePosition?: StyledSystem.ResponsiveValue; listStyleImage?: StyledSystem.ResponsiveValue; listStyleImg?: StyledSystem.ResponsiveValue; listStylePos?: StyledSystem.ResponsiveValue; // Outline prop outline?: StyledSystem.ResponsiveValue; float?: StyledSystem.ResponsiveValue; willChange?: StyledSystem.ResponsiveValue; // Border Width props borderTopWidth?: StyledSystem.ResponsiveValue; borderBottomWidth?: StyledSystem.ResponsiveValue; borderLeftWidth?: StyledSystem.ResponsiveValue; borderRightWidth?: StyledSystem.ResponsiveValue; } type FontSize = | "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl"; interface IFontSize { fontSize?: | StyledSystem.ResponsiveValue | StyledSystem.FontSizeProps["fontSize"]; } type FontWeight = | "hairline" | "thin" | "light" | "normal" | "medium" | "semibold" | "bold" | "extrabold" | "black"; interface IFontWeight { fontWeight?: | StyledSystem.ResponsiveValue | StyledSystem.FontWeightProps["fontWeight"]; } type LineHeight = "none" | "shorter" | "short" | "normal" | "tall" | "taller"; interface ILineHeight { lineHeight?: | StyledSystem.ResponsiveValue | StyledSystem.LineHeightProps["lineHeight"]; } type LetterSpacing = | "tighter" | "tight" | "normal" | "wide" | "wider" | "widest"; interface ILetterSpacing { letterSpacing?: | StyledSystem.ResponsiveValue | StyledSystem.LetterSpacingProps["letterSpacing"]; } interface As { as?: React.ElementType; } type TypographyProps = Omit< StyledSystem.TypographyProps, "fontWeight" | "lineHeight" | "fontSize" | "letterSpacing" >; interface Truncated { /** * If `true`, the text will be truncated */ isTruncated?: boolean; } type StyledSystemProps = StyledSystem.LayoutProps & StyledSystem.ColorProps & StyledSystem.SpaceProps & StyledSystem.BordersProps & StyledSystem.BackgroundProps & StyledSystem.PositionProps & StyledSystem.FlexboxProps & StyledSystem.ShadowProps & StyledSystem.GridProps & StyledSystem.OpacityProps & StyledSystem.OverflowProps; type ModifiedStyledSystemProps = TypographyProps & IFontSize & ILetterSpacing & IFontWeight & ILineHeight & ICustomConfig; type BoxHTMLProps = React.RefAttributes & React.HTMLAttributes; export type BoxProps = BoxHTMLProps & StyledSystemProps & ModifiedStyledSystemProps & As & Truncated; declare const Box: React.FC; export default Box;