UNPKG

@papernote/ui

Version:

A modern React component library with a paper notebook aesthetic - minimal, professional, and expressive

53 lines 1.72 kB
import React from 'react'; type TextElement = 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label'; export interface TextProps extends Omit<React.HTMLAttributes<HTMLElement>, 'color'> { /** Text content */ children: React.ReactNode; /** HTML element to render */ as?: TextElement; /** Size variant */ size?: 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl'; /** Weight variant */ weight?: 'normal' | 'medium' | 'semibold' | 'bold'; /** Color variant */ color?: 'primary' | 'secondary' | 'muted' | 'accent' | 'error' | 'success' | 'warning'; /** Text alignment */ align?: 'left' | 'center' | 'right'; /** Truncate text with ellipsis (single line) */ truncate?: boolean; /** Clamp text to specific number of lines (with ellipsis) */ lineClamp?: 1 | 2 | 3 | 4 | 5 | 6; /** Text transform */ transform?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal'; /** Custom className */ className?: string; } /** * Text component for consistent typography across the application. * * Supports ref forwarding for DOM access. * * Size scale: * - xs: 0.75rem (12px) * - sm: 0.875rem (14px) * - base: 1rem (16px) * - lg: 1.125rem (18px) * - xl: 1.25rem (20px) * - 2xl: 1.5rem (24px) * * @example * ```tsx * <Text size="lg" weight="semibold" color="primary"> * Hello World * </Text> * * <Text color="warning">Warning message</Text> * * // With ref * const textRef = useRef<HTMLParagraphElement>(null); * <Text ref={textRef}>Measurable text</Text> * ``` */ export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>; export default Text; //# sourceMappingURL=Text.d.ts.map