UNPKG

@lax-wp/design-system

Version:

A comprehensive React + TypeScript design system built with Vite, providing reusable UI components for the LAX web portal applications. Features a complete set of form components, data display elements, and interactive controls with full TypeScript suppor

54 lines (53 loc) 1.77 kB
import { COLORS } from "../../../constants/colors"; /** * Available tag size options */ export type TagSize = "xs" | "sm" | "md" | "lg"; /** * Available color names for tags */ export type TagColor = keyof typeof COLORS; /** * Theme mode for styling */ export type ThemeMode = "light" | "dark"; /** * Upload handler function type */ export type UploadHandler = (file: File) => void | Promise<void>; /** * Props for the Tag component */ export interface TagProps { /** The text content to display */ label: string; /** Color name or hex color value */ color?: TagColor | string; /** Size variant */ size?: TagSize; /** Additional CSS classes */ className?: string; /** Click handler for the tag */ onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void; /** Mouse down handler */ onMouseDown?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void; /** Maximum character length before truncation */ truncate?: number; /** Whether to use hash color generation for string colors */ isHashColor?: boolean; /** Icon to display before the label */ icon?: React.ReactNode; /** Whether the tag is removable (shows close button) */ removable?: boolean; /** Handler for remove button click */ onRemove?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; /** Upload handler function */ onUpload?: UploadHandler; /** Whether the tag accepts file uploads */ acceptsUpload?: boolean; /** Theme mode for styling */ theme?: ThemeMode; /** Custom aria-label for accessibility */ "aria-label"?: string; } export declare const Tag: import("react").ForwardRefExoticComponent<TagProps & import("react").RefAttributes<HTMLDivElement>>;