@yuhuanowo/yunui 0.2.17 → 0.2.18

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.
Files changed (41) hide show
  1. package/README.md +3 -1
  2. package/README.zh-CN.md +5 -1
  3. package/README.zh-TW.md +5 -1
  4. package/dist/ai.d.ts +99 -3
  5. package/dist/ai.js +212 -104
  6. package/dist/ai.js.map +1 -1
  7. package/dist/chat.d.ts +10 -3
  8. package/dist/chat.js +12 -7
  9. package/dist/chat.js.map +1 -1
  10. package/dist/{chunk-HH3JBHRP.js → chunk-AFVENY4D.js} +286 -31
  11. package/dist/chunk-AFVENY4D.js.map +1 -0
  12. package/dist/{chunk-F2HG4TOQ.js → chunk-GAXVET76.js} +13 -19
  13. package/dist/chunk-GAXVET76.js.map +1 -0
  14. package/dist/{chunk-DDUP7GAX.js → chunk-LEBQPP4B.js} +69 -3
  15. package/dist/chunk-LEBQPP4B.js.map +1 -0
  16. package/dist/chunk-ST6TSBVQ.js +208 -0
  17. package/dist/chunk-ST6TSBVQ.js.map +1 -0
  18. package/dist/chunk-V7VJKZ5Q.js +254 -0
  19. package/dist/chunk-V7VJKZ5Q.js.map +1 -0
  20. package/dist/{chunk-BCOKFWXC.js → chunk-YKWRCA2S.js} +80 -156
  21. package/dist/chunk-YKWRCA2S.js.map +1 -0
  22. package/dist/content.d.ts +10 -2
  23. package/dist/content.js +50 -40
  24. package/dist/content.js.map +1 -1
  25. package/dist/index.d.ts +266 -16
  26. package/dist/index.js +4 -4
  27. package/dist/patterns.d.ts +471 -22
  28. package/dist/patterns.js +783 -131
  29. package/dist/patterns.js.map +1 -1
  30. package/icons/providers/gmi.svg +5 -0
  31. package/package.json +3 -4
  32. package/styles/content.css +3 -1
  33. package/styles/yunui.css +197 -84
  34. package/dist/chunk-BCOKFWXC.js.map +0 -1
  35. package/dist/chunk-DDUP7GAX.js.map +0 -1
  36. package/dist/chunk-F2HG4TOQ.js.map +0 -1
  37. package/dist/chunk-HH3JBHRP.js.map +0 -1
  38. package/dist/chunk-N4QO7RN5.js +0 -98
  39. package/dist/chunk-N4QO7RN5.js.map +0 -1
  40. package/dist/chunk-QEIBYOG2.js +0 -188
  41. package/dist/chunk-QEIBYOG2.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/primitives/modal/constants.ts","../src/primitives/modal/ConfirmModal.tsx","../src/primitives/sheet.tsx","../src/primitives/checkbox.tsx","../src/primitives/combobox.tsx","../src/primitives/accordion.tsx","../src/primitives/radio-group.tsx","../src/primitives/layout.tsx","../src/primitives/table.tsx","../src/primitives/breadcrumb.tsx","../src/primitives/pagination.tsx","../src/primitives/index.tsx","../src/primitives/modal/Modal.tsx"],"names":["Icon","useState","useRef","useEffect","createPortal","jsx","jsxs","Fragment","Image","useId","X","React","ChevronDown","React2","React3","React4","React5","React6","ChevronRight","Loader2","Minus","Separator","Info","AlertTriangle","Check","ChevronUp","motion","Label","closeIdCounter","useCallback"],"mappings":";;;;;;;;;;;;;;;;;;;;AAaO,IAAM,OAAA,GAAU;AAAA,EACnB,KAAA,EAAO,EAAA;AAAA,EACP,cAAA,EAAgB,EAEpB,CAAA;AAOO,IAAM,YAAA,GAAe;AAAA,EACxB,EAAA,EAAI,UAAA;AAAA;AAAA,EACJ,EAAA,EAAI,UAAA;AAAA;AAAA,EACJ,EAAA,EAAI,UAAA;AAAA;AAAA,EACJ,EAAA,EAAI,UAAA;AAAA;AAAA,EACJ,KAAA,EAAO,WAAA;AAAA;AAAA,EACP,KAAA,EAAO,WAAA;AAAA;AAAA,EACP,KAAA,EAAO,WAAA;AAAA;AAAA,EACP,KAAA,EAAO,WAAA;AAAA;AAAA,EACP,KAAA,EAAO,WAAA;AAAA;AAAA,EACP,IAAA,EAAM;AAAA;AACV,CAAA;AAOO,IAAM,kBAAA,GAAqB,GAAA;AAK3B,IAAM,kBAAA,GAAqB,MAAA;AChBlC,IAAI,cAAA,GAAiB,CAAA;AAErB,IAAM,aAAA,GA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AAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,mBAAA,EACX,QAAA,EAAA;AAAA,kCAAAA,IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,yBAAA,EACX,QAAA,EAAA;AAAA,oCAAAD,IAAC,IAAA,EAAA,EAAG,EAAA,EAAG,aAAA,EAAc,SAAA,EAAU,kCAC1B,QAAA,EAAA,KAAA,EACL,CAAA;AAAA,oBACC,gBAAA,oBACGA,GAAAA,CAAC,MAAA,EAAA,EAAK,WAAU,wBAAA,EACX,QAAA,EAAA,CAAA,CAAE,SAAS,CAAA,EAChB;AAAA,mBAAA,EAER,CAAA;AAAA,kBACC,4BACGA,GAAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,0CAA0C,QAAA,EAAA,QAAA,EAAS;AAAA,iBAAA,EAExE,CAAA;AAAA,gBACC,mCACGA,GAAAA;AAAA,kBAAC,MAAA;AAAA,kBAAA;AAAA,oBACG,OAAA,EAAQ,OAAA;AAAA,oBACR,IAAA,EAAK,IAAA;AAAA,oBACL,OAAA,EAAS,WAAA;AAAA,oBACT,SAAA,EAAU,cAAA;AAAA,oBACV,YAAA,EAAY,EAAE,OAAO,CAAA;AAAA,oBAErB,QAAA,kBAAAA,GAAAA,CAACK,CAAAA,EAAA,EAAE,MAAM,EAAA,EAAI;AAAA;AAAA;AACjB,eAAA,EAER,CAAA;AAAA,8BAGAL,GAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,8BACV,QAAA,EACL,CAAA;AAAA,cAGC,0BACGA,GAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,mDACV,QAAA,EAAA,MAAA,EACL;AAAA;AAAA;AAAA;AAER;AAAA;AAAA,GACJ;AAGJ,EAAA,OAAOD,YAAAA,CAAa,YAAA,EAAc,QAAA,CAAS,IAAI,CAAA;AACnD","file":"chunk-YKWRCA2S.js","sourcesContent":["/**\n * Modal System Constants\n *\n * Unified z-index layers and size definitions for all modals\n */\n\n/**\n * Z-Index Layers\n *\n * z-50: Base modal layer\n * z-60: Confirmation dialogs (on top of modals)\n * z-70: Toast/notification layer (highest)\n */\nexport const Z_INDEX = {\n MODAL: 50,\n CONFIRM_DIALOG: 60,\n TOAST: 70,\n} as const;\n\n/**\n * Modal Size Classes\n *\n * Consistent across all modal implementations\n */\nexport const SIZE_CLASSES = {\n sm: \"max-w-sm\", // 384px\n md: \"max-w-md\", // 448px\n lg: \"max-w-lg\", // 512px\n xl: \"max-w-xl\", // 576px\n \"2xl\": \"max-w-2xl\", // 672px\n \"3xl\": \"max-w-3xl\", // 768px\n \"4xl\": \"max-w-4xl\", // 896px\n \"5xl\": \"max-w-5xl\", // 1024px\n \"6xl\": \"max-w-6xl\", // 1152px\n full: \"max-w-[95vw]\", // 95% viewport width\n} as const;\n\nexport type ModalSize = keyof typeof SIZE_CLASSES;\n\n/**\n * Animation duration in milliseconds\n */\nexport const ANIMATION_DURATION = 150;\n\n/**\n * Default max height for modals\n */\nexport const DEFAULT_MAX_HEIGHT = \"85vh\";\n","/**\n * ConfirmModal - Unified Confirmation Dialog\n *\n * Provides a consistent, accessible confirmation dialog for:\n * - Delete confirmations\n * - Regenerate confirmations\n * - Any action requiring user confirmation\n *\n * Features:\n * - Variant-based styling (danger, warning, info, success)\n * - Escape key to close (with animation)\n * - Body scroll lock\n * - Backdrop click to close\n * - Accessible focus management\n * - Loading state support\n * - SSR compatible\n */\n\n\"use client\";\n\nimport { useState, useEffect, useRef, useCallback } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { AlertTriangle, RefreshCw, Trash2, Info, CheckCircle, Loader2 } from \"lucide-react\";\nimport { Button } from \"../index\";\nimport { useEscapeKey, useBodyScrollLock, useFocusTrap } from \"../../lib/hooks\";\nimport { cn } from \"../../lib/cn\";\nimport { Z_INDEX, ANIMATION_DURATION } from \"./constants\";\nimport type { ConfirmModalProps, ConfirmModalVariant, DeleteConfirmModalProps, RegenerateConfirmModalProps } from \"./types\";\nimport { useYunUI } from \"../../adapters/context\";\n\n// Unique ID counter for timeout tracking\nlet closeIdCounter = 0;\n\nconst variantConfig: Record<ConfirmModalVariant, {\n iconBg: string;\n iconColor: string;\n buttonVariant: \"default\" | \"red\" | \"amber\";\n Icon: typeof Trash2;\n}> = {\n danger: {\n iconBg: \"bg-error-soft\",\n iconColor: \"text-error\",\n buttonVariant: \"red\",\n Icon: Trash2,\n },\n warning: {\n iconBg: \"bg-warning-soft\",\n iconColor: \"text-warning\",\n buttonVariant: \"amber\",\n Icon: RefreshCw,\n },\n info: {\n iconBg: \"bg-info-soft\",\n iconColor: \"text-info\",\n buttonVariant: \"default\",\n Icon: Info,\n },\n success: {\n iconBg: \"bg-success-soft\",\n iconColor: \"text-success\",\n buttonVariant: \"default\",\n Icon: CheckCircle,\n },\n};\n\nexport function ConfirmModal({\n isOpen,\n title,\n subtitle,\n message,\n variant = \"warning\",\n confirmText,\n cancelText,\n isLoading = false,\n onConfirm,\n onClose,\n className,\n icon,\n}: ConfirmModalProps) {\n const t = useYunUI().useT('components.confirmModal');\n const confirmButtonRef = useRef<HTMLButtonElement>(null);\n const dialogRef = useRef<HTMLDivElement>(null);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const closeIdRef = useRef<number>(0);\n const [isClosing, setIsClosing] = useState(false);\n const [mounted, setMounted] = useState(false);\n const config = variantConfig[variant];\n\n // a11y: keep Tab inside the dialog and restore focus to the opener on close.\n // Declared before the explicit confirm-button focus effect below so that\n // effect still wins the *initial* focus; this only adds Tab containment.\n // `mounted` is in the flag so the effect runs once the portal/ref exists.\n useFocusTrap(dialogRef, isOpen && !isClosing && mounted);\n\n // Default values with translations\n const _confirmText = confirmText ?? t('confirm');\n const _cancelText = cancelText ?? t('cancel');\n\n // Track mounted state for SSR\n useEffect(() => {\n setMounted(true);\n return () => setMounted(false);\n }, []);\n\n // Cleanup timeout on unmount\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n };\n }, []);\n\n // Use refs to avoid stale closure issues\n const isClosingRef = useRef(isClosing);\n isClosingRef.current = isClosing;\n\n const isLoadingRef = useRef(isLoading);\n isLoadingRef.current = isLoading;\n\n const onCloseRef = useRef(onClose);\n onCloseRef.current = onClose;\n\n // Handle close with animation - no dependencies to avoid recreation\n const handleClose = useCallback(() => {\n // Prevent double-close or close during loading using refs\n if (isClosingRef.current || isLoadingRef.current) return;\n\n // Clear any existing timeout\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n\n // Generate unique ID for this close operation\n const currentCloseId = ++closeIdCounter;\n closeIdRef.current = currentCloseId;\n\n setIsClosing(true);\n timeoutRef.current = setTimeout(() => {\n // Only execute if this is still the current close operation\n if (closeIdRef.current === currentCloseId) {\n onCloseRef.current();\n setIsClosing(false);\n timeoutRef.current = null;\n }\n }, ANIMATION_DURATION);\n }, []); // No dependencies - uses refs\n\n // Handle Escape key (enabled state checked inside useEscapeKey via refs)\n useEscapeKey(handleClose, isOpen);\n\n // Body scroll lock\n useBodyScrollLock(isOpen);\n\n // Focus confirm button on open\n useEffect(() => {\n if (isOpen) {\n const timer = setTimeout(() => {\n confirmButtonRef.current?.focus();\n }, 0);\n return () => clearTimeout(timer);\n }\n }, [isOpen]);\n\n // Reset closing state when modal reopens\n useEffect(() => {\n if (isOpen && isClosing) {\n setIsClosing(false);\n }\n }, [isOpen, isClosing]);\n\n // Don't render if not open or not mounted (SSR)\n if (!isOpen || !mounted) return null;\n\n const Icon = config.Icon;\n\n const modalContent = (\n <div\n className={cn(\n \"fixed inset-0 pointer-events-auto flex items-center justify-center p-4 transition-opacity\",\n isClosing ? \"opacity-0 pointer-events-none\" : \"opacity-100\"\n )}\n style={{ zIndex: Z_INDEX.CONFIRM_DIALOG }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"confirm-modal-title\"\n aria-describedby=\"confirm-modal-description\"\n >\n {/* Backdrop */}\n <div\n className={cn(\n \"absolute inset-0 bg-black/50 backdrop-blur-sm transition-opacity\",\n isClosing ? \"opacity-0\" : \"opacity-100\"\n )}\n onClick={handleClose}\n aria-hidden=\"true\"\n />\n\n {/* Modal Card */}\n <div\n ref={dialogRef}\n className={cn(\n \"card relative w-full max-w-sm shadow-lg shadow-black/5 transition-all\",\n isClosing ? \"scale-95 opacity-0\" : \"scale-100 opacity-100\",\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"p-5\">\n {/* Header with icon */}\n <div className=\"flex items-center gap-3 mb-4\">\n <div\n className={cn(\n \"w-10 h-10 rounded-full flex items-center justify-center shrink-0\",\n config.iconBg\n )}\n >\n {icon || <Icon size={20} className={config.iconColor} />}\n </div>\n <div className=\"min-w-0\">\n <h3 id=\"confirm-modal-title\" className=\"font-semibold truncate\">\n {title}\n </h3>\n {subtitle && (\n <p className=\"text-xs text-muted-foreground truncate\">{subtitle}</p>\n )}\n </div>\n </div>\n\n {/* Message */}\n <div\n id=\"confirm-modal-description\"\n className=\"text-sm text-muted-foreground mb-4\"\n >\n {message}\n </div>\n\n {/* Actions */}\n <div className=\"flex gap-2\">\n <Button\n onClick={handleClose}\n disabled={isLoading}\n variant=\"secondary\"\n className=\"flex-1\"\n >\n {_cancelText}\n </Button>\n <Button\n ref={confirmButtonRef}\n onClick={onConfirm}\n disabled={isLoading}\n variant={config.buttonVariant}\n className=\"flex-1\"\n >\n {isLoading ? (\n <span className=\"flex items-center gap-2\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n {t('processing')}\n </span>\n ) : (\n _confirmText\n )}\n </Button>\n </div>\n </div>\n </div>\n </div>\n );\n\n return createPortal(modalContent, document.body);\n}\n\n/**\n * Quick confirm dialog for delete actions\n */\nexport function DeleteConfirmModal({\n itemName,\n ...props\n}: DeleteConfirmModalProps) {\n const t = useYunUI().useT('components.confirmModal');\n\n return (\n <ConfirmModal\n variant=\"danger\"\n title={t('deleteQuestion')}\n confirmText={t('delete')}\n message={\n <>\n {t('deleteMessage', { item: itemName })}\n </>\n }\n {...props}\n />\n );\n}\n\n/**\n * Quick confirm dialog for regenerate actions\n */\nexport function RegenerateConfirmModal({\n itemName,\n ...props\n}: RegenerateConfirmModalProps) {\n const t = useYunUI().useT('components.confirmModal');\n\n return (\n <ConfirmModal\n variant=\"warning\"\n title={t('regenerateQuestion')}\n subtitle={t('actionCannotBeUndone')}\n confirmText={t('regenerate')}\n message={\n <>\n {t('regenerateMessage', { item: itemName })}\n </>\n }\n {...props}\n />\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef, useState, useId } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { X } from \"lucide-react\";\nimport { useModalBehavior, useFocusTrap } from \"../lib/hooks\";\nimport { cn } from \"../lib/cn\";\n\ninterface SheetProps {\n /** Whether the sheet is open (controlled). */\n open: boolean;\n /** Called when the sheet should close (backdrop click, escape, close button). */\n onClose: () => void;\n children: React.ReactNode;\n /** Optional header title. */\n title?: string;\n /** Accessible name for the close button. The library ships no copy of its\n * own; the English default only keeps it usable untranslated. */\n closeLabel?: string;\n /** Hide on large screens (`lg`+) — for mobile-only drawers (e.g. a sidebar\n * that's permanent on desktop). @defaultValue false (shows on all sizes). */\n mobileOnly?: boolean;\n}\n\n/** Slide-in panel from the right with a backdrop. By default it shows on every\n * screen size; set `mobileOnly` to hide it on `lg`+ (a mobile-only drawer). */\nexport function Sheet({ open, onClose, children, title, closeLabel, mobileOnly = false }: SheetProps) {\n const [mounted, setMounted] = useState(false);\n const panelRef = useRef<HTMLDivElement>(null);\n const titleId = useId();\n\n useEffect(() => {\n setMounted(true);\n return () => setMounted(false);\n }, []);\n\n useModalBehavior(open, onClose);\n // a11y: trap Tab inside the drawer and restore focus to the opener on close.\n // `mounted` is part of the flag so the effect (re-)runs after the portal\n // renders and the panel ref is actually attached.\n useFocusTrap(panelRef, open && mounted);\n\n if (!mounted) return null;\n\n return createPortal(\n <AnimatePresence>\n {open && (\n <>\n {/* Backdrop */}\n <motion.div\n key=\"sheet-backdrop\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.2 }}\n className={cn(\"fixed inset-0 bg-black/20 backdrop-blur-sm\", mobileOnly && \"lg:hidden\")}\n style={{ zIndex: 40 }}\n onClick={onClose}\n aria-hidden=\"true\"\n />\n {/* Panel */}\n <motion.div\n key=\"sheet-panel\"\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? titleId : undefined}\n initial={{ x: \"100%\" }}\n animate={{ x: 0 }}\n exit={{ x: \"100%\" }}\n transition={{ type: \"spring\", damping: 30, stiffness: 300 }}\n /* A floating, glassy, fully-rounded drawer (inset from the\n edges) — matches YunUI's navbar/modal surface treatment\n instead of a flat edge-to-edge white slab. */\n className={cn(\"fixed inset-y-3 right-3 w-[85vw] min-w-72 max-w-sm bg-background/95 backdrop-blur-xl shadow-2xl flex flex-col overflow-hidden rounded-2xl border border-border\", mobileOnly && \"lg:hidden\")}\n style={{ zIndex: 50 }}\n onClick={(e) => e.stopPropagation()}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between px-5 py-4 border-b border-border/60 shrink-0\">\n {title && (\n <h2 id={titleId} className=\"font-semibold text-sm tracking-tight\">{title}</h2>\n )}\n <button\n onClick={onClose}\n className=\"-mr-1.5 p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors ml-auto\"\n aria-label={closeLabel ?? \"Close\"}\n >\n <X size={18} />\n </button>\n </div>\n {/* Body — px-5 matches the header. Without default padding\n every consumer's content sat flush against the panel\n edges (e.g. settings drawers). */}\n <div className=\"flex-1 overflow-y-auto px-5 py-4\">\n {children}\n </div>\n </motion.div>\n </>\n )}\n </AnimatePresence>,\n document.body\n );\n}\n","\"use client\";\n\nimport { forwardRef, type ButtonHTMLAttributes } from \"react\";\nimport { Check, Minus } from \"lucide-react\";\n\nexport interface CheckboxProps\n extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"checked\" | \"onChange\" | \"type\" | \"role\" | \"disabled\" | \"id\" | \"className\"\n > {\n /** Whether the box is checked. `\"indeterminate\"` shows a dash — for a\n * select-all that's only partially selected. Defaults to `false`. */\n checked?: boolean | \"indeterminate\";\n /** Called with the next checked state when toggled (indeterminate → checked).\n * Optional — omit for a read-only/display checkbox (it won't toggle). */\n onCheckedChange?: (checked: boolean) => void;\n /** Disable interaction and dim the control. */\n disabled?: boolean;\n className?: string;\n /**\n * Element id.\n *\n * NOTE: this renders a `<button role=\"checkbox\">`, and `<label>` — whether\n * wrapping or via `htmlFor` — only names real form controls. It does\n * nothing for a button. Name it with `aria-label`, or point\n * `aria-labelledby` at the text beside it.\n */\n id?: string;\n}\n\n/** Controlled checkbox rendered as an accessible toggle button. Supports an\n * `indeterminate` state (dash) for partial select-all. */\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n ({ checked = false, onCheckedChange, disabled = false, className = \"\", id, ...props }, ref) => {\n const filled = checked === true || checked === \"indeterminate\";\n return (\n <button\n // Spread FIRST so the explicit props below still win, but the\n // caller's aria-label / aria-labelledby / data-* actually reach\n // the DOM. They did not before: this component dropped every\n // prop it did not name, so a YunUI checkbox could not be given\n // an accessible name at all — `<label>` does not work on a\n // button, and aria-label was silently discarded.\n {...props}\n ref={ref}\n type=\"button\"\n role=\"checkbox\"\n aria-checked={checked === \"indeterminate\" ? \"mixed\" : checked}\n id={id}\n onClick={() => !disabled && onCheckedChange?.(checked !== true)}\n disabled={disabled}\n className={`\n w-4 h-4 rounded border-2 flex items-center justify-center\n transition-all duration-200 ease-in-out\n outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\n ${filled\n ? \"bg-primary border-primary text-primary-foreground\"\n : \"border-(--border-strong) bg-transparent hover:border-primary/50\"\n }\n ${disabled ? \"opacity-50 cursor-not-allowed\" : \"cursor-pointer\"}\n ${className}\n `}\n >\n {checked === \"indeterminate\"\n ? <Minus size={12} strokeWidth={3} />\n : checked && <Check size={12} strokeWidth={3} />}\n </button>\n );\n }\n);\n\nCheckbox.displayName = \"Checkbox\";\n","\"use client\";\n\nimport { useState, useRef, useEffect, useId, type ReactNode } from \"react\";\nimport { X, ChevronDown } from \"lucide-react\";\nimport { useYunUI } from \"../adapters/context\";\nimport { useAnchoredPosition } from \"../lib/use-anchored-position\";\nimport { useDismissOnOutside } from \"../lib/hooks\";\n\nexport interface ComboboxOption {\n /** The value reported to `onChange` when selected. */\n value: string;\n /** Display text for the option. */\n label: string;\n /** Optional secondary text for the option. */\n description?: string;\n /**\n * Optional resolved icon URL for the option. The host app resolves this\n * (e.g. from a provider id) before passing options in — YunUI stays\n * domain-agnostic.\n */\n iconUrl?: string | null;\n}\n\ninterface ComboboxProps {\n /** The selectable options. */\n options: ComboboxOption[];\n /** Currently selected value (controlled). */\n value: string;\n /** Called with the chosen (or newly created) value. */\n onChange: (value: string) => void;\n /** Placeholder for the input (falls back to i18n default). */\n placeholder?: string;\n /** Accessible names for the clear / toggle affordances. The library ships no\n * copy of its own; the English defaults only keep it usable untranslated. */\n labels?: { clear?: string; toggle?: string };\n className?: string;\n /** Disable interaction and dim the control. */\n disabled?: boolean;\n /** Show a clear (×) action for the current value. @defaultValue true */\n clearable?: boolean;\n /** Allow entering a value not in `options` (creatable). @defaultValue true */\n allowCustom?: boolean;\n /** Label template for the \"create new\" row; `{value}` is replaced with the typed text. */\n creatableText?: string;\n /** When set, the \"create new\" row only appears for inputs passing this test. */\n creatableFilter?: (input: string) => boolean;\n /** Glyph shown on the \"create new\" row (default `+`). */\n creatableIcon?: ReactNode;\n}\n\n/** Searchable, optionally creatable combobox — type to filter, Enter to pick or create.\n * For long lists where users type to narrow; see `Select`'s doc for \"which select do I use\". */\nexport function Combobox({\n options,\n value,\n onChange,\n placeholder,\n labels,\n className = \"\",\n disabled = false,\n clearable = true,\n allowCustom = true,\n creatableText,\n creatableFilter,\n creatableIcon,\n}: ComboboxProps) {\n const { Image, useT } = useYunUI();\n const t = useT(\"common.combobox\");\n const resolvedPlaceholder = placeholder || t(\"placeholder\");\n const resolvedCreatableText = creatableText || t(\"creatableText\", { value: \"\" });\n const [isOpen, setIsOpen] = useState(false);\n const [inputValue, setInputValue] = useState(value || \"\");\n const [highlighted, setHighlighted] = useState(-1);\n const containerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const { shift, maxHeight, placement } = useAnchoredPosition(isOpen, panelRef);\n const listboxId = useId();\n const optionId = (i: number) => `${listboxId}-opt-${i}`;\n const selectedOption = options.find(o => o.value === value);\n const selectedDisplayValue = selectedOption?.label || value || \"\";\n\n // 當 value 從外部變化時更新輸入值\n useEffect(() => {\n setInputValue(selectedDisplayValue);\n }, [selectedDisplayValue]);\n\n // Escape is handled separately below (it also restores focus to the trigger),\n // so this only takes the outside-press half.\n useDismissOnOutside(\n isOpen,\n () => {\n setIsOpen(false);\n setInputValue(selectedDisplayValue);\n },\n containerRef,\n { escape: false },\n );\n\n // Reset the keyboard highlight when the list changes or the panel closes —\n // start at \"no highlight\" (-1) so the ring only appears after an arrow press.\n useEffect(() => {\n setHighlighted(-1);\n }, [inputValue, isOpen]);\n\n // 過濾選項\n const filteredOptions = inputValue\n ? options.filter(o =>\n o.label.toLowerCase().includes(inputValue.toLowerCase()) ||\n o.value.toLowerCase().includes(inputValue.toLowerCase())\n )\n : options;\n\n // 檢查是否可以創建新選項\n const canCreateNew = allowCustom && !!inputValue &&\n !options.some(o =>\n o.value.toLowerCase() === inputValue.toLowerCase() ||\n o.label.toLowerCase() === inputValue.toLowerCase()\n ) &&\n (!creatableFilter || creatableFilter(inputValue));\n\n const handleSelect = (selectedValue: string) => {\n const option = options.find(o => o.value === selectedValue);\n setInputValue(option?.label || selectedValue);\n onChange(selectedValue);\n setIsOpen(false);\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setInputValue(e.target.value);\n setIsOpen(true);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (!isOpen) return setIsOpen(true);\n setHighlighted((h) => Math.min(h + 1, filteredOptions.length - 1));\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (!isOpen) return setIsOpen(true);\n setHighlighted((h) => Math.max(h - 1, 0));\n break;\n case \"Home\":\n if (isOpen) { e.preventDefault(); setHighlighted(0); }\n break;\n case \"End\":\n if (isOpen) { e.preventDefault(); setHighlighted(filteredOptions.length - 1); }\n break;\n case \"Enter\":\n e.preventDefault();\n if (isOpen && highlighted >= 0 && filteredOptions[highlighted]) {\n handleSelect(filteredOptions[highlighted].value);\n } else if (canCreateNew) {\n handleSelect(inputValue);\n } else if (filteredOptions.length > 0) {\n handleSelect(filteredOptions[0].value);\n }\n break;\n case \"Escape\":\n setIsOpen(false);\n setInputValue(selectedDisplayValue);\n break;\n }\n };\n\n const clearValue = () => {\n onChange(\"\");\n setInputValue(\"\");\n inputRef.current?.focus();\n };\n\n // Only show the committed selection's icon while its label is displayed.\n // Keeping that icon during free-text filtering falsely associates the typed\n // query (and its matching options) with the previously selected item.\n const selectedIconPath = inputValue === selectedDisplayValue\n ? selectedOption?.iconUrl ?? null\n : null;\n\n return (\n <div ref={containerRef} className={`relative ${className}`}>\n <div className=\"relative\">\n {/* Icon display when selected */}\n {selectedIconPath && selectedOption && (\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none\">\n <div className=\"rounded-md overflow-hidden bg-linear-to-br from-black/2 to-black/5\" style={{ width: 16, height: 16 }}>\n <Image\n src={selectedIconPath}\n alt=\"\"\n aria-hidden=\"true\"\n width={16}\n height={16}\n className=\"object-cover\"\n unoptimized\n />\n </div>\n </div>\n )}\n <input\n ref={inputRef}\n type=\"text\"\n value={inputValue}\n onChange={handleInputChange}\n onFocus={() => !disabled && setIsOpen(true)}\n onKeyDown={handleKeyDown}\n placeholder={resolvedPlaceholder}\n aria-label={resolvedPlaceholder}\n role=\"combobox\"\n aria-expanded={isOpen}\n aria-controls={listboxId}\n aria-autocomplete=\"list\"\n aria-activedescendant={isOpen && highlighted >= 0 ? optionId(highlighted) : undefined}\n disabled={disabled}\n className={`\n w-full py-2\n rounded-xl border border-(--border-default) bg-(--bg-elevated)\n hover:border-(--border-strong) hover:bg-(--bg-hover)\n focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary\n truncate transition-all duration-200\n text-base md:text-sm\n ${disabled ? \"opacity-50 cursor-not-allowed\" : \"cursor-pointer\"}\n ${selectedIconPath ? \"pl-10 pr-20\" : \"px-3 pr-20\"}\n `}\n />\n {/* Clear button */}\n {clearable && inputValue && !disabled && (\n <button\n type=\"button\"\n onClick={clearValue}\n aria-label={labels?.clear ?? \"Clear\"}\n className=\"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1 outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <X size={14} />\n </button>\n )}\n {/* Dropdown arrow */}\n <button\n type=\"button\"\n onClick={() => {\n if (disabled) return;\n if (isOpen) setInputValue(selectedDisplayValue);\n setIsOpen(!isOpen);\n }}\n disabled={disabled}\n aria-label={labels?.toggle ?? \"Toggle options\"}\n className=\"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1 disabled:opacity-50 outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <ChevronDown size={14} className={isOpen ? \"rotate-180 transition-transform\" : \"\"} />\n </button>\n </div>\n\n {/* Dropdown */}\n {isOpen && !disabled && (\n <div\n ref={panelRef}\n style={{ marginLeft: shift, maxHeight }}\n className={`absolute z-50 w-full ${placement === \"top\" ? \"bottom-full mb-2 origin-bottom\" : \"top-full mt-2 origin-top\"} p-1 rounded-2xl border border-border bg-popover text-popover-foreground shadow-lg shadow-black/5 overflow-hidden flex flex-col animate-in fade-in-0 zoom-in-95 duration-200`}\n >\n <div className=\"flex-1 min-h-0 max-h-60 overflow-y-auto\" role=\"listbox\" id={listboxId}>\n {filteredOptions.length === 0 && !canCreateNew ? (\n <div className=\"px-3 py-2 text-sm text-muted-foreground\">\n {t(\"noResults\")}\n </div>\n ) : (\n <>\n {filteredOptions.map((option, i) => {\n const isSelected = option.value === value;\n const isHigh = i === highlighted;\n const optionIconPath = option.iconUrl ?? null;\n return (\n <button\n key={option.value}\n id={optionId(i)}\n type=\"button\"\n role=\"option\"\n aria-selected={isSelected}\n data-highlighted={isHigh ? \"\" : undefined}\n onClick={() => handleSelect(option.value)}\n onMouseEnter={() => setHighlighted(i)}\n className={`dropdown-item w-full text-left outline-none focus-visible:ring-2 focus-visible:ring-ring ${isSelected ? \"active\" : \"\"}`}\n >\n {optionIconPath && (\n <div className=\"rounded-md overflow-hidden bg-linear-to-br from-black/2 to-black/5 shrink-0\" style={{ width: 16, height: 16 }}>\n <Image\n src={optionIconPath}\n alt=\"\"\n aria-hidden=\"true\"\n width={16}\n height={16}\n className=\"object-cover\"\n unoptimized\n />\n </div>\n )}\n <span className=\"flex-1 truncate\">{option.label}</span>\n </button>\n );\n })}\n {canCreateNew && (\n <button\n type=\"button\"\n onClick={() => handleSelect(inputValue)}\n className=\"dropdown-item w-full text-left text-primary outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <span className=\"text-lg leading-none\">{creatableIcon ?? \"+\"}</span>\n <span className=\"flex-1 truncate\">{resolvedCreatableText.replace('{value}', inputValue)}</span>\n </button>\n )}\n </>\n )}\n </div>\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\n\n/**\n * Radix Accordion root — a vertically stacked set of collapsible sections.\n *\n * Set `type=\"single\"` for one-at-a-time panels (optionally `collapsible` so the\n * open one can be closed) or `type=\"multiple\"` to allow several open at once.\n * Full keyboard a11y (arrow keys, Home/End, Enter/Space) comes from Radix.\n */\nexport const Accordion = AccordionPrimitive.Root;\n\n/** A single collapsible section. Give each a unique `value`. */\nexport const AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\n \"rounded-xl border border-(--border-default) bg-(--bg-elevated) overflow-hidden\",\n \"data-[state=open]:border-(--border-strong) transition-colors\",\n className\n )}\n {...props}\n />\n));\nAccordionItem.displayName = AccordionPrimitive.Item.displayName;\n\n/** Clickable header that toggles its section; shows a chevron that rotates when open. */\nexport const AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between gap-2 px-4 py-3 text-sm font-medium text-left\",\n \"transition-colors hover:bg-(--bg-hover)\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n \"[&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\n/**\n * Collapsible panel body. Animates its height open/closed by transitioning the\n * `grid-template-rows` `0fr` → `1fr` track, driven by Radix's\n * `data-state` attribute. Self-contained (no external keyframes required).\n */\nexport const AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className={cn(\n \"grid text-sm text-muted-foreground\",\n \"transition-[grid-template-rows] duration-200 ease-out\",\n \"data-[state=closed]:grid-rows-[0fr] data-[state=open]:grid-rows-[1fr]\",\n className\n )}\n {...props}\n >\n <div className=\"overflow-hidden\">\n <div className=\"px-4 pb-3 pt-0\">{children}</div>\n </div>\n </AccordionPrimitive.Content>\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { cn } from \"../lib/cn\";\n\n/**\n * Radix RadioGroup root — a single-choice set of {@link RadioGroupItem}s.\n *\n * Controlled via `value`/`onValueChange` (or uncontrolled via `defaultValue`).\n * Arrow keys move and select within the group; the whole group is one tab stop.\n */\nexport const RadioGroup = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root\n ref={ref}\n className={cn(\"grid gap-2\", className)}\n {...props}\n />\n));\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\n/**\n * A single radio option. Pair with a `<label htmlFor>` via `id`.\n * Renders a ring outline that fills with the primary accent and a center dot\n * when selected — matching YunUI's Checkbox/Switch visual language.\n */\nexport const RadioGroupItem = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"h-4 w-4 shrink-0 rounded-full border-2 flex items-center justify-center\",\n \"border-(--border-strong) bg-transparent\",\n \"transition-all duration-200 ease-in-out\",\n \"hover:border-primary/50\",\n \"data-[state=checked]:border-primary\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/20\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <span className=\"h-2 w-2 rounded-full bg-primary\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n","// =====================================================\n// LAYOUT PRIMITIVES\n// Token-aware, presentational Flex / Grid / Column / Row / Stack.\n// Numeric/scale props are mapped to LITERAL Tailwind classes via static\n// lookup maps so Tailwind's compiler can see and generate them — never\n// build class names dynamically (e.g. `gap-${n}`), those won't be emitted.\n// =====================================================\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/cn\";\n\n// =====================================================\n// SCALE MAPS\n// =====================================================\n\n/**\n * Supported spacing-scale values (Tailwind's default scale: 1 unit = 0.25rem).\n * A fixed set so the literal classes below are always present for the compiler.\n */\nexport type SpacingScale = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12;\n\nconst gapMap: Record<SpacingScale, string> = {\n 0: \"gap-0\",\n 1: \"gap-1\",\n 2: \"gap-2\",\n 3: \"gap-3\",\n 4: \"gap-4\",\n 5: \"gap-5\",\n 6: \"gap-6\",\n 8: \"gap-8\",\n 10: \"gap-10\",\n 12: \"gap-12\",\n};\n\nconst paddingMap: Record<SpacingScale, string> = {\n 0: \"p-0\",\n 1: \"p-1\",\n 2: \"p-2\",\n 3: \"p-3\",\n 4: \"p-4\",\n 5: \"p-5\",\n 6: \"p-6\",\n 8: \"p-8\",\n 10: \"p-10\",\n 12: \"p-12\",\n};\n\nconst pxMap: Record<SpacingScale, string> = {\n 0: \"px-0\",\n 1: \"px-1\",\n 2: \"px-2\",\n 3: \"px-3\",\n 4: \"px-4\",\n 5: \"px-5\",\n 6: \"px-6\",\n 8: \"px-8\",\n 10: \"px-10\",\n 12: \"px-12\",\n};\n\nconst pyMap: Record<SpacingScale, string> = {\n 0: \"py-0\",\n 1: \"py-1\",\n 2: \"py-2\",\n 3: \"py-3\",\n 4: \"py-4\",\n 5: \"py-5\",\n 6: \"py-6\",\n 8: \"py-8\",\n 10: \"py-10\",\n 12: \"py-12\",\n};\n\n// =====================================================\n// FLEX MAPS\n// =====================================================\n\nconst directionMap = {\n row: \"flex-row\",\n col: \"flex-col\",\n \"row-reverse\": \"flex-row-reverse\",\n \"col-reverse\": \"flex-col-reverse\",\n} as const;\n\ntype FlexDirection = keyof typeof directionMap;\n\nconst alignMap = {\n start: \"items-start\",\n center: \"items-center\",\n end: \"items-end\",\n stretch: \"items-stretch\",\n baseline: \"items-baseline\",\n} as const;\n\ntype Align = keyof typeof alignMap;\n\nconst justifyMap = {\n start: \"justify-start\",\n center: \"justify-center\",\n end: \"justify-end\",\n between: \"justify-between\",\n around: \"justify-around\",\n evenly: \"justify-evenly\",\n} as const;\n\ntype Justify = keyof typeof justifyMap;\n\n// =====================================================\n// GRID MAPS\n// =====================================================\n\n/** Supported fixed column/row counts (1–12), mapped to literal grid classes. */\nexport type GridCount = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\nconst colsMap: Record<GridCount, string> = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-2\",\n 3: \"grid-cols-3\",\n 4: \"grid-cols-4\",\n 5: \"grid-cols-5\",\n 6: \"grid-cols-6\",\n 7: \"grid-cols-7\",\n 8: \"grid-cols-8\",\n 9: \"grid-cols-9\",\n 10: \"grid-cols-10\",\n 11: \"grid-cols-11\",\n 12: \"grid-cols-12\",\n};\n\n// Mobile-first column ramps: an N-column grid is cramped on a phone, so by\n// default `<Grid columns={N}>` starts with fewer columns and scales up at the\n// `sm`/`lg` breakpoints. Pass `responsive={false}` for the literal `grid-cols-N`.\n// (All classes are written out so Tailwind generates them.)\nconst responsiveColsMap: Record<GridCount, string> = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-2\",\n 3: \"grid-cols-1 sm:grid-cols-3\",\n 4: \"grid-cols-2 sm:grid-cols-4\",\n 5: \"grid-cols-2 sm:grid-cols-3 lg:grid-cols-5\",\n 6: \"grid-cols-2 sm:grid-cols-3 lg:grid-cols-6\",\n 7: \"grid-cols-3 sm:grid-cols-4 lg:grid-cols-7\",\n 8: \"grid-cols-3 sm:grid-cols-4 lg:grid-cols-8\",\n 9: \"grid-cols-3 sm:grid-cols-4 lg:grid-cols-9\",\n 10: \"grid-cols-3 sm:grid-cols-5 lg:grid-cols-10\",\n 11: \"grid-cols-3 sm:grid-cols-5 lg:grid-cols-11\",\n 12: \"grid-cols-3 sm:grid-cols-6 lg:grid-cols-12\",\n};\n\nconst rowsMap: Record<GridCount, string> = {\n 1: \"grid-rows-1\",\n 2: \"grid-rows-2\",\n 3: \"grid-rows-3\",\n 4: \"grid-rows-4\",\n 5: \"grid-rows-5\",\n 6: \"grid-rows-6\",\n 7: \"grid-rows-7\",\n 8: \"grid-rows-8\",\n 9: \"grid-rows-9\",\n 10: \"grid-rows-10\",\n 11: \"grid-rows-11\",\n 12: \"grid-rows-12\",\n};\n\n// =====================================================\n// FLEX\n// =====================================================\n\nexport interface FlexProps extends React.HTMLAttributes<HTMLElement> {\n /** Main axis direction. @defaultValue \"row\" */\n direction?: FlexDirection;\n /** Cross-axis alignment (`align-items`). */\n align?: Align;\n /** Main-axis distribution (`justify-content`). */\n justify?: Justify;\n /** Gap between children, on the spacing scale. */\n gap?: SpacingScale;\n /** Allow children to wrap onto multiple lines. */\n wrap?: boolean;\n /** Padding on all sides, on the spacing scale. */\n padding?: SpacingScale;\n /** Horizontal padding (`px`), on the spacing scale. */\n px?: SpacingScale;\n /** Vertical padding (`py`), on the spacing scale. */\n py?: SpacingScale;\n /** Element/tag to render as. @defaultValue \"div\" */\n as?: React.ElementType;\n}\n\n/**\n * Flexbox layout primitive. Maps `direction`/`align`/`justify`/`gap`/`wrap`/\n * padding props to literal Tailwind classes via static maps. Purely\n * presentational — extra props are spread onto the rendered element.\n */\nexport const Flex = React.forwardRef<HTMLElement, FlexProps>(\n (\n {\n as,\n direction = \"row\",\n align,\n justify,\n gap,\n wrap,\n padding,\n px,\n py,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const Comp = (as ?? \"div\") as React.ElementType;\n return (\n <Comp\n ref={ref}\n className={cn(\n \"flex\",\n directionMap[direction],\n align && alignMap[align],\n justify && justifyMap[justify],\n gap !== undefined && gapMap[gap],\n wrap && \"flex-wrap\",\n padding !== undefined && paddingMap[padding],\n px !== undefined && pxMap[px],\n py !== undefined && pyMap[py],\n className\n )}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n);\nFlex.displayName = \"Flex\";\n\n// =====================================================\n// GRID\n// =====================================================\n\nexport interface GridProps extends React.HTMLAttributes<HTMLElement> {\n /** Number of equal columns (1–12). */\n columns?: GridCount;\n /** Number of explicit rows (1–12). */\n rows?: GridCount;\n /** Gap between cells, on the spacing scale. */\n gap?: SpacingScale;\n /** Cross-axis alignment of items within their cells (`align-items`). */\n align?: Align;\n /** Padding on all sides, on the spacing scale. */\n padding?: SpacingScale;\n /** Stack into fewer columns on small screens (mobile-first ramp) instead of\n * a literal `grid-cols-N` at every width. @defaultValue true */\n responsive?: boolean;\n /** Element/tag to render as. @defaultValue \"div\" */\n as?: React.ElementType;\n}\n\n/**\n * CSS-grid layout primitive. Maps `columns`/`rows`/`gap`/`align`/`padding`\n * to literal Tailwind classes via static maps. Purely presentational.\n */\nexport const Grid = React.forwardRef<HTMLElement, GridProps>(\n (\n { as, columns, rows, gap, align, padding, responsive = true, className, children, ...props },\n ref\n ) => {\n const Comp = (as ?? \"div\") as React.ElementType;\n return (\n <Comp\n ref={ref}\n className={cn(\n \"grid\",\n columns !== undefined && (responsive ? responsiveColsMap[columns] : colsMap[columns]),\n rows !== undefined && rowsMap[rows],\n gap !== undefined && gapMap[gap],\n align && alignMap[align],\n padding !== undefined && paddingMap[padding],\n className\n )}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n);\nGrid.displayName = \"Grid\";\n\n// =====================================================\n// COLUMN / ROW / STACK\n// =====================================================\n\n/** Thin wrapper around {@link Flex} fixed to `direction=\"col\"`. */\nexport const Column = React.forwardRef<HTMLElement, Omit<FlexProps, \"direction\">>(\n (props, ref) => <Flex ref={ref} direction=\"col\" {...props} />\n);\nColumn.displayName = \"Column\";\n\n/** Thin wrapper around {@link Flex} fixed to `direction=\"row\"`. */\nexport const Row = React.forwardRef<HTMLElement, Omit<FlexProps, \"direction\">>(\n (props, ref) => <Flex ref={ref} direction=\"row\" {...props} />\n);\nRow.displayName = \"Row\";\n\n/**\n * Vertical {@link Flex} (`direction=\"col\"`) with a sensible default `gap`.\n * Alias of {@link Column} optimised for stacking content; override `gap` freely.\n */\nexport const Stack = React.forwardRef<HTMLElement, Omit<FlexProps, \"direction\">>(\n ({ gap = 4, ...props }, ref) => (\n <Flex ref={ref} direction=\"col\" gap={gap} {...props} />\n )\n);\nStack.displayName = \"Stack\";\n","\"use client\";\n\n// =====================================================\n// TABLE\n// Semantic, presentational table family using design-system tokens.\n// =====================================================\n\nimport * as React from \"react\";\nimport { ChevronDown, ChevronUp, ChevronsUpDown } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { useScrollableTabStop } from \"../lib/hooks\";\n\n/**\n * Table root — wraps a `<table>` in an overflow container so wide tables scroll\n * horizontally instead of breaking the layout. `className` is applied to the\n * inner `<table>`; pass `containerClassName` to style the scroll wrapper.\n */\nexport const Table = React.forwardRef<\n HTMLTableElement,\n React.TableHTMLAttributes<HTMLTableElement> & {\n /** Class applied to the outer scroll/overflow wrapper. */\n containerClassName?: string;\n /**\n * Accessible name for the scroll region, used only when the table is\n * actually overflowing and therefore focusable (e.g. \"Transactions,\n * scrollable\"). The library ships no copy, so without it the region is\n * focusable but unnamed.\n */\n scrollLabel?: string;\n /**\n * Stack each row into a labelled card below the `md` breakpoint, so dense\n * many-column tables stay readable on narrow screens instead of forcing a\n * horizontal scroll. Pair with `<TableCell label=\"…\">` to label each value.\n */\n responsive?: boolean;\n }\n>(({ className, containerClassName, responsive, scrollLabel, ...props }, ref) => {\n const scrollRef = React.useRef<HTMLDivElement>(null);\n // Focusable ONLY while the table really overflows: Safari and Firefox do\n // not focus scroll containers on their own, so without this the columns\n // past the right edge are unreachable by keyboard — and a permanent\n // tabIndex would put a dead stop on every table that fits.\n const tabIndex = useScrollableTabStop(scrollRef);\n return (\n <div\n ref={scrollRef}\n tabIndex={tabIndex}\n role={tabIndex === 0 && scrollLabel ? \"region\" : undefined}\n aria-label={tabIndex === 0 ? scrollLabel : undefined}\n className={cn(\"relative w-full overflow-x-auto outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-lg\", containerClassName)}\n >\n <table\n ref={ref}\n className={cn(\n \"w-full caption-bottom border-collapse text-sm\",\n responsive && \"yunui-table-responsive\",\n className\n )}\n {...props}\n />\n </div>\n );\n});\nTable.displayName = \"Table\";\n\n/** Table header group (`<thead>`); contains the column-header row(s). */\nexport const TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead\n ref={ref}\n className={cn(\"[&_tr]:border-b [&_tr]:border-(--border-default)\", className)}\n {...props}\n />\n));\nTableHeader.displayName = \"TableHeader\";\n\n/** Table body group (`<tbody>`); rows are divided by subtle borders. */\nexport const TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n));\nTableBody.displayName = \"TableBody\";\n\n/** Table footer group (`<tfoot>`); a muted summary row band. */\nexport const TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n \"border-t border-(--border-default) bg-muted/30 font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n));\nTableFooter.displayName = \"TableFooter\";\n\n/** Table row (`<tr>`) with a divider and hover highlight. */\nexport const TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n \"border-b border-(--border-default) transition-colors hover:bg-(--bg-hover) data-[state=selected]:bg-muted\",\n className\n )}\n {...props}\n />\n));\nTableRow.displayName = \"TableRow\";\n\n/**\n * Column header cell (`<th>`): uppercase, muted, small.\n *\n * Pass `onSort` to make it a sort control — the content renders as a button with an\n * asc/desc/unsorted chevron and the `<th>` gets `aria-sort`; `sortDirection` is the column's\n * current state (`\"asc\"`/`\"desc\"`, or `false`/omitted when it isn't the active sort column).\n * `align` also aligns the sort control (use `\"right\"` for numeric columns).\n */\nexport const TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement> & {\n onSort?: () => void;\n sortDirection?: \"asc\" | \"desc\" | false;\n align?: \"left\" | \"right\" | \"center\";\n }\n>(({ className, onSort, sortDirection, align = \"left\", children, ...props }, ref) => {\n const alignClass =\n align === \"right\" ? \"text-right\" : align === \"center\" ? \"text-center\" : \"text-left\";\n const head = cn(\n // whitespace-nowrap: header labels are short and must never wrap — CJK labels in\n // particular would otherwise break mid-word (能力 → 能/力) in narrow columns / WebKit.\n \"h-10 whitespace-nowrap px-4 align-middle text-[11px] font-medium uppercase tracking-wider text-muted-foreground [&:has([role=checkbox])]:pr-0\",\n alignClass,\n className\n );\n\n if (!onSort) {\n return (\n <th ref={ref} className={head} {...props}>\n {children}\n </th>\n );\n }\n\n const Icon =\n sortDirection === \"asc\" ? ChevronUp : sortDirection === \"desc\" ? ChevronDown : ChevronsUpDown;\n const justify =\n align === \"right\" ? \"justify-end\" : align === \"center\" ? \"justify-center\" : \"justify-start\";\n return (\n <th\n ref={ref}\n aria-sort={sortDirection === \"asc\" ? \"ascending\" : sortDirection === \"desc\" ? \"descending\" : \"none\"}\n className={head}\n {...props}\n >\n <button\n type=\"button\"\n onClick={onSort}\n className={cn(\n \"inline-flex w-full items-center gap-1 uppercase tracking-wider transition-colors hover:text-foreground\",\n justify\n )}\n >\n {children}\n <Icon\n size={12}\n aria-hidden\n className={cn(\"shrink-0\", sortDirection ? \"text-primary\" : \"opacity-40\")}\n />\n </button>\n </th>\n );\n});\nTableHead.displayName = \"TableHead\";\n\n/** Standard data cell (`<td>`). */\nexport const TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement> & {\n /** Column label shown beside the value when the parent `<Table responsive>`\n * stacks rows into cards on narrow screens. */\n label?: string;\n }\n>(({ className, label, ...props }, ref) => (\n <td\n ref={ref}\n data-label={label}\n className={cn(\"px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0\", className)}\n {...props}\n />\n));\nTableCell.displayName = \"TableCell\";\n\n/** Caption (`<caption>`) rendered below the table; muted helper text. */\nexport const TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn(\"mt-4 text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nTableCaption.displayName = \"TableCaption\";\n\n// ---- short aliases --------------------------------------------------------\n\nexport {\n TableHeader as Thead,\n TableBody as Tbody,\n TableFooter as Tfoot,\n TableRow as Tr,\n TableHead as Th,\n TableCell as Td,\n};\n","// =====================================================\n// BREADCRUMB\n// Accessible breadcrumb trail. Links route through the YunUI adapter.\n// =====================================================\n\n\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronRight } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { useYunUI } from \"../adapters/context\";\n\n/** Breadcrumb root: a `<nav>` landmark labelling the trail for screen readers. */\nexport const Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n /** Accessible name for the navigation landmark. @defaultValue \"Breadcrumb\" */\n \"aria-label\"?: string;\n }\n>(({ \"aria-label\": ariaLabel = \"Breadcrumb\", ...props }, ref) => (\n <nav ref={ref} aria-label={ariaLabel} {...props} />\n));\nBreadcrumb.displayName = \"Breadcrumb\";\n\n/** Ordered list (`<ol>`) holding the breadcrumb items. */\nexport const BreadcrumbList = React.forwardRef<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n));\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\n/** A single breadcrumb item (`<li>`); wrap a link, page, or separator. */\nexport const BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n));\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\n/**\n * A navigable breadcrumb link. Routes through the host app's `Link` adapter\n * (`useYunUI().Link`) so it integrates with the consumer's router; falls back\n * to a plain `<a>` when no provider is present.\n */\nexport function BreadcrumbLink({\n className,\n href,\n ...props\n}: {\n /** Destination URL. */\n href: string;\n children?: React.ReactNode;\n className?: string;\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\">) {\n const { Link } = useYunUI();\n return (\n <Link\n href={href}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n}\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\n/**\n * The current page in the trail. Non-interactive and marked\n * `aria-current=\"page\"` for assistive tech.\n */\nexport const BreadcrumbPage = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n aria-current=\"page\"\n className={cn(\"font-medium text-foreground\", className)}\n {...props}\n />\n));\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\n/**\n * Visual separator between items (a chevron by default). Hidden from the\n * accessibility tree since it carries no information for screen readers.\n */\nexport const BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentPropsWithoutRef<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5 text-muted-foreground/60\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\n/**\n * Ellipsis placeholder for collapsed middle items in a long trail.\n */\nexport const BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentPropsWithoutRef<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <span className=\"text-base leading-none\">…</span>\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbEllipsis\";\n","// =====================================================\n// PAGINATION\n// Controlled page navigator with ellipsis truncation.\n// Presentational: the host owns page state + routing.\n// =====================================================\n\n\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\n\n/** Sentinel inserted into the visible-page list to render an ellipsis gap. */\ntype PageToken = number | \"ellipsis\";\n\ninterface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, \"onChange\"> {\n /** The active page (1-based). */\n page: number;\n /** Total number of pages. */\n totalPages: number;\n /** Called with the requested page when a control is activated. */\n onPageChange: (page: number) => void;\n /**\n * How many page buttons to show on each side of the current page before\n * collapsing into an ellipsis.\n * @defaultValue 1\n */\n siblingCount?: number;\n /** Accessible name for the wrapping nav landmark. @defaultValue \"Pagination\" */\n ariaLabel?: string;\n /** @deprecated Use labels.previous. Retained for 0.2.17 compatibility. */\n previousLabel?: string;\n /** @deprecated Use labels.next. Retained for 0.2.17 compatibility. */\n nextLabel?: string;\n /** Every string the control announces. Matches `BlogPagination.labels`. */\n labels?: {\n /** Previous-page button. @defaultValue \"Go to previous page\" */\n previous?: string;\n /** Next-page button. @defaultValue \"Go to next page\" */\n next?: string;\n /**\n * Names a numbered page button. The number alone is not a usable name\n * — this used to be a hardcoded `Go to page N`, in English, with no way\n * for the host to translate it.\n * @defaultValue (n) => `Go to page ${n}`\n */\n page?: (page: number) => string;\n };\n}\n\n/**\n * Build the truncated list of page tokens to render. Always keeps the first and\n * last page visible, shows `siblingCount` neighbours around the current page,\n * and fills the gaps with `\"ellipsis\"`.\n */\nfunction getPageRange(page: number, totalPages: number, siblingCount: number): PageToken[] {\n // Pages we always want rendered as real buttons.\n const totalNumbers = siblingCount * 2 + 5; // first, last, current, 2 ellipses budget\n\n if (totalPages <= totalNumbers) {\n return Array.from({ length: totalPages }, (_, i) => i + 1);\n }\n\n const leftSibling = Math.max(page - siblingCount, 1);\n const rightSibling = Math.min(page + siblingCount, totalPages);\n\n const showLeftEllipsis = leftSibling > 2;\n const showRightEllipsis = rightSibling < totalPages - 1;\n\n const tokens: PageToken[] = [1];\n\n if (showLeftEllipsis) {\n tokens.push(\"ellipsis\");\n } else {\n // Fill the small gap between page 1 and the left sibling with numbers.\n for (let i = 2; i < leftSibling; i++) tokens.push(i);\n }\n\n for (let i = leftSibling; i <= rightSibling; i++) {\n if (i !== 1 && i !== totalPages) tokens.push(i);\n }\n\n if (showRightEllipsis) {\n tokens.push(\"ellipsis\");\n } else {\n for (let i = rightSibling + 1; i < totalPages; i++) tokens.push(i);\n }\n\n if (totalPages > 1) tokens.push(totalPages);\n\n return tokens;\n}\n\nconst navButton =\n \"inline-flex h-9 min-w-9 items-center justify-center gap-1 rounded-xl border border-(--border-default) bg-(--bg-elevated) px-2 text-sm transition-all duration-200 hover:border-(--border-strong) hover:bg-(--bg-hover) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/20 disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Controlled pagination control. Renders previous/next arrows plus numbered\n * page buttons with ellipsis truncation. The current page is highlighted with\n * the primary accent and exposes `aria-current=\"page\"`; prev/next are disabled\n * at the bounds.\n */\nexport const Pagination = React.forwardRef<HTMLElement, PaginationProps>(\n (\n {\n page,\n totalPages,\n onPageChange,\n siblingCount = 1,\n ariaLabel = \"Pagination\",\n labels,\n previousLabel,\n nextLabel,\n className,\n ...props\n },\n ref\n ) => {\n if (totalPages <= 1) return null;\n\n const tokens = getPageRange(page, totalPages, siblingCount);\n const isFirst = page <= 1;\n const isLast = page >= totalPages;\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={cn(\"flex items-center justify-center gap-1.5\", className)}\n {...props}\n >\n <button\n type=\"button\"\n aria-label={labels?.previous ?? previousLabel ?? \"Go to previous page\"}\n disabled={isFirst}\n onClick={() => !isFirst && onPageChange(page - 1)}\n className={navButton}\n >\n <ChevronLeft size={16} />\n </button>\n\n {tokens.map((token, i) =>\n token === \"ellipsis\" ? (\n <span\n key={`ellipsis-${i}`}\n aria-hidden=\"true\"\n className=\"flex h-9 min-w-9 items-center justify-center text-muted-foreground\"\n >\n …\n </span>\n ) : (\n <button\n key={token}\n type=\"button\"\n aria-label={labels?.page ? labels.page(token) : `Go to page ${token}`}\n aria-current={token === page ? \"page\" : undefined}\n onClick={() => onPageChange(token)}\n className={cn(\n navButton,\n token === page &&\n \"border-primary bg-primary text-primary-foreground hover:border-primary hover:bg-primary\"\n )}\n >\n {token}\n </button>\n )\n )}\n\n <button\n type=\"button\"\n aria-label={labels?.next ?? nextLabel ?? \"Go to next page\"}\n disabled={isLast}\n onClick={() => !isLast && onPageChange(page + 1)}\n className={navButton}\n >\n <ChevronRight size={16} />\n </button>\n </nav>\n );\n }\n);\nPagination.displayName = \"Pagination\";\n\nexport type { PaginationProps };\n","// =====================================================\n// SHARED UI COMPONENTS\n// Built with Radix UI, Lucide Icons, Framer Motion\n// =====================================================\n\n\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport { motion } from \"framer-motion\";\nimport {\n Check,\n ChevronDown,\n ChevronUp,\n ChevronRight,\n X,\n Loader2,\n AlertCircle,\n CheckCircle2,\n Eye,\n EyeOff,\n Minus,\n Plus,\n Search,\n Info,\n AlertTriangle,\n} from \"lucide-react\";\n\n// Re-export Modal component\nexport { Modal } from \"./modal\";\nexport { Sheet } from \"./sheet\";\nexport { Checkbox } from \"./checkbox\";\nexport type { CheckboxProps } from \"./checkbox\";\n\n// Re-export ConfirmModal components\nexport {\n ConfirmModal,\n DeleteConfirmModal,\n RegenerateConfirmModal,\n type ConfirmModalVariant,\n} from \"./confirm-modal\";\n\n// =====================================================\n// UTILITY\n// =====================================================\n\nimport { cn } from \"../lib/cn\";\nexport { cn };\n\n// =====================================================\n// BUTTON\n// =====================================================\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Visual style. Options: `primary`, `secondary`, `ghost`, `accent`, `outline`, `amber`, `red`/`destructive`.\n * @defaultValue \"default\"\n */\n variant?:\n | /** @deprecated alias of `primary` */ \"default\"\n | \"primary\"\n | \"secondary\"\n | \"ghost\"\n | \"accent\"\n | /** Solid fill from the runtime-themeable brand token (data-brand). */ \"brand\"\n | \"outline\"\n | \"amber\"\n | /** @deprecated alias of `destructive` */ \"red\"\n | \"destructive\";\n /** Size: `sm`, `md` (default), `lg`, or `icon` (square 40×40). */\n size?: \"sm\" | \"md\" | \"lg\" | \"icon\";\n /** Show a spinner before the children and disable the button while busy. */\n loading?: boolean;\n /** Render the single child element with the button styling instead of a <button> (e.g. wrap a <Link>). */\n asChild?: boolean;\n}\n\n/** Primary action button with style variants, sizes, a loading spinner, and `asChild` slotting. */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant = \"default\", size = \"md\", loading, disabled, asChild, children, ...props }, ref) => {\n // Map variant names to CSS classes\n const variantMap: Record<string, string> = {\n default: \"btn-primary\",\n primary: \"btn-primary\",\n secondary: \"btn-secondary\",\n ghost: \"btn-ghost\",\n accent: \"btn-accent\",\n brand: \"btn-brand\",\n outline: \"btn-outline\",\n amber: \"btn-amber\",\n red: \"btn-red\",\n destructive: \"btn-red\",\n };\n\n const variantClass = variantMap[variant] || variantMap.default;\n\n const sizes = {\n sm: \"btn-sm\",\n md: \"\",\n lg: \"btn-lg\",\n icon: \"w-10 h-10 p-0\",\n };\n\n const classes = cn(\"btn\", variantClass, sizes[size], className);\n\n // asChild: merge styling onto the provided child (e.g. a routing <Link>)\n // instead of rendering our own <button>.\n if (asChild && React.isValidElement<{ className?: string }>(children)) {\n return React.cloneElement(children, {\n className: cn(classes, children.props.className),\n });\n }\n\n return (\n <button\n ref={ref}\n disabled={disabled || loading}\n className={classes}\n {...props}\n >\n {loading && <Loader2 className=\"w-4 h-4 mr-2 animate-spin\" />}\n {children}\n </button>\n );\n }\n);\nButton.displayName = \"Button\";\n\n// =====================================================\n// INPUT\n// =====================================================\n\ninterface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n /** Leading icon rendered inside the field on the left. */\n icon?: React.ReactNode;\n /** Error message shown below the field; also switches the border to a red error style. */\n error?: string;\n}\n\n/** Single-line text input with an optional leading icon and inline error message. */\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, icon, error, id, \"aria-describedby\": describedBy, ...props }, ref) => {\n const reactId = React.useId();\n const fieldId = id ?? reactId;\n const errorId = error ? `${fieldId}-error` : undefined;\n // Associate the inline error with the field so screen readers announce it.\n const describedByIds = [describedBy, errorId].filter(Boolean).join(\" \") || undefined;\n return (\n <div>\n {/* Keep positioned adornments relative to the field itself. The\n error row changes the outer wrapper's height and must never\n move an icon away from the input's vertical centre. */}\n <div className=\"relative\">\n {icon && (\n <div aria-hidden=\"true\" className=\"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\">\n {icon}\n </div>\n )}\n <input\n ref={ref}\n id={fieldId}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedByIds}\n className={cn(\n \"w-full h-10 px-4 bg-background border border-border rounded-xl text-base md:text-sm outline-none transition-colors\",\n \"placeholder:text-muted-foreground\",\n \"focus:border-ring focus:ring-2 focus:ring-ring/20\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n icon && \"pl-10\",\n error ? \"border-(--error) focus:border-(--error)\" : \"border-border\",\n className\n )}\n {...props}\n />\n </div>\n {error && (\n <p id={errorId} className=\"mt-1.5 text-xs text-error flex items-center gap-1\">\n <AlertCircle aria-hidden=\"true\" className=\"w-3 h-3\" />\n {error}\n </p>\n )}\n </div>\n );\n }\n);\nInput.displayName = \"Input\";\n\n// =====================================================\n// TEXTAREA\n// =====================================================\n\ninterface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Error message shown below the field; also switches the border to a red error style. */\n error?: string;\n}\n\n/** Multi-line text input with an inline error message. */\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, error, id, \"aria-describedby\": describedBy, ...props }, ref) => {\n const reactId = React.useId();\n const fieldId = id ?? reactId;\n const errorId = error ? `${fieldId}-error` : undefined;\n const describedByIds = [describedBy, errorId].filter(Boolean).join(\" \") || undefined;\n return (\n <div>\n <textarea\n ref={ref}\n id={fieldId}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedByIds}\n className={cn(\n \"w-full px-4 py-3 bg-background border border-border rounded-xl text-base md:text-sm outline-none transition-colors resize-none\",\n \"placeholder:text-muted-foreground\",\n \"focus:border-ring focus:ring-2 focus:ring-ring/20\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n error ? \"border-(--error) focus:border-(--error)\" : \"border-border\",\n className\n )}\n {...props}\n />\n {error && (\n <p id={errorId} className=\"mt-1.5 text-xs text-error flex items-center gap-1\">\n <AlertCircle aria-hidden=\"true\" className=\"w-3 h-3\" />\n {error}\n </p>\n )}\n </div>\n );\n }\n);\nTextarea.displayName = \"Textarea\";\n\n// =====================================================\n// PASSWORD INPUT\n// =====================================================\n\ninterface PasswordInputProps extends Omit<InputProps, \"icon\" | \"type\"> {\n /** Accessible labels for the reveal toggle (English defaults). */\n labels?: { show?: string; hide?: string };\n}\n\n/** Password field with a show/hide reveal toggle; same styling + error API as Input. */\nexport const PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n ({ className, error, id, labels, disabled, \"aria-describedby\": describedBy, ...props }, ref) => {\n const [show, setShow] = React.useState(false);\n const reactId = React.useId();\n const fieldId = id ?? reactId;\n const errorId = error ? `${fieldId}-error` : undefined;\n const describedByIds = [describedBy, errorId].filter(Boolean).join(\" \") || undefined;\n return (\n <div>\n {/* Flex row (not an absolutely-positioned button) so the reveal\n toggle is reliably INSIDE the field across browsers (Safari\n mis-placed the absolute button outside the input). */}\n <div\n className={cn(\n \"flex items-center h-10 rounded-xl border border-border bg-background transition-colors\",\n \"focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20\",\n error ? \"border-(--error) focus:border-(--error)\" : \"border-border\",\n disabled && \"opacity-50\",\n className\n )}\n >\n <input\n ref={ref}\n id={fieldId}\n type={show ? \"text\" : \"password\"}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedByIds}\n disabled={disabled}\n className=\"min-w-0 flex-1 h-full bg-transparent rounded-xl px-4 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed\"\n {...props}\n />\n <button\n type=\"button\"\n onClick={() => setShow((s) => !s)}\n aria-label={show ? labels?.hide ?? \"Hide password\" : labels?.show ?? \"Show password\"}\n aria-pressed={show}\n tabIndex={-1}\n disabled={disabled}\n className=\"shrink-0 px-3 text-muted-foreground hover:text-foreground rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {show ? <EyeOff className=\"w-4 h-4\" /> : <Eye className=\"w-4 h-4\" />}\n </button>\n </div>\n {error && (\n <p id={errorId} className=\"mt-1.5 text-xs text-error flex items-center gap-1\">\n <AlertCircle aria-hidden=\"true\" className=\"w-3 h-3\" />\n {error}\n </p>\n )}\n </div>\n );\n }\n);\nPasswordInput.displayName = \"PasswordInput\";\n\n// =====================================================\n// NUMBER INPUT\n// =====================================================\n\ninterface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"onChange\" | \"value\" | \"type\"> {\n /** Current value (controlled). */\n value?: number;\n /** Called with the next clamped value. */\n onChange?: (value: number) => void;\n min?: number;\n max?: number;\n /** Increment/decrement step. @defaultValue 1 */\n step?: number;\n /** Error message shown below the field; also switches the border to a red error style. */\n error?: string;\n /** Accessible labels for the steppers (English defaults). */\n labels?: { increment?: string; decrement?: string };\n}\n\n/** Numeric field with −/+ steppers, min/max clamping, and the Input error API. */\nexport const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(\n ({ className, value, onChange, min, max, step = 1, error, disabled, labels, id, \"aria-describedby\": describedBy, ...props }, ref) => {\n const reactId = React.useId();\n const fieldId = id ?? reactId;\n const errorId = error ? `${fieldId}-error` : undefined;\n const describedByIds = [describedBy, errorId].filter(Boolean).join(\" \") || undefined;\n const clamp = (n: number) => Math.min(max ?? Infinity, Math.max(min ?? -Infinity, n));\n const base = typeof value === \"number\" && !Number.isNaN(value) ? value : 0;\n const bump = (delta: number) => onChange?.(clamp(base + delta));\n const atMin = min != null && base <= min;\n const atMax = max != null && base >= max;\n const stepBtn =\n \"flex h-10 w-10 shrink-0 items-center justify-center text-muted-foreground hover:text-foreground disabled:opacity-40 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\";\n return (\n <div>\n <div\n className={cn(\n \"relative flex items-stretch rounded-xl border border-border bg-background transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20\",\n error ? \"border-(--error) focus:border-(--error)\" : \"border-border\",\n disabled && \"opacity-50\",\n className\n )}\n >\n <button\n type=\"button\"\n onClick={() => bump(-step)}\n disabled={disabled || atMin}\n aria-label={labels?.decrement ?? \"Decrease\"}\n className={cn(stepBtn, \"rounded-l-xl\")}\n >\n <Minus className=\"w-4 h-4\" />\n </button>\n <input\n ref={ref}\n id={fieldId}\n type=\"number\"\n inputMode=\"numeric\"\n value={typeof value === \"number\" ? value : \"\"}\n onChange={(e) => onChange?.(e.target.value === \"\" ? base : clamp(Number(e.target.value)))}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedByIds}\n className=\"yunui-number w-full min-w-0 bg-transparent px-1 text-center text-base md:text-sm outline-none\"\n {...props}\n />\n <button\n type=\"button\"\n onClick={() => bump(step)}\n disabled={disabled || atMax}\n aria-label={labels?.increment ?? \"Increase\"}\n className={cn(stepBtn, \"rounded-r-xl\")}\n >\n <Plus className=\"w-4 h-4\" />\n </button>\n </div>\n {error && (\n <p id={errorId} className=\"mt-1.5 text-xs text-error flex items-center gap-1\">\n <AlertCircle aria-hidden=\"true\" className=\"w-3 h-3\" />\n {error}\n </p>\n )}\n </div>\n );\n }\n);\nNumberInput.displayName = \"NumberInput\";\n\n// =====================================================\n// KBD\n// =====================================================\n\n/** Inline keyboard-key / shortcut display, e.g. `<Kbd>⌘</Kbd><Kbd>K</Kbd>`. */\nexport function Kbd({ className, ...props }: React.HTMLAttributes<HTMLElement>) {\n return (\n <kbd\n className={cn(\n \"inline-flex h-5 min-w-5 items-center justify-center rounded border border-border bg-muted px-1.5 font-mono text-[11px] font-medium text-muted-foreground\",\n className\n )}\n {...props}\n />\n );\n}\n\n// =====================================================\n// SEARCH INPUT\n// =====================================================\n\ninterface SearchInputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"onChange\" | \"value\" | \"type\" | \"size\"> {\n /** Current query (controlled). */\n value?: string;\n /** Called with the new query string — also called with `\"\"` when cleared. */\n onChange?: (value: string) => void;\n /** Show a clear (×) button while there's a value. @defaultValue true */\n clearable?: boolean;\n /** Accessible label for the clear button (English default). */\n clearLabel?: string;\n /** Field size — `sm` for toolbars/dropdowns, `md` standalone. @defaultValue \"md\" */\n size?: \"sm\" | \"md\";\n}\n\n/**\n * Canonical search field: a leading magnifier with the right padding so typed\n * text never sits under the icon, plus an optional clear (×) button. `onChange`\n * receives the string directly (ergonomic for filtering), and the clear button\n * fires `onChange(\"\")`. Use this instead of hand-rolling `<input> + absolute icon`.\n */\nexport const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(\n ({ className, value, onChange, clearable = true, clearLabel, disabled, size = \"md\", ...props }, ref) => {\n // Internal ref so the clear button can restore focus, while still\n // forwarding the node to a caller-provided ref.\n const innerRef = React.useRef<HTMLInputElement>(null);\n const setRef = React.useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLInputElement | null>).current = node;\n },\n [ref]\n );\n const showClear = clearable && !!value && !disabled;\n const handleClear = () => {\n onChange?.(\"\");\n innerRef.current?.focus();\n };\n const sm = size === \"sm\";\n return (\n <div className=\"relative\">\n <Search\n aria-hidden=\"true\"\n className={cn(\n \"absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none\",\n sm ? \"left-2.5\" : \"left-3\"\n )}\n />\n {/* type=\"text\" + role=\"searchbox\" deliberately: type=\"search\" adds a\n native clear (×) decoration that would collide with our own button. */}\n <input\n ref={setRef}\n type=\"text\"\n role=\"searchbox\"\n // Fall back to the placeholder as the accessible name when the\n // host doesn't pass an explicit aria-label (spread below wins).\n aria-label={props.placeholder}\n value={value}\n onChange={(e) => onChange?.(e.target.value)}\n disabled={disabled}\n className={cn(\n \"w-full bg-background border border-border text-base md:text-sm outline-none transition-colors\",\n \"placeholder:text-muted-foreground\",\n \"focus:border-ring focus:ring-2 focus:ring-ring/20\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n sm ? \"h-8 rounded-lg pl-8\" : \"h-10 rounded-xl pl-10\",\n sm ? (showClear ? \"pr-8\" : \"pr-3\") : showClear ? \"pr-10\" : \"pr-4\",\n className\n )}\n {...props}\n />\n {showClear && (\n <button\n type=\"button\"\n onClick={handleClear}\n aria-label={clearLabel ?? \"Clear search\"}\n className={cn(\n \"absolute top-1/2 -translate-y-1/2 rounded-md p-0.5 text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n sm ? \"right-1.5\" : \"right-2.5\"\n )}\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n );\n }\n);\nSearchInput.displayName = \"SearchInput\";\n\n// =====================================================\n// CARD\n// =====================================================\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Add a hover lift (border + shadow transition). */\n hover?: boolean;\n}\n\n/** Surface container rendering the canonical `.card` style. */\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(\n ({ className, hover, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n // Renders the canonical `.card` class so <Card> matches the\n // ~226 raw `className=\"card\"` usages across the app (single look).\n \"card\",\n // `card-interactive` is the house hover (1px lift + one step\n // up the shadow ramp). It used to invent its own recipe here\n // — `hover:border-ring hover:shadow-lg` — which contradicted\n // the `.card:hover` every raw `className=\"card\"` gets.\n hover && \"card-interactive\",\n className\n )}\n {...props}\n />\n );\n }\n);\nCard.displayName = \"Card\";\n\n/** Header region of a Card — title + description live here. */\nexport const CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex flex-col space-y-1.5 p-6\", className)} {...props} />\n));\nCardHeader.displayName = \"CardHeader\";\n\n/** Card title (renders an <h3>). */\nexport const CardTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3 ref={ref} className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)} {...props} />\n));\nCardTitle.displayName = \"CardTitle\";\n\n/** Muted supporting text under the title. */\nexport const CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n));\nCardDescription.displayName = \"CardDescription\";\n\n/** Main content region of a Card. */\nexport const CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n));\nCardContent.displayName = \"CardContent\";\n\n/** Footer region of a Card (actions, meta). */\nexport const CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center p-6 pt-0\", className)} {...props} />\n));\nCardFooter.displayName = \"CardFooter\";\n\n// =====================================================\n// BADGE\n// =====================================================\n\ninterface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n /**\n * Semantic colors: `default` (neutral), `success`, `warning`, `error`, `info`.\n * Plus structural variants for shadcn-style call sites: `secondary`,\n * `outline`, and `destructive` (alias of `error`).\n */\n variant?:\n | \"default\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\"\n | \"secondary\"\n | \"outline\"\n | \"destructive\";\n}\n\n/** Small inline pill for status/labels, with semantic + structural variants. */\nexport function Badge({ className, variant = \"default\", ...props }: BadgeProps) {\n // Token-driven semantic tints (see .bg-*-soft / .text-* helpers in yunui.css)\n // so a Badge, an Alert and a status dot all read the same red/green/amber.\n const variants = {\n default: \"bg-muted text-foreground/80\",\n success: \"bg-success-soft text-success\",\n warning: \"bg-warning-soft text-warning\",\n error: \"bg-error-soft text-error\",\n info: \"bg-info-soft text-info\",\n // Structural (shadcn-compatible) variants:\n secondary: \"bg-secondary text-secondary-foreground\",\n outline: \"border border-border text-foreground\",\n destructive: \"bg-error-soft text-error\",\n };\n\n return (\n <span\n className={cn(\n \"inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium\",\n variants[variant],\n className\n )}\n {...props}\n />\n );\n}\n\n// =====================================================\n// SEPARATOR\n// =====================================================\n\ninterface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: \"horizontal\" | \"vertical\";\n /** Purely decorative — no semantic role announced to assistive tech. */\n decorative?: boolean;\n}\n\n/** A thin divider line. Horizontal by default; set `orientation=\"vertical\"` inside a flex row. */\nexport function Separator({\n className,\n orientation = \"horizontal\",\n decorative = false,\n ...props\n}: SeparatorProps) {\n return (\n <div\n role={decorative ? \"none\" : \"separator\"}\n aria-orientation={!decorative && orientation === \"vertical\" ? \"vertical\" : undefined}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-px w-full\" : \"h-full w-px\",\n className\n )}\n {...props}\n />\n );\n}\n\n// =====================================================\n// ALERT\n// =====================================================\n\ninterface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n variant?: \"info\" | \"success\" | \"warning\" | \"error\" | \"accent\";\n /** Optional bold title above the body. */\n title?: React.ReactNode;\n /** Leading icon. Defaults to a variant-appropriate icon; pass `null` to hide. */\n icon?: React.ReactNode;\n}\n\n/** Inline callout for info / success / warning / error messages. */\nexport function Alert({ className, variant = \"info\", title, icon, children, ...props }: AlertProps) {\n // Token-driven semantic tints (.bg-*-soft / .text-* / .border-*-soft helpers\n // in yunui.css) so Alert matches Badge and the status dots across all themes.\n const styles = {\n info: \"bg-info-soft text-info border-info-soft\",\n success: \"bg-success-soft text-success border-success-soft\",\n warning: \"bg-warning-soft text-warning border-warning-soft\",\n error: \"bg-error-soft text-error border-error-soft\",\n accent: \"bg-accent-soft text-accent border-accent-soft\",\n };\n const defaultIcon = {\n info: <Info className=\"h-4 w-4\" />,\n success: <CheckCircle2 className=\"h-4 w-4\" />,\n warning: <AlertTriangle className=\"h-4 w-4\" />,\n error: <AlertCircle className=\"h-4 w-4\" />,\n accent: <AlertCircle className=\"h-4 w-4\" />,\n };\n const resolvedIcon = icon === undefined ? defaultIcon[variant] : icon;\n // Urgent variants assert; info/success are polite status messages.\n const role = variant === \"error\" || variant === \"warning\" ? \"alert\" : \"status\";\n return (\n <div\n role={role}\n className={cn(\"flex gap-3 rounded-xl border border-border p-3 text-sm\", styles[variant], className)}\n {...props}\n >\n {resolvedIcon && (\n <span aria-hidden=\"true\" className=\"mt-0.5 shrink-0\">\n {resolvedIcon}\n </span>\n )}\n <div className=\"min-w-0 flex-1\">\n {title && <p className=\"font-medium\">{title}</p>}\n {children && <div className={cn(title && \"mt-0.5\", \"opacity-90\")}>{children}</div>}\n </div>\n </div>\n );\n}\n\n// =====================================================\n// TAG\n// =====================================================\n\ninterface TagProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Show a remove (×) button and call this when it's pressed. */\n onRemove?: () => void;\n /** Accessible label for the remove button (English default). */\n removeLabel?: string;\n}\n\n/** A small label, optionally removable. Use `Badge` for non-interactive status text. */\nexport function Tag({ className, children, onRemove, removeLabel, ...props }: TagProps) {\n return (\n <span\n className={cn(\n \"inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs font-medium text-foreground/80\",\n className\n )}\n {...props}\n >\n {children}\n {onRemove && (\n <button\n type=\"button\"\n onClick={onRemove}\n aria-label={removeLabel ?? \"Remove\"}\n className=\"-mr-0.5 rounded-sm p-0.5 text-muted-foreground hover:bg-foreground/10 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n )}\n </span>\n );\n}\n\n// =====================================================\n// STATUS INDICATOR\n// =====================================================\n\ninterface StatusIndicatorProps extends React.HTMLAttributes<HTMLSpanElement> {\n status?: \"online\" | \"offline\" | \"busy\" | \"away\" | \"neutral\";\n /** Add a pulsing halo to signal \"live\". */\n pulse?: boolean;\n}\n\n/** A small colored status dot with an optional label (e.g. provider online/offline). */\nexport function StatusIndicator({\n status = \"neutral\",\n pulse = false,\n className,\n children,\n ...props\n}: StatusIndicatorProps) {\n const color = {\n online: \"bg-(--success)\",\n // Token, not `zinc-400`: every other state in this map is token-driven,\n // and a raw palette value would not follow a theme.\n offline: \"bg-muted-foreground/60\",\n busy: \"bg-(--error)\",\n away: \"bg-(--warning)\",\n neutral: \"bg-muted-foreground\",\n }[status];\n return (\n <span className={cn(\"inline-flex items-center gap-1.5 text-sm\", className)} {...props}>\n <span className=\"relative flex h-2 w-2 shrink-0\">\n {pulse && (\n <span\n aria-hidden=\"true\"\n className={cn(\"absolute inline-flex h-full w-full animate-ping rounded-full opacity-75\", color)}\n />\n )}\n <span className={cn(\"relative inline-flex h-2 w-2 rounded-full\", color)} />\n </span>\n {children}\n </span>\n );\n}\n\n// =====================================================\n// INLINE STATUS\n// =====================================================\n\nexport type InlineStatusKind = \"pending\" | \"processing\" | \"completed\" | \"failed\";\n\ninterface InlineStatusProps {\n /** Job phase — drives the icon, color and whether it spins. */\n status: InlineStatusKind;\n /** The label for this status (host-supplied; no bundled copy). */\n label?: React.ReactNode;\n /** When in-progress and > 0, the percent replaces the label. */\n progress?: number;\n /** Icon size in px. */\n size?: number;\n className?: string;\n}\n\nconst inlineStatusConfig: Record<InlineStatusKind, { icon: typeof Loader2; className: string }> = {\n pending: { icon: Loader2, className: \"text-warning\" },\n processing: { icon: Loader2, className: \"text-warning\" },\n completed: { icon: CheckCircle2, className: \"text-success\" },\n failed: { icon: AlertCircle, className: \"text-error\" },\n};\n\n/** A compact inline async-job status: a (spinning) icon plus a label or percent.\n * For a presence dot use `StatusIndicator`; for an approval pill, `StatusBadge`. */\nexport function InlineStatus({ status, label, progress, size = 12, className }: InlineStatusProps) {\n const config = inlineStatusConfig[status];\n const Icon = config.icon;\n const isProcessing = status === \"processing\" || status === \"pending\";\n return (\n <span className={cn(\"inline-flex items-center gap-1\", config.className, className)}>\n <Icon size={size} className={cn(isProcessing && \"animate-spin\")} />\n <span>{isProcessing && progress !== undefined && progress > 0 ? `${progress}%` : label}</span>\n </span>\n );\n}\n\n// =====================================================\n// INLINE CODE\n// =====================================================\n\n/** Inline `<code>` styling for code spans in prose or chat. Use `Kbd` for keys. */\nexport function InlineCode({ className, ...props }: React.HTMLAttributes<HTMLElement>) {\n return (\n <code\n className={cn(\n \"rounded bg-muted px-1.5 py-0.5 font-mono text-[0.85em] text-foreground/90\",\n className\n )}\n {...props}\n />\n );\n}\n\n// =====================================================\n// STEPS\n// =====================================================\n\ninterface Step {\n /** The milestone's label. */\n title: React.ReactNode;\n /** Optional second line under the title. */\n description?: React.ReactNode;\n}\n\ninterface StepsProps extends Omit<React.HTMLAttributes<HTMLOListElement>, \"children\"> {\n /** The milestones, in order, from first to last. */\n steps: Step[];\n /** Zero-based index of the active step; earlier steps render as completed. */\n current?: number;\n}\n\n/** Vertical progress stepper: completed / active / upcoming states with a connector. */\nexport function Steps({ steps, current = 0, className, ...props }: StepsProps) {\n return (\n <ol className={cn(\"flex flex-col\", className)} {...props}>\n {steps.map((step, i) => {\n const state = i < current ? \"done\" : i === current ? \"active\" : \"upcoming\";\n const isLast = i === steps.length - 1;\n return (\n <li key={i} className=\"flex gap-3\">\n <div className=\"flex flex-col items-center\">\n <span\n aria-hidden=\"true\"\n className={cn(\n \"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-border text-xs font-medium\",\n state === \"done\" && \"border-transparent bg-primary text-primary-foreground\",\n state === \"active\" && \"border-primary text-primary\",\n state === \"upcoming\" && \"border-border text-muted-foreground\"\n )}\n >\n {state === \"done\" ? <Check className=\"h-3.5 w-3.5\" /> : i + 1}\n </span>\n {!isLast && (\n <span\n aria-hidden=\"true\"\n className={cn(\"w-px flex-1 my-1\", i < current ? \"bg-primary\" : \"bg-border\")}\n />\n )}\n </div>\n <div className={cn(\"pb-6\", isLast && \"pb-0\")}>\n <p\n className={cn(\n \"text-sm font-medium leading-6\",\n state === \"upcoming\" ? \"text-muted-foreground\" : \"text-foreground\"\n )}\n aria-current={state === \"active\" ? \"step\" : undefined}\n >\n {step.title}\n </p>\n {step.description && (\n <p className=\"text-xs text-muted-foreground mt-0.5\">{step.description}</p>\n )}\n </div>\n </li>\n );\n })}\n </ol>\n );\n}\n\n// =====================================================\n// DIALOG\n// =====================================================\n\n/**\n * Radix Dialog root — controls open state for a modal dialog. Compose with Dialog* parts.\n *\n * The accessible default for dialogs (focus trap, escape, scroll lock, full ARIA).\n * For the prop-driven styled modal use `Modal`; for confirmations use\n * `ConfirmModal`/`DeleteConfirmModal`/`RegenerateConfirmModal` — see Modal's doc\n * for the full \"which dialog do I use\" guidance.\n */\nexport const Dialog = DialogPrimitive.Root;\n/** Element that opens the dialog when activated. */\nexport const DialogTrigger = DialogPrimitive.Trigger;\n/** Portals dialog content into the document body. */\nexport const DialogPortal = DialogPrimitive.Portal;\n/** Element that closes the dialog when activated. */\nexport const DialogClose = DialogPrimitive.Close;\n\n/** Dimmed, blurred backdrop behind the dialog content. */\nexport const DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\n/** Centered, animated dialog panel (includes the overlay and a built-in close button). */\nexport const DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n /** Accessible name for the built-in close button. The library ships no\n * copy of its own; the English default only keeps it usable untranslated. */\n closeLabel?: string;\n }\n>(({ className, children, closeLabel, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%]\",\n // Dialogs may be nested above another modal. Keep the content\n // surface opaque so labels and controls below never bleed through.\n \"bg-background border border-border rounded-2xl shadow-2xl p-6\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]\",\n \"data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]\",\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close aria-label={closeLabel ?? \"Close\"} className=\"absolute right-4 top-4 rounded-lg p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring\">\n <X className=\"h-4 w-4\" />\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\n/** Header layout block for the dialog title/description. */\nexport function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"mb-4\", className)} {...props} />;\n}\n\n/** Accessible dialog title (labels the dialog for screen readers). */\nexport const DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\n/** Accessible dialog description (supplementary text under the title). */\nexport const DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground mt-1\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n/** Footer layout block (right-aligned action buttons) for the dialog. */\nexport function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"flex items-center justify-end gap-3 mt-6\", className)} {...props} />;\n}\n\n// =====================================================\n// SELECT\n// =====================================================\n\n/**\n * Radix Select root — a styled native-feeling single-select. Compose with Select* parts.\n *\n * Choosing a select (so you never have to guess):\n * - `Select` (this, Radix): the accessible default for a fixed, smallish list of\n * options authored as JSX (`<SelectItem>`). Best a11y/keyboard support.\n * - `CustomSelect`: data-driven (`options` array) with optional search/icons —\n * reach for it when options come from data or you need a searchable list.\n * - `Combobox`: data-driven select with a filterable text input (type-ahead),\n * for longer lists where the user types to narrow.\n * - `SegmentedSelect`: a small inline segmented control (2-5 visible choices),\n * not a dropdown.\n */\nexport const Select = SelectPrimitive.Root;\n/** Renders the selected value (or placeholder) inside the trigger. */\nexport const SelectValue = SelectPrimitive.Value;\n/** Groups related SelectItems together. */\nexport const SelectGroup = SelectPrimitive.Group;\n\n/** Button that opens the select dropdown and shows the current value. */\nexport const SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between rounded-xl border border-border bg-card px-3 text-sm\",\n \"placeholder:text-muted-foreground\",\n \"focus:outline-none focus:ring-2 focus:ring-ring/20\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/** Portalled, animated dropdown panel holding the SelectItems. */\nexport const SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n className={cn(\n \"relative z-50 min-w-32 overflow-hidden rounded-2xl border border-border bg-popover text-popover-foreground shadow-lg shadow-black/5\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n position === \"popper\" && \"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1\",\n className\n )}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" && \"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/** A selectable option in the dropdown (shows a check when selected). */\nexport const SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n // Shares the LanguageSwitcher row look: the left accent bar (via\n // data-state=checked) marks the selection — no separate checkmark.\n \"dropdown-item w-full cursor-pointer select-none outline-none data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/** Non-selectable heading for a group of options. */\nexport const SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-xs font-medium text-muted-foreground\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/** Divider between option groups. */\nexport const SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/** Auto-scroll affordance shown at the top of a long, scrollable list. */\nexport const SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/** Auto-scroll affordance shown at the bottom of a long, scrollable list. */\nexport const SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\n\n// =====================================================\n// SLIDER\n// =====================================================\n\n/** Range slider with a track, filled range, and draggable thumb. */\nexport const Slider = React.forwardRef<\n React.ComponentRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> & {\n /**\n * Accessible name for the thumb. Radix gives it `role=\"slider\"`, and a\n * slider with no name is announced as an unlabelled one — the value\n * without any idea what it sets.\n */\n label?: string;\n }\n>(({ className, label, ...props }, ref) => (\n <SliderPrimitive.Root\n ref={ref}\n // px-2.5 (half the 20px thumb) keeps the thumb inside the Root box at both\n // extremes instead of clipping past the track ends — very visible in narrow\n // containers like the chat settings drawer.\n className={cn(\"relative flex w-full touch-none select-none items-center px-2.5\", className)}\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-2 w-full grow overflow-hidden rounded-full bg-border\">\n <SliderPrimitive.Range className=\"absolute h-full bg-foreground yunui-accent-bg\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb\n aria-label={label}\n className=\"block h-5 w-5 rounded-full border-2 border-foreground bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 yunui-accent-border\"\n />\n </SliderPrimitive.Root>\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\n// =====================================================\n// PROGRESS\n// =====================================================\n\n/** Horizontal progress bar; `value` is the percent complete (0–100). */\nexport const Progress = React.forwardRef<\n React.ComponentRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> & {\n /** Percent complete, 0–100. */\n value?: number;\n /**\n * Accessible name, e.g. \"Upload progress\". Radix gives the root\n * `role=\"progressbar\"`, and a progressbar with no name is announced as\n * an unlabelled one — the percentage without any idea what it measures.\n */\n label?: string;\n }\n>(({ className, value, label, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n aria-label={label}\n className={cn(\"relative h-2 w-full overflow-hidden rounded-full bg-muted\", className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-foreground transition-all duration-300 yunui-accent-bg\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\n// =====================================================\n// TABS\n// =====================================================\n\n/** Radix Tabs root — manages the active tab. Compose with TabsList/TabsTrigger/TabsContent. */\nexport const Tabs = TabsPrimitive.Root;\n\n/** Horizontal container holding the TabsTriggers. */\nexport const TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n // max-w-full: inline-flex sizes to content, so without it a long tab\n // strip grows past its parent and drags the page sideways on narrow\n // screens instead of engaging its own overflow-x-auto.\n \"inline-flex h-11 max-w-full items-center justify-center rounded-xl bg-muted p-1 flex-nowrap overflow-x-auto overflow-y-hidden overscroll-x-contain\",\n className\n )}\n {...props}\n />\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\n\n/** Clickable tab that activates its matching TabsContent. */\nexport const TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-4 py-2 text-sm font-medium transition-all\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"data-[state=active]:bg-card data-[state=active]:shadow-sm\",\n // Inactive tabs sit on bg-muted. The general muted-foreground token\n // is intentionally subtle and can fall just below WCAG AA on that\n // tinted surface, so tabs use a stronger foreground blend.\n \"data-[state=inactive]:text-foreground/70 data-[state=inactive]:hover:text-foreground\",\n \"yunui-tab-trigger\",\n className\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\n/** Panel shown when its matching TabsTrigger is active. */\nexport const TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\"mt-4 focus-visible:outline-none\", className)}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\n// =====================================================\n// AVATAR\n// =====================================================\n\n/** Circular avatar container. Compose with AvatarImage + AvatarFallback. */\nexport const Avatar = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\",\n className\n )}\n {...props}\n />\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\n/** The avatar's image; falls back to AvatarFallback if it fails to load. */\nexport const AvatarImage = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn(\"aspect-square h-full w-full\", className)}\n {...props}\n />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\n/** Placeholder (e.g. initials) shown when the avatar image is missing or loading. */\nexport const AvatarFallback = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted text-sm font-medium\",\n className\n )}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\n// =====================================================\n// AVATAR GROUP\n// =====================================================\n\ninterface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Cap how many avatars render; the remainder collapse into a \"+N\" chip. */\n max?: number;\n}\n\n/** Overlapping row of `Avatar`s with an optional \"+N\" overflow chip. */\nexport function AvatarGroup({ className, max, children, ...props }: AvatarGroupProps) {\n const items = React.Children.toArray(children);\n const shown = max != null ? items.slice(0, max) : items;\n const overflow = items.length - shown.length;\n // The separating ring is an inline box-shadow (not a `ring-*`/`border-*`\n // utility) so it renders in any consumer without depending on those classes\n // being generated, and without changing the avatar's box size.\n const ring = { boxShadow: \"0 0 0 2px var(--color-background)\" };\n return (\n <div className={cn(\"flex items-center -space-x-2\", className)} {...props}>\n {shown.map((child, i) => (\n <div key={i} className=\"rounded-full\" style={ring}>\n {child}\n </div>\n ))}\n {overflow > 0 && (\n <div\n className=\"flex h-10 w-10 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground\"\n style={ring}\n >\n +{overflow}\n </div>\n )}\n </div>\n );\n}\n\n// =====================================================\n// TOOLTIP\n// =====================================================\n\n/** Wraps tooltips to share open/close timing; place once near the app root. */\nexport const TooltipProvider = TooltipPrimitive.Provider;\n/** Radix Tooltip root — pairs a trigger with its content. */\nexport const Tooltip = TooltipPrimitive.Root;\n/** Element that shows the tooltip on hover/focus. */\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\n/** The floating tooltip bubble. */\nexport const TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, collisionPadding = 8, ...props }, ref) => (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n \"z-50 overflow-hidden rounded-lg bg-foreground px-3 py-1.5 text-xs text-background shadow-lg\",\n \"animate-in fade-in-0 zoom-in-95\",\n className\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\n// =====================================================\n// SKELETON\n// =====================================================\n\n/** Pulsing placeholder block for loading states; size it via `className`. */\nexport function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\"animate-pulse rounded-lg bg-muted\", className)}\n {...props}\n />\n );\n}\n\n// =====================================================\n// SPINNER\n// =====================================================\n\ninterface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Size: `sm` (16px), `md` (24px, default), or `lg` (32px). */\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst spinnerSizes = {\n sm: \"w-4 h-4\",\n md: \"w-6 h-6\",\n lg: \"w-8 h-8\",\n};\n\n/** Animated loading spinner with an accessible \"Loading…\" label. */\nexport function Spinner({ size = \"md\", className, ...props }: SpinnerProps) {\n return (\n <div role=\"status\" className={cn(\"inline-flex\", className)} {...props}>\n <Loader2 className={cn(\"animate-spin text-muted-foreground\", spinnerSizes[size])} />\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n}\n\n// =====================================================\n// PAGE LOADER\n// =====================================================\n\ninterface PageLoaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Primary loading message shown under the spinner. */\n title?: string;\n /** Secondary, lighter message under the title. */\n subtitle?: string;\n}\n\n/** Full-viewport centered loading screen with a spinner and optional title/subtitle. */\nexport function PageLoader({ title, subtitle, className, ...props }: PageLoaderProps) {\n return (\n <div\n className={cn(\"flex items-center justify-center min-h-dvh w-full\", className)}\n {...props}\n >\n <div className=\"flex flex-col items-center gap-4\">\n <Spinner size=\"lg\" />\n {(title || subtitle) && (\n <div className=\"flex flex-col items-center gap-1\">\n {title && (\n <p className=\"text-muted-foreground text-sm font-medium\">{title}</p>\n )}\n {subtitle && (\n <p className=\"text-muted-foreground text-xs\">{subtitle}</p>\n )}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n// =====================================================\n// EMPTY STATE\n// =====================================================\n\ninterface EmptyStateProps {\n /** Icon/illustration shown above the title. */\n icon?: React.ReactNode;\n /** Heading text. */\n title: string;\n /** Supporting text below the title. */\n description?: string;\n /** Action slot (e.g. a primary button) below the text. */\n action?: React.ReactNode;\n}\n\n/** Centered \"nothing here\" placeholder with an icon, title, description, and action. */\nexport function EmptyState({ icon, title, description, action }: EmptyStateProps) {\n return (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n {icon && <div className=\"text-4xl mb-4\">{icon}</div>}\n <h3 className=\"text-lg font-medium mb-1\">{title}</h3>\n {description && <p className=\"text-sm text-muted-foreground mb-4 max-w-sm\">{description}</p>}\n {action}\n </div>\n );\n}\n\n// =====================================================\n// MOTION COMPONENTS\n// =====================================================\n\nexport const MotionDiv = motion.div;\nexport const MotionSpan = motion.span;\n\nexport const fadeIn = {\n initial: { opacity: 0, y: 10 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -10 },\n transition: { duration: 0.2 },\n};\n\nexport const staggerContainer = {\n animate: {\n transition: { staggerChildren: 0.05 },\n },\n};\n\nexport const staggerItem = {\n initial: { opacity: 0, y: 20 },\n animate: { opacity: 1, y: 0 },\n};\n\n// =====================================================\n// ICON BUTTON\n// =====================================================\n\ninterface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** The icon to render inside the button. */\n icon: React.ReactNode;\n /** Accessible label, also shown as the hover tooltip. */\n label: string;\n}\n\n/** Icon-only button with a built-in tooltip (uses `label` for both a11y and the tooltip text). */\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ className, icon, label, ...props }, ref) => {\n return (\n <TooltipProvider delayDuration={300}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n ref={ref}\n type={props.type ?? \"button\"}\n aria-label={label}\n className={cn(\n \"p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n className\n )}\n {...props}\n >\n <span aria-hidden=\"true\">{icon}</span>\n </button>\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n }\n);\nIconButton.displayName = \"IconButton\";\n\n// =====================================================\n// LABEL\n// =====================================================\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n /**\n * `xs` (default) is the compact 11px label; `sm` is 12px, for denser forms\n * where the label sits directly above a full-height input and 11px reads as\n * an afterthought.\n * @defaultValue \"xs\"\n */\n size?: \"xs\" | \"sm\";\n}\n\n/** Uppercase, muted form-field label. */\nexport function Label({ className, size = \"xs\", ...props }: LabelProps) {\n return (\n <label\n className={cn(\n \"font-medium text-muted-foreground uppercase tracking-wider block mb-2\",\n size === \"xs\" ? \"text-[11px]\" : \"text-xs\",\n className\n )}\n {...props}\n />\n );\n}\n\n// =====================================================\n// DROPDOWN MENU\n// =====================================================\n\n/** Radix DropdownMenu root — a contextual actions menu. Compose with DropdownMenu* parts. */\nexport const DropdownMenu = DropdownMenuPrimitive.Root;\n/** Element that opens the dropdown menu. */\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n/** Groups related menu items. */\nexport const DropdownMenuGroup = DropdownMenuPrimitive.Group;\n/** Portals menu content into the document body. */\nexport const DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n/** Wraps a nested submenu (use with DropdownMenuSubTrigger/SubContent). */\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\n/** Groups DropdownMenuRadioItems into a single-choice set. */\nexport const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/** Item that opens a nested submenu. `inset` adds left padding to align with checkable items. */\nexport const DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none focus:bg-muted focus:text-foreground data-[state=open]:bg-muted\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\n/** The panel for a nested submenu. */\nexport const DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-2xl border border-border bg-popover/85 backdrop-blur-2xl p-1 text-popover-foreground shadow-lg shadow-black/5 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\n/** Portalled, animated dropdown menu panel holding the items. */\nexport const DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-2xl border border-border bg-popover p-1 text-popover-foreground shadow-lg shadow-black/5\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/** A clickable menu action. `inset` adds left padding to align with checkable items. */\nexport const DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n /** Indent to align with checkbox/radio items. */\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuItemInternal\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-muted focus:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuItemInternal = DropdownMenuPrimitive.Item;\n\n/** A toggleable menu item showing a check when `checked`. */\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-muted focus:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/** A single-choice menu item; use inside a DropdownMenuRadioGroup. */\nexport const DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-muted focus:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckCircle2 className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/** Non-interactive section heading inside the menu. `inset` indents it to align with items. */\nexport const DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n /** Indent to align with checkbox/radio items. */\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/** Thin divider between groups of menu items. */\nexport const DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/** Right-aligned keyboard-shortcut hint shown inside a menu item. */\nexport const DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\n// =====================================================\n// RE-EXPORT COMBOBOX\n// =====================================================\n\nexport { Combobox } from \"./combobox\";\nexport type { ComboboxOption } from \"./combobox\";\n\n// =====================================================\n// RE-EXPORT NEW PRIMITIVES (accordion, radio-group, layout, table, breadcrumb, pagination)\n// =====================================================\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from \"./accordion\";\nexport { RadioGroup, RadioGroupItem } from \"./radio-group\";\nexport { Flex, Grid, Column, Row, Stack } from \"./layout\";\nexport type { FlexProps, GridProps, SpacingScale, GridCount } from \"./layout\";\nexport {\n Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption,\n Thead, Tbody, Tfoot, Tr, Th, Td,\n} from \"./table\";\nexport {\n Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink,\n BreadcrumbSeparator, BreadcrumbPage, BreadcrumbEllipsis,\n} from \"./breadcrumb\";\nexport { Pagination, type PaginationProps } from \"./pagination\";\n","/**\n * Modal - Unified Modal Component\n *\n * A comprehensive modal component that supports all use cases:\n * - Standard content modals\n * - Modals with unsaved changes tracking\n * - Custom sizes and animations\n *\n * Features:\n * - Escape key to close (with animation)\n * - Body scroll lock when open\n * - Backdrop click to close\n * - ARIA attributes + focus trap (focus moves in on open, Tab cycles inside,\n * focus returns to the opener on close)\n * - Optional closing animation\n * - Unsaved changes badge\n * - SSR compatible\n *\n * Choosing a dialog (so you never have to guess):\n * - `Dialog` (Radix, from the root barrel): the accessible default — focus trap,\n * escape, scroll lock, full ARIA. Use it for general/interactive dialogs and\n * anywhere keyboard focus containment matters.\n * - `Modal` (this): a styled, prop-driven modal (title/subtitle/footer, sizes,\n * unsaved-changes badge) for the common app case. Manages escape, scroll-lock,\n * backdrop, and focus-trap itself.\n * - `ConfirmModal` / `DeleteConfirmModal` / `RegenerateConfirmModal`: ready-made\n * confirmation dialogs built on `Modal`.\n */\n\n\"use client\";\n\nimport { useRef, useCallback, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { X } from \"lucide-react\";\nimport { Button } from \"../index\";\nimport { useEscapeKey, useBodyScrollLock, useFocusTrap } from \"../../lib/hooks\";\nimport { cn } from \"../../lib/cn\";\nimport { SIZE_CLASSES, Z_INDEX, ANIMATION_DURATION, DEFAULT_MAX_HEIGHT } from \"./constants\";\nimport type { ModalProps } from \"./types\";\nimport { useYunUI } from \"../../adapters/context\";\n\n// Unique ID counter for timeout tracking\nlet closeIdCounter = 0;\n\nexport function Modal({\n isOpen,\n onClose,\n title,\n subtitle,\n children,\n footer,\n size = \"lg\",\n className,\n showCloseButton = true,\n isClosing: externalIsClosing,\n setIsClosing: externalSetIsClosing,\n showUnsavedBadge = false,\n maxHeight = DEFAULT_MAX_HEIGHT,\n onBackdropClick,\n}: ModalProps) {\n const t = useYunUI().useT('components.modal');\n const modalRef = useRef<HTMLDivElement>(null);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const closeIdRef = useRef<number>(0);\n const [internalIsClosing, setInternalIsClosing] = useState(false);\n const [mounted, setMounted] = useState(false);\n\n // Use external state if provided, otherwise use internal state\n const isClosing = externalIsClosing ?? internalIsClosing;\n\n // Track mounted state for SSR\n useEffect(() => {\n setMounted(true);\n return () => setMounted(false);\n }, []);\n\n // Cleanup timeout on unmount\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n };\n }, []);\n\n // Use refs to avoid stale closure issues\n const isClosingRef = useRef(isClosing);\n isClosingRef.current = isClosing;\n\n const onCloseRef = useRef(onClose);\n onCloseRef.current = onClose;\n\n const externalSetIsClosingRef = useRef(externalSetIsClosing);\n externalSetIsClosingRef.current = externalSetIsClosing;\n\n // Handle close with animation - no dependencies to avoid recreation\n const handleClose = useCallback(() => {\n // Prevent double-close using ref (always current)\n if (isClosingRef.current) return;\n\n // Clear any existing timeout\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n\n // Generate unique ID for this close operation\n const currentCloseId = ++closeIdCounter;\n closeIdRef.current = currentCloseId;\n\n const executeClose = () => {\n // Only execute if this is still the current close operation\n if (closeIdRef.current === currentCloseId) {\n onCloseRef.current();\n if (externalSetIsClosingRef.current) {\n externalSetIsClosingRef.current(false);\n } else {\n setInternalIsClosing(false);\n }\n timeoutRef.current = null;\n }\n };\n\n if (externalSetIsClosingRef.current) {\n externalSetIsClosingRef.current(true);\n timeoutRef.current = setTimeout(executeClose, ANIMATION_DURATION);\n } else {\n setInternalIsClosing(true);\n timeoutRef.current = setTimeout(executeClose, ANIMATION_DURATION);\n }\n }, []); // No dependencies - uses refs\n\n // Handle Escape key (enabled state checked inside useEscapeKey via ref)\n useEscapeKey(handleClose, isOpen);\n\n // Body scroll lock\n useBodyScrollLock(isOpen);\n\n // Focus management — move focus into the dialog on open, trap Tab/Shift+Tab\n // inside it, and restore focus to the opener on close (a11y: no focus escape).\n // `&& mounted` matters: the portal renders null until `mounted` is set, so\n // without it the trap is asked to install itself against a node that does\n // not exist yet. Sheet, ConfirmModal and ConfirmCloseDialog all pass it;\n // this was the one that did not, and its focus trap never armed.\n useFocusTrap(modalRef, isOpen && mounted);\n\n // Reset closing state when modal reopens\n useEffect(() => {\n if (isOpen && internalIsClosing) {\n setInternalIsClosing(false);\n }\n }, [isOpen, internalIsClosing]);\n\n const handleBackdropClick = useCallback((e: React.MouseEvent) => {\n if (e.target === e.currentTarget) {\n if (onBackdropClick) {\n onBackdropClick();\n } else {\n handleClose();\n }\n }\n }, [onBackdropClick, handleClose]);\n\n // Don't render if not open or not mounted (SSR)\n if (!isOpen || !mounted) return null;\n\n const sizeClass = SIZE_CLASSES[size] ?? SIZE_CLASSES.lg;\n\n const modalContent = (\n <div\n className={cn(\n \"fixed inset-0 pointer-events-auto flex items-center justify-center p-4 transition-opacity\",\n isClosing ? \"opacity-0 pointer-events-none\" : \"opacity-100\"\n )}\n style={{ zIndex: Z_INDEX.MODAL }}\n onClick={handleBackdropClick}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"modal-title\"\n >\n {/* Backdrop */}\n <div\n className={cn(\n \"absolute inset-0 bg-black/50 backdrop-blur-sm transition-opacity\",\n isClosing ? \"opacity-0\" : \"opacity-100\"\n )}\n onClick={handleClose}\n aria-hidden=\"true\"\n />\n\n {/* Modal */}\n <div\n ref={modalRef}\n className={cn(\n // Glassy surface (not the solid .card) to match Sheet/Dialog/navbar.\n \"relative w-full rounded-2xl border border-border bg-popover/85 backdrop-blur-2xl shadow-lg shadow-black/5 flex flex-col transition-all\",\n sizeClass,\n isClosing ? \"scale-95 opacity-0\" : \"scale-100 opacity-100\",\n className\n )}\n style={{ maxHeight }}\n onClick={(e) => e.stopPropagation()}\n tabIndex={-1}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between p-4 border-b border-border shrink-0\">\n <div className=\"space-y-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <h2 id=\"modal-title\" className=\"text-lg font-semibold truncate\">\n {title}\n </h2>\n {showUnsavedBadge && (\n <span className=\"badge-warning shrink-0\">\n {t('unsaved')}\n </span>\n )}\n </div>\n {subtitle && (\n <p className=\"text-sm text-muted-foreground truncate\">{subtitle}</p>\n )}\n </div>\n {showCloseButton && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleClose}\n className=\"p-2 shrink-0\"\n aria-label={t('close')}\n >\n <X size={20} />\n </Button>\n )}\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto p-6\">\n {children}\n </div>\n\n {/* Footer */}\n {footer && (\n <div className=\"p-4 border-t border-border bg-muted/20 shrink-0\">\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n\n return createPortal(modalContent, document.body);\n}\n"]}