@jixic/react-ui 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/components/Alert/Alert.tsx","../src/utils/cx.ts","../src/components/Badge/Badge.tsx","../src/components/Button/Button.tsx","../src/components/Spinner/Spinner.tsx","../src/components/Card/Card.tsx","../src/components/EmptyState/EmptyState.tsx","../src/components/Input/Input.tsx","../src/components/Modal/Modal.tsx","../src/components/Skeleton/Skeleton.tsx","../src/tokens/colors.ts","../src/tokens/spacing.ts","../src/tokens/typography.ts"],"sourcesContent":["export { Alert } from \"./components/Alert/Alert\";\nexport type { AlertProps } from \"./components/Alert/Alert\";\nexport { Badge } from \"./components/Badge/Badge\";\nexport type { BadgeProps } from \"./components/Badge/Badge\";\nexport { Button } from \"./components/Button/Button\";\nexport type { ButtonProps } from \"./components/Button/Button\";\nexport { Card, CardContent, CardFooter, CardHeader } from \"./components/Card/Card\";\nexport type {\n CardContentProps,\n CardFooterProps,\n CardHeaderProps,\n CardProps,\n} from \"./components/Card/Card\";\nexport { EmptyState } from \"./components/EmptyState/EmptyState\";\nexport type { EmptyStateProps } from \"./components/EmptyState/EmptyState\";\nexport { Input } from \"./components/Input/Input\";\nexport type { InputProps } from \"./components/Input/Input\";\nexport { Modal } from \"./components/Modal/Modal\";\nexport type { ModalProps } from \"./components/Modal/Modal\";\nexport { Skeleton } from \"./components/Skeleton/Skeleton\";\nexport type { SkeletonProps } from \"./components/Skeleton/Skeleton\";\nexport { Spinner } from \"./components/Spinner/Spinner\";\nexport type { SpinnerProps } from \"./components/Spinner/Spinner\";\nexport { colors, spacing, typography } from \"./tokens\";\n","import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n title?: ReactNode;\n variant?: \"info\" | \"success\" | \"warning\" | \"danger\";\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { children, className, title, variant = \"info\", ...props },\n ref,\n) {\n const role = variant === \"danger\" || variant === \"warning\" ? \"alert\" : \"status\";\n\n return (\n <div\n className={cx(\"ui-alert\", `ui-alert-${variant}`, className)}\n ref={ref}\n role={role}\n {...props}\n >\n {title ? <div className=\"ui-alert-title\">{title}</div> : null}\n <div>{children}</div>\n </div>\n );\n});\n","export function cx(...classes: Array<string | false | null | undefined>): string {\n return classes.filter(Boolean).join(\" \");\n}\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n variant?: \"neutral\" | \"success\" | \"warning\" | \"danger\";\n}\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { className, variant = \"neutral\", ...props },\n ref,\n) {\n return <span className={cx(\"ui-badge\", `ui-badge-${variant}`, className)} ref={ref} {...props} />;\n});\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Spinner } from \"../Spinner/Spinner\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n isLoading?: boolean;\n leftIcon?: ReactNode;\n rightIcon?: ReactNode;\n size?: \"sm\" | \"md\" | \"lg\";\n variant?: \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n className,\n disabled,\n isLoading = false,\n leftIcon,\n rightIcon,\n size = \"md\",\n type = \"button\",\n variant = \"primary\",\n ...props\n },\n ref,\n) {\n return (\n <button\n className={cx(\n \"ui-button\",\n `ui-button-${variant}`,\n size !== \"md\" && `ui-button-${size}`,\n className,\n )}\n data-loading={isLoading ? \"true\" : undefined}\n disabled={disabled || isLoading}\n ref={ref}\n type={type}\n {...props}\n >\n {isLoading ? <Spinner label=\"Loading\" size=\"sm\" /> : leftIcon}\n <span>{children}</span>\n {!isLoading ? rightIcon : null}\n </button>\n );\n});\n","import type { HTMLAttributes } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n label?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport function Spinner({ className, label = \"Loading\", size = \"md\", ...props }: SpinnerProps) {\n return (\n <span\n aria-label={label}\n className={cx(\"ui-spinner\", size !== \"md\" && `ui-spinner-${size}`, className)}\n role=\"status\"\n {...props}\n />\n );\n}\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport type CardProps = HTMLAttributes<HTMLDivElement>;\nexport type CardHeaderProps = HTMLAttributes<HTMLDivElement>;\nexport type CardContentProps = HTMLAttributes<HTMLDivElement>;\nexport type CardFooterProps = HTMLAttributes<HTMLDivElement>;\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n { className, ...props },\n ref,\n) {\n return <div className={cx(\"ui-card\", className)} ref={ref} {...props} />;\n});\n\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(function CardHeader(\n { className, ...props },\n ref,\n) {\n return <div className={cx(\"ui-card-header\", className)} ref={ref} {...props} />;\n});\n\nexport const CardContent = forwardRef<HTMLDivElement, CardContentProps>(function CardContent(\n { className, ...props },\n ref,\n) {\n return <div className={cx(\"ui-card-content\", className)} ref={ref} {...props} />;\n});\n\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(function CardFooter(\n { className, ...props },\n ref,\n) {\n return <div className={cx(\"ui-card-footer\", className)} ref={ref} {...props} />;\n});\n","import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n action?: ReactNode;\n description?: ReactNode;\n icon?: ReactNode;\n title: ReactNode;\n}\n\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(\n { action, className, description, icon, title, ...props },\n ref,\n) {\n return (\n <section className={cx(\"ui-empty-state\", className)} ref={ref} {...props}>\n {icon ? <div aria-hidden=\"true\">{icon}</div> : null}\n <h2 className=\"ui-empty-state-title\">{title}</h2>\n {description ? <p className=\"ui-empty-state-description\">{description}</p> : null}\n {action}\n </section>\n );\n});\n","import { forwardRef, type InputHTMLAttributes, useId } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n error?: string;\n helperText?: string;\n label?: string;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { className, error, helperText, id, label, ...props },\n ref,\n) {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const descriptionId = helperText ? `${inputId}-help` : undefined;\n const errorId = error ? `${inputId}-error` : undefined;\n\n return (\n <div className=\"ui-input-field\">\n {label ? (\n <label className=\"ui-label\" htmlFor={inputId}>\n {label}\n </label>\n ) : null}\n <input\n aria-describedby={cx(descriptionId, errorId) || undefined}\n aria-invalid={error ? true : undefined}\n className={cx(\"ui-input\", error && \"ui-input-error\", className)}\n id={inputId}\n ref={ref}\n {...props}\n />\n {helperText ? (\n <div className=\"ui-field-help\" id={descriptionId}>\n {helperText}\n </div>\n ) : null}\n {error ? (\n <div className=\"ui-field-error\" id={errorId} role=\"alert\">\n {error}\n </div>\n ) : null}\n </div>\n );\n});\n","import {\n forwardRef,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n useEffect,\n useId,\n useRef,\n} from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n children: ReactNode;\n closeLabel?: string;\n isOpen: boolean;\n onOpenChange: (isOpen: boolean) => void;\n title: ReactNode;\n}\n\nfunction getFocusable(container: HTMLElement): HTMLElement[] {\n return Array.from(\n container.querySelectorAll<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n ),\n ).filter((element) => !element.hasAttribute(\"disabled\") && element.tabIndex !== -1);\n}\n\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n { children, className, closeLabel = \"Close dialog\", isOpen, onOpenChange, title, ...props },\n ref,\n) {\n const titleId = useId();\n const dialogRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n const previousActiveElement =\n document.activeElement instanceof HTMLElement ? document.activeElement : null;\n const focusable = dialogRef.current ? getFocusable(dialogRef.current) : [];\n focusable[0]?.focus();\n\n return () => {\n previousActiveElement?.focus();\n };\n }, [isOpen]);\n\n if (!isOpen) {\n return null;\n }\n\n function handleOverlayClick(event: MouseEvent<HTMLDivElement>) {\n if (event.target === event.currentTarget) {\n onOpenChange(false);\n }\n }\n\n function handleKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n if (event.key === \"Escape\") {\n onOpenChange(false);\n return;\n }\n\n if (event.key !== \"Tab\" || !dialogRef.current) {\n return;\n }\n\n const focusable = getFocusable(dialogRef.current);\n if (focusable.length === 0) {\n return;\n }\n\n const first = focusable[0];\n const last = focusable.at(-1);\n\n if (!first || !last) {\n return;\n }\n\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n }\n\n return (\n <div className=\"ui-modal-overlay\" onClick={handleOverlayClick}>\n <div\n aria-labelledby={titleId}\n aria-modal=\"true\"\n className={cx(\"ui-modal\", className)}\n onKeyDown={handleKeyDown}\n ref={(node) => {\n dialogRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n role=\"dialog\"\n {...props}\n >\n <div className=\"ui-modal-header\">\n <h2 className=\"ui-modal-title\" id={titleId}>\n {title}\n </h2>\n <button\n aria-label={closeLabel}\n className=\"ui-modal-close\"\n onClick={() => onOpenChange(false)}\n type=\"button\"\n >\n ×\n </button>\n </div>\n <div className=\"ui-modal-body\">{children}</div>\n </div>\n </div>\n );\n});\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n height?: number | string;\n width?: number | string;\n}\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { className, height = \"1rem\", style, width = \"100%\", ...props },\n ref,\n) {\n return (\n <div\n aria-hidden=\"true\"\n className={cx(\"ui-skeleton\", className)}\n ref={ref}\n style={{ height, width, ...style }}\n {...props}\n />\n );\n});\n","export const colors = {\n background: \"var(--ui-color-background)\",\n foreground: \"var(--ui-color-foreground)\",\n surface: \"var(--ui-color-surface)\",\n surfaceRaised: \"var(--ui-color-surface-raised)\",\n border: \"var(--ui-color-border)\",\n primary: \"var(--ui-color-primary)\",\n primaryForeground: \"var(--ui-color-primary-foreground)\",\n danger: \"var(--ui-color-danger)\",\n dangerForeground: \"var(--ui-color-danger-foreground)\",\n success: \"var(--ui-color-success)\",\n successForeground: \"var(--ui-color-success-foreground)\",\n warning: \"var(--ui-color-warning)\",\n warningForeground: \"var(--ui-color-warning-foreground)\",\n muted: \"var(--ui-color-muted)\",\n mutedForeground: \"var(--ui-color-muted-foreground)\",\n} as const;\n","export const spacing = {\n 0: \"0\",\n 1: \"var(--ui-space-1)\",\n 2: \"var(--ui-space-2)\",\n 3: \"var(--ui-space-3)\",\n 4: \"var(--ui-space-4)\",\n 5: \"var(--ui-space-5)\",\n 6: \"var(--ui-space-6)\",\n 8: \"var(--ui-space-8)\",\n} as const;\n","export const typography = {\n fontFamily: \"var(--ui-font-family)\",\n fontSizeSm: \"var(--ui-font-size-sm)\",\n fontSizeMd: \"var(--ui-font-size-md)\",\n fontSizeLg: \"var(--ui-font-size-lg)\",\n lineHe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;AAEJ,CAAC;;;ACrBM,IAAM,SAAS;AAAA,EACpB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,OAAO;AAAA,EACP,iBAAiB;AACnB;;;AChBO,IAAM,UAAU;AAAA,EACrB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;;;ACTO,IAAM,aAAa;AAAA,EACxB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AACd;","names":["Alert","import_react","import_jsx_runtime","Badge","import_react","import_jsx_runtime","import_jsx_runtime","Button","import_react","import_jsx_runtime","Card","CardHeader","CardContent","CardFooter","import_react","import_jsx_runtime","EmptyState","import_react","import_jsx_runtime","Input","import_react","import_jsx_runtime","Modal","import_react","import_jsx_runtime","Skeleton"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/components/Alert/Alert.tsx","../src/utils/cx.ts","../src/components/Avatar/Avatar.tsx","../src/components/Badge/Badge.tsx","../src/components/Button/Button.tsx","../src/components/Spinner/Spinner.tsx","../src/components/Card/Card.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/EmptyState/EmptyState.tsx","../src/components/Input/Input.tsx","../src/components/Modal/Modal.tsx","../src/components/Radio/Radio.tsx","../src/components/Select/Select.tsx","../src/components/Skeleton/Skeleton.tsx","../src/components/Switch/Switch.tsx","../src/components/Tabs/Tabs.tsx","../src/components/Textarea/Textarea.tsx","../src/components/Tooltip/Tooltip.tsx","../src/tokens/colors.ts","../src/tokens/spacing.ts","../src/tokens/typography.ts"],"sourcesContent":["export { Alert } from \"./components/Alert/Alert\";\nexport type { AlertProps } from \"./components/Alert/Alert\";\nexport { Avatar } from \"./components/Avatar/Avatar\";\nexport type { AvatarProps } from \"./components/Avatar/Avatar\";\nexport { Badge } from \"./components/Badge/Badge\";\nexport type { BadgeProps } from \"./components/Badge/Badge\";\nexport { Button } from \"./components/Button/Button\";\nexport type { ButtonProps } from \"./components/Button/Button\";\nexport { Card, CardContent, CardFooter, CardHeader } from \"./components/Card/Card\";\nexport type {\n CardContentProps,\n CardFooterProps,\n CardHeaderProps,\n CardProps,\n} from \"./components/Card/Card\";\nexport { Checkbox } from \"./components/Checkbox/Checkbox\";\nexport type { CheckboxProps } from \"./components/Checkbox/Checkbox\";\nexport { EmptyState } from \"./components/EmptyState/EmptyState\";\nexport type { EmptyStateProps } from \"./components/EmptyState/EmptyState\";\nexport { Input } from \"./components/Input/Input\";\nexport type { InputProps } from \"./components/Input/Input\";\nexport { Modal } from \"./components/Modal/Modal\";\nexport type { ModalProps } from \"./components/Modal/Modal\";\nexport { Radio, RadioGroup } from \"./components/Radio/Radio\";\nexport type { RadioGroupProps, RadioProps } from \"./components/Radio/Radio\";\nexport { Select } from \"./components/Select/Select\";\nexport type { SelectOption, SelectProps } from \"./components/Select/Select\";\nexport { Skeleton } from \"./components/Skeleton/Skeleton\";\nexport type { SkeletonProps } from \"./components/Skeleton/Skeleton\";\nexport { Spinner } from \"./components/Spinner/Spinner\";\nexport type { SpinnerProps } from \"./components/Spinner/Spinner\";\nexport { Switch } from \"./components/Switch/Switch\";\nexport type { SwitchProps } from \"./components/Switch/Switch\";\nexport { Tabs } from \"./components/Tabs/Tabs\";\nexport type { TabItem, TabsProps } from \"./components/Tabs/Tabs\";\nexport { Textarea } from \"./components/Textarea/Textarea\";\nexport type { TextareaProps } from \"./components/Textarea/Textarea\";\nexport { Tooltip } from \"./components/Tooltip/Tooltip\";\nexport type { TooltipProps } from \"./components/Tooltip/Tooltip\";\nexport { colors, spacing, typography } from \"./tokens\";\n","import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n title?: ReactNode;\n variant?: \"info\" | \"success\" | \"warning\" | \"danger\";\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { children, className, title, variant = \"info\", ...props },\n ref,\n) {\n const role = variant === \"danger\" || variant === \"warning\" ? \"alert\" : \"status\";\n\n return (\n <div\n className={cx(\"ui-alert\", `ui-alert-${variant}`, className)}\n ref={ref}\n role={role}\n {...props}\n >\n {title ? <div className=\"ui-alert-title\">{title}</div> : null}\n <div>{children}</div>\n </div>\n );\n});\n","export function cx(...classes: Array<string | false | null | undefined>): string {\n return classes.filter(Boolean).join(\" \");\n}\n","import { type HTMLAttributes } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {\n alt: string;\n fallback?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n src?: string;\n}\n\nexport function Avatar({ alt, className, fallback, size = \"md\", src, ...props }: AvatarProps) {\n const initials =\n fallback ??\n alt\n .split(\" \")\n .filter(Boolean)\n .slice(0, 2)\n .map((part) => part[0]?.toUpperCase())\n .join(\"\");\n\n return (\n <span className={cx(\"ui-avatar\", `ui-avatar-${size}`, className)} {...props}>\n {src ? <img alt={alt} className=\"ui-avatar-image\" src={src} /> : initials}\n </span>\n );\n}\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n variant?: \"neutral\" | \"success\" | \"warning\" | \"danger\";\n}\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { className, variant = \"neutral\", ...props },\n ref,\n) {\n return <span className={cx(\"ui-badge\", `ui-badge-${variant}`, className)} ref={ref} {...props} />;\n});\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Spinner } from \"../Spinner/Spinner\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n isLoading?: boolean;\n leftIcon?: ReactNode;\n rightIcon?: ReactNode;\n size?: \"sm\" | \"md\" | \"lg\";\n variant?: \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n className,\n disabled,\n isLoading = false,\n leftIcon,\n rightIcon,\n size = \"md\",\n type = \"button\",\n variant = \"primary\",\n ...props\n },\n ref,\n) {\n return (\n <button\n className={cx(\n \"ui-button\",\n `ui-button-${variant}`,\n size !== \"md\" && `ui-button-${size}`,\n className,\n )}\n data-loading={isLoading ? \"true\" : undefined}\n disabled={disabled || isLoading}\n ref={ref}\n type={type}\n {...props}\n >\n {isLoading ? <Spinner label=\"Loading\" size=\"sm\" /> : leftIcon}\n <span>{children}</span>\n {!isLoading ? rightIcon : null}\n </button>\n );\n});\n","import type { HTMLAttributes } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n label?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport function Spinner({ className, label = \"Loading\", size = \"md\", ...props }: SpinnerProps) {\n return (\n <span\n aria-label={label}\n className={cx(\"ui-spinner\", size !== \"md\" && `ui-spinner-${size}`, className)}\n role=\"status\"\n {...props}\n />\n );\n}\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport type CardProps = HTMLAttributes<HTMLDivElement>;\nexport type CardHeaderProps = HTMLAttributes<HTMLDivElement>;\nexport type CardContentProps = HTMLAttributes<HTMLDivElement>;\nexport type CardFooterProps = HTMLAttributes<HTMLDivElement>;\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n { className, ...props },\n ref,\n) {\n return <div className={cx(\"ui-card\", className)} ref={ref} {...props} />;\n});\n\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(function CardHeader(\n { className, ...props },\n ref,\n) {\n return <div className={cx(\"ui-card-header\", className)} ref={ref} {...props} />;\n});\n\nexport const CardContent = forwardRef<HTMLDivElement, CardContentProps>(function CardContent(\n { className, ...props },\n ref,\n) {\n return <div className={cx(\"ui-card-content\", className)} ref={ref} {...props} />;\n});\n\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(function CardFooter(\n { className, ...props },\n ref,\n) {\n return <div className={cx(\"ui-card-footer\", className)} ref={ref} {...props} />;\n});\n","import { forwardRef, type InputHTMLAttributes, useId } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n description?: string;\n error?: string;\n label: string;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { className, description, error, id, label, ...props },\n ref,\n) {\n const generatedId = useId();\n const checkboxId = id ?? generatedId;\n const descriptionId = description ? `${checkboxId}-description` : undefined;\n const errorId = error ? `${checkboxId}-error` : undefined;\n\n return (\n <div className=\"ui-choice-field\">\n <label className=\"ui-choice\">\n <input\n aria-describedby={cx(descriptionId, errorId) || undefined}\n aria-invalid={error ? true : undefined}\n className={cx(\"ui-checkbox\", className)}\n id={checkboxId}\n ref={ref}\n type=\"checkbox\"\n {...props}\n />\n <span className=\"ui-choice-copy\">\n <span className=\"ui-choice-label\">{label}</span>\n {description ? (\n <span className=\"ui-choice-description\" id={descriptionId}>\n {description}\n </span>\n ) : null}\n </span>\n </label>\n {error ? (\n <div className=\"ui-field-error\" id={errorId} role=\"alert\">\n {error}\n </div>\n ) : null}\n </div>\n );\n});\n","import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n action?: ReactNode;\n description?: ReactNode;\n icon?: ReactNode;\n title: ReactNode;\n}\n\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(\n { action, className, description, icon, title, ...props },\n ref,\n) {\n return (\n <section className={cx(\"ui-empty-state\", className)} ref={ref} {...props}>\n {icon ? <div aria-hidden=\"true\">{icon}</div> : null}\n <h2 className=\"ui-empty-state-title\">{title}</h2>\n {description ? <p className=\"ui-empty-state-description\">{description}</p> : null}\n {action}\n </section>\n );\n});\n","import { forwardRef, type InputHTMLAttributes, useId } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n error?: string;\n helperText?: string;\n label?: string;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { className, error, helperText, id, label, ...props },\n ref,\n) {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const descriptionId = helperText ? `${inputId}-help` : undefined;\n const errorId = error ? `${inputId}-error` : undefined;\n\n return (\n <div className=\"ui-input-field\">\n {label ? (\n <label className=\"ui-label\" htmlFor={inputId}>\n {label}\n </label>\n ) : null}\n <input\n aria-describedby={cx(descriptionId, errorId) || undefined}\n aria-invalid={error ? true : undefined}\n className={cx(\"ui-input\", error && \"ui-input-error\", className)}\n id={inputId}\n ref={ref}\n {...props}\n />\n {helperText ? (\n <div className=\"ui-field-help\" id={descriptionId}>\n {helperText}\n </div>\n ) : null}\n {error ? (\n <div className=\"ui-field-error\" id={errorId} role=\"alert\">\n {error}\n </div>\n ) : null}\n </div>\n );\n});\n","import {\n forwardRef,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n useEffect,\n useId,\n useRef,\n} from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n children: ReactNode;\n closeLabel?: string;\n isOpen: boolean;\n onOpenChange: (isOpen: boolean) => void;\n title: ReactNode;\n}\n\nfunction getFocusable(container: HTMLElement): HTMLElement[] {\n return Array.from(\n container.querySelectorAll<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n ),\n ).filter((element) => !element.hasAttribute(\"disabled\") && element.tabIndex !== -1);\n}\n\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n { children, className, closeLabel = \"Close dialog\", isOpen, onOpenChange, title, ...props },\n ref,\n) {\n const titleId = useId();\n const dialogRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n const previousActiveElement =\n document.activeElement instanceof HTMLElement ? document.activeElement : null;\n const focusable = dialogRef.current ? getFocusable(dialogRef.current) : [];\n focusable[0]?.focus();\n\n return () => {\n previousActiveElement?.focus();\n };\n }, [isOpen]);\n\n if (!isOpen) {\n return null;\n }\n\n function handleOverlayClick(event: MouseEvent<HTMLDivElement>) {\n if (event.target === event.currentTarget) {\n onOpenChange(false);\n }\n }\n\n function handleKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n if (event.key === \"Escape\") {\n onOpenChange(false);\n return;\n }\n\n if (event.key !== \"Tab\" || !dialogRef.current) {\n return;\n }\n\n const focusable = getFocusable(dialogRef.current);\n if (focusable.length === 0) {\n return;\n }\n\n const first = focusable[0];\n const last = focusable.at(-1);\n\n if (!first || !last) {\n return;\n }\n\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n }\n\n return (\n <div className=\"ui-modal-overlay\" onClick={handleOverlayClick}>\n <div\n aria-labelledby={titleId}\n aria-modal=\"true\"\n className={cx(\"ui-modal\", className)}\n onKeyDown={handleKeyDown}\n ref={(node) => {\n dialogRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n role=\"dialog\"\n {...props}\n >\n <div className=\"ui-modal-header\">\n <h2 className=\"ui-modal-title\" id={titleId}>\n {title}\n </h2>\n <button\n aria-label={closeLabel}\n className=\"ui-modal-close\"\n onClick={() => onOpenChange(false)}\n type=\"button\"\n >\n ×\n </button>\n </div>\n <div className=\"ui-modal-body\">{children}</div>\n </div>\n </div>\n );\n});\n","import { forwardRef, type InputHTMLAttributes, type ReactNode, useId } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n description?: string;\n label: string;\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { className, description, id, label, ...props },\n ref,\n) {\n const generatedId = useId();\n const radioId = id ?? generatedId;\n const descriptionId = description ? `${radioId}-description` : undefined;\n\n return (\n <label className=\"ui-choice\">\n <input\n aria-describedby={descriptionId}\n className={cx(\"ui-radio\", className)}\n id={radioId}\n ref={ref}\n type=\"radio\"\n {...props}\n />\n <span className=\"ui-choice-copy\">\n <span className=\"ui-choice-label\">{label}</span>\n {description ? (\n <span className=\"ui-choice-description\" id={descriptionId}>\n {description}\n </span>\n ) : null}\n </span>\n </label>\n );\n});\n\nexport interface RadioGroupProps {\n children: ReactNode;\n error?: string;\n label: string;\n}\n\nexport function RadioGroup({ children, error, label }: RadioGroupProps) {\n return (\n <fieldset className=\"ui-radio-group\">\n <legend className=\"ui-label\">{label}</legend>\n <div className=\"ui-radio-options\">{children}</div>\n {error ? (\n <div className=\"ui-field-error\" role=\"alert\">\n {error}\n </div>\n ) : null}\n </fieldset>\n );\n}\n","import { forwardRef, type SelectHTMLAttributes, useId } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface SelectOption {\n disabled?: boolean;\n label: string;\n value: string;\n}\n\nexport interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, \"children\"> {\n error?: string;\n helperText?: string;\n label?: string;\n options: SelectOption[];\n placeholder?: string;\n}\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { className, error, helperText, id, label, options, placeholder, ...props },\n ref,\n) {\n const generatedId = useId();\n const selectId = id ?? generatedId;\n const descriptionId = helperText ? `${selectId}-help` : undefined;\n const errorId = error ? `${selectId}-error` : undefined;\n\n return (\n <div className=\"ui-input-field\">\n {label ? (\n <label className=\"ui-label\" htmlFor={selectId}>\n {label}\n </label>\n ) : null}\n <select\n aria-describedby={cx(descriptionId, errorId) || undefined}\n aria-invalid={error ? true : undefined}\n className={cx(\"ui-input\", \"ui-select\", error && \"ui-input-error\", className)}\n id={selectId}\n ref={ref}\n {...props}\n >\n {placeholder ? (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n ) : null}\n {options.map((option) => (\n <option disabled={option.disabled} key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n {helperText ? (\n <div className=\"ui-field-help\" id={descriptionId}>\n {helperText}\n </div>\n ) : null}\n {error ? (\n <div className=\"ui-field-error\" id={errorId} role=\"alert\">\n {error}\n </div>\n ) : null}\n </div>\n );\n});\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n height?: number | string;\n width?: number | string;\n}\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { className, height = \"1rem\", style, width = \"100%\", ...props },\n ref,\n) {\n return (\n <div\n aria-hidden=\"true\"\n className={cx(\"ui-skeleton\", className)}\n ref={ref}\n style={{ height, width, ...style }}\n {...props}\n />\n );\n});\n","import { forwardRef, type InputHTMLAttributes, useId } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n description?: string;\n label: string;\n}\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n { className, description, id, label, ...props },\n ref,\n) {\n const generatedId = useId();\n const switchId = id ?? generatedId;\n const descriptionId = description ? `${switchId}-description` : undefined;\n\n return (\n <label className=\"ui-switch\">\n <span className=\"ui-choice-copy\">\n <span className=\"ui-choice-label\">{label}</span>\n {description ? (\n <span className=\"ui-choice-description\" id={descriptionId}>\n {description}\n </span>\n ) : null}\n </span>\n <input\n aria-describedby={descriptionId}\n className={cx(\"ui-switch-input\", className)}\n id={switchId}\n ref={ref}\n role=\"switch\"\n type=\"checkbox\"\n {...props}\n />\n <span aria-hidden=\"true\" className=\"ui-switch-track\">\n <span className=\"ui-switch-thumb\" />\n </span>\n </label>\n );\n});\n","import { type ReactNode, useId, useMemo, useState } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface TabItem {\n content: ReactNode;\n disabled?: boolean;\n label: ReactNode;\n value: string;\n}\n\nexport interface TabsProps {\n \"aria-label\"?: string;\n className?: string;\n defaultValue?: string;\n items: TabItem[];\n onValueChange?: (value: string) => void;\n value?: string;\n}\n\nexport function Tabs({\n \"aria-label\": ariaLabel,\n className,\n defaultValue,\n items,\n onValueChange,\n value,\n}: TabsProps) {\n const generatedId = useId();\n const firstEnabledValue = useMemo(() => items.find((item) => !item.disabled)?.value, [items]);\n const [internalValue, setInternalValue] = useState(defaultValue ?? firstEnabledValue);\n const selectedValue = value ?? internalValue;\n const selectedItem = items.find((item) => item.value === selectedValue) ?? items[0];\n\n function selectTab(nextValue: string) {\n setInternalValue(nextValue);\n onValueChange?.(nextValue);\n }\n\n return (\n <div className={cx(\"ui-tabs\", className)}>\n <div aria-label={ariaLabel} className=\"ui-tab-list\" role=\"tablist\">\n {items.map((item) => {\n const isSelected = item.value === selectedItem?.value;\n const tabId = `${generatedId}-${item.value}-tab`;\n const panelId = `${generatedId}-${item.value}-panel`;\n\n return (\n <button\n aria-controls={panelId}\n aria-selected={isSelected}\n className=\"ui-tab\"\n disabled={item.disabled}\n id={tabId}\n key={item.value}\n onClick={() => selectTab(item.value)}\n role=\"tab\"\n tabIndex={isSelected ? 0 : -1}\n type=\"button\"\n >\n {item.label}\n </button>\n );\n })}\n </div>\n {selectedItem ? (\n <div\n aria-labelledby={`${generatedId}-${selectedItem.value}-tab`}\n className=\"ui-tab-panel\"\n id={`${generatedId}-${selectedItem.value}-panel`}\n role=\"tabpanel\"\n >\n {selectedItem.content}\n </div>\n ) : null}\n </div>\n );\n}\n","import { forwardRef, type TextareaHTMLAttributes, useId } from \"react\";\nimport { cx } from \"../../utils/cx\";\n\nexport interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n error?: string;\n helperText?: string;\n label?: string;\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, error, helperText, id, label, rows = 4, ...props },\n ref,\n) {\n const generatedId = useId();\n const textareaId = id ?? generatedId;\n const descriptionId = helperText ? `${textareaId}-help` : undefined;\n const errorId = error ? `${textareaId}-error` : undefined;\n\n return (\n <div className=\"ui-input-field\">\n {label ? (\n <label className=\"ui-label\" htmlFor={textareaId}>\n {label}\n </label>\n ) : null}\n <textarea\n aria-describedby={cx(descriptionId, errorId) || undefined}\n aria-invalid={error ? true : undefined}\n className={cx(\"ui-input\", \"ui-textarea\", error && \"ui-input-error\", className)}\n id={textareaId}\n ref={ref}\n rows={rows}\n {...props}\n />\n {helperText ? (\n <div className=\"ui-field-help\" id={descriptionId}>\n {helperText}\n </div>\n ) : null}\n {error ? (\n <div className=\"ui-field-error\" id={errorId} role=\"alert\">\n {error}\n </div>\n ) : null}\n </div>\n );\n});\n","import { type ReactNode } from \"react\";\n\nexport interface TooltipProps {\n children: ReactNode;\n content: ReactNode;\n}\n\nexport function Tooltip({ children, content }: TooltipProps) {\n return (\n <span className=\"ui-tooltip\">\n {children}\n <span className=\"ui-tooltip-content\" role=\"tooltip\">\n {content}\n </span>\n </span>\n );\n}\n","export const colors = {\n background: \"var(--ui-color-background)\",\n foreground: \"var(--ui-color-foreground)\",\n surface: \"var(--ui-color-surface)\",\n surfaceRaised: \"var(--ui-color-surface-raised)\",\n border: \"var(--ui-color-border)\",\n primary: \"var(--ui-color-primary)\",\n primaryForeground: \"var(--ui-color-primary-foreground)\",\n danger: \"var(--ui-color-danger)\",\n dangerForeground: \"var(--ui-color-danger-foreground)\",\n success: \"var(--ui-color-success)\",\n successForeground: \"var(--ui-color-success-foreground)\",\n warning: \"var(--ui-color-warning)\",\n warningForeground: \"var(--ui-color-warning-foreground)\",\n muted: \"var(--ui-color-muted)\",\n mutedForeground: \"var(--ui-color-muted-foreground)\",\n} as const;\n","export const spacing = {\n 0: \"0\",\n 1: \"var(--ui-space-1)\",\n 2: \"var(--ui-space-2)\",\n 3: \"var(--ui-space-3)\",\n 4: \"var(--ui-space-4)\",\n 5: \"var(--ui-space-5)\",\n 6: \"var(--ui-space-6)\",\n 8: \"var(--ui-space-8)\",\n} as const;\n","export const typography = {\n fontFamily: \"var(--ui-font-family)\",\n fontSizeSm: \"var(--ui-font-size-sm)\",\n fontSizeMd: \"var(--ui-font-size-md)\",\n fontSizeLg: \"var(--ui-font-size-lg)\",\n lineHeight: \"var(--ui-line-height)\",\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAgE;;;ACAzD,SAAS,MAAM,SAA2D;AAC/E,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;;;ADaI;AAPG,IAAM,YAAQ,yBAAuC,SAASA,OACnE,EAAE,UAAU,WAAW,OAAO,UAAU,QAAQ,GAAG,MAAM,GACzD,KACA;AACA,QAAM,OAAO,YAAY,YAAY,YAAY,YAAY,UAAU;AAEvE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,YAAY,YAAY,OAAO,IAAI,SAAS;AAAA,MAC1D;AAAA,MACA;AAA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AAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AACd;","names":["Alert","import_jsx_runtime","import_react","import_jsx_runtime","Badge","import_react","import_jsx_runtime","import_jsx_runtime","Button","import_react","import_jsx_runtime","Card","CardHeader","CardContent","CardFooter","import_react","import_jsx_runtime","Checkbox","import_react","import_jsx_runtime","EmptyState","import_react","import_jsx_runtime","Input","import_react","import_jsx_runtime","Modal","import_react","import_jsx_runtime","Radio","import_react","import_jsx_runtime","Select","import_react","import_jsx_runtime","Skeleton","import_react","import_jsx_runtime","Switch","import_react","import_jsx_runtime","import_react","import_jsx_runtime","Textarea","import_jsx_runtime"]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
2
+ import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
3
3
 
4
4
  interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
5
5
  title?: ReactNode;
@@ -7,6 +7,14 @@ interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
7
7
  }
8
8
  declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
9
9
 
10
+ interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
11
+ alt: string;
12
+ fallback?: string;
13
+ size?: "sm" | "md" | "lg";
14
+ src?: string;
15
+ }
16
+ declare function Avatar({ alt, className, fallback, size, src, ...props }: AvatarProps): react.JSX.Element;
17
+
10
18
  interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
11
19
  variant?: "neutral" | "success" | "warning" | "danger";
12
20
  }
@@ -30,6 +38,13 @@ declare const CardHeader: react.ForwardRefExoticComponent<CardHeaderProps & reac
30
38
  declare const CardContent: react.ForwardRefExoticComponent<CardContentProps & react.RefAttributes<HTMLDivElement>>;
31
39
  declare const CardFooter: react.ForwardRefExoticComponent<CardFooterProps & react.RefAttributes<HTMLDivElement>>;
32
40
 
41
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
42
+ description?: string;
43
+ error?: string;
44
+ label: string;
45
+ }
46
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
47
+
33
48
  interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
34
49
  action?: ReactNode;
35
50
  description?: ReactNode;
@@ -54,6 +69,32 @@ interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
54
69
  }
55
70
  declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDivElement>>;
56
71
 
72
+ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
73
+ description?: string;
74
+ label: string;
75
+ }
76
+ declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
77
+ interface RadioGroupProps {
78
+ children: ReactNode;
79
+ error?: string;
80
+ label: string;
81
+ }
82
+ declare function RadioGroup({ children, error, label }: RadioGroupProps): react.JSX.Element;
83
+
84
+ interface SelectOption {
85
+ disabled?: boolean;
86
+ label: string;
87
+ value: string;
88
+ }
89
+ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "children"> {
90
+ error?: string;
91
+ helperText?: string;
92
+ label?: string;
93
+ options: SelectOption[];
94
+ placeholder?: string;
95
+ }
96
+ declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
97
+
57
98
  interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
58
99
  height?: number | string;
59
100
  width?: number | string;
@@ -66,6 +107,41 @@ interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
66
107
  }
67
108
  declare function Spinner({ className, label, size, ...props }: SpinnerProps): react.JSX.Element;
68
109
 
110
+ interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
111
+ description?: string;
112
+ label: string;
113
+ }
114
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
115
+
116
+ interface TabItem {
117
+ content: ReactNode;
118
+ disabled?: boolean;
119
+ label: ReactNode;
120
+ value: string;
121
+ }
122
+ interface TabsProps {
123
+ "aria-label"?: string;
124
+ className?: string;
125
+ defaultValue?: string;
126
+ items: TabItem[];
127
+ onValueChange?: (value: string) => void;
128
+ value?: string;
129
+ }
130
+ declare function Tabs({ "aria-label": ariaLabel, className, defaultValue, items, onValueChange, value, }: TabsProps): react.JSX.Element;
131
+
132
+ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
133
+ error?: string;
134
+ helperText?: string;
135
+ label?: string;
136
+ }
137
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
138
+
139
+ interface TooltipProps {
140
+ children: ReactNode;
141
+ content: ReactNode;
142
+ }
143
+ declare function Tooltip({ children, content }: TooltipProps): react.JSX.Element;
144
+
69
145
  declare const colors: {
70
146
  readonly background: "var(--ui-color-background)";
71
147
  readonly foreground: "var(--ui-color-foreground)";
@@ -103,4 +179,4 @@ declare const typography: {
103
179
  readonly lineHeight: "var(--ui-line-height)";
104
180
  };
105
181
 
106
- export { Alert, type AlertProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, EmptyState, type EmptyStateProps, Input, type InputProps, Modal, type ModalProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, colors, spacing, typography };
182
+ export { Alert, type AlertProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, Checkbox, type CheckboxProps, EmptyState, type EmptyStateProps, Input, type InputProps, Modal, type ModalProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, Tooltip, type TooltipProps, colors, spacing, typography };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
2
+ import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
3
3
 
4
4
  interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
5
5
  title?: ReactNode;
@@ -7,6 +7,14 @@ interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
7
7
  }
8
8
  declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
9
9
 
10
+ interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
11
+ alt: string;
12
+ fallback?: string;
13
+ size?: "sm" | "md" | "lg";
14
+ src?: string;
15
+ }
16
+ declare function Avatar({ alt, className, fallback, size, src, ...props }: AvatarProps): react.JSX.Element;
17
+
10
18
  interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
11
19
  variant?: "neutral" | "success" | "warning" | "danger";
12
20
  }
@@ -30,6 +38,13 @@ declare const CardHeader: react.ForwardRefExoticComponent<CardHeaderProps & reac
30
38
  declare const CardContent: react.ForwardRefExoticComponent<CardContentProps & react.RefAttributes<HTMLDivElement>>;
31
39
  declare const CardFooter: react.ForwardRefExoticComponent<CardFooterProps & react.RefAttributes<HTMLDivElement>>;
32
40
 
41
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
42
+ description?: string;
43
+ error?: string;
44
+ label: string;
45
+ }
46
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
47
+
33
48
  interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
34
49
  action?: ReactNode;
35
50
  description?: ReactNode;
@@ -54,6 +69,32 @@ interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
54
69
  }
55
70
  declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDivElement>>;
56
71
 
72
+ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
73
+ description?: string;
74
+ label: string;
75
+ }
76
+ declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
77
+ interface RadioGroupProps {
78
+ children: ReactNode;
79
+ error?: string;
80
+ label: string;
81
+ }
82
+ declare function RadioGroup({ children, error, label }: RadioGroupProps): react.JSX.Element;
83
+
84
+ interface SelectOption {
85
+ disabled?: boolean;
86
+ label: string;
87
+ value: string;
88
+ }
89
+ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "children"> {
90
+ error?: string;
91
+ helperText?: string;
92
+ label?: string;
93
+ options: SelectOption[];
94
+ placeholder?: string;
95
+ }
96
+ declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
97
+
57
98
  interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
58
99
  height?: number | string;
59
100
  width?: number | string;
@@ -66,6 +107,41 @@ interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
66
107
  }
67
108
  declare function Spinner({ className, label, size, ...props }: SpinnerProps): react.JSX.Element;
68
109
 
110
+ interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
111
+ description?: string;
112
+ label: string;
113
+ }
114
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
115
+
116
+ interface TabItem {
117
+ content: ReactNode;
118
+ disabled?: boolean;
119
+ label: ReactNode;
120
+ value: string;
121
+ }
122
+ interface TabsProps {
123
+ "aria-label"?: string;
124
+ className?: string;
125
+ defaultValue?: string;
126
+ items: TabItem[];
127
+ onValueChange?: (value: string) => void;
128
+ value?: string;
129
+ }
130
+ declare function Tabs({ "aria-label": ariaLabel, className, defaultValue, items, onValueChange, value, }: TabsProps): react.JSX.Element;
131
+
132
+ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
133
+ error?: string;
134
+ helperText?: string;
135
+ label?: string;
136
+ }
137
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
138
+
139
+ interface TooltipProps {
140
+ children: ReactNode;
141
+ content: ReactNode;
142
+ }
143
+ declare function Tooltip({ children, content }: TooltipProps): react.JSX.Element;
144
+
69
145
  declare const colors: {
70
146
  readonly background: "var(--ui-color-background)";
71
147
  readonly foreground: "var(--ui-color-foreground)";
@@ -103,4 +179,4 @@ declare const typography: {
103
179
  readonly lineHeight: "var(--ui-line-height)";
104
180
  };
105
181
 
106
- export { Alert, type AlertProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, EmptyState, type EmptyStateProps, Input, type InputProps, Modal, type ModalProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, colors, spacing, typography };
182
+ export { Alert, type AlertProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, Checkbox, type CheckboxProps, EmptyState, type EmptyStateProps, Input, type InputProps, Modal, type ModalProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, Tooltip, type TooltipProps, colors, spacing, typography };