# @hua-labs/ui - AI Documentation
# Version: 2.3.1
# Auto-generated by generate-docs — do not edit manually

package:
  name: "@hua-labs/ui"
  version: "2.3.1"
  description: "HUA Labs - Modern React UI Component Library - Beautiful, accessible, and customizable components for React applications"
  license: "MIT"

overview: "Accessible, TypeScript-first component library for React applications. Provides 70+ production-ready components with modular entry points for optimal bundle size, dark mode support, and cross-platform styling via the dot style engine."

exports:
  main:
    path: "@hua-labs/ui"
    provides:
      - name: "Button"
        type: "component"
        description: "Primary action button with variants, sizes, and loading state"
      - name: "Action"
        type: "component"
        description: "Compact icon action button"
      - name: "Input"
        type: "component"
        description: "Text input with validation, prefix/suffix, and error states"
      - name: "NumberInput"
        type: "component"
        description: "Numeric input with increment/decrement controls"
      - name: "Label"
        type: "component"
        description: "Form label with required indicator"
      - name: "Switch"
        type: "component"
        description: "Toggle switch for boolean values"
      - name: "Toggle"
        type: "component"
        description: "Pressable toggle button"
      - name: "Link"
        type: "component"
        description: "Styled anchor with router integration"
      - name: "Icon"
        type: "component"
        description: "Semantic icon component backed by the executable catalog; Phosphor is the default complete fallback, Lucide is a first-class optional alternative, and Iconsax is an opt-in product-style alternative"
      - name: "Avatar"
        type: "component"
        description: "User avatar with image fallback"
      - name: "Badge"
        type: "component"
        description: "Status badge with color variants"
      - name: "Card"
        type: "component"
        description: "Content container with header, body, footer slots"
      - name: "Container"
        type: "component"
        description: "Responsive max-width container"
      - name: "Grid"
        type: "component"
        description: "CSS Grid layout wrapper"
      - name: "Stack"
        type: "component"
        description: "Flex stack layout (vertical/horizontal)"
      - name: "Divider"
        type: "component"
        description: "Visual separator (horizontal/vertical)"
      - name: "Panel"
        type: "component"
        description: "Collapsible content panel"
      - name: "ScrollArea"
        type: "component"
        description: "Custom scrollbar container"
      - name: "Modal"
        type: "component"
        description: "Dialog overlay with backdrop; package docs do not claim browser focus containment or assistive-technology conformance without separate evidence"
      - name: "BottomSheet"
        type: "component"
        description: "Bottom overlay with role=dialog and consumer-owned accessible naming; does not claim aria-modal, focus containment/restoration, or background isolation"
      - name: "Drawer"
        type: "component"
        description: "Directional overlay with role=dialog and consumer-owned accessible naming; does not claim aria-modal, focus containment/restoration, or background isolation"
      - name: "Tooltip"
        type: "component"
        description: "Single-element tooltip with composed hover/focus handlers and preserved aria-describedby tokens; SDUI admits one non-empty string and owns one button trigger; browser and physical assistive-technology behavior remains unproven"
      - name: "Alert"
        type: "component"
        description: "Inline alert with success/warning/error/info variants"
      - name: "ToastProvider"
        type: "component"
        description: "Toast provider with status/polite semantics for info and success, and alert/assertive semantics for warning and error; physical announcement behavior remains unproven"
      - name: "useToast"
        type: "hook"
        description: "Imperative toast API — toast.success(), toast.error()"
      - name: "LoadingSpinner"
        type: "component"
        description: "Animated loading indicator"
      - name: "Textarea"
        type: "component"
        description: "Multiline input with Booleanish aria-invalid preservation; error state forces aria-invalid=true and invalid styling"
      - name: "Progress"
        type: "component"
        description: "Progress bar with percentage"
      - name: "Skeleton"
        type: "component"
        description: "Content placeholder during loading"
      - name: "ThemeProvider"
        type: "component"
        description: "Dark/light theme context provider"
      - name: "ThemeToggle"
        type: "component"
        description: "Theme switch button"
      - name: "useTheme"
        type: "hook"
        description: "Theme context hook — { theme, setTheme }"
      - name: "Section"
        type: "component"
        description: "Page section wrapper with optional header config (title, description, action)"
      - name: "ActionToolbar"
        type: "component"
        description: "Horizontal toolbar that renders a list of icon action buttons"
      - name: "ComponentLayout"
        type: "component"
        description: "Dev/docs layout that renders a component with labelled preview and code slots"
      - name: "Prose"
        type: "component"
        description: "Typography wrapper that applies readable prose styles to raw HTML/markdown content"
      - name: "Box"
        type: "component"
        description: "Base block primitive: div on web and View on React Native; native dot styles compose before the full consumer StyleProp"
      - name: "Text"
        type: "component"
        description: "Base text primitive: span on web and Text on React Native; native dot line clamps map to numberOfLines and explicit props win"
      - name: "Pressable"
        type: "component"
        description: "Interactive primitive: button on web and Pressable on React Native; native dot state composes with consumer event handlers, style callbacks, refs, and accessibility state"
      - name: "cn"
        type: "function"
        description: "Class name merging utility (clsx + tailwind-merge). Legacy — prefer dot prop for new code"
      - name: "Slot"
        type: "component"
        description: "Polymorphic slot for asChild pattern"
      - name: "IconProvider"
        type: "component"
        description: "Icon configuration context provider"
      - name: "ScrollToTop"
        type: "component"
        description: "Scroll-to-top floating button"
      - name: "merge"
        type: "function"
        description: "Merge multiple class strings, filtering falsy values"
      - name: "mergeIf"
        type: "function"
        description: "Conditionally append a class string based on a boolean flag"
      - name: "mergeMap"
        type: "function"
        description: "Map over an object of conditional classes and merge the truthy ones"
      - name: "formatRelativeTime"
        type: "function"
        description: "Format a Date as a human-readable relative time string (e.g. '3 minutes ago')"
      - name: "composeRefs"
        type: "function"
        description: "Compose multiple React refs into a single callback ref"
      - name: "mergeProps"
        type: "function"
        description: "Merge two sets of React props, combining event handlers and class names"
      - name: "createColorStyles"
        type: "function"
        description: "Generate Tailwind color class strings from a ColorStyleConfig"
      - name: "useColorStyles"
        type: "hook"
        description: "Hook that returns memoised color class strings from a ColorStyleConfig"
      - name: "createVariantStyles"
        type: "function"
        description: "Build a variant→class-string map for a component (e.g. solid, outline, ghost)"
      - name: "createSizeStyles"
        type: "function"
        description: "Build a size→class-string map (xs, sm, md, lg, xl)"
      - name: "createRoundedStyles"
        type: "function"
        description: "Build a rounded→class-string map (none, sm, md, lg, full)"
      - name: "createShadowStyles"
        type: "function"
        description: "Build a shadow level→class-string map"
      - name: "createHoverStyles"
        type: "function"
        description: "Build hover effect→class-string map (scale, brightness, opacity, etc.)"
      - name: "MotionConfigProvider"
        type: "component"
        description: "Context provider for per-component motion configuration overrides"
      - name: "useMotionConfig"
        type: "hook"
        description: "Read the current MotionConfigContext value"
      - name: "useComponentMotion"
        type: "hook"
        description: "Resolve the merged motion config for a specific component name"
      - name: "HUA_SPRING_EASING"
        type: "variable"
        description: "CSS cubic-bezier string for the HUA brand spring easing"
      - name: "withDarkMode"
        type: "function"
        description: "Wrap a class string with a dark: variant equivalent"
      - name: "createGradient"
        type: "function"
        description: "Generate a Tailwind gradient class string from from/via/to color stops"
      - name: "withOpacity"
        type: "function"
        description: "Append a Tailwind opacity modifier to a color class (e.g. bg-primary/50)"
      - name: "isTextWhite"
        type: "function"
        description: "Return true if a given color variant requires white text for contrast"
      - name: "isGradientVariant"
        type: "function"
        description: "Type-guard that checks whether a color value is a gradient variant string"
      - name: "responsive"
        type: "function"
        description: "Apply breakpoint prefixes to a class string (sm:, md:, lg:, etc.)"
      - name: "conditionalClass"
        type: "function"
        description: "Return a class string only when a condition is true, otherwise empty string"
      - name: "useMicroMotion"
        type: "hook"
        description: "Hook that returns CSS class strings for micro-interaction motion states"
      - name: "getMicroMotionClasses"
        type: "function"
        description: "Pure function that resolves micro-motion class strings from a config without a hook"
      - name: "EASING_FUNCTIONS"
        type: "variable"
        description: "Map of named CSS cubic-bezier easing strings used by micro motion"
      - name: "DURATIONS"
        type: "variable"
        description: "Map of semantic duration tokens (fast, normal, slow, etc.) in milliseconds"
      - name: "COMPONENT_MOTION_DEFAULTS"
        type: "variable"
        description: "Default micro-motion configs keyed by component name"
      - name: "iconNames"
        type: "variable"
        description: "Frozen exact-name inventory derived from the executable icon catalog"
      - name: "iconProviderMapping"
        type: "variable"
        description: "Catalog-derived provider bindings for Phosphor, Lucide, and Iconsax"
      - name: "isValidIconName"
        type: "function"
        description: "Exact-membership type guard for canonical icon IDs and aliases; it does not normalize arbitrary strings"
      - name: "getIconNameForProvider"
        type: "function"
        description: "Resolve a verified semantic icon name to its explicit provider binding"
      - name: "ICON_ALIASES"
        type: "variable"
        description: "Map of alias strings to canonical icon names"
      - name: "resolveIconAlias"
        type: "function"
        description: "Resolve an alias to its canonical icon name, returning the input unchanged if not an alias"
      - name: "getIconAliases"
        type: "function"
        description: "Return the list of all registered icon alias strings"
      - name: "registerLucideResolver"
        type: "function"
        description: "Low-level resolver hook used by the public @hua-labs/ui/lucide side-effect entry"
      - name: "useAnimatedEntrance"
        type: "hook"
        description: "Trigger a CSS class-based entrance animation when an element enters the viewport"
      - name: "useBreakpoint"
        type: "hook"
        description: "Track the current responsive breakpoint (sm / md / lg / xl / 2xl)"
      - name: "useDotEnv"
        type: "hook"
        description: "Read dot-engine style tokens from a CSS custom-property environment"
      - name: "useDotMap"
        type: "hook"
        description: "Resolve a DotStyleMap (state→dot-string) to live style objects based on current state"
      - name: "mergeStyles"
        type: "function"
        description: "Merge two CSSProperties / style objects, with the second taking precedence"
      - name: "resolveDot"
        type: "function"
        description: "Resolve a dot-style string to a CSSProperties object at runtime"

  subpaths:
    - path: "@hua-labs/ui/advanced"
      category: "web-runtime"
      description: "Broad advanced React web component aggregation entry."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/advanced/dashboard"
      category: "compatibility-alias"
      description: "Deprecated dashboard aggregation retained for 2.x compatibility with bounded replacement imports."
      deprecated: true
      routing:
        - "web"
      replacementImports:
        - "@hua-labs/ui/data"
        - "@hua-labs/ui/feedback"
        - "@hua-labs/ui/navigation"
        - "@hua-labs/ui/interactive"
        - "@hua-labs/ui/interactive/kanban"
      allowedOptionalPeers:
        - "@dnd-kit/core"
        - "@dnd-kit/sortable"
        - "@dnd-kit/utilities"
    - path: "@hua-labs/ui/advanced/emotion"
      category: "web-runtime"
      description: "Emotion-oriented React web components."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/advanced/motion"
      category: "web-runtime"
      description: "Advanced React web motion components and helpers."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/ax"
      category: "runtime-neutral"
      description: "Server-safe package AX catalog derived from the technical and semantic public-surface sources of truth."
      deprecated: false
      routing:
        - "server"
      provides:
        - name: "getUiAxCatalog"
          type: "function"
          description: "Return the frozen server-safe catalog derived from the UI package export map and semantic public-subpath manifest"
    - path: "@hua-labs/ui/data"
      category: "web-runtime"
      description: "React web table, code, timeline, and data display components."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/feedback"
      category: "web-runtime"
      description: "React web feedback, toast, alert, loading, and status components."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/form"
      category: "web-runtime"
      description: "React web form controls and form composition components."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/icons"
      category: "web-runtime"
      description: "Regular HUA icon component entry."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/icons-bold"
      category: "web-runtime"
      description: "Bold HUA icon component entry."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/iconsax"
      category: "web-runtime"
      description: "Curated Iconsax React component entry."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/iconsax-extended"
      category: "web-runtime"
      description: "Extended Iconsax React component entry for gallery and administration surfaces."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/interactive"
      category: "web-runtime"
      description: "React web interactive controls and composite interaction components."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/interactive/kanban"
      category: "web-runtime"
      description: "React web Kanban interaction surface backed by optional DnD peers."
      deprecated: false
      routing:
        - "web"
      allowedOptionalPeers:
        - "@dnd-kit/core"
        - "@dnd-kit/sortable"
        - "@dnd-kit/utilities"
      provides:
        - name: "KanbanBoard"
          type: "component"
          description: "Web Kanban route with optional dnd-kit peers, mouse/touch/keyboard sensors, detached canonical metadata snapshots, preview-only hover, one-drop transaction commits, WIP fail-closed behavior, terminal-safe click activation, and bounded sanitized announcements; browser, touch-device, live-region speech, and physical assistive-technology evidence remain separate"
    - path: "@hua-labs/ui/landing"
      category: "web-runtime"
      description: "React web landing-page sections backed by optional motion-core runtime."
      deprecated: false
      routing:
        - "web"
      allowedOptionalPeers:
        - "@hua-labs/motion-core"
    - path: "@hua-labs/ui/layout"
      category: "compatibility-alias"
      description: "2.x compatibility entry for React web layout components."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/lucide"
      category: "web-runtime"
      description: "Curated Lucide React provider entry backed by the executable icon catalog."
      deprecated: false
      routing:
        - "web"
      allowedOptionalPeers:
        - "lucide-react"
    - path: "@hua-labs/ui/motion"
      category: "compatibility-alias"
      description: "2.x compatibility entry for UI motion helpers and configuration."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/native"
      category: "native-runtime"
      description: "Canonical React Native Box, Text, Pressable, and useDotMap entry."
      deprecated: false
      routing:
        - "native"
      allowedOptionalPeers:
        - "react-native"
    - path: "@hua-labs/ui/navigation"
      category: "web-runtime"
      description: "React web navigation, breadcrumb, and pagination components."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/overlay"
      category: "web-runtime"
      description: "React web modal, drawer, popover, and overlay components."
      deprecated: false
      routing:
        - "web"
      allowedOptionalPeers:
        - "react-dom"
    - path: "@hua-labs/ui/primitives"
      category: "compatibility-alias"
      description: "2.x compatibility entry for cross-platform Box, Text, and Pressable primitives."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/sdui"
      category: "web-runtime"
      description: "React web SDUI renderer plus schema, registry, and authoring helpers."
      deprecated: false
      routing:
        - "web"
      allowedOptionalPeers:
        - "react-dom"
      provides:
        - name: "SDUIMotionIntent"
          type: "type"
          description: "Declarative SDUI motion slot payload backed by @hua-labs/motion-core intent metadata; not a renderer hook or executable animation"
    - path: "@hua-labs/ui/sdui/manifest"
      category: "runtime-neutral"
      description: "Server-safe SDUI component manifest and tree explain helpers."
      deprecated: false
      routing:
        - "server"
      provides:
        - name: "getDefaultSDUIManifest"
          type: "function"
          description: "Return the current default SDUI component/event/style manifest without importing or executing the renderer"
        - name: "explainSDUITree"
          type: "function"
          description: "Explain a canonical SDUI V1 tree against the default manifest and dotExplain target diagnostics without changing renderer behavior"
        - name: "SDUIManifestPreview"
          type: "type"
          description: "Server-safe preview manifest for default SDUI component allowlist, style slots, and renderer-mapped event boundaries"
        - name: "SDUITreeExplainResult"
          type: "type"
          description: "Tree-level SDUI authoring diagnostics result with component, event, style token, and dotExplain target caveat evidence"
    - path: "@hua-labs/ui/sdui/motion-core-validation"
      category: "runtime-neutral"
      description: "Server-safe SDUI validation prewired to motion-core projection metadata."
      deprecated: false
      routing:
        - "server"
      allowedOptionalPeers:
        - "@hua-labs/motion-core/manifest"
      provides:
        - name: "validateSDUIPageSchemaV1WithMotionCore"
          type: "function"
          description: "Validate a published SDUI V1 page envelope using the package-owned @hua-labs/motion-core projection catalog without executing renderer or animation runtime code"
    - path: "@hua-labs/ui/sdui/validation"
      category: "runtime-neutral"
      description: "Server-safe SDUI V1 schema validation without renderer exports."
      deprecated: false
      routing:
        - "server"
      provides:
        - name: "validateSDUIPageSchemaV1"
          type: "function"
          description: "Validate a published SDUI V1 page envelope, including the additive schema 1.1.0 motion slot when supplied with the motion-core projection catalog"
        - name: "SDUI_MOTION_SCHEMA_VERSION"
          type: "variable"
          description: "Minimum SDUI schema version that may publish the additive motion slot"
    - path: "@hua-labs/ui/styles/base.css"
      category: "asset"
      description: "Base UI CSS asset."
      deprecated: false
      routing:
        - "asset"
    - path: "@hua-labs/ui/styles/codeblock.css"
      category: "asset"
      description: "Code block component CSS asset."
      deprecated: false
      routing:
        - "asset"
    - path: "@hua-labs/ui/styles/landing.css"
      category: "asset"
      description: "Landing component CSS asset."
      deprecated: false
      routing:
        - "asset"
    - path: "@hua-labs/ui/styles/prose.css"
      category: "asset"
      description: "Prose typography CSS asset."
      deprecated: false
      routing:
        - "asset"
    - path: "@hua-labs/ui/styles/recommended-theme.css"
      category: "asset"
      description: "Recommended semantic theme CSS asset."
      deprecated: false
      routing:
        - "asset"
    - path: "@hua-labs/ui/styles/toast.css"
      category: "asset"
      description: "Toast component CSS asset."
      deprecated: false
      routing:
        - "asset"
    - path: "@hua-labs/ui/styles/utilities.css"
      category: "asset"
      description: "UI utility CSS asset."
      deprecated: false
      routing:
        - "asset"
    - path: "@hua-labs/ui/theme"
      category: "web-runtime"
      description: "React web theme provider, controls, and theme hooks."
      deprecated: false
      routing:
        - "web"
    - path: "@hua-labs/ui/theme/foundation"
      category: "runtime-neutral"
      description: "Server-safe theme foundation metadata, CSS variable helpers, and dot configuration seed."
      deprecated: false
      routing:
        - "server"
      provides:
        - name: "getDefaultThemeFoundationPreview"
          type: "function"
          description: "Return the server-safe preview theme foundation metadata without importing ThemeProvider or renderer code"
        - name: "getThemeFoundationCssVars"
          type: "function"
          description: "Return light or dark preview CSS variable maps for current semantic theme tokens"
        - name: "stringifyThemeFoundationCssVars"
          type: "function"
          description: "Serialize a preview theme foundation CSS variable map under a selector"
        - name: "getThemeFoundationDotConfigSeed"
          type: "function"
          description: "Return a preview @hua-labs/dot config seed for semantic CSS variable color tokens"
        - name: "UIThemeFoundationPreview"
          type: "type"
          description: "Server-safe preview type for theme foundation metadata, presets, CSS vars, and dot config seed"
    - path: "@hua-labs/ui/utils"
      category: "compatibility-alias"
      description: "2.x compatibility entry for UI utility helpers."
      deprecated: false
      routing:
        - "web"

features:
  - "70+ components — Buttons, forms, tables, modals, overlays, and more"
  - "Modular entry points — Import only what you need for optimal bundle size"
  - "Accessibility foundations — component-specific ARIA and keyboard contracts; browser and physical assistive-technology evidence remain separate"
  - "Dark mode — Built-in dark mode support"
  - "dot style engine — Cross-platform styling (Web CSSProperties / React Native StyleSheet) via dot prop"
  - "Tree-shakeable — Side-effect free (except CSS)"

related_packages:
  - "@hua-labs/hua"

ax:
  schemaVersion: "hua-package-ax.v1"
  catalogKind: "public-surface"
  sourcePackage: "@hua-labs/ui"
  sourceExport: "getUiAxCatalog"
  entryCount: 37
  targetRowCount: 38
  surfaceRowCount: 74
  targets:
    - "asset"
    - "native"
    - "server"
    - "web"
  surfaces:
    - "docs"
    - "package-export"
  supportSummary:
    direct: 38
  executionSummary:
    runtime: 38

compatibility:
  react: ">=19.0.0"
  node: ">=20.0.0"
