onecart-ui
Version:
OneCart UI: Cross-platform design tokens + React & React Native components
33 lines (32 loc) • 1.1 kB
TypeScript
import React from "react";
export type BodySize = "xl" | "lg" | "md" | "sm";
export interface BaseTypographyProps {
align?: "left" | "center" | "right";
color?: string;
truncate?: boolean;
lineClamp?: number;
className?: string;
style?: React.CSSProperties | Record<string, unknown>;
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
testID?: string;
children?: React.ReactNode;
}
export interface BodyProps extends BaseTypographyProps {
size?: BodySize;
element?: keyof JSX.IntrinsicElements;
}
export type DisplaySize = "2xl" | "xl";
export interface DisplayProps extends BaseTypographyProps {
size?: DisplaySize;
element?: keyof JSX.IntrinsicElements;
}
export type HeadingSize = "xl" | "lg" | "md" | "sm" | "xs" | "2xs";
export interface HeadingProps extends BaseTypographyProps {
size?: HeadingSize;
element?: keyof JSX.IntrinsicElements;
}
export type UtilityVariant = "button" | "link" | "caption";
export interface UtilityProps extends BaseTypographyProps {
variant?: UtilityVariant;
element?: keyof JSX.IntrinsicElements;
}