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

package:
  name: "@hua-labs/hua"
  version: "2.0.0"
  description: "HUA - Ship UX faster: UI + motion + i18n, pre-wired. A framework for React product teams."
  license: "MIT"

overview: "Batteries-included framework for React product teams. Unifies UI components, animation hooks, internationalization, state management, and utilities into a single dependency with automatic provider setup for Next.js."

exports:
  main:
    path: "@hua-labs/hua"
    provides:
      - name: "HuaProvider"
        type: "component"
        description: "Root layout provider — injects Tailwind v4 CSS theme variables at runtime, auto-wires BrandingProvider, ToastProvider, IconProvider, MotionConfigProvider, and i18n. Import from '@hua-labs/hua/framework'."
      - name: "HuaPage"
        type: "component"
        description: "Page wrapper with automatic motion (vibe prop: 'clean' | 'fancy' | 'minimal'), ErrorBoundary, and i18nKey namespace hint. Import from '@hua-labs/hua/framework'."
      - name: "UnifiedProviders"
        type: "component"
        description: "Lower-level provider composition component used internally by HuaProvider. Accepts optional config override. Prefer HuaProvider unless you need fine-grained provider control."
      - name: "ErrorBoundary"
        type: "component"
        description: "React error boundary with optional custom fallback. Built into HuaPage; can also be used standalone. Import from '@hua-labs/hua/framework'."
      - name: "WelcomePage"
        type: "component"
        description: "Default welcome page for new hua projects. Renders project name, framework feature cards, and quick links with fade/slide animations. Accepts projectName, showFeatures, showQuickLinks props."
      - name: "Button"
        type: "component"
        description: "BrandedButton re-exported as Button — auto-applies branding primary/secondary/accent CSS variables when branding is configured. Falls back to @hua-labs/ui Button when no branding."
      - name: "BrandedButton"
        type: "component"
        description: "Lower-level branded button (same as Button export). Use the Button export from '@hua-labs/hua' or import BrandedButton from '@hua-labs/hua/framework' directly."
      - name: "Card"
        type: "component"
        description: "BrandedCard re-exported as Card — auto-applies branding CSS variables when branding is configured. Falls back to @hua-labs/ui Card when no branding."
      - name: "BrandedCard"
        type: "component"
        description: "Lower-level branded card (same as Card export). Use the Card export from '@hua-labs/hua' or import BrandedCard from '@hua-labs/hua/framework' directly."
      - name: "defineConfig"
        type: "function"
        description: "Define hua configuration with presets (product, landing, docs). Available presets: 'product' | 'landing' | 'docs'. Import from '@hua-labs/hua/framework/config'."
      - name: "BrandingProvider"
        type: "component"
        description: "Context provider that makes branding config (colors, logo, fonts) available to BrandedButton and BrandedCard. Automatically included by HuaProvider when branding is set in defineConfig."
      - name: "useBranding"
        type: "hook"
        description: "Access branding config from context. Returns null when no branding is configured."
      - name: "useBrandingColor"
        type: "hook"
        description: "Retrieve a specific branding color by key (e.g. 'primary', 'secondary', 'accent'). Returns undefined when no branding is configured."
      - name: "usePresetMotion"
        type: "hook"
        description: "Convenience hook that resolves per-role motion config from the active preset and combines it with reducedMotion / enableAnimations global flags. Returns { config: ComponentMotionConfig | undefined, shouldAnimate: boolean }."
      - name: "useMotion"
        type: "hook"
        description: "Framework-level motion hook — wraps motion-core's useUnifiedMotion. Accepts { type: EntranceType, duration, autoStart } and returns { ref, style, start, stop }. Import from '@hua-labs/hua/framework'."
      - name: "useFocusManagement"
        type: "hook"
        description: "A11y hook for programmatic focus management — move focus to a target ref. Import from '@hua-labs/hua/framework'."
      - name: "useFocusTrap"
        type: "hook"
        description: "A11y hook that traps keyboard focus within a container (dialogs, drawers). Import from '@hua-labs/hua/framework'."
      - name: "SkipToContent"
        type: "component"
        description: "Accessible skip-to-content link rendered at the top of the page for keyboard navigation. Import from '@hua-labs/hua/framework'."
      - name: "LiveRegion"
        type: "component"
        description: "ARIA live region component for announcing dynamic content changes to screen readers. Import from '@hua-labs/hua/framework'."
      - name: "useLiveRegion"
        type: "hook"
        description: "Hook to imperatively announce messages to screen readers via an ARIA live region. Import from '@hua-labs/hua/framework'."
      - name: "useDelayedLoading"
        type: "hook"
        description: "Prevents loading flicker by delaying the visible loading state by a configurable threshold (default 200ms). Import from '@hua-labs/hua/framework'."
      - name: "useLoadingState"
        type: "hook"
        description: "Manages async loading state with error capture. Import from '@hua-labs/hua/framework'."
      - name: "SuspenseWrapper"
        type: "component"
        description: "Thin Suspense wrapper that accepts a skeleton fallback. Import from '@hua-labs/hua/framework'."
      - name: "withSuspense"
        type: "function"
        description: "HOC that wraps a component in SuspenseWrapper. Import from '@hua-labs/hua/framework'."
      - name: "useData"
        type: "hook"
        description: "Client-side data fetching hook with loading/error state. Import from '@hua-labs/hua/framework'."
      - name: "fetchData"
        type: "function"
        description: "Async data fetching utility for use outside React components (e.g. RSC, actions). Import from '@hua-labs/hua/framework'."
      - name: "initLicense"
        type: "function"
        description: "Initialize the hua license at app startup. Import from '@hua-labs/hua/framework'."
      - name: "getLicense"
        type: "function"
        description: "Return the currently active LicenseInfo. Import from '@hua-labs/hua/framework'."
      - name: "checkLicense"
        type: "function"
        description: "Check whether a specific LicenseFeature is available. Returns LicenseCheckResult. Import from '@hua-labs/hua/framework'."
      - name: "hasLicense"
        type: "function"
        description: "Boolean guard — true when the specified LicenseFeature is licensed. Import from '@hua-labs/hua/framework'."
      - name: "requireLicense"
        type: "function"
        description: "Throw if the specified LicenseFeature is not licensed (use at component/route level). Import from '@hua-labs/hua/framework'."
      - name: "pluginRegistry"
        type: "constant"
        description: "Central plugin registry instance. Use registerPlugin / getPlugin / getAllPlugins helpers instead of accessing directly. Import from '@hua-labs/hua/framework'."
      - name: "registerPlugin"
        type: "function"
        description: "Register a HuaPlugin at runtime. Import from '@hua-labs/hua/framework'."
      - name: "getPlugin"
        type: "function"
        description: "Retrieve a registered plugin by name. Import from '@hua-labs/hua/framework'."
      - name: "getAllPlugins"
        type: "function"
        description: "Return all registered HuaPlugin instances. Import from '@hua-labs/hua/framework'."
      - name: "generateGEOMetadata"
        type: "function"
        description: "Generate Next.js Metadata object optimized for AI/LLM search engines (Generative Engine Optimization). Server-safe. Import from '@hua-labs/hua/framework'."
      - name: "renderJSONLD"
        type: "function"
        description: "Render a JSON-LD script tag for structured data. Server-safe. Import from '@hua-labs/hua/framework'."
      - name: "generatePageMetadata"
        type: "function"
        description: "Convenience wrapper around Next.js generateMetadata for standard SEO fields. Server-safe. Import from '@hua-labs/hua/framework'."
      - name: "generateCSSVariables"
        type: "function"
        description: "Generate a CSS string of branding color variables for server-side injection (e.g. inline <style>). Import from '@hua-labs/hua/framework'."
      - name: "generateTailwindConfig"
        type: "function"
        description: "Generate a Tailwind CSS config object from branding colors. Import from '@hua-labs/hua/framework'."
      - name: "createI18nMiddleware"
        type: "function"
        description: "Create a Next.js middleware handler for i18n locale detection and routing. Import from '@hua-labs/hua/framework'."

  subpaths:
    - path: "@hua-labs/hua/framework"
      description: "Framework layer (HuaProvider, defineConfig, HuaPage)"
    - path: "@hua-labs/hua/framework/server"
      description: "Server-only framework utilities"
    - path: "@hua-labs/hua/framework/config"
      description: "Configuration types and defineConfig"
    - path: "@hua-labs/hua/ui"
      description: "Re-exports from @hua-labs/ui"
    - path: "@hua-labs/hua/motion"
      description: "Re-exports from @hua-labs/motion-core"
    - path: "@hua-labs/hua/i18n"
      description: "Re-exports from @hua-labs/i18n-core"
    - path: "@hua-labs/hua/state"
      description: "Re-exports from @hua-labs/state"
    - path: "@hua-labs/hua/formatters"
      description: "Re-exports from @hua-labs/i18n-formatters"
    - path: "@hua-labs/hua/utils"
      description: "Re-exports from @hua-labs/utils"
    - path: "@hua-labs/hua/hooks"
      description: "Re-exports from @hua-labs/hooks"
    - path: "@hua-labs/hua/loaders"
      description: "Re-exports from @hua-labs/i18n-loaders"
    - path: "@hua-labs/hua/dot"
      description: "Re-exports from @hua-labs/dot — dot, dotMap, createDotConfig, clearDotCache, dotCx, dotVariants, adaptNative"
    - path: "@hua-labs/hua/dot/react"
      description: "React hooks for dot — useDot, useDotMap (requires 'use client')"

features:
  - "Pre-wired — UI, motion, i18n, state configured and ready to use"
  - "Framework layer — Next.js-optimized with defineConfig and automatic providers"
  - "Re-exports 290+ symbols — UI (100+ components), motion-core (40+ hooks), i18n, state, pro"
  - "Accessibility — WCAG 2.1 compliant utilities (focus management, skip-to-content)"
  - "Loading UX — Built-in delayed loading, suspense wrappers"
  - "Error handling — ErrorBoundary built into HuaPage"
  - "White-labeling — SSR-compatible CSS variable injection via branding config"
  - "GEO support — Generative Engine Optimization for AI search engines"
  - "License system — Runtime feature gating with initLicense / requireLicense"
  - "Plugin system — Register and retrieve runtime plugins via pluginRegistry"

related_packages:
  - "@hua-labs/ui"
  - "@hua-labs/motion-core"
  - "@hua-labs/i18n-core"
  - "@hua-labs/state"

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