UNPKG

onecart-ui

Version:

Cross-platform React and React Native component library with white-label support

35 lines (28 loc) 903 B
import React from "react"; export type TypographyAlign = "left" | "center" | "right"; export type TypographyWeight = "normal" | "medium" | "semibold" | "bold"; export interface BaseTypographyProps { element?: React.ElementType; align?: TypographyAlign; weight?: TypographyWeight; color?: string; truncate?: boolean; lineClamp?: number; children: React.ReactNode; className?: string; style?: React.CSSProperties; onClick?: (event: React.MouseEvent<HTMLElement>) => void; testID?: string; } export interface DisplayProps extends BaseTypographyProps { size: "2xl" | "xl"; } export interface HeadingProps extends BaseTypographyProps { size: "xl" | "lg" | "md" | "sm" | "xs"; } export interface BodyProps extends BaseTypographyProps { size: "xl" | "lg" | "md" | "sm"; } export interface UtilityProps extends BaseTypographyProps { variant: "button" | "link" | "caption"; }