@craftzbay/ui 0.6.0 → 0.7.0
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.
- package/dist-lib/index.cjs +2 -2
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +301 -305
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/showcase/guides/Migration.d.ts +1 -0
- package/dist-lib/showcase/layout/DocLayout.d.ts +9 -3
- package/dist-lib/showcase/layout/DocSidebar.d.ts +15 -1
- package/dist-lib/showcase/layout/ShowcaseFooter.d.ts +5 -0
- package/dist-lib/showcase/layout/sidebars.d.ts +8 -0
- package/dist-lib/showcase/routing.d.ts +1 -1
- package/package.json +1 -1
package/dist-lib/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/lib/utils.ts","../src/hooks/use-media-query.ts","../src/hooks/use-toast.ts","../src/illustrations/index.tsx","../src/components/ui/Accordion.tsx","../src/components/ui/Alert.tsx","../src/components/ui/Avatar.tsx","../src/components/ui/Badge.tsx","../src/components/ui/Breadcrumbs.tsx","../src/components/ui/Button.tsx","../src/components/ui/Card.tsx","../src/components/ui/Checkbox.tsx","../src/components/ui/Combobox.tsx","../src/components/ui/CommandPalette.tsx","../src/components/ui/ContextMenu.tsx","../src/components/ui/DropdownMenu.tsx","../src/components/ui/IconButton.tsx","../src/components/ui/Input.tsx","../src/components/ui/Table.tsx","../src/components/ui/Skeleton.tsx","../src/components/ui/DataGrid.tsx","../src/components/ui/Calendar.tsx","../src/components/ui/DatePicker.tsx","../src/components/ui/DesignSystemProvider.tsx","../src/components/ui/Dialog.tsx","../src/components/ui/EmptyState.tsx","../src/components/ui/ErrorState.tsx","../src/components/ui/Form.tsx","../src/components/ui/Kbd.tsx","../src/components/ui/MultiSelect.tsx","../src/components/ui/Select.tsx","../src/components/ui/Pagination.tsx","../src/components/ui/Popover.tsx","../src/components/ui/Progress.tsx","../src/components/ui/RadioGroup.tsx","../src/components/ui/ScrollArea.tsx","../src/components/ui/Separator.tsx","../src/components/ui/Sheet.tsx","../src/components/ui/Sidebar.tsx","../src/components/ui/Slider.tsx","../src/components/ui/Spinner.tsx","../src/components/ui/Stepper.tsx","../src/components/ui/Switch.tsx","../src/components/ui/Tabs.tsx","../src/components/ui/Textarea.tsx","../src/components/ui/Toast.tsx","../src/components/ui/Tooltip.tsx","../src/components/ui/TopNav.tsx","../src/components/ui/Carousel.tsx","../src/components/ui/Chart.tsx","../src/components/ui/Drawer.tsx","../src/components/ui/FileUpload.tsx","../src/components/ui/Snackbar.tsx","../src/components/ui/TagInput.tsx","../src/components/ui/Timeline.tsx","../src/components/ui/Tree.tsx","../src/components/patterns/Authentication.tsx","../src/components/patterns/AppShell.tsx","../src/components/patterns/Settings.tsx","../src/components/patterns/DataTablePage.tsx","../src/components/patterns/RecordDetail.tsx","../src/components/patterns/Onboarding.tsx","../src/components/patterns/Pricing.tsx","../src/components/patterns/FirstRunEmpty.tsx"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Compose Tailwind class names safely.\n *\n * - `clsx` handles conditionals, arrays, and objects.\n * - `tailwind-merge` resolves conflicts: `cn('p-2', condition && 'p-4')` returns `'p-4'`.\n *\n * Use this everywhere classes are composed. Never concatenate Tailwind\n * classes with template strings — they will not de-duplicate.\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Tiny helper to build a stable id for label/aria-describedby pairings\n * when the component does not receive an `id` from the consumer.\n */\nlet __idCounter = 0;\nexport function uid(prefix = 'ds'): string {\n __idCounter += 1;\n return `${prefix}-${__idCounter}`;\n}\n","import { useEffect, useState } from 'react';\n\n/**\n * Subscribe to a CSS media query. SSR-safe — returns `false` on the server.\n *\n * @example\n * const isDesktop = useMediaQuery('(min-width: 1024px)');\n */\nexport function useMediaQuery(query: string): boolean {\n const [matches, setMatches] = useState(() => {\n if (typeof window === 'undefined') return false;\n return window.matchMedia(query).matches;\n });\n\n useEffect(() => {\n if (typeof window === 'undefined') return;\n const list = window.matchMedia(query);\n const onChange = (event: MediaQueryListEvent) => setMatches(event.matches);\n setMatches(list.matches);\n list.addEventListener('change', onChange);\n return () => list.removeEventListener('change', onChange);\n }, [query]);\n\n return matches;\n}\n\n/** Convenience: respect `prefers-reduced-motion`. */\nexport function usePrefersReducedMotion(): boolean {\n return useMediaQuery('(prefers-reduced-motion: reduce)');\n}\n","import { useCallback, useEffect, useState, type ReactNode } from 'react';\n\n/* -----------------------------------------------------------------------------\n * Minimal toast queue + hook. The host app mounts a single <ToastHub> near\n * the root which subscribes to this store; any component can call\n * `useToast().push({...})` from anywhere.\n *\n * Kept dependency-free intentionally — no external state library.\n * --------------------------------------------------------------------------- */\n\nexport type ToastVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';\n\nexport interface ToastDescriptor {\n /** Auto-generated; consumers can pass an explicit id to update an in-flight toast. */\n id?: string;\n title?: ReactNode;\n description?: ReactNode;\n variant?: ToastVariant;\n /** Milliseconds before auto-dismiss. Default 5000. Set to 0 to keep open. */\n duration?: number;\n /** Action button. The alt text is used for screen reader announcements. */\n action?: {\n label: ReactNode;\n altText: string;\n onClick: () => void;\n };\n}\n\ninterface InternalToast extends ToastDescriptor {\n id: string;\n open: boolean;\n}\n\ntype Listener = (toasts: InternalToast[]) => void;\n\ninterface ToastStore {\n toasts: InternalToast[];\n listeners: Set<Listener>;\n emit(): void;\n push(t: ToastDescriptor): string;\n dismiss(id: string): void;\n remove(id: string): void;\n}\n\nconst store: ToastStore = {\n toasts: [],\n listeners: new Set<Listener>(),\n emit() {\n for (const listener of this.listeners) listener(this.toasts);\n },\n push(t: ToastDescriptor) {\n const id = t.id ?? `t_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;\n const next: InternalToast = { open: true, duration: 5000, variant: 'default', ...t, id };\n this.toasts = [next, ...this.toasts].slice(0, 3);\n this.emit();\n return id;\n },\n dismiss(id: string) {\n this.toasts = this.toasts.map((t: InternalToast) => (t.id === id ? { ...t, open: false } : t));\n this.emit();\n },\n remove(id: string) {\n this.toasts = this.toasts.filter((t: InternalToast) => t.id !== id);\n this.emit();\n },\n};\n\n/**\n * Subscribe to the toast queue and dispatch new toasts.\n *\n * @example\n * const toast = useToast();\n * toast.push({ variant: 'success', title: 'Saved' });\n *\n * // With an action\n * toast.push({\n * title: 'Project archived',\n * action: { label: 'Undo', altText: 'Undo archive', onClick: undo },\n * });\n */\nexport function useToast() {\n const [toasts, setToasts] = useState<InternalToast[]>(() => [...store.toasts]);\n\n useEffect(() => {\n const listener: Listener = (next) => setToasts([...next]);\n store.listeners.add(listener);\n return () => {\n store.listeners.delete(listener);\n };\n }, []);\n\n const push = useCallback((t: ToastDescriptor) => store.push(t), []);\n const dismiss = useCallback((id: string) => store.dismiss(id), []);\n const remove = useCallback((id: string) => store.remove(id), []);\n\n return { toasts, push, dismiss, remove };\n}\n\n/** Convenience export — dispatch a toast outside React (e.g. from an API client). */\nexport const toast = (t: ToastDescriptor) => store.push(t);\n","import { type SVGProps } from 'react';\nimport { cn } from '@/lib/utils';\n\n/* Refined-minimal line illustrations. Single accent stroke, no fills.\n * Drop into EmptyState / ErrorState / FirstRunEmpty `icon` slots. */\n\ntype Props = SVGProps<SVGSVGElement>;\n\nfunction Base({ className, children, ...props }: Props & { children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 120 120\"\n role=\"img\"\n width=\"120\"\n height=\"120\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn('text-foreground-subtle', className)}\n aria-hidden\n {...props}\n >\n {children}\n </svg>\n );\n}\n\nexport function InboxEmpty(props: Props) {\n return (\n <Base {...props}>\n <path d=\"M22 56l10-28a6 6 0 0 1 6-4h44a6 6 0 0 1 6 4l10 28\" />\n <path d=\"M22 56v32a6 6 0 0 0 6 6h64a6 6 0 0 0 6-6V56\" />\n <path d=\"M22 56h22l4 10h24l4-10h22\" />\n <circle cx=\"60\" cy=\"36\" r=\"2\" className=\"text-accent\" stroke=\"currentColor\" />\n <path d=\"M52 28l8 8M68 28l-8 8\" opacity=\"0.4\" />\n </Base>\n );\n}\n\nexport function NoSearchResults(props: Props) {\n return (\n <Base {...props}>\n <circle cx=\"52\" cy=\"52\" r=\"26\" />\n <path d=\"M72 72l20 20\" />\n <path d=\"M42 52h20\" opacity=\"0.5\" />\n <circle cx=\"98\" cy=\"22\" r=\"1.5\" className=\"text-accent\" stroke=\"currentColor\" />\n <circle cx=\"20\" cy=\"92\" r=\"1.5\" className=\"text-accent\" stroke=\"currentColor\" />\n </Base>\n );\n}\n\nexport function NotFound(props: Props) {\n return (\n <Base {...props}>\n <path d=\"M22 32h76v56a6 6 0 0 1-6 6H28a6 6 0 0 1-6-6V32z\" />\n <path d=\"M22 44h76\" />\n <circle cx=\"32\" cy=\"38\" r=\"1.5\" />\n <circle cx=\"40\" cy=\"38\" r=\"1.5\" />\n <circle cx=\"48\" cy=\"38\" r=\"1.5\" />\n <path d=\"M44 64l32 16M76 64l-32 16\" className=\"text-accent\" stroke=\"currentColor\" />\n <text\n x=\"60\"\n y=\"76\"\n fontFamily=\"ui-monospace,monospace\"\n fontSize=\"9\"\n textAnchor=\"middle\"\n fill=\"currentColor\"\n stroke=\"none\"\n opacity=\"0.6\"\n >\n 404\n </text>\n </Base>\n );\n}\n\nexport function ServerError(props: Props) {\n return (\n <Base {...props}>\n <rect x=\"22\" y=\"28\" width=\"76\" height=\"20\" rx=\"3\" />\n <rect x=\"22\" y=\"54\" width=\"76\" height=\"20\" rx=\"3\" />\n <rect x=\"22\" y=\"80\" width=\"76\" height=\"20\" rx=\"3\" />\n <circle cx=\"32\" cy=\"38\" r=\"2\" className=\"text-danger\" stroke=\"currentColor\" />\n <circle cx=\"32\" cy=\"64\" r=\"2\" className=\"text-danger\" stroke=\"currentColor\" />\n <circle cx=\"32\" cy=\"90\" r=\"2\" className=\"text-warning\" stroke=\"currentColor\" />\n <path d=\"M44 38h44M44 64h44M44 90h28\" opacity=\"0.4\" />\n <path d=\"M82 84l16 16M82 100l16-16\" className=\"text-danger\" stroke=\"currentColor\" />\n </Base>\n );\n}\n\nexport function Construction(props: Props) {\n return (\n <Base {...props}>\n <path d=\"M22 86h76\" />\n <path d=\"M30 86V52l30-22 30 22v34\" />\n <rect x=\"40\" y=\"64\" width=\"14\" height=\"14\" rx=\"1\" />\n <rect x=\"66\" y=\"64\" width=\"14\" height=\"14\" rx=\"1\" />\n <path d=\"M30 52h60\" opacity=\"0.4\" />\n <path d=\"M40 40v6M50 36v10M70 36v10M80 40v6\" className=\"text-accent\" stroke=\"currentColor\" />\n </Base>\n );\n}\n\nexport function ConnectionLost(props: Props) {\n return (\n <Base {...props}>\n <path d=\"M22 60a40 40 0 0 1 76 0\" opacity=\"0.4\" />\n <path d=\"M34 70a28 28 0 0 1 52 0\" opacity=\"0.6\" />\n <path d=\"M46 80a16 16 0 0 1 28 0\" />\n <circle cx=\"60\" cy=\"92\" r=\"3\" />\n <path d=\"M20 20l80 80\" className=\"text-danger\" stroke=\"currentColor\" />\n </Base>\n );\n}\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { ChevronDown } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/**\n * Accessible disclosure list. Supports single (`type=\"single\"`) and multiple\n * (`type=\"multiple\"`) open behaviour — both come from Radix.\n *\n * @example FAQ\n * <Accordion type=\"single\" collapsible>\n * <AccordionItem value=\"q1\">\n * <AccordionTrigger>Can I cancel anytime?</AccordionTrigger>\n * <AccordionContent>Yes — usage stops at the end of the billing period.</AccordionContent>\n * </AccordionItem>\n * …\n * </Accordion>\n *\n * @do Use for FAQs, settings groups, and progressive-disclosure forms.\n * @dont Nest accordions inside accordions — the focus order becomes opaque.\n */\nexport const Accordion = AccordionPrimitive.Root;\n\nexport const AccordionItem = forwardRef<\n ElementRef<typeof AccordionPrimitive.Item>,\n ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(function AccordionItem({ className, ...props }, ref) {\n return (\n <AccordionPrimitive.Item ref={ref} className={cn('border-b border-border', className)} {...props} />\n );\n});\nAccordionItem.displayName = 'AccordionItem';\n\nexport const AccordionTrigger = forwardRef<\n ElementRef<typeof AccordionPrimitive.Trigger>,\n ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(function AccordionTrigger({ className, children, ...props }, ref) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n 'flex flex-1 items-center justify-between gap-2 py-4 text-left text-sm font-medium text-foreground',\n 'outline-none transition-colors duration-[var(--duration-fast)]',\n 'hover:text-accent',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n '[&[data-state=open]>svg]:rotate-180',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDown\n className=\"size-4 shrink-0 text-foreground-subtle transition-transform duration-[var(--duration-base)]\"\n aria-hidden\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n});\nAccordionTrigger.displayName = 'AccordionTrigger';\n\nexport const AccordionContent = forwardRef<\n ElementRef<typeof AccordionPrimitive.Content>,\n ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(function AccordionContent({ className, children, ...props }, ref) {\n return (\n <AccordionPrimitive.Content\n ref={ref}\n className={cn(\n 'overflow-hidden text-sm text-foreground-muted',\n 'data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down',\n )}\n {...props}\n >\n <div className={cn('pb-4 pt-0', className)}>{children}</div>\n </AccordionPrimitive.Content>\n );\n});\nAccordionContent.displayName = 'AccordionContent';\n","import { forwardRef, useState, type HTMLAttributes, type ReactNode } from 'react';\nimport { AlertTriangle, CheckCircle2, Info, X, XCircle } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst alert = cva(\n ['relative flex w-full gap-3 rounded-lg border p-4', 'text-sm'],\n {\n variants: {\n variant: {\n default: 'border-border bg-background-subtle text-foreground',\n info: 'border-info-border-soft bg-info-soft text-info-text',\n success: 'border-success-border-soft bg-success-soft text-success-text',\n warning: 'border-warning-border-soft bg-warning-soft text-warning-text',\n danger: 'border-danger-border-soft bg-danger-soft text-danger-text',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconForVariant = {\n default: null,\n info: <Info className=\"size-4 shrink-0 mt-0.5\" aria-hidden />,\n success: <CheckCircle2 className=\"size-4 shrink-0 mt-0.5\" aria-hidden />,\n warning: <AlertTriangle className=\"size-4 shrink-0 mt-0.5\" aria-hidden />,\n danger: <XCircle className=\"size-4 shrink-0 mt-0.5\" aria-hidden />,\n};\n\nexport interface AlertProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>,\n VariantProps<typeof alert> {\n /** Heading. Renders bold above the description. */\n title?: ReactNode;\n /** Show a dismiss (×) button. */\n dismissible?: boolean;\n /** Called when the user dismisses. */\n onDismiss?: () => void;\n /** Override the variant's default icon. Pass `false` to suppress the icon. */\n icon?: ReactNode | false;\n}\n\n/**\n * Inline banner for static page-level or section-level state. For transient\n * notifications use `Toast` instead.\n *\n * @example Inline error\n * <Alert variant=\"danger\" title=\"Payment failed\">\n * Your card was declined. Update your billing info to retry.\n * </Alert>\n *\n * @example Dismissible info\n * <Alert variant=\"info\" dismissible onDismiss={dismiss}>\n * We're improving search — give us feedback at #search-feedback.\n * </Alert>\n *\n * @do Use the closest semantic variant — `info` for neutral facts,\n * `warning` for \"watch out\", `danger` for \"this is broken\".\n * @dont Use Alert for one-time confirmations — that's Toast.\n */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { className, variant = 'default', title, dismissible, onDismiss, icon, children, ...props },\n ref,\n) {\n const [open, setOpen] = useState(true);\n if (!open) return null;\n\n const handleDismiss = () => {\n setOpen(false);\n onDismiss?.();\n };\n\n const renderedIcon = icon === false ? null : icon ?? iconForVariant[variant ?? 'default'];\n\n return (\n <div ref={ref} role=\"alert\" className={cn(alert({ variant }), className)} {...props}>\n {renderedIcon}\n <div className=\"flex-1 min-w-0\">\n {title && <h5 className=\"font-medium leading-tight mb-1\">{title}</h5>}\n <div className=\"text-sm leading-relaxed [&_p]:leading-relaxed\">{children}</div>\n </div>\n {dismissible && (\n <button\n type=\"button\"\n aria-label=\"Dismiss\"\n onClick={handleDismiss}\n className={cn(\n 'inline-flex size-6 shrink-0 items-center justify-center rounded-md',\n 'hover:bg-current/10 outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n )}\n >\n <X className=\"size-3.5\" aria-hidden />\n </button>\n )}\n </div>\n );\n});\nAlert.displayName = 'Alert';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst sizeMap = {\n xs: 'size-5 text-[10px]',\n sm: 'size-6 text-xs',\n md: 'size-8 text-xs',\n lg: 'size-10 text-sm',\n xl: 'size-12 text-base',\n} as const;\n\n// The wrapper sets size — Root sits inside and clips image/fallback only.\nconst avatarWrapper = cva('relative inline-flex shrink-0', {\n variants: { size: sizeMap },\n defaultVariants: { size: 'md' },\n});\n\nexport interface AvatarProps\n extends ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarWrapper> {\n /** Image URL. If absent or fails to load, fallback initials are shown. */\n src?: string;\n /** Alt text for the image; falls back to fallback when there's no `src`. */\n alt?: string;\n /** Initials shown when image is missing or loading. Pass at most 2 characters. */\n fallback?: string;\n /** Status dot rendered on the bottom-right. */\n status?: 'online' | 'busy' | 'away' | 'offline';\n}\n\nconst statusColour: Record<NonNullable<AvatarProps['status']>, string> = {\n online: 'bg-success',\n busy: 'bg-danger',\n away: 'bg-warning',\n offline: 'bg-foreground-subtle',\n};\n\n/**\n * Avatar with image, initials fallback, and optional status dot.\n *\n * @example\n * <Avatar src={user.photo} alt={user.name} fallback={getInitials(user.name)} status=\"online\" />\n *\n * @example AvatarGroup\n * <AvatarGroup max={3}>\n * {users.map(u => <Avatar key={u.id} src={u.photo} fallback={getInitials(u.name)} />)}\n * </AvatarGroup>\n *\n * @do Provide `alt` for image avatars and meaningful initials for the\n * fallback so screen readers announce something useful.\n * @dont Use the status dot without a tooltip explaining what it means.\n */\nexport const Avatar = forwardRef<ElementRef<typeof AvatarPrimitive.Root>, AvatarProps>(\n function Avatar({ className, size, src, alt, fallback, status, ...props }, ref) {\n return (\n <span className={avatarWrapper({ size })}>\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n 'block size-full overflow-hidden rounded-full bg-background-muted text-foreground-muted',\n className,\n )}\n {...props}\n >\n {src && (\n <AvatarPrimitive.Image\n src={src}\n alt={alt ?? ''}\n className=\"aspect-square size-full object-cover\"\n />\n )}\n <AvatarPrimitive.Fallback\n delayMs={src ? 200 : 0}\n className=\"flex size-full items-center justify-center bg-background-muted font-medium uppercase\"\n >\n {fallback ?? '?'}\n </AvatarPrimitive.Fallback>\n </AvatarPrimitive.Root>\n {status && (\n <span\n aria-label={`Status: ${status}`}\n className={cn(\n 'absolute bottom-0 right-0 block size-[28%] rounded-full ring-2 ring-background',\n statusColour[status],\n )}\n />\n )}\n </span>\n );\n },\n);\nAvatar.displayName = 'Avatar';\n\nexport interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {\n /** Maximum visible avatars before showing a \"+N\" overflow chip. */\n max?: number;\n /** Avatar size applied to children + overflow. */\n size?: keyof typeof sizeMap;\n /** Children — Avatars. */\n children: ReactNode;\n}\n\n/**\n * Overlapping avatars with overflow indicator. Pass plain `<Avatar>` children.\n */\nexport const AvatarGroup = forwardRef<HTMLDivElement, AvatarGroupProps>(function AvatarGroup(\n { max = 4, size = 'md', className, children, ...props },\n ref,\n) {\n const items = Array.isArray(children) ? children : [children];\n const visible = items.slice(0, max);\n const overflow = items.length - visible.length;\n\n return (\n <div ref={ref} className={cn('flex items-center -space-x-2', className)} {...props}>\n {visible.map((child, i) => (\n <div key={i} className=\"ring-2 ring-background rounded-full\">\n {child}\n </div>\n ))}\n {overflow > 0 && (\n <div\n className={cn(\n 'inline-flex items-center justify-center rounded-full bg-background-muted text-foreground-muted ring-2 ring-background',\n sizeMap[size],\n 'font-medium',\n )}\n aria-label={`${overflow} more`}\n >\n +{overflow}\n </div>\n )}\n </div>\n );\n});\nAvatarGroup.displayName = 'AvatarGroup';\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst badge = cva(\n [\n 'inline-flex items-center gap-1 rounded-full px-2 py-0.5',\n 'text-xs font-medium whitespace-nowrap',\n ],\n {\n variants: {\n variant: {\n subtle: '',\n outline: 'border bg-transparent',\n },\n tone: {\n neutral: '',\n accent: '',\n success: '',\n warning: '',\n danger: '',\n info: '',\n },\n },\n compoundVariants: [\n // Subtle — coloured fill + matching text.\n { variant: 'subtle', tone: 'neutral', class: 'bg-background-muted text-foreground-muted' },\n { variant: 'subtle', tone: 'accent', class: 'bg-accent-soft text-on-accent-soft' },\n { variant: 'subtle', tone: 'success', class: 'bg-success-soft text-success-text' },\n { variant: 'subtle', tone: 'warning', class: 'bg-warning-soft text-warning-text' },\n { variant: 'subtle', tone: 'danger', class: 'bg-danger-soft text-danger-text' },\n { variant: 'subtle', tone: 'info', class: 'bg-info-soft text-info-text' },\n // Outline — coloured border + text, transparent fill.\n { variant: 'outline', tone: 'neutral', class: 'border-border text-foreground-muted' },\n { variant: 'outline', tone: 'accent', class: 'border-accent text-accent' },\n { variant: 'outline', tone: 'success', class: 'border-success-border-soft text-success-text' },\n { variant: 'outline', tone: 'warning', class: 'border-warning-border-soft text-warning-text' },\n { variant: 'outline', tone: 'danger', class: 'border-danger-border-soft text-danger-text' },\n { variant: 'outline', tone: 'info', class: 'border-info-border-soft text-info-text' },\n ],\n defaultVariants: { variant: 'subtle', tone: 'neutral' },\n },\n);\n\nexport interface BadgeProps\n extends HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof badge> {\n /** Show a leading status dot in the same tone. */\n dot?: boolean;\n}\n\nconst dotColour = {\n neutral: 'bg-foreground-subtle',\n accent: 'bg-accent',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-danger',\n info: 'bg-info',\n} as const;\n\n/**\n * Status pill. Use `subtle` for high-volume contexts (table cells, lists);\n * `outline` when the badge sits on a busy or coloured background.\n *\n * @example\n * <Badge tone=\"success\" dot>Active</Badge>\n * <Badge tone=\"danger\" variant=\"outline\">Failed</Badge>\n *\n * @do Use badges to summarise state, not to label categories — for taxonomies\n * pick a tone palette and stick with it.\n * @dont Use a badge as a button. Wrap it in a Button or use a Toggle.\n */\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { className, variant, tone = 'neutral', dot, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn(badge({ variant, tone }), className)} {...props}>\n {dot && (\n <span\n aria-hidden\n className={cn('inline-block size-1.5 rounded-full', dotColour[tone ?? 'neutral'])}\n />\n )}\n {children}\n </span>\n );\n});\nBadge.displayName = 'Badge';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { ChevronRight, MoreHorizontal } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface BreadcrumbItem {\n /** Visible label. */\n label: ReactNode;\n /** Optional URL. Last item is treated as current page even if href is set. */\n href?: string;\n}\n\nexport interface BreadcrumbsProps extends HTMLAttributes<HTMLElement> {\n items: BreadcrumbItem[];\n /** Collapse to first + ellipsis + last `n` when items.length exceeds this. */\n maxItems?: number;\n /** Custom link renderer (for next/link, react-router, etc.). */\n renderLink?: (href: string, children: ReactNode) => ReactNode;\n}\n\n/**\n * Breadcrumb trail. Collapses with an ellipsis when there are too many crumbs.\n *\n * @example\n * <Breadcrumbs items={[\n * { label: 'Projects', href: '/projects' },\n * { label: 'Nova', href: '/projects/nova' },\n * { label: 'Settings' },\n * ]} />\n *\n * @example With react-router\n * <Breadcrumbs items={trail} renderLink={(href, c) => <Link to={href}>{c}</Link>} />\n *\n * @do Always omit `href` on the last item — it represents the current page.\n * @dont Use Breadcrumbs for flat navigation. Use TopNav links instead.\n */\nexport const Breadcrumbs = forwardRef<HTMLElement, BreadcrumbsProps>(function Breadcrumbs(\n { items, maxItems = 4, renderLink, className, ...props },\n ref,\n) {\n const shouldCollapse = items.length > maxItems;\n const displayItems =\n !shouldCollapse\n ? items\n : [items[0], { collapsed: true } as const, ...items.slice(-2)];\n\n return (\n <nav ref={ref} aria-label=\"Breadcrumb\" className={cn('text-sm', className)} {...props}>\n <ol className=\"flex flex-wrap items-center gap-1.5 text-foreground-subtle\">\n {displayItems.map((it, i) => {\n const isLast = i === displayItems.length - 1;\n if ('collapsed' in it) {\n return (\n <li key={`ellipsis-${i}`} className=\"flex items-center gap-1.5\">\n <MoreHorizontal className=\"size-4\" aria-hidden />\n <ChevronRight className=\"size-3.5\" aria-hidden />\n </li>\n );\n }\n const item = it as BreadcrumbItem;\n const labelNode = isLast ? (\n <span aria-current=\"page\" className=\"font-medium text-foreground\">\n {item.label}\n </span>\n ) : item.href ? (\n renderLink ? (\n renderLink(item.href, item.label)\n ) : (\n <a\n href={item.href}\n className=\"hover:text-foreground transition-colors duration-[var(--duration-fast)] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm\"\n >\n {item.label}\n </a>\n )\n ) : (\n <span>{item.label}</span>\n );\n return (\n <li key={i} className=\"flex items-center gap-1.5\">\n {labelNode}\n {!isLast && <ChevronRight className=\"size-3.5\" aria-hidden />}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n});\nBreadcrumbs.displayName = 'Breadcrumbs';\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { Loader2 } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Variants — the entire visual surface of the Button.\n *\n * All sizes share the same border radius (md = 6px) per the refined-minimal\n * rules. Focus state is the standardised 2px-ring + 2px-offset on every\n * variant, including `link`.\n * --------------------------------------------------------------------------- */\nconst button = cva(\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'rounded-md text-sm font-medium',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'bg-accent text-on-accent',\n 'hover:bg-accent-700',\n 'active:bg-accent-800',\n ],\n secondary: [\n 'bg-background-muted text-foreground border border-border',\n 'hover:bg-neutral-200 dark:hover:bg-neutral-800',\n 'active:bg-neutral-300 dark:active:bg-neutral-700',\n ],\n outline: [\n 'border border-border bg-transparent text-foreground',\n 'hover:bg-background-muted',\n 'active:bg-background-subtle',\n ],\n ghost: [\n 'bg-transparent text-foreground',\n 'hover:bg-background-muted',\n 'active:bg-background-subtle',\n ],\n destructive: [\n 'bg-danger text-on-danger',\n 'hover:bg-danger-700',\n 'active:bg-danger-800',\n ],\n link: [\n 'bg-transparent text-accent underline-offset-4 px-0',\n 'hover:underline',\n 'active:text-accent-700',\n ],\n },\n size: {\n sm: 'h-8 px-3 text-xs [&_svg]:size-4',\n md: 'h-9 px-3.5 text-sm [&_svg]:size-4',\n lg: 'h-10 px-4 text-sm [&_svg]:size-5',\n icon: 'h-9 w-9 [&_svg]:size-4',\n },\n },\n compoundVariants: [\n // The `link` variant ignores horizontal padding from the size variant.\n { variant: 'link', size: 'sm', class: 'h-auto px-0' },\n { variant: 'link', size: 'md', class: 'h-auto px-0' },\n { variant: 'link', size: 'lg', class: 'h-auto px-0' },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n);\n\nexport interface ButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof button> {\n /**\n * Render as a different element via Radix Slot. Useful when wrapping a\n * link: `<Button asChild><a href=\"…\">…</a></Button>`.\n * @default false\n */\n asChild?: boolean;\n /**\n * Show a spinner in place of the leading icon and disable the button.\n * Use for async actions where the user must wait.\n * @default false\n */\n loading?: boolean;\n /** Icon rendered before the label. Replaced by a spinner when loading. */\n leadingIcon?: ReactNode;\n /** Icon rendered after the label. Hidden while loading. */\n trailingIcon?: ReactNode;\n}\n\n/**\n * Primary interactive element. Variants:\n *\n * - `primary` — accent fill, the single most prominent action on a screen.\n * - `secondary` — neutral fill, sits next to a primary or stands alone for\n * secondary actions.\n * - `outline` — border only, transparent fill. Use when next to a primary.\n * - `ghost` — no border, hover background. Use in dense toolbars and tables.\n * - `destructive` — danger fill, reserved for irreversible actions.\n * - `link` — text styled as a link.\n *\n * @example Two-button row\n * <div className=\"flex gap-2 justify-end\">\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Save changes</Button>\n * </div>\n *\n * @example Loading state\n * <Button loading leadingIcon={<Mail />}>Sending…</Button>\n *\n * @do Use one primary button per major surface. Verb-first labels.\n * @dont Stack three primary buttons in a row — only the most important\n * action gets the primary variant.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n leadingIcon,\n trailingIcon,\n disabled,\n children,\n type = 'button',\n ...props\n },\n ref,\n) {\n const isDisabled = disabled || loading;\n const classes = cn(button({ variant, size }), className);\n\n if (asChild) {\n // Slot requires exactly one element child — pass the consumer's element\n // through untouched. The consumer is responsible for any leading/trailing\n // icons inside that element.\n return (\n <Slot\n ref={ref}\n aria-busy={loading || undefined}\n data-loading={loading || undefined}\n className={classes}\n {...props}\n >\n {children}\n </Slot>\n );\n }\n\n return (\n <button\n ref={ref}\n type={type}\n aria-busy={loading || undefined}\n disabled={isDisabled}\n data-loading={loading || undefined}\n className={classes}\n {...props}\n >\n {loading ? (\n <Loader2 className=\"animate-spin\" aria-hidden=\"true\" />\n ) : (\n leadingIcon\n )}\n {children}\n {!loading && trailingIcon}\n </button>\n );\n});\n\nButton.displayName = 'Button';\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst card = cva(\n [\n 'rounded-lg border bg-card text-card-foreground',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n ],\n {\n variants: {\n variant: {\n default: 'border-border',\n interactive:\n 'border-border hover:border-border-strong hover:bg-background-subtle cursor-pointer',\n },\n padding: {\n none: '',\n sm: 'p-4',\n md: 'p-5',\n lg: 'p-6',\n },\n },\n defaultVariants: {\n variant: 'default',\n padding: 'md',\n },\n },\n);\n\nexport interface CardProps\n extends HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof card> {}\n\n/**\n * Bounded surface used to group related content. Per the refined-minimal\n * rules, cards on the page have a hairline border and no shadow.\n *\n * @example Header + content + footer\n * <Card>\n * <CardHeader>\n * <CardTitle>Storage</CardTitle>\n * <CardDescription>Usage across all projects.</CardDescription>\n * </CardHeader>\n * <CardContent>…</CardContent>\n * <CardFooter><Button>Upgrade</Button></CardFooter>\n * </Card>\n *\n * @example Clickable list row\n * <Card variant=\"interactive\" onClick={open}>…</Card>\n *\n * @do Use the `border` style. If a card needs to \"float\" (modal, dropdown),\n * it isn't a Card — it's a Popover/Dialog.\n * @dont Add `shadow-lg` to Cards. Shadows on inline surfaces violate the\n * refined-minimal direction.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n { className, variant, padding, ...props },\n ref,\n) {\n return <div ref={ref} className={cn(card({ variant, padding }), className)} {...props} />;\n});\nCard.displayName = 'Card';\n\nexport const CardHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CardHeader({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn('flex flex-col gap-1 pb-4', className)}\n {...props}\n />\n );\n },\n);\nCardHeader.displayName = 'CardHeader';\n\nexport const CardTitle = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingElement>>(\n function CardTitle({ className, ...props }, ref) {\n return (\n <h3\n ref={ref}\n className={cn('text-base font-semibold text-foreground leading-tight', className)}\n {...props}\n />\n );\n },\n);\nCardTitle.displayName = 'CardTitle';\n\nexport const CardDescription = forwardRef<\n HTMLParagraphElement,\n HTMLAttributes<HTMLParagraphElement>\n>(function CardDescription({ className, ...props }, ref) {\n return (\n <p\n ref={ref}\n className={cn('text-sm text-foreground-muted', className)}\n {...props}\n />\n );\n});\nCardDescription.displayName = 'CardDescription';\n\nexport const CardContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CardContent({ className, ...props }, ref) {\n return <div ref={ref} className={cn('text-sm text-foreground', className)} {...props} />;\n },\n);\nCardContent.displayName = 'CardContent';\n\nexport const CardFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CardFooter({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn('flex items-center gap-2 pt-4', className)}\n {...props}\n />\n );\n },\n);\nCardFooter.displayName = 'CardFooter';\n","import { forwardRef, useId, type ComponentPropsWithoutRef, type ElementRef, type ReactNode } from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Check, Minus } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface CheckboxProps\n extends Omit<ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'asChild'> {\n /** Visible label rendered to the right of the box. */\n label?: ReactNode;\n /** Secondary description rendered below the label. */\n description?: ReactNode;\n /** Validation error message. */\n error?: ReactNode;\n /** Hide the label visually while keeping it in the a11y tree. */\n hideLabel?: boolean;\n}\n\n/**\n * Checkbox with optional inline label + description. Pass `checked=\"indeterminate\"`\n * for the indeterminate state — Radix renders a `Minus` icon automatically.\n *\n * @example Single\n * <Checkbox label=\"I agree to the terms\" checked={ok} onCheckedChange={setOk} />\n *\n * @example Tri-state header\n * <Checkbox aria-label=\"Select all\"\n * checked={allSelected ? true : someSelected ? 'indeterminate' : false}\n * onCheckedChange={toggleAll} />\n *\n * @do Use indeterminate to summarise child rows in a table header.\n * @dont Use a Checkbox for mutually exclusive choices — use RadioGroup.\n */\nexport const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n function Checkbox({ className, label, description, error, hideLabel, id, disabled, ...props }, ref) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const descId = description ? `${fieldId}-desc` : undefined;\n const errorId = error ? `${fieldId}-error` : undefined;\n\n return (\n <div className={cn('flex flex-col gap-1', className)}>\n <div className=\"flex items-start gap-2.5\">\n <CheckboxPrimitive.Root\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={errorId ?? descId}\n aria-invalid={Boolean(error) || undefined}\n className={cn(\n 'peer mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-sm border',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'data-[state=checked]:bg-accent data-[state=checked]:border-accent data-[state=checked]:text-on-accent',\n 'data-[state=indeterminate]:bg-accent data-[state=indeterminate]:border-accent data-[state=indeterminate]:text-on-accent',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n error ? 'border-danger' : 'border-border-strong',\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center\">\n {props.checked === 'indeterminate' ? (\n <Minus className=\"size-3\" aria-hidden strokeWidth={3} />\n ) : (\n <Check className=\"size-3\" aria-hidden strokeWidth={3} />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n\n {label && (\n <div className={cn('flex flex-col gap-0.5', hideLabel && 'sr-only')}>\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm text-foreground select-none',\n disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n {label}\n </label>\n {description && (\n <p id={descId} className=\"text-xs text-foreground-subtle\">\n {description}\n </p>\n )}\n </div>\n )}\n </div>\n {error && (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n )}\n </div>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n type ReactNode,\n} from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Check, ChevronsUpDown, Loader2, X } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface ComboboxOption {\n value: string;\n label: string;\n description?: string;\n disabled?: boolean;\n}\n\nexport interface ComboboxProps {\n /** Currently selected value (controlled). */\n value: string | null;\n /** Called when a value is picked or cleared. */\n onChange: (value: string | null) => void;\n /** Static options. Ignored if `loadOptions` is provided. */\n options?: ComboboxOption[];\n /**\n * Async loader called with the current query each time it changes.\n * Use for server-side search.\n */\n loadOptions?: (query: string) => Promise<ComboboxOption[]>;\n /** Visible label above the field. */\n label?: ReactNode;\n /** Hint below the field. Hidden when `error` is set. */\n helperText?: ReactNode;\n /** Validation error. */\n error?: ReactNode;\n /** Placeholder shown when no value is selected. */\n placeholder?: string;\n /** Search placeholder inside the popover. */\n searchPlaceholder?: string;\n /** Empty state copy when nothing matches. */\n emptyText?: string;\n /** Allow clearing the selection with an inline ×. */\n clearable?: boolean;\n /** Disable the entire field. */\n disabled?: boolean;\n /** Field size, matches Input. */\n size?: 'sm' | 'md' | 'lg';\n className?: string;\n}\n\n/**\n * Single-select with typeahead. Use `options` for client-side filtering or\n * `loadOptions` for server-side search.\n *\n * @example Client-side\n * <Combobox label=\"Country\" options={countries} value={c} onChange={setC} />\n *\n * @example Server-side\n * <Combobox label=\"Assignee\"\n * value={user}\n * onChange={setUser}\n * loadOptions={async (q) => api.searchUsers(q)} />\n *\n * @do Use Combobox over Select for >12 options or when the user is expected\n * to know what they want.\n * @dont Re-query on every keystroke without debouncing — pass a debounced\n * `loadOptions` to avoid hammering the server.\n */\nexport const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(function Combobox(\n {\n value,\n onChange,\n options,\n loadOptions,\n label,\n helperText,\n error,\n placeholder = 'Select…',\n searchPlaceholder = 'Search…',\n emptyText = 'No results.',\n clearable = true,\n disabled,\n size = 'md',\n className,\n },\n ref,\n) {\n const autoId = useId();\n const helperId = `${autoId}-helper`;\n const errorId = `${autoId}-error`;\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const [loaded, setLoaded] = useState<ComboboxOption[]>([]);\n const [loading, setLoading] = useState(false);\n\n // Resolve options: static or async-loaded.\n const items = loadOptions ? loaded : options ?? [];\n\n useEffect(() => {\n if (!loadOptions || !open) return;\n let cancelled = false;\n setLoading(true);\n loadOptions(query)\n .then((res) => {\n if (!cancelled) setLoaded(res);\n })\n .finally(() => {\n if (!cancelled) setLoading(false);\n });\n return () => {\n cancelled = true;\n };\n }, [query, open, loadOptions]);\n\n const selected = useMemo(\n () => items.find((o) => o.value === value) ?? null,\n [items, value],\n );\n\n const triggerHeight = size === 'sm' ? 'h-8' : size === 'lg' ? 'h-10' : 'h-9';\n const triggerPadding = size === 'sm' ? 'px-2.5' : size === 'lg' ? 'px-3.5' : 'px-3';\n\n const handleClear = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n onChange(null);\n },\n [onChange],\n );\n\n const isError = Boolean(error);\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label htmlFor={autoId} className=\"text-sm font-medium text-foreground\">\n {label}\n </label>\n )}\n\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n <button\n id={autoId}\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-invalid={isError || undefined}\n aria-describedby={isError ? errorId : helperText ? helperId : undefined}\n disabled={disabled}\n className={cn(\n 'inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-sm text-foreground',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n triggerHeight,\n triggerPadding,\n isError\n ? 'border-danger focus-visible:border-danger focus-visible:ring-danger'\n : 'border-border focus-visible:border-accent focus-visible:ring-ring',\n )}\n >\n <span className={cn('truncate', !selected && 'text-foreground-subtle')}>\n {selected ? selected.label : placeholder}\n </span>\n <span className=\"ml-2 flex items-center gap-1 shrink-0\">\n {clearable && selected && !disabled && (\n <span\n role=\"button\"\n tabIndex={-1}\n onClick={handleClear}\n aria-label=\"Clear selection\"\n className=\"text-foreground-subtle hover:text-foreground\"\n >\n <X className=\"size-4\" aria-hidden />\n </span>\n )}\n <ChevronsUpDown className=\"size-4 text-foreground-subtle\" aria-hidden />\n </span>\n </button>\n </PopoverPrimitive.Trigger>\n\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={4}\n className={cn(\n 'z-[var(--z-popover)] w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md',\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 )}\n >\n <CommandPrimitive shouldFilter={!loadOptions} className=\"flex h-full w-full flex-col\">\n <div className=\"flex items-center border-b border-border px-3\">\n <CommandPrimitive.Input\n value={query}\n onValueChange={setQuery}\n placeholder={searchPlaceholder}\n className=\"flex h-9 w-full bg-transparent py-2 text-sm outline-none placeholder:text-foreground-subtle\"\n />\n {loading && (\n <Loader2 className=\"size-4 animate-spin text-foreground-subtle\" aria-hidden />\n )}\n </div>\n <CommandPrimitive.List className=\"max-h-64 overflow-y-auto p-1\">\n {items.map((opt) => {\n const isSelected = opt.value === value;\n return (\n <CommandPrimitive.Item\n key={opt.value}\n value={opt.value}\n disabled={opt.disabled}\n onSelect={(v) => {\n onChange(v);\n setOpen(false);\n }}\n className={cn(\n 'flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground',\n 'data-[selected=true]:bg-background-muted',\n 'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none',\n )}\n >\n <span className=\"flex-1\">{opt.label}</span>\n {opt.description && (\n <span className=\"text-xs text-foreground-subtle\">{opt.description}</span>\n )}\n {isSelected && <Check className=\"size-4 text-accent\" aria-hidden />}\n </CommandPrimitive.Item>\n );\n })}\n {!loading && items.length === 0 && (\n <CommandPrimitive.Empty className=\"px-2 py-6 text-center text-sm text-foreground-subtle\">\n {emptyText}\n </CommandPrimitive.Empty>\n )}\n </CommandPrimitive.List>\n </CommandPrimitive>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n\n {error ? (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-xs text-foreground-subtle\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nCombobox.displayName = 'Combobox';\n","import {\n forwardRef,\n useEffect,\n useState,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Search } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * CommandPalette is a Dialog hosting a `cmdk` Command. It supports grouped\n * items, keyboard navigation (handled by cmdk), an empty state, and a\n * pluggable list of \"recent\" items shown when the search input is empty.\n * --------------------------------------------------------------------------- */\n\nexport const Command = forwardRef<\n ElementRef<typeof CommandPrimitive>,\n ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(function Command({ className, ...props }, ref) {\n return (\n <CommandPrimitive\n ref={ref}\n className={cn(\n 'flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground',\n className,\n )}\n {...props}\n />\n );\n});\nCommand.displayName = 'Command';\n\nexport const CommandInput = forwardRef<\n ElementRef<typeof CommandPrimitive.Input>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(function CommandInput({ className, ...props }, ref) {\n return (\n <div className=\"flex items-center gap-2 border-b border-border px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"size-4 shrink-0 text-foreground-subtle\" aria-hidden />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full bg-transparent py-3 text-sm outline-none',\n 'placeholder:text-foreground-subtle disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n );\n});\nCommandInput.displayName = 'CommandInput';\n\nexport const CommandList = forwardRef<\n ElementRef<typeof CommandPrimitive.List>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(function CommandList({ className, ...props }, ref) {\n return (\n <CommandPrimitive.List\n ref={ref}\n className={cn('max-h-[320px] overflow-y-auto p-1', className)}\n {...props}\n />\n );\n});\nCommandList.displayName = 'CommandList';\n\nexport const CommandEmpty = forwardRef<\n ElementRef<typeof CommandPrimitive.Empty>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>(function CommandEmpty(props, ref) {\n return (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-8 text-center text-sm text-foreground-subtle\"\n {...props}\n />\n );\n});\nCommandEmpty.displayName = 'CommandEmpty';\n\nexport const CommandGroup = forwardRef<\n ElementRef<typeof CommandPrimitive.Group>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(function CommandGroup({ className, ...props }, ref) {\n return (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden text-foreground p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5',\n '[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',\n '[&_[cmdk-group-heading]]:text-foreground-subtle',\n className,\n )}\n {...props}\n />\n );\n});\nCommandGroup.displayName = 'CommandGroup';\n\nexport const CommandSeparator = forwardRef<\n ElementRef<typeof CommandPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(function CommandSeparator({ className, ...props }, ref) {\n return (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\nCommandSeparator.displayName = 'CommandSeparator';\n\nexport const CommandItem = forwardRef<\n ElementRef<typeof CommandPrimitive.Item>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(function CommandItem({ className, ...props }, ref) {\n return (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none',\n 'data-[selected=true]:bg-background-muted data-[selected=true]:text-foreground',\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n '[&_svg]:size-4 [&_svg]:text-foreground-subtle',\n className,\n )}\n {...props}\n />\n );\n});\nCommandItem.displayName = 'CommandItem';\n\nexport function CommandShortcut({ children, className }: { children: ReactNode; className?: string }) {\n return (\n <span\n className={cn(\n 'ml-auto inline-flex items-center gap-0.5 text-xs tracking-widest text-foreground-subtle font-mono',\n className,\n )}\n >\n {children}\n </span>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Dialog wrapper — a ready-to-use ⌘K palette.\n * --------------------------------------------------------------------------- */\n\nexport interface CommandDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n children: ReactNode;\n /** Visible label for screen readers. */\n title?: string;\n}\n\nexport function CommandDialog({ open, onOpenChange, children, title = 'Command palette' }: CommandDialogProps) {\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n )}\n />\n <DialogPrimitive.Content\n className={cn(\n 'fixed left-1/2 top-[20%] z-[var(--z-modal)] -translate-x-1/2',\n 'w-[calc(100%-2rem)] max-w-[640px] overflow-hidden',\n 'rounded-lg border border-border bg-popover text-popover-foreground shadow-lg',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n 'data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95',\n )}\n >\n <DialogPrimitive.Title className=\"sr-only\">{title}</DialogPrimitive.Title>\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n}\n\n/**\n * Hook that wires ⌘K / Ctrl+K to a setter — the canonical way to mount the\n * palette in an app shell.\n *\n * @example\n * const [open, setOpen] = useState(false);\n * useCommandPaletteShortcut(setOpen);\n * …\n * <CommandDialog open={open} onOpenChange={setOpen}>\n * <CommandInput placeholder=\"Type a command…\" />\n * <CommandList>\n * <CommandEmpty>No results.</CommandEmpty>\n * <CommandGroup heading=\"Suggestions\">\n * <CommandItem>Create project</CommandItem>\n * <CommandItem>Invite teammate</CommandItem>\n * </CommandGroup>\n * </CommandList>\n * </CommandDialog>\n *\n * @do Group items by category. Show \"Recent\" first when the query is empty.\n * @dont Hide essential actions behind the palette only — keep at least one\n * button entry in the UI.\n */\nexport function useCommandPaletteShortcut(setOpen: (open: boolean) => void): void {\n const [_, force] = useState(0);\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'k' && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n setOpen(true);\n force((n) => n + 1);\n }\n };\n window.addEventListener('keydown', onKey);\n return () => window.removeEventListener('keydown', onKey);\n }, [setOpen]);\n}\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n} from 'react';\nimport * as ContextMenuPrimitive from '@radix-ui/react-context-menu';\nimport { Check, ChevronRight, Circle } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/**\n * Right-click (or two-finger tap) menu. Visual surface mirrors DropdownMenu\n * for consistency.\n *\n * @example\n * <ContextMenu>\n * <ContextMenuTrigger asChild>\n * <div className=\"grid h-32 place-items-center rounded-lg border border-border\">\n * Right-click me\n * </div>\n * </ContextMenuTrigger>\n * <ContextMenuContent>\n * <ContextMenuItem>Open</ContextMenuItem>\n * <ContextMenuSeparator />\n * <ContextMenuItem destructive>Delete</ContextMenuItem>\n * </ContextMenuContent>\n * </ContextMenu>\n *\n * @do Mirror DropdownMenu items for the same surface — users expect the same\n * operations from both.\n * @dont Hide critical actions behind right-click — they must also exist in\n * a visible button or menu.\n */\nexport const ContextMenu = ContextMenuPrimitive.Root;\nexport const ContextMenuTrigger = ContextMenuPrimitive.Trigger;\nexport const ContextMenuGroup = ContextMenuPrimitive.Group;\nexport const ContextMenuPortal = ContextMenuPrimitive.Portal;\nexport const ContextMenuSub = ContextMenuPrimitive.Sub;\nexport const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst itemClasses = cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none',\n 'data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n);\n\nexport const ContextMenuSubTrigger = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger>\n>(function ContextMenuSubTrigger({ className, children, ...props }, ref) {\n return (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(itemClasses, 'data-[state=open]:bg-background-muted', className)}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto size-4 text-foreground-subtle\" aria-hidden />\n </ContextMenuPrimitive.SubTrigger>\n );\n});\nContextMenuSubTrigger.displayName = 'ContextMenuSubTrigger';\n\nexport const ContextMenuSubContent = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.SubContent>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(function ContextMenuSubContent({ className, ...props }, ref) {\n return (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-[var(--z-popover)] min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md',\n className,\n )}\n {...props}\n />\n );\n});\nContextMenuSubContent.displayName = 'ContextMenuSubContent';\n\nexport const ContextMenuContent = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.Content>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(function ContextMenuContent({ className, ...props }, ref) {\n return (\n <ContextMenuPortal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n 'z-[var(--z-popover)] min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md',\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 </ContextMenuPortal>\n );\n});\nContextMenuContent.displayName = 'ContextMenuContent';\n\nexport const ContextMenuItem = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.Item>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & { destructive?: boolean }\n>(function ContextMenuItem({ className, destructive, ...props }, ref) {\n return (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n itemClasses,\n destructive &&\n 'text-danger-text data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger-text',\n className,\n )}\n {...props}\n />\n );\n});\nContextMenuItem.displayName = 'ContextMenuItem';\n\nexport const ContextMenuCheckboxItem = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(function ContextMenuCheckboxItem({ className, children, ...props }, ref) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Check className=\"size-4 text-accent\" aria-hidden />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n});\nContextMenuCheckboxItem.displayName = 'ContextMenuCheckboxItem';\n\nexport const ContextMenuRadioItem = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(function ContextMenuRadioItem({ className, children, ...props }, ref) {\n return (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Circle className=\"size-2 fill-accent text-accent\" aria-hidden />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n});\nContextMenuRadioItem.displayName = 'ContextMenuRadioItem';\n\nexport const ContextMenuLabel = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.Label>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label>\n>(function ContextMenuLabel({ className, ...props }, ref) {\n return (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-xs font-medium text-foreground-subtle', className)}\n {...props}\n />\n );\n});\nContextMenuLabel.displayName = 'ContextMenuLabel';\n\nexport const ContextMenuSeparator = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(function ContextMenuSeparator({ className, ...props }, ref) {\n return (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\nContextMenuSeparator.displayName = 'ContextMenuSeparator';\n\nexport function ContextMenuShortcut({ className, ...props }: HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest text-foreground-subtle font-mono', className)}\n {...props}\n />\n );\n}\nContextMenuShortcut.displayName = 'ContextMenuShortcut';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n} from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Full dropdown menu surface with submenu support, separators, checkbox /\n * radio items, and keyboard shortcut labels (Kbd).\n * --------------------------------------------------------------------------- */\n\nexport const DropdownMenu = DropdownMenuPrimitive.Root;\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nexport const DropdownMenuGroup = DropdownMenuPrimitive.Group;\nexport const DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\nexport const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst itemClasses = cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none',\n 'data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n 'transition-colors duration-[var(--duration-fast)]',\n);\n\nexport const DropdownMenuSubTrigger = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(function DropdownMenuSubTrigger({ className, inset, children, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(itemClasses, 'data-[state=open]:bg-background-muted', inset && 'pl-8', className)}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto size-4 text-foreground-subtle\" aria-hidden />\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\nexport const DropdownMenuSubContent = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(function DropdownMenuSubContent({ className, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-[var(--z-popover)] min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md',\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 className,\n )}\n {...props}\n />\n );\n});\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\nexport const DropdownMenuContent = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Content>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(function DropdownMenuContent({ className, sideOffset = 4, align = 'end', ...props }, ref) {\n return (\n <DropdownMenuPortal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n align={align}\n className={cn(\n 'z-[var(--z-popover)] min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md',\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-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1',\n className,\n )}\n {...props}\n />\n </DropdownMenuPortal>\n );\n});\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\nexport const DropdownMenuItem = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Item>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n destructive?: boolean;\n }\n>(function DropdownMenuItem({ className, inset, destructive, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n itemClasses,\n inset && 'pl-8',\n destructive &&\n 'text-danger-text data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger-text',\n className,\n )}\n {...props}\n />\n );\n});\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(function DropdownMenuCheckboxItem({ className, children, checked, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n checked={checked}\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"size-4 text-accent\" aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n\nexport const DropdownMenuRadioItem = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(function DropdownMenuRadioItem({ className, children, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"size-2 fill-accent text-accent\" aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n\nexport const DropdownMenuLabel = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Label>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(function DropdownMenuLabel({ className, inset, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-xs font-medium text-foreground-subtle',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n );\n});\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n\nexport const DropdownMenuSeparator = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(function DropdownMenuSeparator({ className, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\n/**\n * Trailing right-aligned shortcut label inside a menu item. Pair with `<Kbd>`\n * inside the Kbd component file if you want stylised keys.\n */\nexport function DropdownMenuShortcut({ className, ...props }: HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest text-foreground-subtle font-mono', className)}\n {...props}\n />\n );\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\n/**\n * @example\n * <DropdownMenu>\n * <DropdownMenuTrigger asChild><IconButton aria-label=\"More\" icon={<MoreHorizontal />} /></DropdownMenuTrigger>\n * <DropdownMenuContent>\n * <DropdownMenuItem>Open<DropdownMenuShortcut>⌘O</DropdownMenuShortcut></DropdownMenuItem>\n * <DropdownMenuItem>Rename</DropdownMenuItem>\n * <DropdownMenuSeparator />\n * <DropdownMenuItem destructive>Delete</DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n *\n * @do Group destructive items at the bottom with a separator.\n * @dont Mix link navigation and action items in the same menu — split into\n * two menus or two groups with labels.\n */\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport { Loader2 } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst iconButton = cva(\n [\n 'inline-flex items-center justify-center shrink-0',\n 'rounded-md',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&_svg]:pointer-events-none',\n ],\n {\n variants: {\n variant: {\n primary: 'bg-accent text-on-accent hover:bg-accent-700 active:bg-accent-800',\n secondary:\n 'bg-background-muted text-foreground border border-border hover:bg-neutral-200 dark:hover:bg-neutral-800',\n outline:\n 'border border-border bg-transparent text-foreground hover:bg-background-muted',\n ghost: 'bg-transparent text-foreground-muted hover:bg-background-muted hover:text-foreground',\n destructive: 'bg-danger text-on-danger hover:bg-danger-700 active:bg-danger-800',\n },\n size: {\n sm: 'h-7 w-7 [&_svg]:size-3.5',\n md: 'h-8 w-8 [&_svg]:size-4',\n lg: 'h-10 w-10 [&_svg]:size-5',\n },\n },\n defaultVariants: {\n variant: 'ghost',\n size: 'md',\n },\n },\n);\n\nexport interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButton> {\n /**\n * Accessible label for screen readers. **Required** — an icon-only button\n * with no label is invisible to assistive tech.\n */\n 'aria-label': string;\n /** The Lucide icon to render. */\n icon: ReactNode;\n /** Show a spinner instead of the icon. */\n loading?: boolean;\n}\n\n/**\n * Square, icon-only button. Default variant is `ghost` because most\n * IconButtons sit in dense toolbars or tables. Always pass `aria-label`.\n *\n * @example Toolbar action\n * <IconButton aria-label=\"Edit row\" icon={<Edit2 />} onClick={onEdit} />\n *\n * @example Dismissible chip\n * <IconButton aria-label=\"Remove tag\" size=\"sm\" icon={<X />} />\n *\n * @do Use `ghost` for in-row actions; `outline` when next to a label-less\n * primary button you want users to consider as an alternative.\n * @dont Use IconButton when the action's meaning isn't universally\n * recognised. If users need to learn the icon, ship a Button with text.\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { className, variant, size, icon, loading, disabled, type = 'button', ...props },\n ref,\n) {\n const isDisabled = disabled || loading;\n return (\n <button\n ref={ref}\n type={type}\n aria-busy={loading || undefined}\n disabled={isDisabled}\n className={cn(iconButton({ variant, size }), className)}\n {...props}\n >\n {loading ? <Loader2 className=\"animate-spin\" aria-hidden=\"true\" /> : icon}\n </button>\n );\n});\n\nIconButton.displayName = 'IconButton';\n","import {\n forwardRef,\n useId,\n useState,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { Eye, EyeOff, Search, X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Field-shell variants. The inner <input> is unstyled background and gets all\n * its visual treatment from this wrapper so prefix / suffix / clear slots\n * share the same border + focus state with no double rings.\n * --------------------------------------------------------------------------- */\nconst field = cva(\n [\n 'group inline-flex items-center w-full',\n 'rounded-md border bg-card text-sm',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'has-disabled:opacity-50 has-disabled:pointer-events-none',\n 'focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-background',\n ],\n {\n variants: {\n size: {\n sm: 'h-8 px-2.5 gap-1.5',\n md: 'h-9 px-3 gap-2',\n lg: 'h-10 px-3.5 gap-2',\n },\n tone: {\n default: 'border-border focus-within:border-accent focus-within:ring-ring',\n error: 'border-danger focus-within:border-danger focus-within:ring-danger',\n },\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst innerInput = cva([\n 'flex-1 min-w-0 bg-transparent outline-none',\n 'placeholder:text-foreground-subtle',\n 'text-foreground',\n 'disabled:cursor-not-allowed',\n]);\n\ntype InputType = 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url';\n\nexport interface InputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'>,\n VariantProps<typeof field> {\n /** Field type. `password` enables a show/hide toggle; `search` adds a clear button. */\n type?: InputType;\n /** Visible label rendered above the input. */\n label?: ReactNode;\n /** Hint below the input. Hidden while `error` is set. */\n helperText?: ReactNode;\n /** Validation message. Renders in `danger` colour and sets `aria-invalid`. */\n error?: ReactNode;\n /** Content rendered inside the field, before the input — icon or short text. */\n prefix?: ReactNode;\n /** Content rendered inside the field, after the input. */\n suffix?: ReactNode;\n /** Show an inline clear (×) button when the input has a value. */\n clearable?: boolean;\n /** Fires when the clear button is pressed. The consumer owns the state. */\n onClear?: () => void;\n /** Visually conceal the label while keeping it for screen readers. */\n hideLabel?: boolean;\n}\n\n/**\n * Text-style input with optional label, helper / error, prefix / suffix,\n * clear, and password show-hide. Wraps a single native `<input>` so it works\n * with `react-hook-form` and any controlled / uncontrolled pattern.\n *\n * @example Email with helper\n * <Input type=\"email\" label=\"Work email\" helperText=\"We never share this.\" />\n *\n * @example Password with show/hide\n * <Input type=\"password\" label=\"Password\" autoComplete=\"current-password\" />\n *\n * @example Search with clear\n * <Input type=\"search\" placeholder=\"Search…\" value={q} onChange={…}\n * clearable onClear={() => setQ('')} />\n *\n * @do Always pair an input with a visible label. If space forces hiding it,\n * use `hideLabel` so the label stays in the accessibility tree.\n * @dont Use placeholder as the only label — placeholders disappear on input\n * and fail accessibility.\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n className,\n type = 'text',\n size,\n tone,\n label,\n helperText,\n error,\n prefix,\n suffix,\n clearable,\n onClear,\n hideLabel,\n id,\n disabled,\n value,\n ...props\n },\n ref,\n) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const helperId = `${fieldId}-helper`;\n const errorId = `${fieldId}-error`;\n\n const [showPassword, setShowPassword] = useState(false);\n const effectiveType =\n type === 'password' ? (showPassword ? 'text' : 'password') : type;\n\n const isError = Boolean(error);\n const effectiveTone = isError ? 'error' : tone;\n\n // Pre-fill prefix slot for search type.\n const renderedPrefix =\n prefix ?? (type === 'search' ? <Search className=\"size-4 text-foreground-subtle\" aria-hidden /> : null);\n\n const hasValue = value !== undefined && value !== '' && value !== null;\n\n return (\n <div className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm font-medium text-foreground',\n hideLabel && 'sr-only',\n )}\n >\n {label}\n </label>\n )}\n\n <div className={cn(field({ size, tone: effectiveTone }))}>\n {renderedPrefix && (\n <span className=\"flex items-center text-foreground-subtle [&_svg]:size-4\">\n {renderedPrefix}\n </span>\n )}\n\n <input\n ref={ref}\n id={fieldId}\n type={effectiveType}\n disabled={disabled}\n value={value}\n aria-invalid={isError || undefined}\n aria-describedby={\n error ? errorId : helperText ? helperId : undefined\n }\n className={cn(innerInput())}\n {...props}\n />\n\n {clearable && hasValue && (\n <button\n type=\"button\"\n onClick={onClear}\n tabIndex={-1}\n aria-label=\"Clear input\"\n className=\"flex items-center text-foreground-subtle hover:text-foreground\"\n >\n <X className=\"size-4\" aria-hidden />\n </button>\n )}\n\n {type === 'password' && (\n <button\n type=\"button\"\n onClick={() => setShowPassword((p) => !p)}\n tabIndex={-1}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n aria-pressed={showPassword}\n className=\"flex items-center text-foreground-subtle hover:text-foreground\"\n >\n {showPassword ? (\n <EyeOff className=\"size-4\" aria-hidden />\n ) : (\n <Eye className=\"size-4\" aria-hidden />\n )}\n </button>\n )}\n\n {suffix && (\n <span className=\"flex items-center text-foreground-subtle [&_svg]:size-4\">\n {suffix}\n </span>\n )}\n </div>\n\n {error ? (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-xs text-foreground-subtle\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nInput.displayName = 'Input';\n","import { forwardRef, type HTMLAttributes, type ThHTMLAttributes, type TdHTMLAttributes } from 'react';\nimport { ArrowDown, ArrowUp, ArrowUpDown } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Table primitives — minimal sugar over <table>. Pair with a sortable\n * header helper (`TableSortHeader`) when you need built-in sort visuals.\n * Empty + loading states are pure composition with the rest of the system.\n * --------------------------------------------------------------------------- */\n\nexport const Table = forwardRef<HTMLTableElement, HTMLAttributes<HTMLTableElement>>(\n function Table({ className, ...props }, ref) {\n return (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn('w-full caption-bottom text-sm border-collapse', className)}\n {...props}\n />\n </div>\n );\n },\n);\nTable.displayName = 'Table';\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableHeader({ className, ...props }, ref) {\n return (\n <thead\n ref={ref}\n className={cn(\n 'sticky top-0 z-10 bg-background-subtle text-foreground-muted',\n '[&_tr]:border-b [&_tr]:border-border',\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableHeader.displayName = 'TableHeader';\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableBody({ className, ...props }, ref) {\n return (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n );\n },\n);\nTableBody.displayName = 'TableBody';\n\nexport const TableFooter = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableFooter({ className, ...props }, ref) {\n return (\n <tfoot\n ref={ref}\n className={cn('border-t border-border bg-background-subtle font-medium', className)}\n {...props}\n />\n );\n },\n);\nTableFooter.displayName = 'TableFooter';\n\nexport const TableRow = forwardRef<\n HTMLTableRowElement,\n HTMLAttributes<HTMLTableRowElement> & { selected?: boolean }\n>(function TableRow({ className, selected, ...props }, ref) {\n return (\n <tr\n ref={ref}\n data-selected={selected || undefined}\n className={cn(\n 'border-b border-border transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-subtle',\n 'data-[selected]:bg-accent-soft data-[selected]:hover:bg-accent-soft',\n className,\n )}\n {...props}\n />\n );\n});\nTableRow.displayName = 'TableRow';\n\nexport const TableHead = forwardRef<\n HTMLTableCellElement,\n ThHTMLAttributes<HTMLTableCellElement>\n>(function TableHead({ className, ...props }, ref) {\n return (\n <th\n ref={ref}\n className={cn(\n 'h-10 px-3 text-left align-middle text-xs font-medium uppercase tracking-wide text-foreground-subtle',\n '[&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0',\n className,\n )}\n {...props}\n />\n );\n});\nTableHead.displayName = 'TableHead';\n\nexport const TableCell = forwardRef<\n HTMLTableCellElement,\n TdHTMLAttributes<HTMLTableCellElement>\n>(function TableCell({ className, ...props }, ref) {\n return (\n <td\n ref={ref}\n className={cn('px-3 py-3 align-middle text-foreground', className)}\n {...props}\n />\n );\n});\nTableCell.displayName = 'TableCell';\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, HTMLAttributes<HTMLTableCaptionElement>>(\n function TableCaption({ className, ...props }, ref) {\n return (\n <caption\n ref={ref}\n className={cn('mt-4 text-sm text-foreground-subtle', className)}\n {...props}\n />\n );\n },\n);\nTableCaption.displayName = 'TableCaption';\n\nexport interface TableSortHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {\n /** Stable column key used in `currentSort.key`. */\n sortKey: string;\n /** Currently sorted column + direction (or null). */\n currentSort: { key: string; direction: 'asc' | 'desc' } | null;\n /** Called when the user clicks the header. */\n onSortChange: (key: string, direction: 'asc' | 'desc') => void;\n}\n\n/**\n * Sortable column header. Click toggles asc → desc → asc; the icon reflects\n * the current state.\n *\n * @example\n * <TableSortHeader sortKey=\"name\" currentSort={sort} onSortChange={onSort}>\n * Name\n * </TableSortHeader>\n *\n * @do Sort by one column at a time. Multi-sort hides state from users.\n * @dont Sort silently — the icon must change so users see what changed.\n */\nexport const TableSortHeader = forwardRef<HTMLTableCellElement, TableSortHeaderProps>(\n function TableSortHeader(\n { sortKey, currentSort, onSortChange, children, className, ...props },\n ref,\n ) {\n const active = currentSort?.key === sortKey;\n const direction = active ? currentSort?.direction : undefined;\n const handle = () => {\n onSortChange(sortKey, active && direction === 'asc' ? 'desc' : 'asc');\n };\n return (\n <TableHead ref={ref} className={cn('p-0', className)} aria-sort={active ? (direction === 'asc' ? 'ascending' : 'descending') : 'none'} {...props}>\n <button\n type=\"button\"\n onClick={handle}\n className={cn(\n 'inline-flex h-10 w-full items-center gap-1.5 px-3 outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:text-foreground focus-visible:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm',\n active && 'text-foreground',\n )}\n >\n {children}\n {direction === 'asc' ? (\n <ArrowUp className=\"size-3.5\" aria-hidden />\n ) : direction === 'desc' ? (\n <ArrowDown className=\"size-3.5\" aria-hidden />\n ) : (\n <ArrowUpDown className=\"size-3.5 opacity-40\" aria-hidden />\n )}\n </button>\n </TableHead>\n );\n },\n);\nTableSortHeader.displayName = 'TableSortHeader';\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n /** Predefined silhouette presets. */\n variant?: 'text' | 'circle' | 'card' | 'avatar';\n}\n\n/**\n * Animated placeholder. Use `Skeleton.Text` / `Skeleton.Avatar` for common\n * shapes; pass `className` directly for one-off sizes.\n *\n * @example List item\n * <div className=\"flex items-center gap-3\">\n * <Skeleton variant=\"avatar\" />\n * <div className=\"space-y-1.5 flex-1\">\n * <Skeleton variant=\"text\" className=\"w-1/3\" />\n * <Skeleton variant=\"text\" className=\"w-1/2\" />\n * </div>\n * </div>\n *\n * @example Card\n * <Skeleton variant=\"card\" className=\"h-32\" />\n *\n * @do Match the silhouette of the eventual content so the layout doesn't\n * shift when data arrives.\n * @dont Show a full-page skeleton for sub-300ms loads — use a single Spinner.\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { className, variant, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n aria-hidden\n className={cn(\n 'animate-pulse bg-background-muted',\n variant === 'text' && 'h-3 rounded-sm',\n variant === 'circle' && 'rounded-full aspect-square',\n variant === 'avatar' && 'size-8 rounded-full',\n variant === 'card' && 'rounded-lg',\n !variant && 'rounded-md',\n className,\n )}\n {...props}\n />\n );\n});\nSkeleton.displayName = 'Skeleton';\n","import { useMemo, useState, type ReactNode } from 'react';\nimport { Settings } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './DropdownMenu';\nimport { IconButton } from './IconButton';\nimport { Input } from './Input';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n TableSortHeader,\n} from './Table';\nimport { Skeleton } from './Skeleton';\n\nexport interface DataGridColumn<TRow> {\n /** Stable key used for visibility, sort, and React lists. */\n key: string;\n /** Header label. */\n header: ReactNode;\n /** Render the cell. Defaults to the value at `row[key]`. */\n cell?: (row: TRow) => ReactNode;\n /** Cell width — passed to `<col>` so the grid keeps shape during loading. */\n width?: string;\n /** Allow sorting on this column. */\n sortable?: boolean;\n /** Right-align numeric / monetary columns. */\n align?: 'left' | 'right';\n}\n\nexport interface DataGridProps<TRow extends { id: string | number }> {\n columns: DataGridColumn<TRow>[];\n rows: TRow[];\n loading?: boolean;\n /** Initial sort state. */\n sort?: { key: string; direction: 'asc' | 'desc' } | null;\n onSortChange?: (sort: { key: string; direction: 'asc' | 'desc' }) => void;\n /** Show a filter input row above the grid. */\n filter?: { value: string; onChange: (q: string) => void; placeholder?: string };\n /** Empty-state node when no rows are visible. */\n emptyState?: ReactNode;\n className?: string;\n}\n\n/**\n * Composite grid built from `Table` + DropdownMenu + Input. Provides\n * column visibility toggle, an inline filter, sortable headers, and\n * loading / empty states.\n *\n * @example\n * <DataGrid\n * columns={[\n * { key: 'name', header: 'Name', sortable: true },\n * { key: 'status', header: 'Status', cell: r => <Badge tone={...}>{r.status}</Badge> },\n * { key: 'updatedAt', header: 'Updated', align: 'right' },\n * ]}\n * rows={rows}\n * filter={{ value: q, onChange: setQ }}\n * sort={sort}\n * onSortChange={setSort}\n * />\n *\n * @do Provide a meaningful empty state with a primary action when the grid\n * starts empty (no items at all, not just filtered out).\n * @dont Render thousands of rows synchronously — virtualise with `@tanstack/react-virtual`\n * and wrap with this component's headers as a shell.\n */\nexport function DataGrid<TRow extends { id: string | number }>({\n columns,\n rows,\n loading,\n sort,\n onSortChange,\n filter,\n emptyState,\n className,\n}: DataGridProps<TRow>) {\n const [hidden, setHidden] = useState<Record<string, boolean>>({});\n const visibleColumns = useMemo(() => columns.filter((c) => !hidden[c.key]), [columns, hidden]);\n\n const renderRows = () => {\n if (loading) {\n return Array.from({ length: 5 }).map((_, i) => (\n <TableRow key={`skel-${i}`}>\n {visibleColumns.map((c) => (\n <TableCell key={c.key}>\n <Skeleton variant=\"text\" className=\"w-3/4\" />\n </TableCell>\n ))}\n </TableRow>\n ));\n }\n if (rows.length === 0) {\n return (\n <TableRow>\n <TableCell colSpan={visibleColumns.length} className=\"h-32 text-center\">\n {emptyState ?? (\n <span className=\"text-foreground-subtle\">No results.</span>\n )}\n </TableCell>\n </TableRow>\n );\n }\n return rows.map((row) => (\n <TableRow key={row.id}>\n {visibleColumns.map((c) => (\n <TableCell\n key={c.key}\n className={cn(c.align === 'right' && 'text-right tabular')}\n >\n {c.cell ? c.cell(row) : (row as Record<string, unknown>)[c.key] as ReactNode}\n </TableCell>\n ))}\n </TableRow>\n ));\n };\n\n return (\n <div className={cn('flex flex-col gap-3', className)}>\n <div className=\"flex items-center justify-between gap-2\">\n {filter ? (\n <Input\n type=\"search\"\n placeholder={filter.placeholder ?? 'Filter…'}\n value={filter.value}\n onChange={(e) => filter.onChange(e.target.value)}\n clearable\n onClear={() => filter.onChange('')}\n className=\"max-w-sm w-full\"\n hideLabel\n label=\"Filter rows\"\n />\n ) : (\n <div />\n )}\n <div className=\"flex items-center gap-2\">\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <IconButton aria-label=\"Column visibility\" icon={<Settings />} variant=\"outline\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuLabel>Columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {columns.map((c) => (\n <DropdownMenuCheckboxItem\n key={c.key}\n checked={!hidden[c.key]}\n onCheckedChange={(v) =>\n setHidden((prev) => ({ ...prev, [c.key]: !v }))\n }\n >\n {c.header}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n </div>\n\n <div className=\"rounded-lg border border-border overflow-hidden\">\n <Table>\n <colgroup>\n {visibleColumns.map((c) => (\n <col key={c.key} style={c.width ? { width: c.width } : undefined} />\n ))}\n </colgroup>\n <TableHeader>\n <TableRow>\n {visibleColumns.map((c) =>\n c.sortable && onSortChange ? (\n <TableSortHeader\n key={c.key}\n sortKey={c.key}\n currentSort={sort ?? null}\n onSortChange={(k, d) => onSortChange({ key: k, direction: d })}\n >\n {c.header}\n </TableSortHeader>\n ) : (\n <TableHead key={c.key} className={cn(c.align === 'right' && 'text-right')}>\n {c.header}\n </TableHead>\n ),\n )}\n </TableRow>\n </TableHeader>\n <TableBody>{renderRows()}</TableBody>\n </Table>\n </div>\n </div>\n );\n}\n","import { forwardRef } from 'react';\nimport { DayPicker, type DayPickerProps } from 'react-day-picker';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport 'react-day-picker/style.css';\nimport { cn } from '@/lib/utils';\n\nexport type CalendarProps = DayPickerProps & { className?: string };\n\n/**\n * Standalone calendar surface. Used by DatePicker, but can also be embedded\n * directly in popovers, sheets, or inline forms. Wraps `react-day-picker` v9.\n */\nexport const Calendar = forwardRef<HTMLDivElement, CalendarProps>(function Calendar(\n { className, classNames, ...props },\n _ref,\n) {\n return (\n <DayPicker\n showOutsideDays\n className={cn('p-3', className)}\n classNames={{\n root: 'rdp',\n months: 'flex flex-col gap-4 sm:flex-row sm:gap-6',\n month: 'flex flex-col gap-3',\n month_caption: 'relative flex h-8 items-center justify-center',\n caption_label: 'text-sm font-medium',\n nav: 'absolute inset-x-0 top-0 flex h-8 items-center justify-between',\n button_previous:\n 'inline-flex h-7 w-7 items-center justify-center rounded-md text-foreground-muted hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring outline-none',\n button_next:\n 'inline-flex h-7 w-7 items-center justify-center rounded-md text-foreground-muted hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring outline-none',\n month_grid: 'w-full border-collapse',\n weekdays: 'grid grid-cols-7',\n weekday:\n 'h-8 w-9 text-center text-[11px] font-medium uppercase tracking-wide text-foreground-subtle',\n week: 'mt-0.5 grid grid-cols-7',\n day: 'relative h-9 w-9 p-0 text-center',\n day_button:\n 'inline-flex h-9 w-9 items-center justify-center rounded-md text-sm hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring outline-none aria-selected:bg-accent aria-selected:text-on-accent aria-selected:hover:bg-accent-700',\n today: '[&_button]:border [&_button]:border-border',\n outside: 'text-foreground-subtle',\n disabled: 'opacity-40 pointer-events-none',\n range_start:\n '[&_button]:bg-accent [&_button]:text-on-accent [&_button]:rounded-r-none',\n range_end:\n '[&_button]:bg-accent [&_button]:text-on-accent [&_button]:rounded-l-none',\n range_middle:\n '[&_button]:bg-accent-soft [&_button]:text-foreground [&_button]:rounded-none',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) =>\n orientation === 'left' ? (\n <ChevronLeft className=\"size-4\" />\n ) : (\n <ChevronRight className=\"size-4\" />\n ),\n }}\n {...props}\n />\n );\n});\n","import { forwardRef, useId, useState, type ReactNode } from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport type { DateRange } from 'react-day-picker';\nimport { Calendar as CalendarIcon } from '@/icons';\nimport { Calendar } from './Calendar';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Two related components share the same trigger shell:\n *\n * <DatePicker value={date} onChange={setDate} /> // single date\n * <DateRangePicker value={range} onChange={setRange} /> // {from,to}\n * --------------------------------------------------------------------------- */\n\nfunction formatDate(d?: Date): string {\n if (!d) return '';\n return d.toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' });\n}\n\nfunction PickerTrigger({\n label,\n placeholder,\n hasValue,\n children,\n error,\n fieldId,\n disabled,\n}: {\n label?: ReactNode;\n placeholder: string;\n hasValue: boolean;\n children: ReactNode;\n error?: ReactNode;\n fieldId: string;\n disabled?: boolean;\n}) {\n return (\n <div className=\"flex flex-col gap-1.5\">\n {label && (\n <label htmlFor={fieldId} className=\"text-sm font-medium text-foreground\">\n {label}\n </label>\n )}\n <PopoverPrimitive.Trigger asChild>\n <button\n id={fieldId}\n type=\"button\"\n disabled={disabled}\n aria-invalid={Boolean(error) || undefined}\n className={cn(\n 'inline-flex h-9 w-full items-center justify-start gap-2 rounded-md border bg-card px-3 text-left text-sm',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n error\n ? 'border-danger focus-visible:border-danger focus-visible:ring-danger'\n : 'border-border focus-visible:border-accent focus-visible:ring-ring',\n !hasValue && 'text-foreground-subtle',\n )}\n >\n <CalendarIcon className=\"size-4 text-foreground-subtle\" aria-hidden />\n <span className=\"truncate\">{hasValue ? children : placeholder}</span>\n </button>\n </PopoverPrimitive.Trigger>\n {error && (\n <p role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n )}\n </div>\n );\n}\n\nexport interface DatePickerProps {\n value?: Date;\n onChange: (date: Date | undefined) => void;\n label?: ReactNode;\n placeholder?: string;\n error?: ReactNode;\n disabled?: boolean;\n /** Restrict to a date range. Days outside are not selectable. */\n fromDate?: Date;\n toDate?: Date;\n className?: string;\n}\n\n/**\n * Single-date picker.\n *\n * @example\n * <DatePicker label=\"Date of birth\" value={dob} onChange={setDob} />\n *\n * @do Use locale-aware formatting via the consumer's display layer.\n * @dont Roll a custom calendar — Radix Popover + react-day-picker handles a11y.\n */\nexport const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(function DatePicker(\n { value, onChange, label, placeholder = 'Pick a date', error, disabled, fromDate, toDate, className },\n ref,\n) {\n const fieldId = useId();\n const [open, setOpen] = useState(false);\n\n return (\n <div ref={ref} className={cn(className)}>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PickerTrigger\n label={label}\n placeholder={placeholder}\n hasValue={Boolean(value)}\n error={error}\n fieldId={fieldId}\n disabled={disabled}\n >\n {formatDate(value)}\n </PickerTrigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={4}\n className=\"z-[var(--z-popover)] rounded-lg border border-border bg-popover text-popover-foreground shadow-md\"\n >\n <Calendar\n mode=\"single\"\n selected={value}\n onSelect={(d) => {\n onChange(d ?? undefined);\n if (d) setOpen(false);\n }}\n startMonth={fromDate}\n endMonth={toDate}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </div>\n );\n});\nDatePicker.displayName = 'DatePicker';\n\nexport interface DateRangePickerProps {\n value?: DateRange;\n onChange: (range: DateRange | undefined) => void;\n label?: ReactNode;\n placeholder?: string;\n error?: ReactNode;\n disabled?: boolean;\n fromDate?: Date;\n toDate?: Date;\n className?: string;\n}\n\n/**\n * Two-date range picker. `value` is `{from, to}`.\n *\n * @example\n * <DateRangePicker label=\"Reporting period\" value={range} onChange={setRange} />\n */\nexport const DateRangePicker = forwardRef<HTMLDivElement, DateRangePickerProps>(function DateRangePicker(\n { value, onChange, label, placeholder = 'Pick a range', error, disabled, fromDate, toDate, className },\n ref,\n) {\n const fieldId = useId();\n const [open, setOpen] = useState(false);\n const hasValue = Boolean(value?.from);\n\n return (\n <div ref={ref} className={cn(className)}>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PickerTrigger\n label={label}\n placeholder={placeholder}\n hasValue={hasValue}\n error={error}\n fieldId={fieldId}\n disabled={disabled}\n >\n {value?.from && value.to\n ? `${formatDate(value.from)} – ${formatDate(value.to)}`\n : value?.from\n ? formatDate(value.from)\n : ''}\n </PickerTrigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={4}\n className=\"z-[var(--z-popover)] rounded-lg border border-border bg-popover text-popover-foreground shadow-md\"\n >\n <Calendar\n mode=\"range\"\n selected={value}\n onSelect={onChange}\n numberOfMonths={2}\n startMonth={fromDate}\n endMonth={toDate}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </div>\n );\n});\nDateRangePicker.displayName = 'DateRangePicker';\n","import { type CSSProperties, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Per-brand token overrides. Keys are CSS variable names (without the `--`\n * prefix); values are CSS values. Any unspecified token falls back to the\n * design system default.\n *\n * @example\n * <DesignSystemProvider tokens={{ 'color-accent': '#ff5555', 'radius-md': '10px' }}>\n * <App />\n * </DesignSystemProvider>\n *\n * @example Multiple brands in one app\n * <DesignSystemProvider tokens={edgelogBrand}>\n * <Card>...</Card>\n * </DesignSystemProvider>\n * <DesignSystemProvider tokens={geregeBrand}>\n * <Card>...</Card>\n * </DesignSystemProvider>\n */\nexport type BrandTokens = Record<string, string>;\n\nexport interface DesignSystemProviderProps extends HTMLAttributes<HTMLDivElement> {\n /** Token overrides (CSS variable name → value). */\n tokens?: BrandTokens;\n /** Children to scope this brand to. */\n children: ReactNode;\n}\n\nexport function DesignSystemProvider({\n tokens,\n className,\n children,\n style,\n ...props\n}: DesignSystemProviderProps) {\n // Build the inline style from tokens — wrapping every key with `--` so\n // consumers can pass either `accent` or `color-accent` without remembering\n // the prefix dance.\n const css: CSSProperties = { ...style };\n if (tokens) {\n for (const [k, v] of Object.entries(tokens)) {\n const key = k.startsWith('--') ? k : `--${k}`;\n (css as Record<string, string>)[key] = v;\n }\n }\n\n return (\n <div data-brand-scope className={cn('contents', className)} style={css} {...props}>\n {children}\n </div>\n );\n}\n\n/**\n * Built-in brand presets — drop-in starters showing how a token override\n * map is shaped. Consumers can fork or replace any value.\n */\nexport const brandPresets = {\n default: {} as BrandTokens,\n /** Cool indigo accent, slightly rounder corners. */\n edgelog: {\n 'color-accent': 'oklch(0.55 0.18 250)',\n 'color-accent-700': 'oklch(0.46 0.16 250)',\n 'color-accent-800': 'oklch(0.38 0.14 250)',\n 'color-accent-soft': 'oklch(0.95 0.04 250)',\n 'radius-md': '8px',\n 'radius-lg': '12px',\n },\n /** Warm copper accent, tighter geometry. */\n gerege: {\n 'color-accent': 'oklch(0.62 0.16 45)',\n 'color-accent-700': 'oklch(0.54 0.16 45)',\n 'color-accent-800': 'oklch(0.46 0.14 45)',\n 'color-accent-soft': 'oklch(0.95 0.04 45)',\n 'radius-md': '4px',\n 'radius-lg': '6px',\n },\n /** Forest green accent. */\n forest: {\n 'color-accent': 'oklch(0.55 0.14 155)',\n 'color-accent-700': 'oklch(0.47 0.14 155)',\n 'color-accent-800': 'oklch(0.39 0.12 155)',\n 'color-accent-soft': 'oklch(0.95 0.04 155)',\n },\n} as const;\n\nexport type BrandName = keyof typeof brandPresets;\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { Button, type ButtonProps } from './Button';\n\nexport const Dialog = DialogPrimitive.Root;\nexport const DialogTrigger = DialogPrimitive.Trigger;\nexport const DialogPortal = DialogPrimitive.Portal;\nexport const DialogClose = DialogPrimitive.Close;\n\nexport const DialogOverlay = forwardRef<\n ElementRef<typeof DialogPrimitive.Overlay>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(function DialogOverlay({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]',\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 );\n});\nDialogOverlay.displayName = 'DialogOverlay';\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {\n /** Show the default close (×) button in the top-right. */\n showClose?: boolean;\n /** Dialog width — `sm` 400 / `md` 520 / `lg` 720. */\n size?: 'sm' | 'md' | 'lg';\n}\n\nexport const DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(function DialogContent({ className, children, showClose = true, size = 'md', ...props }, ref) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-1/2 top-1/2 z-[var(--z-modal)] -translate-x-1/2 -translate-y-1/2',\n 'w-[calc(100%-2rem)] rounded-lg border border-border bg-card text-card-foreground shadow-lg',\n '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 size === 'sm' && 'max-w-[400px]',\n size === 'md' && 'max-w-[520px]',\n size === 'lg' && 'max-w-[720px]',\n className,\n )}\n {...props}\n >\n {children}\n {showClose && (\n <DialogPrimitive.Close\n aria-label=\"Close\"\n className={cn(\n 'absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-foreground-subtle',\n 'hover:bg-background-muted hover:text-foreground',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n <X className=\"size-4\" aria-hidden />\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n});\nDialogContent.displayName = 'DialogContent';\n\nexport function DialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('flex flex-col gap-1 pb-4', className)} {...props} />;\n}\nDialogHeader.displayName = 'DialogHeader';\n\nexport function DialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('flex flex-col-reverse gap-2 pt-6 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\nDialogFooter.displayName = 'DialogFooter';\n\nexport const DialogTitle = forwardRef<\n ElementRef<typeof DialogPrimitive.Title>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(function DialogTitle({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground leading-tight', className)}\n {...props}\n />\n );\n});\nDialogTitle.displayName = 'DialogTitle';\n\nexport const DialogDescription = forwardRef<\n ElementRef<typeof DialogPrimitive.Description>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(function DialogDescription({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-foreground-muted', className)}\n {...props}\n />\n );\n});\nDialogDescription.displayName = 'DialogDescription';\n\n/* -----------------------------------------------------------------------------\n * ConfirmationDialog — pre-composed pattern for destructive/important\n * confirmations. Use this when the body is a single sentence and the only\n * controls are Cancel + Confirm.\n * --------------------------------------------------------------------------- */\n\nexport interface ConfirmationDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: ReactNode;\n description?: ReactNode;\n /** Label of the confirm button. */\n confirmLabel?: string;\n /** Label of the cancel button. */\n cancelLabel?: string;\n /** Variant of the confirm button — typically `primary` or `destructive`. */\n confirmVariant?: ButtonProps['variant'];\n /** Called when the user confirms. Awaited — shows a spinner while pending. */\n onConfirm: () => void | Promise<void>;\n /** Whether the confirm button is currently submitting. */\n loading?: boolean;\n}\n\n/**\n * Confirmation dialog with title, description, cancel + confirm buttons.\n *\n * @example Destructive confirmation\n * <ConfirmationDialog\n * open={open} onOpenChange={setOpen}\n * title=\"Delete project?\"\n * description=\"This permanently deletes the project and all its data.\"\n * confirmLabel=\"Delete project\"\n * confirmVariant=\"destructive\"\n * onConfirm={handleDelete}\n * />\n *\n * @do Lead the title with the action: \"Delete project?\" not \"Are you sure?\".\n * State consequences in the description.\n * @dont Use for low-risk reversible actions — those don't need a dialog.\n */\nexport function ConfirmationDialog({\n open,\n onOpenChange,\n title,\n description,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n confirmVariant = 'primary',\n onConfirm,\n loading,\n}: ConfirmationDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent size=\"sm\">\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n {description && <DialogDescription>{description}</DialogDescription>}\n </DialogHeader>\n <DialogFooter>\n <DialogClose asChild>\n <Button variant=\"outline\">{cancelLabel}</Button>\n </DialogClose>\n <Button variant={confirmVariant} loading={loading} onClick={onConfirm}>\n {confirmLabel}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\nConfirmationDialog.displayName = 'ConfirmationDialog';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\nimport { InboxEmpty } from '@/illustrations';\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /**\n * Small Lucide-sized icon rendered inside a 48px circular container.\n * Use for compact empty states (table cells, sidebar panes, cards).\n */\n icon?: ReactNode;\n /**\n * Full-size illustration rendered without the icon container. Takes\n * precedence over `icon`. If neither is set, the default `InboxEmpty`\n * line illustration is used.\n */\n illustration?: ReactNode;\n /** Heading. One short sentence. */\n title: ReactNode;\n /** Description. One or two sentences max. */\n description?: ReactNode;\n /** Primary action — usually a `<Button>` that creates the missing item. */\n action?: ReactNode;\n /** Secondary helper link — \"Learn more\", \"Import existing\", etc. */\n secondaryAction?: ReactNode;\n}\n\n/**\n * Shown when a list / dataset / surface has no content yet. Tone is helpful,\n * never apologetic.\n *\n * @example Default — uses the built-in InboxEmpty illustration\n * <EmptyState\n * title=\"No projects yet\"\n * description=\"Create a project to start tracking work.\"\n * action={<Button>New project</Button>}\n * />\n *\n * @example Compact — small Lucide icon for dense layouts\n * <EmptyState\n * icon={<Folder className=\"size-6\" />}\n * title=\"No items\"\n * />\n *\n * @example Custom illustration\n * <EmptyState\n * illustration={<Illustrations.NoSearchResults className=\"size-32\" />}\n * title=\"No results\"\n * />\n */\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(\n { icon, illustration, title, description, action, secondaryAction, className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={cn(\n 'flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border bg-background-subtle p-10 text-center',\n className,\n )}\n {...props}\n >\n {/* Visual: illustration > icon > default illustration */}\n {illustration ? (\n illustration\n ) : icon ? (\n <div className=\"inline-flex size-12 items-center justify-center rounded-full bg-background-muted text-foreground-muted [&_svg]:size-6\">\n {icon}\n </div>\n ) : (\n <InboxEmpty className=\"size-24\" />\n )}\n <h3 className=\"text-base font-semibold text-foreground leading-tight\">{title}</h3>\n {description && (\n <p className=\"max-w-md text-sm text-foreground-muted leading-relaxed\">{description}</p>\n )}\n {(action || secondaryAction) && (\n <div className=\"mt-2 flex items-center gap-2\">\n {action}\n {secondaryAction}\n </div>\n )}\n </div>\n );\n});\nEmptyState.displayName = 'EmptyState';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\nimport { NotFound, ServerError, ConnectionLost } from '@/illustrations';\nimport { Button } from './Button';\n\nexport interface ErrorStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** `404` not-found, `500` server, or `generic` (catch-all). */\n variant?: '404' | '500' | 'generic';\n /** Override the default title. */\n title?: ReactNode;\n /** Override the default description. */\n description?: ReactNode;\n /**\n * Override the variant's default illustration. Pass any ReactNode (e.g.\n * `<Illustrations.Construction className=\"size-32\" />`).\n */\n illustration?: ReactNode;\n /** Custom action node. Replaces the default retry button. */\n action?: ReactNode;\n /** When provided, renders a default \"Try again\" button calling this handler. */\n onRetry?: () => void;\n}\n\nconst presets = {\n '404': {\n illustration: <NotFound className=\"size-32\" />,\n title: 'Page not found',\n description: \"We couldn't find what you were looking for.\",\n },\n '500': {\n illustration: <ServerError className=\"size-32\" />,\n title: 'Something went wrong',\n description: \"We're looking into it. Please try again in a moment.\",\n },\n generic: {\n illustration: <ConnectionLost className=\"size-32\" />,\n title: 'Unexpected error',\n description: 'Something interrupted this action.',\n },\n} as const;\n\n/**\n * Page-level error placeholder. Pair with `onRetry` for transient failures.\n *\n * @example 404 (uses built-in line illustration)\n * <ErrorState variant=\"404\" />\n *\n * @example 500 with retry\n * <ErrorState variant=\"500\" onRetry={refetch} />\n *\n * @example Custom\n * <ErrorState\n * title=\"Quota exceeded\"\n * description=\"Your plan allows 1,000 events/day.\"\n * illustration={<Illustrations.Construction className=\"size-32\" />}\n * action={<Button>Upgrade plan</Button>}\n * />\n *\n * @do Match the tone to the cause — server errors apologise, user errors\n * explain. Always offer a next step.\n * @dont Show a raw stack trace to end users.\n */\nexport const ErrorState = forwardRef<HTMLDivElement, ErrorStateProps>(function ErrorState(\n { variant = 'generic', title, description, illustration, action, onRetry, className, ...props },\n ref,\n) {\n const preset = presets[variant];\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(\n 'flex flex-col items-center justify-center gap-3 rounded-lg border border-border bg-background-subtle p-10 text-center',\n className,\n )}\n {...props}\n >\n {illustration ?? preset.illustration}\n <h3 className=\"text-base font-semibold text-foreground leading-tight\">\n {title ?? preset.title}\n </h3>\n <p className=\"max-w-md text-sm text-foreground-muted leading-relaxed\">\n {description ?? preset.description}\n </p>\n {(action || onRetry) && (\n <div className=\"mt-2 flex items-center gap-2\">\n {action ?? (\n <Button onClick={onRetry} variant=\"outline\">\n Try again\n </Button>\n )}\n </div>\n )}\n </div>\n );\n});\nErrorState.displayName = 'ErrorState';\n","import {\n createContext,\n forwardRef,\n useContext,\n useId,\n type HTMLAttributes,\n} from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from 'react-hook-form';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * react-hook-form bindings + accessible label / description / error wiring.\n *\n * Usage:\n * const form = useForm<Values>(…);\n * <Form {...form}>\n * <FormField\n * control={form.control}\n * name=\"email\"\n * render={({ field }) => (\n * <FormItem>\n * <FormLabel>Email</FormLabel>\n * <FormControl><Input type=\"email\" {...field} /></FormControl>\n * <FormDescription>We never share this.</FormDescription>\n * <FormError />\n * </FormItem>\n * )}\n * />\n * </Form>\n * --------------------------------------------------------------------------- */\n\nexport const Form = FormProvider;\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\nconst FormFieldContext = createContext<FormFieldContextValue | null>(null);\n\nexport function FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(props: ControllerProps<TFieldValues, TName>) {\n return (\n <FormFieldContext.Provider value={{ name: props.name as string }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\ninterface FormItemContextValue {\n id: string;\n}\nconst FormItemContext = createContext<FormItemContextValue | null>(null);\n\nexport function useFormField() {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n if (!fieldContext) {\n throw new Error('useFormField must be used inside <FormField>');\n }\n const fieldState = getFieldState(fieldContext.name, formState);\n const id = itemContext?.id ?? '';\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-item`,\n formDescriptionId: `${id}-desc`,\n formMessageId: `${id}-error`,\n ...fieldState,\n };\n}\n\nexport const FormItem = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function FormItem({ className, ...props }, ref) {\n const id = useId();\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\nFormItem.displayName = 'FormItem';\n\nexport const FormLabel = forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(function FormLabel({ className, ...props }, ref) {\n const { formItemId, error } = useFormField();\n return (\n <LabelPrimitive.Root\n ref={ref}\n htmlFor={formItemId}\n className={cn(\n 'text-sm font-medium text-foreground',\n error && 'text-danger-text',\n className,\n )}\n {...props}\n />\n );\n});\nFormLabel.displayName = 'FormLabel';\n\nexport const FormControl = forwardRef<HTMLElement, React.ComponentPropsWithoutRef<typeof Slot>>(\n function FormControl(props, ref) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n },\n);\nFormControl.displayName = 'FormControl';\n\nexport const FormDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(\n function FormDescription({ className, ...props }, ref) {\n const { formDescriptionId } = useFormField();\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-xs text-foreground-subtle', className)}\n {...props}\n />\n );\n },\n);\nFormDescription.displayName = 'FormDescription';\n\nexport const FormError = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(\n function FormError({ className, children, ...props }, ref) {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : children;\n if (!body) return null;\n return (\n <p\n ref={ref}\n id={formMessageId}\n role=\"alert\"\n className={cn('text-xs text-danger-text', className)}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\nFormError.displayName = 'FormError';\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface KbdProps extends HTMLAttributes<HTMLElement> {\n /** Visual size — match the surrounding text. */\n size?: 'sm' | 'md';\n}\n\n/**\n * Stylised keyboard shortcut indicator. Compose multiple `<Kbd>` for chords.\n *\n * @example\n * Press <Kbd>⌘</Kbd>+<Kbd>K</Kbd> to open the command palette.\n *\n * @do Use OS-conventional symbols (⌘ ⇧ ⌥ ⌃ ⏎) — keep visuals consistent\n * across the app.\n * @dont Use Kbd for clickable buttons — it implies a real keyboard input.\n */\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(function Kbd(\n { size = 'sm', className, ...props },\n ref,\n) {\n return (\n <kbd\n ref={ref}\n className={cn(\n 'inline-flex items-center justify-center rounded border border-border bg-background-subtle font-mono',\n 'text-foreground-muted shadow-xs',\n size === 'sm' ? 'h-5 min-w-5 px-1 text-[10px]' : 'h-6 min-w-6 px-1.5 text-xs',\n className,\n )}\n {...props}\n />\n );\n});\nKbd.displayName = 'Kbd';\n","import {\n forwardRef,\n useCallback,\n useId,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Check, ChevronsUpDown, X } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface MultiSelectOption {\n /** Stable, unique value submitted in `onChange`. */\n value: string;\n /** Visible label shown both in the menu and in the selected chip. */\n label: string;\n /** Optional secondary text shown after the label in the menu. */\n description?: string;\n /** Disable selecting this option. */\n disabled?: boolean;\n}\n\nexport interface MultiSelectProps {\n /** All possible options. */\n options: MultiSelectOption[];\n /** Currently selected values. Controlled. */\n value: string[];\n /** Called whenever the selection changes. */\n onChange: (next: string[]) => void;\n /** Visible label above the field. */\n label?: ReactNode;\n /** Hint below the field. Hidden when `error` is set. */\n helperText?: ReactNode;\n /** Validation message. */\n error?: ReactNode;\n /** Empty-state placeholder shown when nothing is selected. */\n placeholder?: string;\n /** Text shown when no options match the search. */\n emptyText?: string;\n /** Max number of chips rendered inline; remainder shown as \"+N more\". */\n maxVisibleChips?: number;\n /** Whether the user can clear all selections with a single click. */\n clearable?: boolean;\n /** Disable the entire field. */\n disabled?: boolean;\n className?: string;\n}\n\n/**\n * Chip-based multi-select with a searchable menu (cmdk under the hood).\n *\n * Keyboard:\n * - Backspace on the input with empty query removes the last chip\n * - Enter / Space toggles the highlighted option\n * - Escape closes the menu\n *\n * @example Tag picker\n * <MultiSelect label=\"Tags\"\n * options={tags}\n * value={selected}\n * onChange={setSelected}\n * placeholder=\"Pick tags\" />\n *\n * @example Bounded with overflow chip\n * <MultiSelect options={users}\n * value={value}\n * onChange={setValue}\n * maxVisibleChips={3} />\n *\n * @do Cap `maxVisibleChips` (3–5) on narrow surfaces so the field doesn't\n * reflow as the user adds selections.\n * @dont Use MultiSelect for fewer than ~6 options. CheckboxGroup is clearer.\n */\nexport const MultiSelect = forwardRef<HTMLDivElement, MultiSelectProps>(function MultiSelect(\n {\n options,\n value,\n onChange,\n label,\n helperText,\n error,\n placeholder = 'Select…',\n emptyText = 'No results.',\n maxVisibleChips = 3,\n clearable = true,\n disabled,\n className,\n },\n ref,\n) {\n const autoId = useId();\n const fieldId = autoId;\n const helperId = `${autoId}-helper`;\n const errorId = `${autoId}-error`;\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const selected = useMemo(\n () => options.filter((o) => value.includes(o.value)),\n [options, value],\n );\n\n const toggle = useCallback(\n (v: string) => {\n if (value.includes(v)) onChange(value.filter((x) => x !== v));\n else onChange([...value, v]);\n },\n [value, onChange],\n );\n\n const clear = useCallback(() => onChange([]), [onChange]);\n\n const handleKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Backspace' && query === '' && value.length > 0) {\n onChange(value.slice(0, -1));\n }\n };\n\n const visibleChips = selected.slice(0, maxVisibleChips);\n const overflow = selected.length - visibleChips.length;\n const isError = Boolean(error);\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label htmlFor={fieldId} className=\"text-sm font-medium text-foreground\">\n {label}\n </label>\n )}\n\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n <div\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={`${fieldId}-list`}\n aria-haspopup=\"listbox\"\n id={fieldId}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleKeyDown}\n aria-disabled={disabled || undefined}\n aria-invalid={isError || undefined}\n aria-describedby={isError ? errorId : helperText ? helperId : undefined}\n className={cn(\n 'flex h-9 w-full cursor-text items-center gap-1.5 overflow-hidden rounded-md border bg-card px-2 py-1 text-sm',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n isError\n ? 'border-danger focus-visible:border-danger focus-visible:ring-danger'\n : 'border-border focus-visible:border-accent focus-visible:ring-ring',\n disabled && 'opacity-50 pointer-events-none',\n )}\n onClick={() => inputRef.current?.focus()}\n >\n {visibleChips.length === 0 && (\n <span className=\"text-foreground-subtle px-1\">{placeholder}</span>\n )}\n {visibleChips.map((opt) => (\n <span\n key={opt.value}\n className=\"inline-flex max-w-[10rem] shrink-0 items-center gap-1 rounded-md bg-accent-soft px-1.5 py-0.5 text-xs font-medium text-on-accent-soft\"\n >\n <span className=\"truncate\">{opt.label}</span>\n <button\n type=\"button\"\n aria-label={`Remove ${opt.label}`}\n className=\"inline-flex items-center text-on-accent-soft hover:text-foreground\"\n onClick={(e) => {\n e.stopPropagation();\n toggle(opt.value);\n }}\n >\n <X className=\"size-3\" aria-hidden />\n </button>\n </span>\n ))}\n {overflow > 0 && (\n <span className=\"shrink-0 rounded-md bg-background-muted px-1.5 py-0.5 text-xs font-medium text-foreground-muted\">\n +{overflow}\n </span>\n )}\n <input\n ref={inputRef}\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n onFocus={() => setOpen(true)}\n className=\"flex-1 min-w-[8ch] bg-transparent text-sm outline-none placeholder:text-foreground-subtle\"\n placeholder={selected.length === 0 ? '' : ''}\n disabled={disabled}\n />\n <span className=\"ml-auto flex items-center gap-1\">\n {clearable && selected.length > 0 && (\n <button\n type=\"button\"\n aria-label=\"Clear all\"\n onClick={(e) => {\n e.stopPropagation();\n clear();\n }}\n className=\"text-foreground-subtle hover:text-foreground\"\n >\n <X className=\"size-4\" aria-hidden />\n </button>\n )}\n <ChevronsUpDown className=\"size-4 text-foreground-subtle\" aria-hidden />\n </span>\n </div>\n </PopoverPrimitive.Trigger>\n\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={4}\n className={cn(\n 'z-[var(--z-popover)] w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md',\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 )}\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n <CommandPrimitive shouldFilter={false} className=\"flex h-full w-full flex-col\">\n <CommandPrimitive.List\n id={`${fieldId}-list`}\n className=\"max-h-64 overflow-y-auto p-1\"\n >\n {options\n .filter((o) => o.label.toLowerCase().includes(query.toLowerCase()))\n .map((opt) => {\n const isSelected = value.includes(opt.value);\n return (\n <CommandPrimitive.Item\n key={opt.value}\n value={opt.value}\n disabled={opt.disabled}\n onSelect={() => toggle(opt.value)}\n className={cn(\n 'flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground',\n 'data-[selected=true]:bg-background-muted',\n 'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none',\n )}\n >\n <span\n aria-hidden\n className={cn(\n 'flex size-4 items-center justify-center rounded-sm border',\n isSelected ? 'border-accent bg-accent text-on-accent' : 'border-border',\n )}\n >\n {isSelected && <Check className=\"size-3\" aria-hidden />}\n </span>\n <span className=\"flex-1\">{opt.label}</span>\n {opt.description && (\n <span className=\"text-xs text-foreground-subtle\">{opt.description}</span>\n )}\n </CommandPrimitive.Item>\n );\n })}\n <CommandPrimitive.Empty className=\"px-2 py-6 text-center text-sm text-foreground-subtle\">\n {emptyText}\n </CommandPrimitive.Empty>\n </CommandPrimitive.List>\n </CommandPrimitive>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n\n {error ? (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-xs text-foreground-subtle\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nMultiSelect.displayName = 'MultiSelect';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { Check, ChevronDown, ChevronUp, ChevronsUpDown } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Compound API:\n *\n * <Select value={…} onValueChange={…}>\n * <SelectTrigger placeholder=\"Pick one\" />\n * <SelectContent>\n * <SelectGroup label=\"Active\">\n * <SelectItem value=\"a\">Apple</SelectItem>\n * <SelectItem value=\"b\">Banana</SelectItem>\n * </SelectGroup>\n * </SelectContent>\n * </Select>\n *\n * All accessibility is handled by Radix: keyboard navigation, type-ahead,\n * focus trap, ARIA roles. We only style.\n * --------------------------------------------------------------------------- */\n\nexport const Select = SelectPrimitive.Root;\nexport const SelectValue = SelectPrimitive.Value;\n\nexport interface SelectTriggerProps\n extends Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'children'> {\n /** Placeholder shown when no value is selected. */\n placeholder?: string;\n /** Trigger height — matches Input sizes. */\n size?: 'sm' | 'md' | 'lg';\n /** Visual tone — `error` swaps the border + ring to danger. */\n tone?: 'default' | 'error';\n}\n\nexport const SelectTrigger = forwardRef<\n ElementRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(function SelectTrigger({ className, placeholder, size = 'md', tone = 'default', ...props }, ref) {\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-sm text-foreground',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n 'data-[placeholder]:text-foreground-subtle',\n size === 'sm' && 'h-8 px-2.5',\n size === 'md' && 'h-9 px-3',\n size === 'lg' && 'h-10 px-3.5',\n tone === 'default'\n ? 'border-border focus-visible:border-accent focus-visible:ring-ring'\n : 'border-danger focus-visible:border-danger focus-visible:ring-danger',\n className,\n )}\n {...props}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n <SelectPrimitive.Icon asChild>\n <ChevronsUpDown className=\"size-4 text-foreground-subtle shrink-0\" aria-hidden />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n});\nSelectTrigger.displayName = 'SelectTrigger';\n\nconst scrollBtn =\n 'flex h-6 cursor-default items-center justify-center text-foreground-subtle';\n\nexport const SelectScrollUpButton = forwardRef<\n ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(function SelectScrollUpButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollUpButton ref={ref} className={cn(scrollBtn, className)} {...props}>\n <ChevronUp className=\"size-4\" aria-hidden />\n </SelectPrimitive.ScrollUpButton>\n );\n});\nSelectScrollUpButton.displayName = 'SelectScrollUpButton';\n\nexport const SelectScrollDownButton = forwardRef<\n ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(function SelectScrollDownButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollDownButton ref={ref} className={cn(scrollBtn, className)} {...props}>\n <ChevronDown className=\"size-4\" aria-hidden />\n </SelectPrimitive.ScrollDownButton>\n );\n});\nSelectScrollDownButton.displayName = 'SelectScrollDownButton';\n\nexport const SelectContent = forwardRef<\n ElementRef<typeof SelectPrimitive.Content>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(function SelectContent({ className, children, position = 'popper', ...props }, ref) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n className={cn(\n 'z-[var(--z-popover)] min-w-[var(--radix-select-trigger-width)] max-h-96',\n 'overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground',\n 'shadow-md',\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' &&\n 'data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1',\n className,\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport className=\"p-1\">{children}</SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n});\nSelectContent.displayName = 'SelectContent';\n\nexport const SelectLabel = forwardRef<\n ElementRef<typeof SelectPrimitive.Label>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(function SelectLabel({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-xs font-medium text-foreground-subtle', className)}\n {...props}\n />\n );\n});\nSelectLabel.displayName = 'SelectLabel';\n\nexport interface SelectItemProps\n extends ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {\n /** Icon shown to the left of the label. */\n leadingIcon?: ReactNode;\n}\n\nexport const SelectItem = forwardRef<\n ElementRef<typeof SelectPrimitive.Item>,\n SelectItemProps\n>(function SelectItem({ className, children, leadingIcon, ...props }, ref) {\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default select-none items-center gap-2',\n 'rounded-sm px-2 py-1.5 pr-8 text-sm text-foreground outline-none',\n 'data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n {leadingIcon && (\n <span className=\"flex items-center text-foreground-subtle [&_svg]:size-4\">\n {leadingIcon}\n </span>\n )}\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className=\"absolute right-2 flex items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"size-4 text-accent\" aria-hidden />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n});\nSelectItem.displayName = 'SelectItem';\n\nexport const SelectSeparator = forwardRef<\n ElementRef<typeof SelectPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(function SelectSeparator({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\nSelectSeparator.displayName = 'SelectSeparator';\n\n/** Optional grouping with a label header. Pure composition over Radix Group + Label. */\nexport interface SelectGroupProps\n extends ComponentPropsWithoutRef<typeof SelectPrimitive.Group> {\n label?: ReactNode;\n}\nexport const SelectGroup = forwardRef<\n ElementRef<typeof SelectPrimitive.Group>,\n SelectGroupProps\n>(function SelectGroup({ label, children, ...props }, ref) {\n return (\n <SelectPrimitive.Group ref={ref} {...props}>\n {label && <SelectLabel>{label}</SelectLabel>}\n {children}\n </SelectPrimitive.Group>\n );\n});\nSelectGroup.displayName = 'SelectGroup';\n\n/**\n * Compose `Select` + `SelectTrigger` + `SelectContent` + `SelectItem` for a\n * single-choice picker. Keyboard, type-ahead, and ARIA come from Radix.\n *\n * @example Basic\n * <Select onValueChange={setStatus}>\n * <SelectTrigger placeholder=\"Status\" />\n * <SelectContent>\n * <SelectItem value=\"open\">Open</SelectItem>\n * <SelectItem value=\"closed\">Closed</SelectItem>\n * </SelectContent>\n * </Select>\n *\n * @example Grouped\n * <SelectContent>\n * <SelectGroup label=\"People\">\n * <SelectItem value=\"anu\">Anu</SelectItem>\n * <SelectItem value=\"bat\">Bat</SelectItem>\n * </SelectGroup>\n * <SelectSeparator />\n * <SelectGroup label=\"Bots\">\n * <SelectItem value=\"robo\">Robo</SelectItem>\n * </SelectGroup>\n * </SelectContent>\n *\n * @do Use `placeholder` on the trigger when there is no default value.\n * @dont Use Select for more than ~12 options — switch to `Combobox`.\n */\n","import { forwardRef, useMemo, type HTMLAttributes } from 'react';\nimport { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n} from './Select';\n\nexport interface PaginationProps extends HTMLAttributes<HTMLElement> {\n /** 1-indexed current page. */\n page: number;\n /** Total number of pages. Set to 0 to hide page numbers. */\n pageCount: number;\n /** Called with the new page when navigating. */\n onPageChange: (page: number) => void;\n /** Total item count, for the \"Showing 1-20 of 200\" hint. Omit to hide. */\n totalItems?: number;\n /** Items shown per page (controlled if `onPageSizeChange` is provided). */\n pageSize?: number;\n /** Options for the page-size select. */\n pageSizeOptions?: number[];\n /** Called when the user picks a new page size. */\n onPageSizeChange?: (size: number) => void;\n /** Show first/last (« ») jump buttons. Default true. */\n showJump?: boolean;\n}\n\nfunction pageRange(current: number, total: number, max = 7): (number | 'gap')[] {\n if (total <= max) return Array.from({ length: total }, (_, i) => i + 1);\n const window = 1;\n const result: (number | 'gap')[] = [];\n const start = Math.max(2, current - window);\n const end = Math.min(total - 1, current + window);\n\n result.push(1);\n if (start > 2) result.push('gap');\n for (let i = start; i <= end; i++) result.push(i);\n if (end < total - 1) result.push('gap');\n result.push(total);\n return result;\n}\n\n/**\n * Numbered pagination with prev/next, first/last jumps, page-size selector,\n * and item-count summary.\n *\n * @example\n * <Pagination page={page} pageCount={20} onPageChange={setPage}\n * totalItems={400} pageSize={20}\n * pageSizeOptions={[10, 20, 50]} onPageSizeChange={setSize} />\n *\n * @do Place the count summary on the left and controls on the right.\n * @dont Show numbers when there are >100 pages — use a \"jump to\" input instead.\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n page,\n pageCount,\n onPageChange,\n totalItems,\n pageSize,\n pageSizeOptions,\n onPageSizeChange,\n showJump = true,\n className,\n ...props\n },\n ref,\n) {\n const pages = useMemo(() => pageRange(page, pageCount), [page, pageCount]);\n\n const from = pageSize ? (page - 1) * pageSize + 1 : undefined;\n const to = pageSize && totalItems ? Math.min(page * pageSize, totalItems) : undefined;\n\n const goto = (p: number) => {\n if (p < 1 || p > pageCount || p === page) return;\n onPageChange(p);\n };\n\n return (\n <nav\n ref={ref}\n aria-label=\"Pagination\"\n className={cn('flex flex-wrap items-center justify-between gap-3', className)}\n {...props}\n >\n <div className=\"flex items-center gap-3 text-sm text-foreground-muted\">\n {totalItems !== undefined && pageSize !== undefined && (\n <span className=\"tabular\">\n Showing {from}–{to} of {totalItems}\n </span>\n )}\n {pageSizeOptions && onPageSizeChange && pageSize !== undefined && (\n <div className=\"flex items-center gap-2\">\n <label htmlFor=\"page-size\" className=\"sr-only\">\n Rows per page\n </label>\n <Select value={String(pageSize)} onValueChange={(v) => onPageSizeChange(Number(v))}>\n <SelectTrigger size=\"sm\" className=\"w-[7.5rem] whitespace-nowrap\" />\n <SelectContent>\n {pageSizeOptions.map((s) => (\n <SelectItem key={s} value={String(s)}>\n {s} / page\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n )}\n </div>\n\n <ul className=\"flex items-center gap-1\">\n {showJump && (\n <li>\n <button\n type=\"button\"\n aria-label=\"Go to first page\"\n disabled={page === 1}\n onClick={() => goto(1)}\n className={navButtonClass}\n >\n <ChevronsLeft className=\"size-4\" aria-hidden />\n </button>\n </li>\n )}\n <li>\n <button\n type=\"button\"\n aria-label=\"Previous page\"\n disabled={page === 1}\n onClick={() => goto(page - 1)}\n className={navButtonClass}\n >\n <ChevronLeft className=\"size-4\" aria-hidden />\n </button>\n </li>\n {pages.map((p, i) =>\n p === 'gap' ? (\n <li key={`gap-${i}`} className=\"px-2 text-foreground-subtle\">\n …\n </li>\n ) : (\n <li key={p}>\n <button\n type=\"button\"\n aria-label={`Page ${p}`}\n aria-current={p === page ? 'page' : undefined}\n onClick={() => goto(p)}\n className={cn(\n 'inline-flex size-8 items-center justify-center rounded-md text-sm tabular outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n p === page\n ? 'bg-accent text-on-accent font-medium'\n : 'text-foreground-muted hover:bg-background-muted hover:text-foreground',\n )}\n >\n {p}\n </button>\n </li>\n ),\n )}\n <li>\n <button\n type=\"button\"\n aria-label=\"Next page\"\n disabled={page === pageCount}\n onClick={() => goto(page + 1)}\n className={navButtonClass}\n >\n <ChevronRight className=\"size-4\" aria-hidden />\n </button>\n </li>\n {showJump && (\n <li>\n <button\n type=\"button\"\n aria-label=\"Go to last page\"\n disabled={page === pageCount}\n onClick={() => goto(pageCount)}\n className={navButtonClass}\n >\n <ChevronsRight className=\"size-4\" aria-hidden />\n </button>\n </li>\n )}\n </ul>\n </nav>\n );\n});\nPagination.displayName = 'Pagination';\n\nconst navButtonClass = cn(\n 'inline-flex size-8 items-center justify-center rounded-md text-foreground-muted',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-muted hover:text-foreground',\n 'disabled:opacity-50 disabled:pointer-events-none',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n);\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { cn } from '@/lib/utils';\n\nexport const Popover = PopoverPrimitive.Root;\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\nexport const PopoverClose = PopoverPrimitive.Close;\n\nexport const PopoverContent = forwardRef<\n ElementRef<typeof PopoverPrimitive.Content>,\n ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(function PopoverContent({ className, align = 'center', sideOffset = 4, ...props }, ref) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-popover)] w-72 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-md',\n 'outline-none',\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-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1',\n 'data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n});\nPopoverContent.displayName = 'PopoverContent';\n\n/**\n * @example\n * <Popover>\n * <PopoverTrigger asChild><Button variant=\"outline\">Options</Button></PopoverTrigger>\n * <PopoverContent>…</PopoverContent>\n * </Popover>\n *\n * @do Reserve Popover for low-stakes, transient UI — pickers, mini-forms.\n * @dont Use Popover for navigation menus — that's DropdownMenu.\n */\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type SVGProps,\n} from 'react';\nimport * as ProgressPrimitive from '@radix-ui/react-progress';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Linear — bar that fills left-to-right.\n * Circular — SVG ring. Both support determinate (value 0..100) and\n * indeterminate (`value` omitted) states.\n * --------------------------------------------------------------------------- */\n\nexport interface ProgressProps\n extends Omit<ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>, 'value'> {\n /** 0–100. Omit for indeterminate. */\n value?: number | null;\n /** Bar height. */\n size?: 'sm' | 'md' | 'lg';\n /** Visual tone. Use `success`/`danger` to colour-code completion state. */\n tone?: 'accent' | 'success' | 'warning' | 'danger';\n}\n\nconst heightMap = { sm: 'h-1', md: 'h-1.5', lg: 'h-2' } as const;\nconst fillTone = {\n accent: 'bg-accent',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-danger',\n} as const;\n\n/**\n * Linear progress bar.\n *\n * @example\n * <Progress value={uploadPct} aria-label=\"Upload progress\" />\n * <Progress aria-label=\"Loading\" /> // indeterminate\n *\n * @do Always pair Progress with an `aria-label` describing what is progressing.\n * @dont Use a Progress for an unknown-completion task — use a Spinner.\n */\nexport const Progress = forwardRef<ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n function Progress({ className, value, size = 'md', tone = 'accent', ...props }, ref) {\n const indeterminate = value === undefined || value === null;\n return (\n <ProgressPrimitive.Root\n ref={ref}\n value={indeterminate ? undefined : value}\n className={cn(\n 'relative w-full overflow-hidden rounded-full bg-background-muted',\n heightMap[size],\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className={cn(\n 'h-full w-full flex-1 transition-transform',\n fillTone[tone],\n indeterminate && 'animate-[progressIndeterminate_1.4s_ease-in-out_infinite] origin-left',\n )}\n style={\n indeterminate\n ? undefined\n : { transform: `translateX(-${100 - (value ?? 0)}%)` }\n }\n />\n {/* Keyframes inline so consumers don't need to register them globally. */}\n <style>{`\n @keyframes progressIndeterminate {\n 0% { transform: translateX(-100%) scaleX(0.6); }\n 50% { transform: translateX(0%) scaleX(0.4); }\n 100% { transform: translateX(100%) scaleX(0.6); }\n }\n `}</style>\n </ProgressPrimitive.Root>\n );\n },\n);\nProgress.displayName = 'Progress';\n\nexport interface ProgressCircleProps extends SVGProps<SVGSVGElement> {\n /** 0–100. Omit for indeterminate. */\n value?: number;\n /** Pixel size of the SVG. */\n size?: number;\n /** Stroke thickness. */\n thickness?: number;\n /** Visible label for screen readers. */\n 'aria-label': string;\n tone?: 'accent' | 'success' | 'warning' | 'danger';\n}\n\nconst circleTone = {\n accent: 'stroke-accent',\n success: 'stroke-success',\n warning: 'stroke-warning',\n danger: 'stroke-danger',\n} as const;\n\n/**\n * Circular progress ring. Pairs with a numeric label for percentage-style\n * indicators.\n *\n * @example\n * <ProgressCircle value={72} aria-label=\"Storage used\" />\n */\nexport const ProgressCircle = forwardRef<SVGSVGElement, ProgressCircleProps>(function ProgressCircle(\n { value, size = 36, thickness = 3, className, tone = 'accent', ...props },\n ref,\n) {\n const isIndeterminate = value === undefined;\n const radius = (size - thickness) / 2;\n const circumference = 2 * Math.PI * radius;\n const offset = isIndeterminate ? 0 : circumference - (Math.min(100, Math.max(0, value)) / 100) * circumference;\n\n return (\n <svg\n ref={ref}\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={isIndeterminate ? undefined : value}\n className={cn('shrink-0', isIndeterminate && 'animate-spin', className)}\n {...props}\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n strokeWidth={thickness}\n className=\"stroke-background-muted fill-none\"\n />\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n strokeWidth={thickness}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={isIndeterminate ? circumference * 0.7 : offset}\n className={cn(circleTone[tone], 'fill-none transition-[stroke-dashoffset]')}\n transform={`rotate(-90 ${size / 2} ${size / 2})`}\n />\n </svg>\n );\n});\nProgressCircle.displayName = 'ProgressCircle';\n","import {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { cn } from '@/lib/utils';\n\nexport interface RadioGroupProps\n extends ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {\n /** Lay out the radios horizontally (default) or vertically. */\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport const RadioGroup = forwardRef<\n ElementRef<typeof RadioGroupPrimitive.Root>,\n RadioGroupProps\n>(function RadioGroup({ className, orientation = 'vertical', ...props }, ref) {\n return (\n <RadioGroupPrimitive.Root\n ref={ref}\n className={cn(\n 'flex gap-3',\n orientation === 'vertical' ? 'flex-col' : 'flex-row flex-wrap',\n className,\n )}\n {...props}\n />\n );\n});\nRadioGroup.displayName = 'RadioGroup';\n\nexport interface RadioItemProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'asChild'> {\n label?: ReactNode;\n description?: ReactNode;\n hideLabel?: boolean;\n}\n\n/**\n * One radio option with inline label + description.\n *\n * @example\n * <RadioGroup defaultValue=\"weekly\">\n * <RadioItem value=\"daily\" label=\"Daily\" description=\"Every morning at 9am\" />\n * <RadioItem value=\"weekly\" label=\"Weekly\" description=\"Monday mornings\" />\n * <RadioItem value=\"never\" label=\"Never\" />\n * </RadioGroup>\n *\n * @do Pair every RadioItem with a label — naked radios are unreachable for\n * screen reader users.\n * @dont Use RadioGroup for binary choices — use Switch.\n */\nexport const RadioItem = forwardRef<\n ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioItemProps\n>(function RadioItem({ className, label, description, hideLabel, id, disabled, ...props }, ref) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const descId = description ? `${fieldId}-desc` : undefined;\n\n return (\n <div className={cn('flex items-start gap-2.5', className)}>\n <RadioGroupPrimitive.Item\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={descId}\n className={cn(\n 'mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border bg-card',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'data-[state=checked]:border-accent',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'border-border-strong',\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <span className=\"size-2 rounded-full bg-accent\" aria-hidden />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n\n {label && (\n <div className={cn('flex flex-col gap-0.5', hideLabel && 'sr-only')}>\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm text-foreground select-none',\n disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n {label}\n </label>\n {description && (\n <p id={descId} className=\"text-xs text-foreground-subtle\">\n {description}\n </p>\n )}\n </div>\n )}\n </div>\n );\n});\nRadioItem.displayName = 'RadioItem';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\nimport { cn } from '@/lib/utils';\n\n/**\n * Custom scroll container with consistent styled scrollbars across OS / browsers.\n * Use when the default OS scrollbar would visually clash (sidebars, command\n * palettes, code panes). Falls back to native scroll inside the viewport.\n *\n * @example\n * <ScrollArea className=\"h-64 rounded-md border border-border\">\n * <div className=\"p-3\">…long content…</div>\n * </ScrollArea>\n */\nexport const ScrollArea = forwardRef<\n ElementRef<typeof ScrollAreaPrimitive.Root>,\n ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(function ScrollArea({ className, children, ...props }, ref) {\n return (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport const ScrollBar = forwardRef<\n ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(function ScrollBar({ className, orientation = 'vertical', ...props }, ref) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex touch-none select-none transition-colors duration-[var(--duration-fast)]',\n orientation === 'vertical' && 'h-full w-2 border-l border-l-transparent p-px',\n orientation === 'horizontal' && 'h-2 flex-col border-t border-t-transparent p-px',\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border-strong\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n});\nScrollBar.displayName = 'ScrollBar';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport { cn } from '@/lib/utils';\n\n/**\n * Hairline divider. Decorative by default (no role announced). Pass\n * `decorative={false}` when the separator carries semantic meaning, e.g.\n * splitting two regions in a landmark.\n *\n * @example Section divider\n * <Separator className=\"my-6\" />\n *\n * @example Vertical inside a toolbar\n * <Separator orientation=\"vertical\" className=\"h-5 mx-2\" />\n */\nexport const Separator = forwardRef<\n ElementRef<typeof SeparatorPrimitive.Root>,\n ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(function Separator(\n { className, orientation = 'horizontal', decorative = true, ...props },\n ref,\n) {\n return (\n <SeparatorPrimitive.Root\n ref={ref}\n orientation={orientation}\n decorative={decorative}\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});\nSeparator.displayName = 'Separator';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n} from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Sheet — drawer-style overlay. Built on Radix Dialog (focus trap, escape,\n * click-outside come from there). Slides in from one of four sides.\n * --------------------------------------------------------------------------- */\n\nexport const Sheet = DialogPrimitive.Root;\nexport const SheetTrigger = DialogPrimitive.Trigger;\nexport const SheetClose = DialogPrimitive.Close;\nexport const SheetPortal = DialogPrimitive.Portal;\n\nconst SheetOverlay = forwardRef<\n ElementRef<typeof DialogPrimitive.Overlay>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(function SheetOverlay({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n className,\n )}\n {...props}\n />\n );\n});\nSheetOverlay.displayName = 'SheetOverlay';\n\nconst sheet = cva(\n [\n 'fixed z-[var(--z-modal)] bg-card text-card-foreground shadow-lg',\n 'flex flex-col gap-4 p-6',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:duration-[var(--duration-base)] data-[state=open]:duration-[var(--duration-slow)]',\n ],\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b border-border data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top',\n bottom:\n 'inset-x-0 bottom-0 border-t border-border data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 max-w-md border-r border-border data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left',\n right:\n 'inset-y-0 right-0 h-full w-3/4 max-w-md border-l border-border data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right',\n },\n },\n defaultVariants: { side: 'right' },\n },\n);\n\nexport interface SheetContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof sheet> {\n showClose?: boolean;\n}\n\nexport const SheetContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n SheetContentProps\n>(function SheetContent({ className, children, side = 'right', showClose = true, ...props }, ref) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <DialogPrimitive.Content ref={ref} className={cn(sheet({ side }), className)} {...props}>\n {children}\n {showClose && (\n <DialogPrimitive.Close\n aria-label=\"Close\"\n className={cn(\n 'absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-foreground-subtle',\n 'hover:bg-background-muted hover:text-foreground',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n <X className=\"size-4\" aria-hidden />\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </SheetPortal>\n );\n});\nSheetContent.displayName = 'SheetContent';\n\nexport function SheetHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('flex flex-col gap-1', className)} {...props} />;\n}\nSheetHeader.displayName = 'SheetHeader';\n\nexport function SheetFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('mt-auto flex flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\nSheetFooter.displayName = 'SheetFooter';\n\nexport const SheetTitle = forwardRef<\n ElementRef<typeof DialogPrimitive.Title>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(function SheetTitle({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground leading-tight', className)}\n {...props}\n />\n );\n});\nSheetTitle.displayName = 'SheetTitle';\n\nexport const SheetDescription = forwardRef<\n ElementRef<typeof DialogPrimitive.Description>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(function SheetDescription({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-foreground-muted', className)}\n {...props}\n />\n );\n});\nSheetDescription.displayName = 'SheetDescription';\n\n/**\n * @example Right-side filter drawer\n * <Sheet>\n * <SheetTrigger asChild><Button variant=\"outline\">Filters</Button></SheetTrigger>\n * <SheetContent side=\"right\">\n * <SheetHeader>\n * <SheetTitle>Filters</SheetTitle>\n * <SheetDescription>Refine the result set.</SheetDescription>\n * </SheetHeader>\n * …\n * <SheetFooter>\n * <SheetClose asChild><Button variant=\"outline\">Cancel</Button></SheetClose>\n * <Button>Apply</Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n *\n * @do Use right side for filters/inspectors, left for navigation, bottom for\n * mobile sheets.\n * @dont Use a full-screen sheet on desktop — prefer Dialog or a dedicated page.\n */\n","import {\n createContext,\n forwardRef,\n useContext,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { ChevronDown, ChevronsLeft, ChevronsRight } from '@/icons';\nimport { cn } from '@/lib/utils';\n\ninterface SidebarContextValue {\n collapsed: boolean;\n}\nconst SidebarContext = createContext<SidebarContextValue>({ collapsed: false });\n\n/** Read the parent Sidebar's collapsed state. Useful for brand/footer slots\n * that need to swap between full and compact rendering. */\nexport function useSidebar(): SidebarContextValue {\n return useContext(SidebarContext);\n}\n\nexport interface SidebarProps extends HTMLAttributes<HTMLElement> {\n /** Default state on first mount. Use `defaultCollapsed` for uncontrolled. */\n defaultCollapsed?: boolean;\n /** Controlled collapsed state. */\n collapsed?: boolean;\n /** Called when the user toggles via the rail or keyboard. */\n onCollapsedChange?: (next: boolean) => void;\n /** Header slot pinned to the top (brand, workspace switcher, etc.). */\n header?: ReactNode;\n /** Footer slot pinned to the bottom (user card, version, etc.). */\n footer?: ReactNode;\n}\n\n/**\n * App-level navigation rail. Holds `SidebarSection` → `SidebarItem` lists,\n * and optionally a `footer`. Supports collapse to icon-only on desktop.\n *\n * @example\n * <Sidebar footer={<UserCard />}>\n * <SidebarSection label=\"Workspace\">\n * <SidebarItem icon={<Home />} active>Home</SidebarItem>\n * <SidebarItem icon={<Folder />}>Projects</SidebarItem>\n * </SidebarSection>\n * <SidebarSection label=\"Account\">\n * <SidebarItem icon={<Settings />}>Settings</SidebarItem>\n * </SidebarSection>\n * </Sidebar>\n *\n * @do Use 1–3 sections. More than that signals the IA needs restructuring.\n * @dont Hide critical navigation under the collapsed state — keep icons\n * always visible with tooltips.\n */\nexport const Sidebar = forwardRef<HTMLElement, SidebarProps>(function Sidebar(\n {\n defaultCollapsed = false,\n collapsed: controlled,\n onCollapsedChange,\n header,\n footer,\n className,\n children,\n ...props\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultCollapsed);\n const collapsed = controlled ?? internal;\n const setCollapsed = (next: boolean) => {\n if (controlled === undefined) setInternal(next);\n onCollapsedChange?.(next);\n };\n\n return (\n <SidebarContext.Provider value={{ collapsed }}>\n <aside\n ref={ref}\n aria-label=\"Primary\"\n className={cn(\n 'sticky top-0 hidden md:flex h-screen shrink-0 flex-col gap-2 border-r border-border bg-background-subtle',\n 'transition-[width] duration-[var(--duration-base)] ease-[var(--ease-out)]',\n collapsed ? 'w-14' : 'w-60',\n className,\n )}\n {...props}\n >\n {header && (\n <div\n className={cn(\n 'flex h-14 shrink-0 items-center overflow-hidden border-b border-border',\n collapsed ? 'justify-center px-2' : 'px-3',\n )}\n >\n {header}\n </div>\n )}\n <div className=\"flex-1 overflow-y-auto py-3\">{children}</div>\n {footer && (\n <div className=\"border-t border-border p-2\">{footer}</div>\n )}\n <button\n type=\"button\"\n onClick={() => setCollapsed(!collapsed)}\n aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n aria-expanded={!collapsed}\n className={cn(\n 'flex h-8 items-center gap-2 mx-2 mb-2 rounded-md px-2 text-foreground-subtle',\n 'hover:bg-background-muted hover:text-foreground outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n {collapsed ? <ChevronsRight className=\"size-4\" aria-hidden /> : <ChevronsLeft className=\"size-4\" aria-hidden />}\n {!collapsed && <span className=\"text-xs font-medium\">Collapse</span>}\n </button>\n </aside>\n </SidebarContext.Provider>\n );\n});\nSidebar.displayName = 'Sidebar';\n\nexport interface SidebarSectionProps extends HTMLAttributes<HTMLDivElement> {\n /** Visible section header. Hidden when collapsed. */\n label?: ReactNode;\n}\n\nexport function SidebarSection({ label, className, children, ...props }: SidebarSectionProps) {\n const { collapsed } = useContext(SidebarContext);\n return (\n <div className={cn('mb-3', className)} {...props}>\n {label && !collapsed && (\n <div className=\"px-4 pb-1 pt-2 text-xs font-medium text-foreground-subtle uppercase tracking-wide\">\n {label}\n </div>\n )}\n <ul className=\"flex flex-col gap-px\">{children}</ul>\n </div>\n );\n}\nSidebarSection.displayName = 'SidebarSection';\n\nexport interface SidebarItemProps extends HTMLAttributes<HTMLAnchorElement> {\n /** Lucide icon shown to the left. */\n icon?: ReactNode;\n /** Mark as the current page. */\n active?: boolean;\n /** Optional `href` — when absent, renders as a `<button>` so consumers can\n * bind their own handler / routing wrapper via `onClick`. */\n href?: string;\n /** Trailing badge / counter slot. */\n trailing?: ReactNode;\n /** Render a sub-item indented under a parent. */\n sub?: boolean;\n}\n\nexport function SidebarItem({\n icon,\n active,\n href,\n trailing,\n sub,\n className,\n children,\n ...props\n}: SidebarItemProps) {\n const { collapsed } = useContext(SidebarContext);\n const Comp: any = href ? 'a' : 'button';\n return (\n <li>\n <Comp\n href={href}\n aria-current={active ? 'page' : undefined}\n className={cn(\n 'mx-2 flex h-8 items-center gap-2 rounded-md px-2 text-sm outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n active\n ? 'bg-background-muted text-foreground font-medium'\n : 'text-foreground-muted hover:bg-background-muted hover:text-foreground',\n sub && !collapsed && 'ml-6',\n collapsed && 'justify-center',\n className,\n )}\n {...props}\n >\n {icon && <span className=\"flex shrink-0 items-center [&_svg]:size-4\">{icon}</span>}\n {!collapsed && <span className=\"flex-1 truncate text-left\">{children}</span>}\n {!collapsed && trailing && <span className=\"ml-auto\">{trailing}</span>}\n </Comp>\n </li>\n );\n}\nSidebarItem.displayName = 'SidebarItem';\n\n/** Lightweight collapsible sub-section inside the sidebar. */\nexport interface SidebarGroupProps {\n icon?: ReactNode;\n label: ReactNode;\n defaultOpen?: boolean;\n children: ReactNode;\n}\n\nexport function SidebarGroup({ icon, label, defaultOpen = true, children }: SidebarGroupProps) {\n const { collapsed } = useContext(SidebarContext);\n const [open, setOpen] = useState(defaultOpen);\n if (collapsed) return <>{children}</>;\n return (\n <li>\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n aria-expanded={open}\n className={cn(\n 'mx-2 flex h-8 w-[calc(100%-1rem)] items-center gap-2 rounded-md px-2 text-sm text-foreground-muted outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-muted hover:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n )}\n >\n {icon && <span className=\"flex shrink-0 items-center [&_svg]:size-4\">{icon}</span>}\n <span className=\"flex-1 text-left\">{label}</span>\n <ChevronDown className={cn('size-3.5 transition-transform', open && 'rotate-180')} aria-hidden />\n </button>\n {open && <ul className=\"flex flex-col gap-px\">{children}</ul>}\n </li>\n );\n}\nSidebarGroup.displayName = 'SidebarGroup';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as SliderPrimitive from '@radix-ui/react-slider';\nimport { cn } from '@/lib/utils';\n\nexport interface SliderProps\n extends Omit<ComponentPropsWithoutRef<typeof SliderPrimitive.Root>, 'value' | 'defaultValue'> {\n /**\n * Controlled value. Pass `[n]` for a single-thumb slider, `[a, b]` for a range slider.\n */\n value?: number[];\n defaultValue?: number[];\n /** Inline label rendered above the slider. */\n label?: ReactNode;\n /** Show the numeric value next to the label. */\n showValue?: boolean;\n /** Format the displayed value (e.g. `(v) => \\`${v}%\\``). */\n formatValue?: (value: number) => string;\n}\n\n/**\n * Single- or range-thumb slider. Pass one item in `value` for a single\n * thumb, two for a range.\n *\n * @example Single value\n * <Slider label=\"Volume\" showValue defaultValue={[60]} max={100} step={1} />\n *\n * @example Price range\n * <Slider label=\"Price\"\n * defaultValue={[50, 250]}\n * min={0} max={500} step={10}\n * formatValue={(v) => \\`$\\${v}\\`}\n * showValue />\n *\n * @do Use `showValue` when the absolute number matters (price, volume, weight).\n * @dont Hide the value when users will need to reason about exact thresholds.\n */\nexport const Slider = forwardRef<ElementRef<typeof SliderPrimitive.Root>, SliderProps>(\n function Slider(\n {\n className,\n label,\n showValue,\n formatValue = (v) => String(v),\n value,\n defaultValue,\n ...props\n },\n ref,\n ) {\n const currentValue = value ?? defaultValue ?? [0];\n const isRange = currentValue.length > 1;\n\n return (\n <div className={cn('flex flex-col gap-2', className)}>\n {(label || showValue) && (\n <div className=\"flex items-center justify-between\">\n {label && <span className=\"text-sm font-medium text-foreground\">{label}</span>}\n {showValue && (\n <span className=\"text-xs tabular text-foreground-muted font-mono\">\n {isRange\n ? `${formatValue(currentValue[0])} – ${formatValue(currentValue[1])}`\n : formatValue(currentValue[0])}\n </span>\n )}\n </div>\n )}\n\n <SliderPrimitive.Root\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n className=\"relative flex w-full touch-none select-none items-center\"\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-1 w-full grow overflow-hidden rounded-full bg-background-muted\">\n <SliderPrimitive.Range className=\"absolute h-full bg-accent\" />\n </SliderPrimitive.Track>\n {currentValue.map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n className={cn(\n 'block size-4 rounded-full border-2 border-accent bg-card shadow-sm',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'transition-transform duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'hover:scale-110 disabled:pointer-events-none disabled:opacity-50',\n )}\n aria-label={isRange ? (i === 0 ? 'Minimum' : 'Maximum') : (label ? String(label) : 'Value')}\n />\n ))}\n </SliderPrimitive.Root>\n </div>\n );\n },\n);\n\nSlider.displayName = 'Slider';\n","import { forwardRef, type SVGProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface SpinnerProps extends SVGProps<SVGSVGElement> {\n /** Visual weight. */\n tone?: 'accent' | 'neutral' | 'on-accent';\n /** Pixel size. */\n size?: 'sm' | 'md' | 'lg';\n /** Accessible label. Required unless `decorative` is true. */\n label?: string;\n /** Hide from assistive tech (set when a parent already announces busy state). */\n decorative?: boolean;\n}\n\nconst sizeMap = { sm: 'size-3.5', md: 'size-4', lg: 'size-6' };\nconst toneMap = {\n accent: 'text-accent',\n neutral: 'text-foreground-subtle',\n 'on-accent': 'text-on-accent',\n};\n\n/**\n * Small indeterminate progress indicator. Use when the operation duration is\n * unknown and Progress isn't appropriate.\n *\n * @example\n * <Spinner label=\"Loading users\" />\n * <Button loading>Saving…</Button> // uses Spinner internally\n *\n * @do Provide a `label` so the busy state is announced.\n * @dont Use a Spinner for tasks that take 300ms+; use Skeleton instead.\n */\nexport const Spinner = forwardRef<SVGSVGElement, SpinnerProps>(function Spinner(\n { className, tone = 'accent', size = 'md', label, decorative, ...props },\n ref,\n) {\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 24 24\"\n role={decorative ? undefined : 'status'}\n aria-label={decorative ? undefined : label ?? 'Loading'}\n aria-hidden={decorative || undefined}\n className={cn('animate-spin', sizeMap[size], toneMap[tone], className)}\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeOpacity={0.2} fill=\"none\" />\n <path\n d=\"M12 2a10 10 0 0 1 10 10\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n});\nSpinner.displayName = 'Spinner';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { Check } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface Step {\n /** Step heading. */\n title: ReactNode;\n /** Optional secondary description, only shown in vertical orientation. */\n description?: ReactNode;\n}\n\nexport interface StepperProps extends HTMLAttributes<HTMLOListElement> {\n /** Ordered list of steps. */\n steps: Step[];\n /** 0-indexed active step. Steps before it are marked complete. */\n current: number;\n /** Layout direction. */\n orientation?: 'horizontal' | 'vertical';\n}\n\n/**\n * Multi-step progress indicator. Use the horizontal variant in narrow flows\n * (top of an onboarding modal) and vertical for deeper context.\n *\n * @example Onboarding\n * <Stepper\n * current={step}\n * steps={[\n * { title: 'Workspace' },\n * { title: 'Invite team' },\n * { title: 'Connect data' },\n * { title: 'Done' },\n * ]}\n * />\n *\n * @do Keep titles 1–2 words. Save explanations for the page body.\n * @dont Use Stepper for free-form navigation. It implies a linear flow.\n */\nexport const Stepper = forwardRef<HTMLOListElement, StepperProps>(function Stepper(\n { steps, current, orientation = 'horizontal', className, ...props },\n ref,\n) {\n return (\n <ol\n ref={ref}\n aria-label=\"Progress\"\n className={cn(\n orientation === 'horizontal' ? 'flex w-full items-center' : 'flex flex-col gap-6',\n className,\n )}\n {...props}\n >\n {steps.map((step, i) => {\n const state = i < current ? 'complete' : i === current ? 'current' : 'upcoming';\n const isLast = i === steps.length - 1;\n return (\n <li\n key={i}\n aria-current={state === 'current' ? 'step' : undefined}\n className={cn(\n orientation === 'horizontal'\n ? 'flex flex-1 items-center gap-3 last:flex-initial'\n : 'flex items-start gap-3',\n )}\n >\n <div className={cn(orientation === 'horizontal' ? 'flex items-center gap-3' : 'flex flex-col items-center')}>\n <span\n aria-hidden\n className={cn(\n 'inline-flex size-7 items-center justify-center rounded-full text-xs font-semibold transition-colors',\n state === 'complete' && 'bg-accent text-on-accent',\n state === 'current' && 'bg-card border-2 border-accent text-accent',\n state === 'upcoming' && 'bg-background-muted text-foreground-subtle border border-border',\n )}\n >\n {state === 'complete' ? <Check className=\"size-4\" /> : i + 1}\n </span>\n {orientation === 'vertical' && !isLast && (\n <span\n className={cn(\n 'mt-1 w-px flex-1 min-h-6',\n i < current ? 'bg-accent' : 'bg-border',\n )}\n />\n )}\n </div>\n <div className={cn('flex flex-col', orientation === 'horizontal' && 'min-w-0')}>\n <span\n className={cn(\n 'text-sm font-medium',\n state === 'upcoming' ? 'text-foreground-subtle' : 'text-foreground',\n )}\n >\n {step.title}\n </span>\n {orientation === 'vertical' && step.description && (\n <p className=\"text-xs text-foreground-muted mt-0.5\">{step.description}</p>\n )}\n </div>\n {orientation === 'horizontal' && !isLast && (\n <span\n aria-hidden\n className={cn(\n 'h-px flex-1 mx-2',\n i < current ? 'bg-accent' : 'bg-border',\n )}\n />\n )}\n </li>\n );\n })}\n </ol>\n );\n});\nStepper.displayName = 'Stepper';\n","import {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as SwitchPrimitive from '@radix-ui/react-switch';\nimport { cn } from '@/lib/utils';\n\nexport interface SwitchProps\n extends Omit<ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, 'asChild'> {\n /** Inline label rendered to the right. */\n label?: ReactNode;\n /** Secondary description rendered below the label. */\n description?: ReactNode;\n /** Position the label before the switch instead of after. */\n labelPosition?: 'before' | 'after';\n /** Visual size. */\n size?: 'sm' | 'md';\n /** Hide the label visually while keeping it accessible. */\n hideLabel?: boolean;\n}\n\nconst trackSize = {\n sm: 'h-4 w-7',\n md: 'h-5 w-9',\n} as const;\nconst thumbSize = {\n sm: 'size-3 data-[state=checked]:translate-x-3',\n md: 'size-4 data-[state=checked]:translate-x-4',\n} as const;\n\n/**\n * Binary on/off toggle for instant-apply settings. Use Checkbox when the\n * choice is part of a form that needs explicit submission.\n *\n * @example Instant toggle\n * <Switch label=\"Email digest\" checked={on} onCheckedChange={setOn} />\n *\n * @example With description\n * <Switch label=\"Two-factor authentication\"\n * description=\"Required for admins on production accounts.\"\n * checked={tfa}\n * onCheckedChange={setTfa} />\n *\n * @do Use Switch when the change takes effect immediately. Pair with\n * a toast confirming the new state.\n * @dont Use Switch inside a form that requires submission — Checkbox\n * better matches that mental model.\n */\nexport const Switch = forwardRef<ElementRef<typeof SwitchPrimitive.Root>, SwitchProps>(\n function Switch(\n {\n className,\n label,\n description,\n labelPosition = 'after',\n size = 'md',\n hideLabel,\n id,\n disabled,\n ...props\n },\n ref,\n ) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const descId = description ? `${fieldId}-desc` : undefined;\n\n const control = (\n <SwitchPrimitive.Root\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={descId}\n className={cn(\n 'peer inline-flex shrink-0 items-center rounded-full border-2 border-transparent',\n 'transition-colors duration-[var(--duration-base)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[state=checked]:bg-accent data-[state=unchecked]:bg-neutral-300 dark:data-[state=unchecked]:bg-neutral-700',\n trackSize[size],\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n 'pointer-events-none block rounded-full bg-white shadow-sm',\n 'transition-transform duration-[var(--duration-base)] ease-[var(--ease-out)]',\n 'translate-x-0',\n thumbSize[size],\n )}\n />\n </SwitchPrimitive.Root>\n );\n\n const labelBlock = label && (\n <div className={cn('flex flex-col gap-0.5 select-none', hideLabel && 'sr-only')}>\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm text-foreground',\n disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n {label}\n </label>\n {description && (\n <p id={descId} className=\"text-xs text-foreground-subtle\">\n {description}\n </p>\n )}\n </div>\n );\n\n return (\n <div className={cn('inline-flex items-center gap-2.5', className)}>\n {labelPosition === 'before' && labelBlock}\n {control}\n {labelPosition === 'after' && labelBlock}\n </div>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Two visual variants — `underline` (refined-minimal default) and `pills`.\n * Variant is set on `TabsList`; trigger styles auto-derive via data-attr.\n * --------------------------------------------------------------------------- */\n\nexport const Tabs = TabsPrimitive.Root;\n\nconst list = cva('inline-flex items-center', {\n variants: {\n variant: {\n underline: 'gap-4 border-b border-border w-full',\n pills: 'gap-1 rounded-lg bg-background-muted p-1',\n },\n size: {\n sm: 'h-9 text-xs',\n md: 'h-10 text-sm',\n lg: 'h-11 text-sm',\n },\n },\n defaultVariants: { variant: 'underline', size: 'md' },\n});\n\nexport interface TabsListProps\n extends ComponentPropsWithoutRef<typeof TabsPrimitive.List>,\n VariantProps<typeof list> {}\n\nexport const TabsList = forwardRef<ElementRef<typeof TabsPrimitive.List>, TabsListProps>(\n function TabsList({ className, variant = 'underline', size, ...props }, ref) {\n return (\n <TabsPrimitive.List\n ref={ref}\n data-variant={variant}\n className={cn(list({ variant, size }), className)}\n {...props}\n />\n );\n },\n);\nTabsList.displayName = 'TabsList';\n\nexport const TabsTrigger = forwardRef<\n ElementRef<typeof TabsPrimitive.Trigger>,\n ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(function TabsTrigger({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'inline-flex items-center gap-2 whitespace-nowrap font-medium',\n 'outline-none transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:pointer-events-none disabled:opacity-50',\n // Underline variant\n '[[data-variant=underline]_&]:relative [[data-variant=underline]_&]:h-full',\n '[[data-variant=underline]_&]:px-1 [[data-variant=underline]_&]:text-foreground-muted',\n '[[data-variant=underline]_&]:hover:text-foreground',\n '[[data-variant=underline]_&]:data-[state=active]:text-foreground',\n '[[data-variant=underline]_&]:data-[state=active]:after:absolute',\n '[[data-variant=underline]_&]:data-[state=active]:after:inset-x-0',\n '[[data-variant=underline]_&]:data-[state=active]:after:-bottom-px',\n '[[data-variant=underline]_&]:data-[state=active]:after:h-0.5',\n '[[data-variant=underline]_&]:data-[state=active]:after:bg-accent',\n // Pills variant\n '[[data-variant=pills]_&]:h-full [[data-variant=pills]_&]:rounded-md [[data-variant=pills]_&]:px-3',\n '[[data-variant=pills]_&]:text-foreground-muted',\n '[[data-variant=pills]_&]:hover:text-foreground',\n '[[data-variant=pills]_&]:data-[state=active]:bg-card',\n '[[data-variant=pills]_&]:data-[state=active]:text-foreground',\n '[[data-variant=pills]_&]:data-[state=active]:shadow-xs',\n className,\n )}\n {...props}\n />\n );\n});\nTabsTrigger.displayName = 'TabsTrigger';\n\nexport const TabsContent = forwardRef<\n ElementRef<typeof TabsPrimitive.Content>,\n ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(function TabsContent({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'mt-4 outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n className,\n )}\n {...props}\n />\n );\n});\nTabsContent.displayName = 'TabsContent';\n\n/**\n * @example Underline (default)\n * <Tabs defaultValue=\"overview\">\n * <TabsList>\n * <TabsTrigger value=\"overview\">Overview</TabsTrigger>\n * <TabsTrigger value=\"activity\">Activity</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"overview\">…</TabsContent>\n * <TabsContent value=\"activity\">…</TabsContent>\n * </Tabs>\n *\n * @example Pills\n * <TabsList variant=\"pills\"><TabsTrigger value=\"all\">All</TabsTrigger>…</TabsList>\n *\n * @do Use `underline` at the top of a page or panel. Use `pills` inside a\n * card or for filter-style switches.\n * @dont Mix variants on the same screen — pick one and commit.\n */\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n type TextareaHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface TextareaProps\n extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Visible label above the field. */\n label?: ReactNode;\n /** Hint below the field. Hidden when `error` is set. */\n helperText?: ReactNode;\n /** Validation message. Sets `aria-invalid`. */\n error?: ReactNode;\n /** Grow vertically as content is added. */\n autoResize?: boolean;\n /** Minimum rows when `autoResize`. Defaults to 3. */\n minRows?: number;\n /** Maximum rows before scrolling when `autoResize`. Defaults to 12. */\n maxRows?: number;\n /** Visually hide the label while keeping it accessible. */\n hideLabel?: boolean;\n}\n\n/**\n * Multi-line text input. With `autoResize`, height tracks content from\n * `minRows` to `maxRows`. Without it, behaves like a native `<textarea>`.\n *\n * @example Comment box\n * <Textarea label=\"Note\" autoResize minRows={3} maxRows={10} />\n *\n * @example With error\n * <Textarea label=\"Description\"\n * error={errors.description?.message}\n * {...register('description')} />\n *\n * @do Default to `autoResize` for multi-line free-form input.\n * @dont Add `resize-none` without auto-resize — users will be stuck with a\n * 3-line box for long content.\n */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n {\n className,\n label,\n helperText,\n error,\n autoResize,\n minRows = 3,\n maxRows = 12,\n hideLabel,\n id,\n onChange,\n value,\n defaultValue,\n ...props\n },\n ref,\n) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const helperId = `${fieldId}-helper`;\n const errorId = `${fieldId}-error`;\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n // Stash a ref locally and forward to the consumer.\n const setRef = (node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLTextAreaElement | null>).current = node;\n };\n\n const recompute = useCallback(() => {\n const el = innerRef.current;\n if (!el || !autoResize) return;\n el.style.height = 'auto';\n const lineHeight = parseFloat(getComputedStyle(el).lineHeight) || 20;\n const maxH = lineHeight * maxRows;\n el.style.height = `${Math.min(el.scrollHeight, maxH)}px`;\n el.style.overflowY = el.scrollHeight > maxH ? 'auto' : 'hidden';\n }, [autoResize, maxRows]);\n\n useEffect(() => {\n if (autoResize) recompute();\n }, [autoResize, recompute, value, defaultValue]);\n\n return (\n <div className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm font-medium text-foreground',\n hideLabel && 'sr-only',\n )}\n >\n {label}\n </label>\n )}\n <textarea\n ref={setRef}\n id={fieldId}\n rows={minRows}\n value={value}\n defaultValue={defaultValue}\n onChange={(e) => {\n onChange?.(e);\n if (autoResize) recompute();\n }}\n aria-invalid={Boolean(error) || undefined}\n aria-describedby={error ? errorId : helperText ? helperId : undefined}\n className={cn(\n 'rounded-md border bg-card px-3 py-2 text-sm text-foreground',\n 'placeholder:text-foreground-subtle',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n error\n ? 'border-danger focus-visible:border-danger focus-visible:ring-danger'\n : 'border-border focus-visible:border-accent',\n autoResize ? 'resize-none' : 'resize-y min-h-20',\n )}\n {...props}\n />\n {error ? (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-xs text-foreground-subtle\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nTextarea.displayName = 'Textarea';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactElement,\n} from 'react';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport { AlertTriangle, CheckCircle2, Info, X, XCircle } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nexport const ToastProvider = ToastPrimitive.Provider;\n\nexport const ToastViewport = forwardRef<\n ElementRef<typeof ToastPrimitive.Viewport>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Viewport>\n>(function ToastViewport({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Viewport\n ref={ref}\n className={cn(\n 'fixed bottom-0 right-0 z-[var(--z-toast)] flex max-h-screen w-full flex-col-reverse gap-2 p-6',\n 'sm:bottom-auto sm:top-4 sm:right-4 sm:max-w-sm sm:flex-col',\n className,\n )}\n {...props}\n />\n );\n});\nToastViewport.displayName = 'ToastViewport';\n\nconst toast = cva(\n [\n 'group pointer-events-auto relative flex w-full items-start gap-3',\n 'overflow-hidden rounded-lg border p-4 pr-8 shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-right-full',\n 'data-[state=closed]:slide-out-to-right-full',\n 'data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)]',\n 'data-[swipe=cancel]:translate-x-0 data-[swipe=cancel]:transition-transform',\n 'data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)]',\n ],\n {\n variants: {\n variant: {\n default: 'border-border bg-card text-card-foreground',\n success: 'border-success-border-soft bg-success-soft text-success-text',\n warning: 'border-warning-border-soft bg-warning-soft text-warning-text',\n danger: 'border-danger-border-soft bg-danger-soft text-danger-text',\n info: 'border-info-border-soft bg-info-soft text-info-text',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconMap = {\n default: null,\n success: <CheckCircle2 className=\"size-5 text-success-text shrink-0 mt-0.5\" aria-hidden />,\n warning: <AlertTriangle className=\"size-5 text-warning-text shrink-0 mt-0.5\" aria-hidden />,\n danger: <XCircle className=\"size-5 text-danger-text shrink-0 mt-0.5\" aria-hidden />,\n info: <Info className=\"size-5 text-info-text shrink-0 mt-0.5\" aria-hidden />,\n} satisfies Record<'default' | 'success' | 'warning' | 'danger' | 'info', ReactElement | null>;\n\nexport interface ToastProps\n extends ComponentPropsWithoutRef<typeof ToastPrimitive.Root>,\n VariantProps<typeof toast> {}\n\nexport const Toast = forwardRef<ElementRef<typeof ToastPrimitive.Root>, ToastProps>(\n function Toast({ className, variant = 'default', children, ...props }, ref) {\n return (\n <ToastPrimitive.Root ref={ref} className={cn(toast({ variant }), className)} {...props}>\n {iconMap[variant ?? 'default']}\n <div className=\"flex-1 space-y-1\">{children}</div>\n </ToastPrimitive.Root>\n );\n },\n);\nToast.displayName = 'Toast';\n\nexport const ToastTitle = forwardRef<\n ElementRef<typeof ToastPrimitive.Title>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Title>\n>(function ToastTitle({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Title\n ref={ref}\n className={cn('text-sm font-medium', className)}\n {...props}\n />\n );\n});\nToastTitle.displayName = 'ToastTitle';\n\nexport const ToastDescription = forwardRef<\n ElementRef<typeof ToastPrimitive.Description>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Description>\n>(function ToastDescription({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n );\n});\nToastDescription.displayName = 'ToastDescription';\n\nexport const ToastAction = forwardRef<\n ElementRef<typeof ToastPrimitive.Action>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Action>\n>(function ToastAction({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Action\n ref={ref}\n className={cn(\n 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-current bg-transparent px-3 text-sm font-medium',\n 'transition-colors hover:bg-current/10 outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card',\n className,\n )}\n {...props}\n />\n );\n});\nToastAction.displayName = 'ToastAction';\n\nexport const ToastClose = forwardRef<\n ElementRef<typeof ToastPrimitive.Close>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Close>\n>(function ToastClose({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Close\n ref={ref}\n aria-label=\"Close\"\n className={cn(\n 'absolute right-2 top-2 inline-flex size-7 items-center justify-center rounded-md text-foreground-subtle',\n 'opacity-0 transition-opacity group-hover:opacity-100 hover:text-foreground',\n 'outline-none focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring',\n className,\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-4\" aria-hidden />\n </ToastPrimitive.Close>\n );\n});\nToastClose.displayName = 'ToastClose';\n\n/**\n * @example\n * <ToastProvider>\n * …app…\n * <Toast variant=\"success\">\n * <ToastTitle>Saved</ToastTitle>\n * <ToastDescription>Your changes are live.</ToastDescription>\n * <ToastAction altText=\"Undo\">Undo</ToastAction>\n * <ToastClose />\n * </Toast>\n * <ToastViewport />\n * </ToastProvider>\n *\n * @do Use the `useToast()` hook (in `src/hooks/use-toast.ts`) in app code —\n * the components here are the primitives the hook renders.\n * @dont Stack more than two toasts at a time. Newer toasts replace older ones.\n */\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { cn } from '@/lib/utils';\n\n/**\n * Wrap the app in a single `<TooltipProvider>` near the root. All Tooltips\n * share the same `delayDuration` and `skipDelayDuration`.\n */\nexport const TooltipProvider = ({\n delayDuration = 500,\n skipDelayDuration = 200,\n ...props\n}: ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>) => (\n <TooltipPrimitive.Provider\n delayDuration={delayDuration}\n skipDelayDuration={skipDelayDuration}\n {...props}\n />\n);\n\nexport const TooltipRoot = TooltipPrimitive.Root;\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\nexport const TooltipContent = forwardRef<\n ElementRef<typeof TooltipPrimitive.Content>,\n ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(function TooltipContent({ className, sideOffset = 4, ...props }, ref) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-tooltip)] overflow-hidden rounded-md px-2 py-1 text-xs font-medium',\n 'bg-neutral-900 text-neutral-50',\n 'dark:bg-neutral-50 dark:text-neutral-900',\n 'shadow-sm max-w-xs',\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 className,\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = 'TooltipContent';\n\nexport interface TooltipProps {\n children: ReactNode;\n label: ReactNode;\n side?: 'top' | 'right' | 'bottom' | 'left';\n align?: 'start' | 'center' | 'end';\n /** Disable showing the tooltip (e.g. when text is not truncated). */\n disabled?: boolean;\n /** Override the global delay. */\n delayDuration?: number;\n}\n\n/**\n * Shorthand for the most common Tooltip case.\n *\n * @example\n * <Tooltip label=\"Copy link\"><IconButton aria-label=\"Copy\" icon={<Copy/>} /></Tooltip>\n *\n * @do Keep tooltip text short — one line, no full sentences. Use a Popover\n * for any content that needs structure.\n * @dont Wrap disabled buttons in Tooltip without `asChild + tabIndex={0}`.\n * Disabled elements don't receive focus, so the tooltip never opens.\n */\nexport function Tooltip({\n children,\n label,\n side = 'top',\n align = 'center',\n disabled,\n delayDuration,\n}: TooltipProps) {\n if (disabled) return <>{children}</>;\n return (\n <TooltipRoot delayDuration={delayDuration}>\n <TooltipTrigger asChild>{children}</TooltipTrigger>\n <TooltipContent side={side} align={align}>\n {label}\n </TooltipContent>\n </TooltipRoot>\n );\n}\nTooltip.displayName = 'Tooltip';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface TopNavProps extends HTMLAttributes<HTMLElement> {\n /** Logo / wordmark slot. Shown on the far left. */\n logo: ReactNode;\n /** Primary navigation links — typically a list of `<TopNavLink>`. */\n nav?: ReactNode;\n /** Search / command bar slot — fills the centre on wide screens. */\n search?: ReactNode;\n /** Right-aligned cluster — notifications, theme toggle, user menu. */\n actions?: ReactNode;\n}\n\n/**\n * App-level top bar. Layout: `logo · nav · search · actions`. Search and nav\n * are optional.\n *\n * @example\n * <TopNav\n * logo={<Logo />}\n * nav={<><TopNavLink href=\"/\" active>Home</TopNavLink>…</>}\n * search={<Input type=\"search\" placeholder=\"Search…\" />}\n * actions={<><Bell /><Avatar /></>}\n * />\n *\n * @do Pick one primary nav style — links here or in the Sidebar, not both.\n * @dont Stack two rows of navigation in the TopNav. If you need tabs as well,\n * put them below the bar inside the page content.\n */\nexport const TopNav = forwardRef<HTMLElement, TopNavProps>(function TopNav(\n { logo, nav, search, actions, className, ...props },\n ref,\n) {\n return (\n <header\n ref={ref}\n className={cn(\n 'sticky top-0 z-[var(--z-sticky)] flex h-14 w-full items-center gap-4',\n 'border-b border-border bg-background/80 px-4 backdrop-blur',\n 'supports-[backdrop-filter]:bg-background/60',\n className,\n )}\n {...props}\n >\n <div className=\"flex items-center gap-6 shrink-0\">\n {logo}\n {nav && <nav className=\"hidden md:flex items-center gap-1\">{nav}</nav>}\n </div>\n {search && <div className=\"flex-1 max-w-md mx-auto\">{search}</div>}\n {actions && <div className=\"ml-auto flex items-center gap-2 shrink-0\">{actions}</div>}\n </header>\n );\n});\nTopNav.displayName = 'TopNav';\n\nexport interface TopNavLinkProps extends HTMLAttributes<HTMLAnchorElement> {\n href: string;\n active?: boolean;\n}\n\nexport const TopNavLink = forwardRef<HTMLAnchorElement, TopNavLinkProps>(function TopNavLink(\n { href, active, className, children, ...props },\n ref,\n) {\n return (\n <a\n ref={ref}\n href={href}\n aria-current={active ? 'page' : undefined}\n className={cn(\n 'inline-flex h-9 items-center rounded-md px-3 text-sm font-medium outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n active ? 'text-foreground' : 'text-foreground-muted hover:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n className,\n )}\n {...props}\n >\n {children}\n </a>\n );\n});\nTopNavLink.displayName = 'TopNavLink';\n","import { createContext, forwardRef, useCallback, useContext, useEffect, useState, type HTMLAttributes } from 'react';\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { IconButton } from './IconButton';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype CarouselOptions = Parameters<typeof useEmblaCarousel>[0];\n\ninterface CarouselContextValue {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: CarouselApi;\n canPrev: boolean;\n canNext: boolean;\n scrollPrev: () => void;\n scrollNext: () => void;\n orientation: 'horizontal' | 'vertical';\n}\n\nconst CarouselContext = createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel() {\n const ctx = useContext(CarouselContext);\n if (!ctx) throw new Error('Carousel components must be used inside <Carousel>');\n return ctx;\n}\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n opts?: CarouselOptions;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n}\n\n/**\n * Embla-backed carousel. Compose with `<CarouselContent>`, `<CarouselItem>`,\n * `<CarouselPrevious>`, and `<CarouselNext>`.\n */\nexport const Carousel = forwardRef<HTMLDivElement, CarouselProps>(function Carousel(\n { opts, orientation = 'horizontal', setApi, className, children, ...props },\n ref,\n) {\n const [carouselRef, api] = useEmblaCarousel({ ...opts, axis: orientation === 'horizontal' ? 'x' : 'y' });\n const [canPrev, setCanPrev] = useState(false);\n const [canNext, setCanNext] = useState(false);\n\n const onSelect = useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanPrev(api.canScrollPrev());\n setCanNext(api.canScrollNext());\n }, []);\n\n useEffect(() => {\n if (!api) return;\n setApi?.(api);\n onSelect(api);\n api.on('reInit', onSelect).on('select', onSelect);\n return () => {\n api.off('reInit', onSelect).off('select', onSelect);\n };\n }, [api, onSelect, setApi]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api,\n canPrev,\n canNext,\n scrollPrev: () => api?.scrollPrev(),\n scrollNext: () => api?.scrollNext(),\n orientation,\n }}\n >\n <div ref={ref} className={cn('relative', className)} role=\"region\" aria-roledescription=\"carousel\" {...props}>\n {children}\n </div>\n </CarouselContext.Provider>\n );\n});\n\nexport const CarouselContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CarouselContent({ className, ...props }, ref) {\n const { carouselRef, orientation } = useCarousel();\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n 'flex',\n orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',\n className,\n )}\n {...props}\n />\n </div>\n );\n },\n);\n\nexport const CarouselItem = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CarouselItem({ className, ...props }, ref) {\n const { orientation } = useCarousel();\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n 'min-w-0 shrink-0 grow-0 basis-full',\n orientation === 'horizontal' ? 'pl-4' : 'pt-4',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nexport function CarouselPrevious({ className }: { className?: string }) {\n const { canPrev, scrollPrev, orientation } = useCarousel();\n return (\n <IconButton\n aria-label=\"Previous\"\n variant=\"outline\"\n disabled={!canPrev}\n onClick={scrollPrev}\n icon={<ChevronLeft />}\n className={cn(\n 'absolute z-10',\n orientation === 'horizontal'\n ? '-left-12 top-1/2 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n />\n );\n}\n\nexport function CarouselNext({ className }: { className?: string }) {\n const { canNext, scrollNext, orientation } = useCarousel();\n return (\n <IconButton\n aria-label=\"Next\"\n variant=\"outline\"\n disabled={!canNext}\n onClick={scrollNext}\n icon={<ChevronRight />}\n className={cn(\n 'absolute z-10',\n orientation === 'horizontal'\n ? '-right-12 top-1/2 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n />\n );\n}\n","import { type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Tiny, dependency-free chart primitives for inline dashboards. For complex\n * visualisations reach for a charting library (Recharts, visx). These suffice\n * for sparklines, KPI cards, and at-a-glance trends.\n */\n\nexport interface ChartPoint {\n x: string | number;\n y: number;\n}\n\nexport interface ChartProps {\n data: ChartPoint[];\n /** Defaults to 24px height per point + 60px padding. */\n height?: number;\n /** Defaults to fluid 100%. */\n width?: number | string;\n /** Tooltip / label rendered above the chart. */\n caption?: ReactNode;\n className?: string;\n}\n\nfunction useScales(data: ChartPoint[], w: number, h: number, padding = 8) {\n const ys = data.map((d) => d.y);\n const min = Math.min(0, ...ys);\n const max = Math.max(...ys, 1);\n const range = max - min || 1;\n const innerW = w - padding * 2;\n const innerH = h - padding * 2;\n const sx = (i: number) =>\n data.length <= 1 ? padding + innerW / 2 : padding + (i / (data.length - 1)) * innerW;\n const sy = (v: number) => padding + innerH - ((v - min) / range) * innerH;\n return { sx, sy, min, max };\n}\n\nexport function LineChart({ data, height = 80, width = '100%', caption, className }: ChartProps) {\n const w = typeof width === 'number' ? width : 320;\n const { sx, sy } = useScales(data, w, height);\n const path = data.map((d, i) => `${i === 0 ? 'M' : 'L'}${sx(i).toFixed(1)},${sy(d.y).toFixed(1)}`).join(' ');\n\n return (\n <figure className={cn('flex flex-col gap-1.5', className)}>\n {caption && <figcaption className=\"text-xs text-foreground-muted\">{caption}</figcaption>}\n <svg viewBox={`0 0 ${w} ${height}`} width={width} height={height} role=\"img\">\n <path d={path} fill=\"none\" stroke=\"var(--color-accent)\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n {data.map((d, i) => (\n <circle key={i} cx={sx(i)} cy={sy(d.y)} r={2} fill=\"var(--color-accent)\" />\n ))}\n </svg>\n </figure>\n );\n}\n\nexport function AreaChart({ data, height = 80, width = '100%', caption, className }: ChartProps) {\n const w = typeof width === 'number' ? width : 320;\n const { sx, sy } = useScales(data, w, height);\n const top = data.map((d, i) => `${i === 0 ? 'M' : 'L'}${sx(i).toFixed(1)},${sy(d.y).toFixed(1)}`).join(' ');\n const area = `${top} L${sx(data.length - 1).toFixed(1)},${height} L${sx(0).toFixed(1)},${height} Z`;\n\n return (\n <figure className={cn('flex flex-col gap-1.5', className)}>\n {caption && <figcaption className=\"text-xs text-foreground-muted\">{caption}</figcaption>}\n <svg viewBox={`0 0 ${w} ${height}`} width={width} height={height} role=\"img\">\n <path d={area} fill=\"var(--color-accent-soft)\" />\n <path d={top} fill=\"none\" stroke=\"var(--color-accent)\" strokeWidth={1.5} />\n </svg>\n </figure>\n );\n}\n\nexport function BarChart({ data, height = 100, width = '100%', caption, className }: ChartProps) {\n const w = typeof width === 'number' ? width : 320;\n const padding = 8;\n const gap = 2;\n const innerW = w - padding * 2;\n const barW = Math.max(2, innerW / data.length - gap);\n const ys = data.map((d) => d.y);\n const max = Math.max(...ys, 1);\n\n return (\n <figure className={cn('flex flex-col gap-1.5', className)}>\n {caption && <figcaption className=\"text-xs text-foreground-muted\">{caption}</figcaption>}\n <svg viewBox={`0 0 ${w} ${height}`} width={width} height={height} role=\"img\">\n {data.map((d, i) => {\n const h = ((d.y / max) * (height - padding * 2));\n return (\n <rect\n key={i}\n x={padding + i * (barW + gap)}\n y={height - padding - h}\n width={barW}\n height={h}\n fill=\"var(--color-accent)\"\n rx={1.5}\n >\n <title>{`${d.x}: ${d.y}`}</title>\n </rect>\n );\n })}\n </svg>\n </figure>\n );\n}\n","import { forwardRef, type ComponentPropsWithoutRef, type ElementRef, type HTMLAttributes } from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '@/lib/utils';\n\ntype Direction = 'top' | 'right' | 'bottom' | 'left';\n\nexport const Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: ComponentPropsWithoutRef<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\n);\nDrawer.displayName = 'Drawer';\n\nexport const DrawerTrigger = DrawerPrimitive.Trigger;\nexport const DrawerPortal = DrawerPrimitive.Portal;\nexport const DrawerClose = DrawerPrimitive.Close;\n\nexport const DrawerOverlay = forwardRef<\n ElementRef<typeof DrawerPrimitive.Overlay>,\n ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(function DrawerOverlay({ className, ...props }, ref) {\n return (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-black/40', className)}\n {...props}\n />\n );\n});\n\nconst directionStyles: Record<Direction, string> = {\n bottom:\n 'inset-x-0 bottom-0 mt-24 flex h-auto max-h-[90vh] flex-col rounded-t-xl border-t border-border',\n top: 'inset-x-0 top-0 mb-24 flex h-auto max-h-[90vh] flex-col rounded-b-xl border-b border-border',\n left: 'inset-y-0 left-0 flex h-full w-[420px] max-w-[90vw] flex-col rounded-r-xl border-r border-border',\n right: 'inset-y-0 right-0 flex h-full w-[420px] max-w-[90vw] flex-col rounded-l-xl border-l border-border',\n};\n\nconst handleStyles: Record<Direction, string> = {\n bottom: 'mx-auto mt-3 h-1.5 w-12 rounded-full bg-border',\n top: 'mx-auto mb-3 h-1.5 w-12 rounded-full bg-border order-last',\n left: 'mx-1.5 my-auto h-12 w-1.5 rounded-full bg-border order-last self-stretch shrink-0',\n right: 'mx-1.5 my-auto h-12 w-1.5 rounded-full bg-border shrink-0 self-stretch',\n};\n\nexport interface DrawerContentProps\n extends ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> {\n /** Side the drawer slides in from. Default `bottom`. */\n direction?: Direction;\n /** Hide the drag handle. */\n hideHandle?: boolean;\n}\n\nexport const DrawerContent = forwardRef<\n ElementRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(function DrawerContent(\n { className, direction = 'bottom', hideHandle, children, ...props },\n ref,\n) {\n const isHorizontal = direction === 'left' || direction === 'right';\n return (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed z-50 bg-card',\n directionStyles[direction],\n isHorizontal && 'flex-row',\n className,\n )}\n {...props}\n >\n {!hideHandle && <div aria-hidden className={handleStyles[direction]} />}\n <div className={cn('min-h-0 min-w-0 flex-1', isHorizontal && 'flex flex-col')}>\n {children}\n </div>\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n});\n\nexport function DrawerHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('grid gap-1 p-4 text-center sm:text-left', className)} {...props} />;\n}\n\nexport function DrawerFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n}\n\nexport const DrawerTitle = forwardRef<\n ElementRef<typeof DrawerPrimitive.Title>,\n ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(function DrawerTitle({ className, ...props }, ref) {\n return (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold', className)}\n {...props}\n />\n );\n});\n\nexport const DrawerDescription = forwardRef<\n ElementRef<typeof DrawerPrimitive.Description>,\n ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(function DrawerDescription({ className, ...props }, ref) {\n return (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn('text-sm text-foreground-muted', className)}\n {...props}\n />\n );\n});\n","import { forwardRef, useCallback, useId, useRef, useState, type DragEvent as ReactDragEvent, type ReactNode } from 'react';\nimport { File as FileIcon, Upload, X } from 'lucide-react';\nimport { cn } from '@/lib/utils';\n\nexport interface FileUploadProps {\n /** Accepted file types, e.g. `image/*` or `.pdf,.docx`. */\n accept?: string;\n /** Allow multiple files. */\n multiple?: boolean;\n /** Max file size in bytes. Files larger than this are rejected. */\n maxSize?: number;\n /** Controlled file list. */\n value?: File[];\n /** Called when files are added or removed. */\n onChange?: (files: File[]) => void;\n /** Helper text inside the drop zone. */\n hint?: ReactNode;\n /** Disable the picker entirely. */\n disabled?: boolean;\n className?: string;\n}\n\nfunction formatSize(bytes: number) {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n}\n\n/**\n * Drag-and-drop file picker with an inline file list. Uncontrolled by default;\n * pass `value` + `onChange` to control externally.\n */\nexport const FileUpload = forwardRef<HTMLDivElement, FileUploadProps>(function FileUpload(\n { accept, multiple, maxSize, value, onChange, hint, disabled, className },\n ref,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n const inputId = useId();\n const [internal, setInternal] = useState<File[]>([]);\n const [over, setOver] = useState(false);\n const files = value ?? internal;\n\n const update = useCallback(\n (next: File[]) => {\n if (value === undefined) setInternal(next);\n onChange?.(next);\n },\n [onChange, value],\n );\n\n const addFiles = useCallback(\n (incoming: FileList | File[]) => {\n const arr = Array.from(incoming).filter(\n (f) => !maxSize || f.size <= maxSize,\n );\n update(multiple ? [...files, ...arr] : arr.slice(0, 1));\n },\n [files, maxSize, multiple, update],\n );\n\n const remove = (idx: number) => update(files.filter((_, i) => i !== idx));\n\n const onDrop = (e: ReactDragEvent<HTMLLabelElement>) => {\n e.preventDefault();\n setOver(false);\n if (disabled) return;\n addFiles(e.dataTransfer.files);\n };\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-3', className)}>\n <label\n htmlFor={inputId}\n onDragOver={(e) => {\n e.preventDefault();\n if (!disabled) setOver(true);\n }}\n onDragLeave={() => setOver(false)}\n onDrop={onDrop}\n className={cn(\n 'group relative flex cursor-pointer flex-col items-center justify-center gap-2',\n 'rounded-md border border-dashed border-border bg-background-subtle px-6 py-8',\n 'text-center transition-colors',\n 'hover:border-border-strong hover:bg-background-muted',\n over && 'border-accent bg-accent-soft',\n disabled && 'pointer-events-none opacity-50',\n )}\n >\n <Upload className=\"size-5 text-foreground-muted\" aria-hidden />\n <div className=\"space-y-1\">\n <p className=\"text-sm font-medium\">Drop files here, or click to browse</p>\n {hint && <p className=\"text-xs text-foreground-muted\">{hint}</p>}\n </div>\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n className=\"sr-only\"\n onChange={(e) => e.target.files && addFiles(e.target.files)}\n />\n </label>\n\n {files.length > 0 && (\n <ul className=\"flex flex-col gap-2\">\n {files.map((file, idx) => (\n <li\n key={`${file.name}-${idx}`}\n className=\"flex items-center gap-3 rounded-md border border-border bg-card px-3 py-2\"\n >\n <FileIcon className=\"size-4 shrink-0 text-foreground-muted\" aria-hidden />\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm\">{file.name}</p>\n <p className=\"text-xs text-foreground-muted\">{formatSize(file.size)}</p>\n </div>\n <button\n type=\"button\"\n onClick={() => remove(idx)}\n className=\"rounded p-1 text-foreground-muted hover:bg-background-muted hover:text-foreground\"\n aria-label={`Remove ${file.name}`}\n >\n <X className=\"size-4\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n});\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { CheckCircle2, Info, AlertTriangle, XCircle, X } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst snackbar = cva(\n [\n 'relative pointer-events-auto w-full max-w-md',\n 'flex items-start gap-3 rounded-md border bg-card p-3 shadow-md',\n 'text-sm text-foreground',\n ],\n {\n variants: {\n variant: {\n default: 'border-border',\n info: 'border-info-border-soft',\n success: 'border-success-border-soft',\n warning: 'border-warning-border-soft',\n danger: 'border-danger-border-soft',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconForVariant: Record<NonNullable<VariantProps<typeof snackbar>['variant']>, ReactNode> = {\n default: null,\n info: <Info className=\"size-4 shrink-0 mt-0.5 text-info-text\" aria-hidden />,\n success: <CheckCircle2 className=\"size-4 shrink-0 mt-0.5 text-success-text\" aria-hidden />,\n warning: <AlertTriangle className=\"size-4 shrink-0 mt-0.5 text-warning-text\" aria-hidden />,\n danger: <XCircle className=\"size-4 shrink-0 mt-0.5 text-danger-text\" aria-hidden />,\n};\n\nexport interface SnackbarProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>,\n VariantProps<typeof snackbar> {\n /** Headline. */\n title?: ReactNode;\n /** Action button rendered on the right. */\n action?: ReactNode;\n /** Show a close (×) button on the right. */\n onClose?: () => void;\n /** Override the variant's default icon. Pass `false` to hide. */\n icon?: ReactNode | false;\n}\n\n/**\n * Persistent inline notification. Unlike Toast, Snackbar does **not** auto-\n * dismiss. Pair with an `action` button or an `onClose` handler.\n */\nexport const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(function Snackbar(\n { className, variant = 'default', title, action, onClose, icon, children, ...props },\n ref,\n) {\n const renderedIcon = icon === false ? null : icon ?? iconForVariant[variant ?? 'default'];\n\n return (\n <div ref={ref} role=\"status\" className={cn(snackbar({ variant }), className)} {...props}>\n {renderedIcon}\n <div className=\"min-w-0 flex-1\">\n {title && <p className=\"font-medium\">{title}</p>}\n {children && <p className=\"text-foreground-muted\">{children}</p>}\n </div>\n {action}\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Dismiss\"\n className=\"rounded p-1 text-foreground-muted hover:bg-background-muted hover:text-foreground\"\n >\n <X className=\"size-4\" />\n </button>\n )}\n </div>\n );\n});\n","import { forwardRef, useCallback, useState, type KeyboardEvent } from 'react';\nimport { X } from 'lucide-react';\nimport { cn } from '@/lib/utils';\n\nexport interface TagInputProps {\n /** Controlled list of tags. */\n value?: string[];\n /** Default tags when uncontrolled. */\n defaultValue?: string[];\n /** Called when the tag list changes. */\n onChange?: (tags: string[]) => void;\n /** Placeholder shown inside the inline input. */\n placeholder?: string;\n /** Maximum number of tags. */\n max?: number;\n /** Disable the editor. */\n disabled?: boolean;\n /** Show a danger border. */\n error?: boolean;\n /** Treat these characters as separators (default: Enter + comma). */\n separators?: string[];\n className?: string;\n}\n\n/**\n * Chip-based multi-value input. Press Enter or comma to add. Backspace on an\n * empty input removes the last tag.\n */\nexport const TagInput = forwardRef<HTMLDivElement, TagInputProps>(function TagInput(\n {\n value,\n defaultValue = [],\n onChange,\n placeholder = 'Add and press Enter',\n max,\n disabled,\n error,\n separators = ['Enter', ','],\n className,\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(defaultValue);\n const [draft, setDraft] = useState('');\n const tags = value ?? internal;\n\n const update = useCallback(\n (next: string[]) => {\n if (value === undefined) setInternal(next);\n onChange?.(next);\n },\n [onChange, value],\n );\n\n const commit = (raw: string) => {\n const t = raw.trim();\n if (!t || tags.includes(t) || (max !== undefined && tags.length >= max)) return;\n update([...tags, t]);\n };\n\n const remove = (idx: number) => update(tags.filter((_, i) => i !== idx));\n\n const onKey = (e: KeyboardEvent<HTMLInputElement>) => {\n if (separators.includes(e.key)) {\n e.preventDefault();\n commit(draft);\n setDraft('');\n } else if (e.key === 'Backspace' && !draft && tags.length) {\n remove(tags.length - 1);\n }\n };\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-card px-2 py-1.5',\n 'transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring',\n error ? 'border-danger focus-within:border-danger focus-within:ring-danger' : 'border-border',\n disabled && 'pointer-events-none opacity-50',\n className,\n )}\n >\n {tags.map((t, i) => (\n <span\n key={`${t}-${i}`}\n className=\"inline-flex items-center gap-1 rounded bg-background-muted px-2 py-0.5 text-xs\"\n >\n {t}\n <button\n type=\"button\"\n onClick={() => remove(i)}\n className=\"rounded p-0.5 text-foreground-muted hover:bg-background-subtle hover:text-foreground\"\n aria-label={`Remove ${t}`}\n >\n <X className=\"size-3\" />\n </button>\n </span>\n ))}\n <input\n value={draft}\n disabled={disabled}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKey}\n onBlur={() => {\n if (draft) {\n commit(draft);\n setDraft('');\n }\n }}\n placeholder={tags.length === 0 ? placeholder : undefined}\n className=\"min-w-[8ch] flex-1 bg-transparent text-sm outline-none placeholder:text-foreground-subtle\"\n />\n </div>\n );\n});\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface TimelineProps extends HTMLAttributes<HTMLOListElement> {}\n\nexport const Timeline = forwardRef<HTMLOListElement, TimelineProps>(function Timeline(\n { className, children, ...props },\n ref,\n) {\n return (\n <ol ref={ref} className={cn('relative flex flex-col gap-6', className)} {...props}>\n {children}\n </ol>\n );\n});\n\nexport interface TimelineItemProps extends HTMLAttributes<HTMLLIElement> {\n /** Optional bullet override. Default: small accent dot. */\n bullet?: ReactNode;\n /** Hide the connector line below this item — use for the last item. */\n isLast?: boolean;\n}\n\nexport const TimelineItem = forwardRef<HTMLLIElement, TimelineItemProps>(function TimelineItem(\n { bullet, isLast, className, children, ...props },\n ref,\n) {\n return (\n <li ref={ref} className={cn('relative flex gap-4 pb-1', className)} {...props}>\n <div className=\"relative flex shrink-0 flex-col items-center\">\n <div className=\"flex size-6 items-center justify-center rounded-full border border-border bg-card text-foreground-muted\">\n {bullet ?? <span className=\"size-2 rounded-full bg-accent\" aria-hidden />}\n </div>\n {!isLast && <span className=\"mt-1 flex-1 w-px bg-border\" aria-hidden />}\n </div>\n <div className=\"min-w-0 flex-1 pb-4\">{children}</div>\n </li>\n );\n});\n\nexport function TimelineTime({ className, children }: { className?: string; children: ReactNode }) {\n return (\n <p className={cn('text-xs text-foreground-subtle', className)}>{children}</p>\n );\n}\n\nexport function TimelineTitle({\n className,\n children,\n}: {\n className?: string;\n children: ReactNode;\n}) {\n return <p className={cn('text-sm font-medium', className)}>{children}</p>;\n}\n\nexport function TimelineDescription({\n className,\n children,\n}: {\n className?: string;\n children: ReactNode;\n}) {\n return <p className={cn('mt-0.5 text-sm text-foreground-muted', className)}>{children}</p>;\n}\n","import { useState, type ReactNode } from 'react';\nimport { ChevronRight, File as FileIcon, Folder, FolderOpen } from 'lucide-react';\nimport { cn } from '@/lib/utils';\n\nexport interface TreeNode {\n id: string;\n label: ReactNode;\n /** If undefined the node is a leaf; if empty array it is an empty folder. */\n children?: TreeNode[];\n /** Optional custom icon (overrides default file/folder icons). */\n icon?: ReactNode;\n}\n\nexport interface TreeProps {\n /** The root nodes. */\n data: TreeNode[];\n /** Ids to expand by default. */\n defaultExpanded?: string[];\n /** Currently selected node id. */\n selectedId?: string;\n onSelect?: (id: string) => void;\n className?: string;\n}\n\n/**\n * Expandable file-tree style list. Single selection. Keyboard a11y is\n * handled at the row level (`tabIndex`, Enter, ArrowRight/Left to toggle).\n */\nexport function Tree({ data, defaultExpanded = [], selectedId, onSelect, className }: TreeProps) {\n const [expanded, setExpanded] = useState<Set<string>>(new Set(defaultExpanded));\n\n const toggle = (id: string) =>\n setExpanded((cur) => {\n const next = new Set(cur);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n\n function renderNode(node: TreeNode, depth: number): ReactNode {\n const hasChildren = !!node.children;\n const isOpen = expanded.has(node.id);\n const isSelected = selectedId === node.id;\n const DefaultIcon = hasChildren ? (isOpen ? FolderOpen : Folder) : FileIcon;\n\n return (\n <li key={node.id} role=\"treeitem\" aria-expanded={hasChildren ? isOpen : undefined}>\n <button\n type=\"button\"\n tabIndex={0}\n onClick={() => {\n onSelect?.(node.id);\n if (hasChildren) toggle(node.id);\n }}\n onKeyDown={(e) => {\n if (e.key === 'ArrowRight' && hasChildren && !isOpen) toggle(node.id);\n else if (e.key === 'ArrowLeft' && hasChildren && isOpen) toggle(node.id);\n }}\n style={{ paddingLeft: depth * 16 + 8 }}\n className={cn(\n 'flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left text-sm',\n 'hover:bg-background-muted focus-visible:bg-background-muted outline-none',\n isSelected && 'bg-accent-soft text-foreground',\n )}\n >\n {hasChildren ? (\n <ChevronRight\n className={cn('size-3.5 shrink-0 text-foreground-subtle transition-transform', isOpen && 'rotate-90')}\n aria-hidden\n />\n ) : (\n <span className=\"w-3.5 shrink-0\" aria-hidden />\n )}\n {node.icon ?? <DefaultIcon className=\"size-4 shrink-0 text-foreground-muted\" aria-hidden />}\n <span className=\"truncate\">{node.label}</span>\n </button>\n {hasChildren && isOpen && (\n <ul role=\"group\" className=\"mt-0.5\">\n {node.children!.map((c) => renderNode(c, depth + 1))}\n </ul>\n )}\n </li>\n );\n }\n\n return (\n <ul role=\"tree\" className={cn('flex flex-col gap-0.5', className)}>\n {data.map((n) => renderNode(n, 0))}\n </ul>\n );\n}\n","import { useState, type FormEvent, type ReactNode } from 'react';\nimport { ArrowRight, CheckCircle2, Mail } from '@/icons';\nimport { Button } from '@/components/ui/Button';\nimport { Input } from '@/components/ui/Input';\nimport { Alert } from '@/components/ui/Alert';\nimport { Separator } from '@/components/ui/Separator';\n\n/* -----------------------------------------------------------------------------\n * Authentication pattern — four screens that share the same shell.\n *\n * <AuthLayout title=\"…\" subtitle=\"…\">…form…</AuthLayout>\n *\n * Below: SignIn, SignUp, ForgotPassword, MagicLinkSent — each composed of\n * primitives. They emit events; the host app handles network calls.\n * --------------------------------------------------------------------------- */\n\nexport interface AuthLayoutProps {\n /** Brand mark shown above the title. */\n brand?: ReactNode;\n /** Page heading. */\n title: ReactNode;\n /** Secondary line under the title. */\n subtitle?: ReactNode;\n /** Form / content. */\n children: ReactNode;\n /** Footer slot — \"Don't have an account? Sign up\". */\n footer?: ReactNode;\n}\n\nexport function AuthLayout({ brand, title, subtitle, children, footer }: AuthLayoutProps) {\n return (\n <main className=\"grid min-h-screen place-items-center bg-background-subtle px-4 py-12\">\n <div className=\"w-full max-w-[400px] space-y-6\">\n {brand && <div className=\"flex justify-center\">{brand}</div>}\n <div className=\"space-y-2 text-center\">\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">{title}</h1>\n {subtitle && <p className=\"text-sm text-foreground-muted\">{subtitle}</p>}\n </div>\n <div className=\"rounded-lg border border-border bg-card p-6\">{children}</div>\n {footer && (\n <p className=\"text-center text-sm text-foreground-muted\">{footer}</p>\n )}\n </div>\n </main>\n );\n}\n\nexport interface SignInFormProps {\n onSubmit: (data: { email: string; password: string }) => void | Promise<void>;\n loading?: boolean;\n error?: ReactNode;\n forgotHref?: string;\n}\n\nexport function SignInForm({ onSubmit, loading, error, forgotHref = '/forgot' }: SignInFormProps) {\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n\n const handle = (e: FormEvent) => {\n e.preventDefault();\n onSubmit({ email, password });\n };\n\n return (\n <form onSubmit={handle} className=\"space-y-4\">\n {error && <Alert variant=\"danger\">{error}</Alert>}\n <Input\n type=\"email\"\n label=\"Email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n autoComplete=\"email\"\n required\n />\n <Input\n type=\"password\"\n label=\"Password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n autoComplete=\"current-password\"\n required\n />\n <div className=\"flex items-center justify-between text-sm\">\n <a\n href={forgotHref}\n className=\"font-medium text-accent hover:underline outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm\"\n >\n Forgot password?\n </a>\n </div>\n <Button type=\"submit\" loading={loading} className=\"w-full\" trailingIcon={<ArrowRight />}>\n Sign in\n </Button>\n </form>\n );\n}\n\nexport interface SignUpFormProps {\n onSubmit: (data: { name: string; email: string; password: string }) => void | Promise<void>;\n loading?: boolean;\n error?: ReactNode;\n}\n\nexport function SignUpForm({ onSubmit, loading, error }: SignUpFormProps) {\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n\n return (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n onSubmit({ name, email, password });\n }}\n className=\"space-y-4\"\n >\n {error && <Alert variant=\"danger\">{error}</Alert>}\n <Input label=\"Full name\" value={name} onChange={(e) => setName(e.target.value)} required />\n <Input\n type=\"email\"\n label=\"Work email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n autoComplete=\"email\"\n required\n />\n <Input\n type=\"password\"\n label=\"Password\"\n helperText=\"At least 8 characters.\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n autoComplete=\"new-password\"\n required\n />\n <Button type=\"submit\" loading={loading} className=\"w-full\">\n Create account\n </Button>\n <p className=\"text-xs text-foreground-subtle text-center\">\n By signing up you agree to our Terms of Service and Privacy Policy.\n </p>\n </form>\n );\n}\n\nexport interface ForgotPasswordFormProps {\n onSubmit: (email: string) => void | Promise<void>;\n loading?: boolean;\n error?: ReactNode;\n}\n\nexport function ForgotPasswordForm({ onSubmit, loading, error }: ForgotPasswordFormProps) {\n const [email, setEmail] = useState('');\n return (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n onSubmit(email);\n }}\n className=\"space-y-4\"\n >\n {error && <Alert variant=\"danger\">{error}</Alert>}\n <Input\n type=\"email\"\n label=\"Email\"\n helperText=\"We'll send a reset link if an account exists.\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n autoComplete=\"email\"\n required\n />\n <Button type=\"submit\" loading={loading} className=\"w-full\" leadingIcon={<Mail />}>\n Send reset link\n </Button>\n </form>\n );\n}\n\nexport interface MagicLinkSentProps {\n email: string;\n onResend?: () => void;\n}\n\nexport function MagicLinkSent({ email, onResend }: MagicLinkSentProps) {\n return (\n <div className=\"space-y-4 text-center\">\n <div className=\"mx-auto inline-flex size-12 items-center justify-center rounded-full bg-success-soft text-success-text\">\n <CheckCircle2 className=\"size-6\" aria-hidden />\n </div>\n <p className=\"text-sm text-foreground-muted\">\n We sent a sign-in link to{' '}\n <span className=\"font-medium text-foreground\">{email}</span>. Open it on this device to\n continue.\n </p>\n <Separator />\n <p className=\"text-xs text-foreground-subtle\">\n Didn't get it?{' '}\n <button\n type=\"button\"\n onClick={onResend}\n className=\"font-medium text-accent hover:underline outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm\"\n >\n Resend\n </button>\n </p>\n </div>\n );\n}\n","import { Fragment, useState, type ReactNode } from 'react';\nimport {\n BarChart3,\n Bell,\n Bookmark,\n Folder,\n HelpCircle,\n Home,\n Inbox,\n LayoutGrid,\n LogOut,\n Menu,\n Plug,\n Search,\n Settings,\n Sparkles,\n User,\n Users,\n} from '@/icons';\nimport { Avatar } from '@/components/ui/Avatar';\nimport { Badge } from '@/components/ui/Badge';\nimport { Card, CardDescription, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';\nimport { IconButton } from '@/components/ui/IconButton';\nimport { Input } from '@/components/ui/Input';\nimport { Kbd } from '@/components/ui/Kbd';\nimport { Sheet, SheetContent, SheetTrigger } from '@/components/ui/Sheet';\nimport { Sidebar, SidebarItem, SidebarSection } from '@/components/ui/Sidebar';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/components/ui/Table';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/ui/DropdownMenu';\n\n/* -----------------------------------------------------------------------------\n * Generic AppShell — sidebar (with brand in header + nav + footer) plus a\n * slim topbar holding search + notifications + profile dropdown.\n *\n * Sidebar nav, topbar actions, search, profile, and notifications are all\n * data-driven. Sensible defaults match the legacy demo so existing call\n * sites render unchanged.\n * --------------------------------------------------------------------------- */\n\nfunction navigate(hash: string) {\n if (typeof window === 'undefined') return;\n window.location.hash = hash;\n}\n\n/* -----------------------------------------------------------------------------\n * Public types\n * --------------------------------------------------------------------------- */\n\n/**\n * Legacy nav keys retained for back-compat. The `active` prop now accepts\n * any string — these are kept as a typed alias for consumers that hard-code\n * one of the original demo values.\n */\nexport type AppShellNavKey =\n | 'home'\n | 'projects'\n | 'inbox'\n | 'members'\n | 'insights'\n | 'bookmarks'\n | 'apps'\n | 'settings'\n | 'integrations'\n | 'help';\n\nexport interface AppShellNavItem {\n /** Active-state identifier — matches AppShell's `active` prop. */\n key: string;\n label: ReactNode;\n /** Leading icon. */\n icon?: ReactNode;\n /** Destination. Renders as <a href>; for SPAs intercept onClick. */\n href?: string;\n /** Right-aligned content (Badge, count). */\n trailing?: ReactNode;\n /** Optional click handler. */\n onClick?: () => void;\n}\n\nexport interface AppShellNavSection {\n /** Section heading shown above the items. */\n label?: ReactNode;\n items: AppShellNavItem[];\n}\n\nexport interface AppShellUser {\n name: ReactNode;\n email?: ReactNode;\n /** 1–2 char initials for the Avatar fallback. */\n initials: string;\n /** Online status — drives the Avatar status dot. */\n status?: 'online' | 'busy' | 'away' | 'offline';\n}\n\nexport interface AppShellNotification {\n id: string;\n who: { name: string; initials: string };\n action: ReactNode;\n target: ReactNode;\n when: ReactNode;\n unread?: boolean;\n onClick?: () => void;\n}\n\nexport interface AppShellProfileMenuItem {\n label: ReactNode;\n icon?: ReactNode;\n trailing?: ReactNode;\n onSelect?: () => void;\n /** Renders a separator before this item. */\n separatorAbove?: boolean;\n}\n\nexport interface AppShellProps {\n /** Page content. */\n children: ReactNode;\n /** Logo / wordmark rendered at the top of the sidebar. */\n brand: ReactNode;\n /** Which sidebar item is active. Matches `AppShellNavItem.key`. Defaults to `'home'`. */\n active?: string;\n /**\n * Sidebar nav sections. Defaults to the built-in demo nav. Pass an empty\n * array to hide the nav entirely, or use `sidebar` for a fully custom rail.\n */\n navSections?: AppShellNavSection[];\n /**\n * Escape hatch: replace the entire Sidebar contents. Takes precedence over\n * `navSections`. Use when you need custom section components, groups, etc.\n */\n sidebar?: ReactNode;\n /** Slot for additional topbar actions (left of notifications). */\n topbarActions?: ReactNode;\n /** Topbar search input — pass `false` to hide. */\n search?: ReactNode | false;\n /** Currently signed-in user, shown in the sidebar footer + profile menu. */\n user?: AppShellUser;\n /** Profile dropdown items. Defaults to the demo Profile / Settings / Sign out menu. */\n profileMenu?: AppShellProfileMenuItem[];\n /** Notification feed. Set to an empty array to hide the bell entirely. */\n notifications?: AppShellNotification[];\n /** Fires when the user clicks \"Mark all read\". */\n onMarkAllNotificationsRead?: () => void;\n /** Fires when the user clicks \"View all\" in the notifications menu. */\n onViewAllNotifications?: () => void;\n}\n\n/* -----------------------------------------------------------------------------\n * Default content (matches the legacy demo)\n * --------------------------------------------------------------------------- */\n\nconst DEFAULT_NAV_SECTIONS: AppShellNavSection[] = [\n {\n label: 'Workspace',\n items: [\n { key: 'home', label: 'Home', icon: <Home />, href: '#dashboard' },\n { key: 'projects', label: 'Projects', icon: <Folder />, href: '#data-table', trailing: <Badge tone=\"neutral\">12</Badge> },\n { key: 'inbox', label: 'Inbox', icon: <Inbox />, href: '#first-run', trailing: <Badge tone=\"accent\">5</Badge> },\n { key: 'members', label: 'Members', icon: <Users />, href: '#record', trailing: <Badge tone=\"neutral\">3</Badge> },\n { key: 'insights', label: 'Insights', icon: <BarChart3 />, href: '#dashboard' },\n ],\n },\n {\n label: 'Personal',\n items: [\n { key: 'bookmarks', label: 'Bookmarks', icon: <Bookmark />, href: '#pricing' },\n { key: 'apps', label: 'Apps', icon: <LayoutGrid />, href: '#onboarding' },\n ],\n },\n {\n label: 'Account',\n items: [\n { key: 'settings', label: 'Settings', icon: <Settings />, href: '#settings' },\n { key: 'integrations', label: 'Integrations', icon: <Plug />, href: '#settings' },\n { key: 'help', label: 'Help & docs', icon: <HelpCircle />, href: '#' },\n ],\n },\n];\n\nconst DEFAULT_USER: AppShellUser = {\n name: 'Bay Otgonbayar',\n email: 'bay@craftzbay.com',\n initials: 'BO',\n status: 'online',\n};\n\nconst DEFAULT_NOTIFICATIONS: AppShellNotification[] = [\n { id: 'n1', who: { name: 'Anu B.', initials: 'AB' }, action: 'mentioned you in', target: 'Q2 OKRs', when: '2m', unread: true },\n { id: 'n2', who: { name: 'Bat E.', initials: 'BE' }, action: 'requested review on', target: 'fix/login-flow', when: '18m', unread: true },\n { id: 'n3', who: { name: 'Tuya G.', initials: 'TG' }, action: 'commented on', target: 'feat/segments', when: '1h', unread: true },\n { id: 'n4', who: { name: 'Khulan O.', initials: 'KO' }, action: 'archived', target: 'old-billing-spike', when: '3h' },\n { id: 'n5', who: { name: 'Sara M.', initials: 'SM' }, action: 'invited you to', target: 'Atlas workspace', when: 'Yesterday' },\n];\n\nconst DEFAULT_PROFILE_MENU: AppShellProfileMenuItem[] = [\n { label: 'Profile', icon: <User className=\"size-4\" />, onSelect: () => navigate('record') },\n { label: 'Account settings', icon: <Settings className=\"size-4\" />, onSelect: () => navigate('settings') },\n {\n label: 'Upgrade plan',\n icon: <Sparkles className=\"size-4\" />,\n trailing: <Badge tone=\"accent\" className=\"ml-auto\">Pro</Badge>,\n onSelect: () => navigate('pricing'),\n },\n { label: 'Help & support', icon: <HelpCircle className=\"size-4\" />, onSelect: () => navigate('first-run'), separatorAbove: true },\n { label: 'Sign out', icon: <LogOut className=\"size-4\" />, onSelect: () => navigate('auth-signin'), separatorAbove: true },\n];\n\n/* -----------------------------------------------------------------------------\n * AppShell\n * --------------------------------------------------------------------------- */\n\n/**\n * AppShell — sticky sidebar + topbar shell for SaaS dashboards.\n *\n * @example Default — uses the built-in demo nav, user, notifications\n * <AppShell brand={<Logo />} active=\"home\">\n * <Dashboard />\n * </AppShell>\n *\n * @example Custom nav + user\n * <AppShell\n * brand={<Logo />}\n * active=\"projects\"\n * user={{ name: 'Avery Long', email: 'avery@acme.com', initials: 'AL', status: 'online' }}\n * navSections={[\n * { label: 'Workspace', items: [\n * { key: 'home', label: 'Home', icon: <Home />, href: '/' },\n * { key: 'projects', label: 'Projects', icon: <Folder />, href: '/projects',\n * trailing: <Badge tone=\"neutral\">{count}</Badge> },\n * ]},\n * ]}\n * notifications={data?.notifications ?? []}\n * >\n * <ProjectsPage />\n * </AppShell>\n */\nexport function AppShell({\n children,\n brand,\n active = 'home',\n navSections = DEFAULT_NAV_SECTIONS,\n sidebar,\n topbarActions,\n search,\n user = DEFAULT_USER,\n profileMenu = DEFAULT_PROFILE_MENU,\n notifications = DEFAULT_NOTIFICATIONS,\n onMarkAllNotificationsRead,\n onViewAllNotifications,\n}: AppShellProps) {\n return (\n <div className=\"flex min-h-screen w-full bg-background\">\n <Sidebar defaultCollapsed={false} header={brand} footer={<ProfileFooter user={user} />}>\n {sidebar ?? <RenderNavSections sections={navSections} active={active} />}\n </Sidebar>\n\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <TopBar\n brand={brand}\n active={active}\n navSections={navSections}\n sidebar={sidebar}\n user={user}\n search={search}\n topbarActions={topbarActions}\n notifications={notifications}\n profileMenu={profileMenu}\n onMarkAllNotificationsRead={onMarkAllNotificationsRead}\n onViewAllNotifications={onViewAllNotifications}\n />\n <main className=\"flex-1 overflow-y-auto p-4 md:p-8\">{children}</main>\n </div>\n </div>\n );\n}\n\nfunction RenderNavSections({\n sections,\n active,\n}: {\n sections: AppShellNavSection[];\n active: string;\n}) {\n return (\n <>\n {sections.map((section, si) => (\n <SidebarSection key={si} label={section.label}>\n {section.items.map((item) => (\n <SidebarItem\n key={item.key}\n href={item.href}\n icon={item.icon}\n active={item.key === active}\n trailing={item.trailing}\n onClick={item.onClick}\n >\n {item.label}\n </SidebarItem>\n ))}\n </SidebarSection>\n ))}\n </>\n );\n}\n\nfunction TopBar({\n brand,\n active,\n navSections,\n sidebar,\n user,\n search,\n topbarActions,\n notifications,\n profileMenu,\n onMarkAllNotificationsRead,\n onViewAllNotifications,\n}: {\n brand: ReactNode;\n active: string;\n navSections: AppShellNavSection[];\n sidebar: ReactNode | undefined;\n user: AppShellUser;\n search: ReactNode | false | undefined;\n topbarActions: ReactNode | undefined;\n notifications: AppShellNotification[];\n profileMenu: AppShellProfileMenuItem[];\n onMarkAllNotificationsRead?: () => void;\n onViewAllNotifications?: () => void;\n}) {\n const [open, setOpen] = useState(false);\n\n const searchNode =\n search === false ? null : (\n search ?? (\n <Input\n type=\"search\"\n placeholder=\"Search projects, members, files…\"\n hideLabel\n label=\"Search\"\n prefix={<Search />}\n suffix={<Kbd>⌘K</Kbd>}\n />\n )\n );\n\n return (\n <header className=\"sticky top-0 z-30 flex h-14 items-center gap-3 border-b border-border bg-background/80 px-4 backdrop-blur md:px-6\">\n {/* Mobile-only hamburger + brand */}\n <div className=\"flex items-center gap-2 md:hidden\">\n <Sheet open={open} onOpenChange={setOpen}>\n <SheetTrigger asChild>\n <IconButton aria-label=\"Open menu\" icon={<Menu />} variant=\"ghost\" size=\"sm\" />\n </SheetTrigger>\n <SheetContent side=\"left\" className=\"w-64 p-0\">\n <div className=\"flex h-14 shrink-0 items-center border-b border-border px-3\">\n {brand}\n </div>\n <div className=\"flex-1 overflow-y-auto py-3\" onClick={() => setOpen(false)}>\n {sidebar ?? <RenderNavSections sections={navSections} active={active} />}\n </div>\n <div className=\"border-t border-border p-2\">\n <ProfileFooter user={user} />\n </div>\n </SheetContent>\n </Sheet>\n <div className=\"text-sm\">{brand}</div>\n </div>\n\n {searchNode && (\n <div className=\"relative hidden max-w-xl flex-1 sm:block\">{searchNode}</div>\n )}\n\n <div className=\"ml-auto flex items-center gap-1\">\n {topbarActions}\n {notifications.length > 0 && (\n <NotificationMenu\n notifications={notifications}\n onMarkAllRead={onMarkAllNotificationsRead}\n onViewAll={onViewAllNotifications}\n />\n )}\n <ProfileMenu user={user} items={profileMenu} />\n </div>\n </header>\n );\n}\n\nfunction NotificationMenu({\n notifications,\n onMarkAllRead,\n onViewAll,\n}: {\n notifications: AppShellNotification[];\n onMarkAllRead?: () => void;\n onViewAll?: () => void;\n}) {\n const unread = notifications.filter((n) => n.unread).length;\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n aria-label={`Notifications${unread ? `, ${unread} unread` : ''}`}\n className=\"relative inline-flex size-9 items-center justify-center rounded-md text-foreground-muted outline-none transition-colors hover:bg-background-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n <Bell className=\"size-4\" />\n {unread > 0 && (\n <span\n aria-hidden\n className=\"absolute right-2 top-2 inline-flex h-2 w-2 rounded-full bg-accent ring-2 ring-background\"\n />\n )}\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-80 p-0\">\n <div className=\"flex items-center justify-between border-b border-border px-3 py-2.5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm font-medium\">Notifications</span>\n {unread > 0 && <Badge tone=\"accent\">{unread} new</Badge>}\n </div>\n {onMarkAllRead && (\n <button\n type=\"button\"\n onClick={onMarkAllRead}\n className=\"text-xs text-foreground-muted hover:text-foreground\"\n >\n Mark all read\n </button>\n )}\n </div>\n <ul className=\"max-h-80 overflow-y-auto py-1\">\n {notifications.map((n) => (\n <li key={n.id}>\n <button\n type=\"button\"\n onClick={n.onClick}\n className=\"flex w-full items-start gap-3 px-3 py-2.5 text-left outline-none hover:bg-background-muted focus-visible:bg-background-muted\"\n >\n <div className=\"relative mt-0.5\">\n <Avatar size=\"sm\" fallback={n.who.initials} />\n {n.unread && (\n <span\n aria-hidden\n className=\"absolute -right-0.5 -top-0.5 inline-flex h-2 w-2 rounded-full bg-accent ring-2 ring-background\"\n />\n )}\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm leading-snug\">\n <span className=\"font-medium text-foreground\">{n.who.name}</span>{' '}\n <span className=\"text-foreground-muted\">{n.action}</span>{' '}\n <span className=\"font-medium text-foreground\">{n.target}</span>\n </p>\n <p className=\"mt-0.5 text-xs text-foreground-subtle\">{n.when}</p>\n </div>\n </button>\n </li>\n ))}\n </ul>\n {onViewAll && (\n <div className=\"border-t border-border px-3 py-2 text-center\">\n <button\n type=\"button\"\n onClick={onViewAll}\n className=\"text-xs font-medium text-accent hover:underline\"\n >\n View all notifications\n </button>\n </div>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction ProfileMenu({\n user,\n items,\n}: {\n user: AppShellUser;\n items: AppShellProfileMenuItem[];\n}) {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n aria-label=\"Open profile menu\"\n className=\"flex items-center gap-2 rounded-full p-0.5 outline-none hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n <Avatar size=\"sm\" fallback={user.initials} status={user.status} />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-60\">\n <DropdownMenuLabel>\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"text-sm font-medium text-foreground\">{user.name}</span>\n {user.email && (\n <span className=\"text-xs text-foreground-subtle\">{user.email}</span>\n )}\n </div>\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n {items.map((item, i) => (\n <Fragment key={i}>\n {item.separatorAbove && <DropdownMenuSeparator />}\n <DropdownMenuItem onSelect={item.onSelect}>\n {item.icon}\n {item.label}\n {item.trailing}\n </DropdownMenuItem>\n </Fragment>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction ProfileFooter({ user }: { user: AppShellUser }) {\n return (\n <div className=\"flex items-center gap-2.5 rounded-md px-2 py-1.5\">\n <Avatar fallback={user.initials} size=\"sm\" status={user.status} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-foreground\">{user.name}</p>\n {user.email && (\n <p className=\"truncate text-xs text-foreground-subtle\">{user.email}</p>\n )}\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Dashboard — header, stat cards, chart slot, recent-activity table.\n * Data-driven: pass `stats`, `chart`, `activity`, or override the entire\n * rendering with `children`.\n * --------------------------------------------------------------------------- */\n\nexport interface DashboardStat {\n label: ReactNode;\n value: ReactNode;\n delta?: { value: string; positive?: boolean };\n}\n\nexport interface DashboardActivityRow {\n id: string;\n who: { name: string; initials: string };\n action: ReactNode;\n target: ReactNode;\n when: ReactNode;\n}\n\nexport interface DashboardProps {\n /** Top heading. */\n title?: ReactNode;\n /** Subtitle below the heading. */\n subtitle?: ReactNode;\n /** Top-right slot (date-range picker, segmented control, …). */\n headerActions?: ReactNode;\n /** Stat cards rendered in a responsive grid. */\n stats?: DashboardStat[];\n /** Chart card — any ReactNode (Chart component, SVG, image, placeholder). */\n chart?: ReactNode;\n /** Title above the chart. */\n chartTitle?: ReactNode;\n /** Subtitle under the chart title. */\n chartDescription?: ReactNode;\n /** Activity table rows. */\n activity?: DashboardActivityRow[];\n /** Title for the activity table. */\n activityTitle?: ReactNode;\n}\n\nconst DEFAULT_STATS: DashboardStat[] = [\n { label: 'Active users', value: '2,840', delta: { value: '+12%', positive: true } },\n { label: 'Sessions today', value: '8,402', delta: { value: '+4%', positive: true } },\n { label: 'Open issues', value: '14', delta: { value: '−6%', positive: true } },\n { label: 'Error rate', value: '0.32%', delta: { value: '+0.05%', positive: false } },\n];\n\nconst DEFAULT_ACTIVITY: DashboardActivityRow[] = [\n { id: '1', who: { name: 'Anu B.', initials: 'AB' }, action: 'merged', target: 'feat/segments', when: '12m ago' },\n { id: '2', who: { name: 'Bat E.', initials: 'BE' }, action: 'opened', target: 'fix/login-flow', when: '34m ago' },\n { id: '3', who: { name: 'Tuya G.', initials: 'TG' }, action: 'commented on', target: 'Q2 OKRs', when: '1h ago' },\n { id: '4', who: { name: 'Khulan O.', initials: 'KO' }, action: 'archived', target: 'old-billing-spike', when: '3h ago' },\n];\n\nexport function Dashboard({\n title = 'Overview',\n subtitle = \"What's happening across your workspace today.\",\n headerActions = (\n <Badge tone=\"neutral\" variant=\"outline\">\n Last 7 days\n </Badge>\n ),\n stats = DEFAULT_STATS,\n chart,\n chartTitle = 'Active users',\n chartDescription = 'Distinct sessions per day, last 30 days.',\n activity = DEFAULT_ACTIVITY,\n activityTitle = 'Recent activity',\n}: DashboardProps = {}) {\n return (\n <div className=\"space-y-8\">\n <header className=\"flex items-end justify-between gap-4\">\n <div>\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">{title}</h1>\n {subtitle && <p className=\"mt-1 text-sm text-foreground-muted\">{subtitle}</p>}\n </div>\n {headerActions && (\n <div className=\"hidden items-center gap-2 md:flex\">{headerActions}</div>\n )}\n </header>\n\n {stats.length > 0 && (\n <section className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n {stats.map((s, i) => (\n <Card key={i}>\n <CardHeader className=\"pb-2\">\n <CardDescription>{s.label}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"flex items-baseline gap-2\">\n <span className=\"tabular text-2xl font-semibold text-foreground\">{s.value}</span>\n {s.delta && (\n <span\n className={\n s.delta.positive\n ? 'tabular text-xs font-medium text-success-text'\n : 'tabular text-xs font-medium text-danger-text'\n }\n >\n {s.delta.value}\n </span>\n )}\n </div>\n </CardContent>\n </Card>\n ))}\n </section>\n )}\n\n {(chart !== undefined || chartTitle) && (\n <Card>\n <CardHeader>\n {chartTitle && <CardTitle>{chartTitle}</CardTitle>}\n {chartDescription && <CardDescription>{chartDescription}</CardDescription>}\n </CardHeader>\n <CardContent>\n {chart ?? (\n <div\n role=\"img\"\n aria-label=\"Chart placeholder\"\n className=\"h-48 w-full rounded-md border border-dashed border-border bg-background-subtle\"\n />\n )}\n </CardContent>\n </Card>\n )}\n\n {activity.length > 0 && (\n <Card padding=\"none\">\n <CardHeader className=\"px-5 pt-5\">\n <CardTitle>{activityTitle}</CardTitle>\n </CardHeader>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Who</TableHead>\n <TableHead>Action</TableHead>\n <TableHead>Target</TableHead>\n <TableHead className=\"text-right\">When</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {activity.map((r) => (\n <TableRow key={r.id}>\n <TableCell>\n <div className=\"flex items-center gap-2\">\n <Avatar size=\"xs\" fallback={r.who.initials} />\n <span className=\"text-foreground\">{r.who.name}</span>\n </div>\n </TableCell>\n <TableCell className=\"text-foreground-muted\">{r.action}</TableCell>\n <TableCell>\n <Badge tone=\"neutral\" variant=\"outline\">\n {r.target}\n </Badge>\n </TableCell>\n <TableCell className=\"tabular text-right text-foreground-subtle\">\n {r.when}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Card>\n )}\n </div>\n );\n}\n","import { useState, type ReactNode } from 'react';\nimport { Bell, CreditCard, Lock, User, Users } from '@/icons';\nimport { Avatar } from '@/components/ui/Avatar';\nimport { Button } from '@/components/ui/Button';\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/Card';\nimport { Input } from '@/components/ui/Input';\nimport { Separator } from '@/components/ui/Separator';\nimport { Switch } from '@/components/ui/Switch';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Settings shell with a sticky left sub-nav. Sections are declared as data so\n * consumers can add / remove / reorder without touching the layout.\n * --------------------------------------------------------------------------- */\n\nexport interface SettingsSection {\n id: string;\n label: string;\n icon?: ReactNode;\n render: () => ReactNode;\n}\n\nexport interface SettingsPageProps {\n /** Page title — defaults to \"Settings\". */\n title?: ReactNode;\n /** Subtitle under the heading. */\n subtitle?: ReactNode;\n sections?: SettingsSection[];\n /** Initially active section id. Defaults to the first section. */\n defaultSection?: string;\n /** Controlled active section id. */\n activeSection?: string;\n /** Fires when the active section changes (controlled mode). */\n onActiveSectionChange?: (id: string) => void;\n className?: string;\n}\n\n/* -----------------------------------------------------------------------------\n * Default demo sections — used when the consumer renders <SettingsPage /> with\n * no `sections` prop, and on the showcase preview.\n * --------------------------------------------------------------------------- */\n\nconst DEMO_SECTIONS: SettingsSection[] = [\n {\n id: 'profile',\n label: 'Profile',\n icon: <User />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Profile</CardTitle>\n <CardDescription>Visible to your teammates.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"flex items-center gap-4\">\n <Avatar size=\"xl\" fallback=\"BO\" />\n <div>\n <Button variant=\"outline\" size=\"sm\">Change photo</Button>\n <p className=\"mt-2 text-xs text-foreground-subtle\">JPG or PNG, max 2 MB.</p>\n </div>\n </div>\n <Separator />\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <Input label=\"First name\" defaultValue=\"Bay\" />\n <Input label=\"Last name\" defaultValue=\"Otgonbayar\" />\n </div>\n <Input label=\"Display email\" type=\"email\" defaultValue=\"bay@company.com\" />\n <div className=\"flex justify-end\">\n <Button>Save changes</Button>\n </div>\n </CardContent>\n </Card>\n ),\n },\n {\n id: 'security',\n label: 'Security',\n icon: <Lock />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Security</CardTitle>\n <CardDescription>How you sign in and protect your account.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <Input label=\"Current password\" type=\"password\" />\n <Input label=\"New password\" type=\"password\" helperText=\"At least 8 characters.\" />\n <Separator />\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-foreground\">Two-factor authentication</p>\n <p className=\"text-xs text-foreground-subtle\">Required for admin accounts on production.</p>\n </div>\n <Switch defaultChecked />\n </div>\n <div className=\"flex justify-end\">\n <Button>Update password</Button>\n </div>\n </CardContent>\n </Card>\n ),\n },\n {\n id: 'notifications',\n label: 'Notifications',\n icon: <Bell />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Notifications</CardTitle>\n <CardDescription>Choose what we email and ping you about.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <Switch label=\"Product updates\" description=\"A short note when we ship something.\" defaultChecked />\n <Separator />\n <Switch label=\"Mentions\" description=\"When a teammate @ mentions you in a comment.\" defaultChecked />\n <Separator />\n <Switch label=\"Weekly digest\" description=\"A Monday-morning summary of last week's activity.\" />\n </CardContent>\n </Card>\n ),\n },\n {\n id: 'billing',\n label: 'Billing',\n icon: <CreditCard />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Billing</CardTitle>\n <CardDescription>Your plan, invoices, and payment method.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"rounded-md border border-border bg-background-subtle p-4\">\n <p className=\"text-sm font-medium text-foreground\">Team — $20/user/month</p>\n <p className=\"mt-1 text-xs text-foreground-subtle\">Renews on 1 June 2026 · 12 seats</p>\n </div>\n <div className=\"flex justify-end gap-2\">\n <Button variant=\"outline\">Manage seats</Button>\n <Button>Upgrade plan</Button>\n </div>\n </CardContent>\n </Card>\n ),\n },\n {\n id: 'team',\n label: 'Team',\n icon: <Users />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Team</CardTitle>\n <CardDescription>Invite teammates and manage roles.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"flex gap-2\">\n <Input\n type=\"email\"\n placeholder=\"teammate@company.com\"\n hideLabel\n label=\"Invite email\"\n className=\"flex-1\"\n />\n <Button>Send invite</Button>\n </div>\n <p className=\"text-xs text-foreground-subtle\">\n Invited members will receive a sign-up link by email.\n </p>\n </CardContent>\n </Card>\n ),\n },\n];\n\n/**\n * Settings page with a sticky sub-nav on the left and section cards on the right.\n *\n * @example\n * <SettingsPage\n * sections={[\n * { id: 'profile', label: 'Profile', icon: <User />, render: () => <ProfileForm /> },\n * { id: 'team', label: 'Team', icon: <Users />, render: () => <TeamForm /> },\n * ]}\n * defaultSection=\"profile\"\n * />\n */\nexport function SettingsPage({\n title = 'Settings',\n subtitle = 'Manage your account, preferences, and billing.',\n sections = DEMO_SECTIONS,\n defaultSection,\n activeSection,\n onActiveSectionChange,\n className,\n}: SettingsPageProps = {}) {\n const isControlled = activeSection !== undefined;\n const [internal, setInternal] = useState<string>(\n defaultSection ?? sections[0]?.id ?? '',\n );\n const active = isControlled ? activeSection! : internal;\n const setActive = (id: string) => {\n if (!isControlled) setInternal(id);\n onActiveSectionChange?.(id);\n };\n\n return (\n <div className={cn('mx-auto max-w-5xl space-y-8', className)}>\n {(title || subtitle) && (\n <header>\n {title && (\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">{title}</h1>\n )}\n {subtitle && <p className=\"mt-1 text-sm text-foreground-muted\">{subtitle}</p>}\n </header>\n )}\n\n <div className=\"grid gap-8 md:grid-cols-[200px_1fr]\">\n <nav aria-label=\"Settings sections\" className=\"md:sticky md:top-20 md:self-start\">\n <ul className=\"flex flex-col gap-px\">\n {sections.map((s) => (\n <li key={s.id}>\n <button\n type=\"button\"\n onClick={() => setActive(s.id)}\n className={cn(\n 'flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm transition-colors duration-[var(--duration-fast)] outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n active === s.id\n ? 'bg-background-muted font-medium text-foreground'\n : 'text-foreground-muted hover:bg-background-muted hover:text-foreground',\n )}\n aria-current={active === s.id ? 'page' : undefined}\n >\n {s.icon && <span className=\"[&_svg]:size-4\">{s.icon}</span>}\n {s.label}\n </button>\n </li>\n ))}\n </ul>\n </nav>\n\n <div className=\"space-y-8\">\n {sections.map((s) => (\n <section key={s.id} id={s.id} hidden={active !== s.id}>\n {s.render()}\n </section>\n ))}\n </div>\n </div>\n </div>\n );\n}\n","import { useMemo, useState, type ReactNode } from 'react';\nimport { Download, Filter, Plus, Trash2, Upload } from '@/icons';\nimport { Badge } from '@/components/ui/Badge';\nimport { Button, type ButtonProps } from '@/components/ui/Button';\nimport { Checkbox } from '@/components/ui/Checkbox';\nimport { DataGrid, type DataGridColumn } from '@/components/ui/DataGrid';\nimport { EmptyState } from '@/components/ui/EmptyState';\nimport { Pagination } from '@/components/ui/Pagination';\nimport { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/Select';\n\n/* -----------------------------------------------------------------------------\n * DataTablePage — generic filter + search + bulk-action + grid + pagination\n * scaffold. Generic over row type T (must have an `id`).\n * --------------------------------------------------------------------------- */\n\nexport interface DataTableFilter {\n /** Field key used by the default predicate, and as the React key. */\n key: string;\n label: string;\n /** First option should be the \"all\" / cleared value. */\n options: { value: string; label: string }[];\n /** Initial value. Defaults to the first option's value. */\n defaultValue?: string;\n}\n\nexport interface DataTableBulkAction<T> {\n label: string;\n /** Optional leading icon. */\n icon?: ReactNode;\n variant?: ButtonProps['variant'];\n /** Receives the selected rows. Awaited — toolbar shows a spinner while pending. */\n onAction: (selected: T[]) => void | Promise<void>;\n}\n\nexport interface DataTablePageProps<T extends { id: string | number }> {\n /** Page heading. */\n title?: ReactNode;\n /** Optional subtitle — defaults to a row-count line. */\n subtitle?: ReactNode;\n /** Right-aligned header actions (e.g. New / Import buttons). */\n headerActions?: ReactNode;\n /** Row data. */\n rows?: T[];\n /** Column descriptors. */\n columns?: DataGridColumn<T>[];\n /** Filter selects to render in the toolbar. */\n filters?: DataTableFilter[];\n /** Custom predicate. Receives the row + the active filter values. */\n predicate?: (row: T, filterValues: Record<string, string>, search: string) => boolean;\n /** Search placeholder. */\n searchPlaceholder?: string;\n /** Available rows-per-page sizes. */\n pageSizeOptions?: number[];\n /** Initial page size. */\n defaultPageSize?: number;\n /** Bulk-action buttons shown when rows are selected. */\n bulkActions?: DataTableBulkAction<T>[];\n /** EmptyState rendered when the filtered rows are empty. */\n emptyState?: ReactNode;\n className?: string;\n}\n\n/* -----------------------------------------------------------------------------\n * Default demo data + columns\n * --------------------------------------------------------------------------- */\n\ninterface DemoProject {\n id: string;\n name: string;\n status: 'active' | 'paused' | 'archived';\n owner: string;\n updatedAt: string;\n}\n\nconst DEMO_ROWS: DemoProject[] = [\n { id: 'p1', name: 'Pulse onboarding', status: 'active', owner: 'Anu B.', updatedAt: '2 hours ago' },\n { id: 'p2', name: 'Q2 OKRs rollout', status: 'active', owner: 'Bat E.', updatedAt: 'Yesterday' },\n { id: 'p3', name: 'Legacy export', status: 'paused', owner: 'Tuya G.', updatedAt: '3 days ago' },\n { id: 'p4', name: 'Billing spike', status: 'archived', owner: 'Khulan O.', updatedAt: 'Last week' },\n { id: 'p5', name: 'Marketing refresh', status: 'active', owner: 'Anu B.', updatedAt: 'Last week' },\n];\n\nconst STATUS_TONE = {\n active: { tone: 'success' as const, label: 'Active' },\n paused: { tone: 'warning' as const, label: 'Paused' },\n archived: { tone: 'neutral' as const, label: 'Archived' },\n};\n\nconst DEMO_COLUMNS: DataGridColumn<DemoProject>[] = [\n {\n key: 'name',\n header: 'Name',\n sortable: true,\n cell: (r) => <span className=\"font-medium text-foreground\">{r.name}</span>,\n },\n {\n key: 'status',\n header: 'Status',\n cell: (r) => (\n <Badge tone={STATUS_TONE[r.status].tone} dot>\n {STATUS_TONE[r.status].label}\n </Badge>\n ),\n },\n { key: 'owner', header: 'Owner' },\n { key: 'updatedAt', header: 'Updated', align: 'right' },\n];\n\nconst DEMO_FILTERS: DataTableFilter[] = [\n {\n key: 'status',\n label: 'Status',\n options: [\n { value: 'all', label: 'All statuses' },\n { value: 'active', label: 'Active' },\n { value: 'paused', label: 'Paused' },\n { value: 'archived', label: 'Archived' },\n ],\n },\n];\n\nconst DEMO_HEADER_ACTIONS: ReactNode = (\n <>\n <Button variant=\"outline\" leadingIcon={<Upload />}>Import</Button>\n <Button leadingIcon={<Plus />}>New project</Button>\n </>\n);\n\nconst DEMO_BULK_ACTIONS: DataTableBulkAction<DemoProject>[] = [\n { label: 'Export', icon: <Download />, variant: 'ghost', onAction: () => {} },\n { label: 'Delete', icon: <Trash2 />, variant: 'ghost', onAction: () => {} },\n];\n\n/**\n * Generic data-table page.\n *\n * @example\n * interface User { id: string; name: string; role: string; status: 'active' | 'invited' }\n *\n * <DataTablePage<User>\n * title=\"Members\"\n * rows={users}\n * columns={[\n * { key: 'name', header: 'Name', sortable: true },\n * { key: 'role', header: 'Role' },\n * { key: 'status', header: 'Status', cell: (r) => <Badge>{r.status}</Badge> },\n * ]}\n * filters={[\n * { key: 'status', label: 'Status', options: [\n * { value: 'all', label: 'All' },\n * { value: 'active', label: 'Active' },\n * { value: 'invited', label: 'Invited' },\n * ]},\n * ]}\n * bulkActions={[\n * { label: 'Remove', variant: 'destructive', onAction: (rows) => api.remove(rows) },\n * ]}\n * />\n */\nexport function DataTablePage<T extends { id: string | number }>({\n title = 'Projects',\n subtitle,\n headerActions = DEMO_HEADER_ACTIONS,\n rows: rowsProp,\n columns: columnsProp,\n filters: filtersProp,\n predicate,\n searchPlaceholder = 'Search…',\n pageSizeOptions = [10, 20, 50],\n defaultPageSize = 10,\n bulkActions: bulkActionsProp,\n emptyState,\n className,\n}: DataTablePageProps<T> = {}) {\n // Defaults — typed back through `T` via assertions. Consumers replace\n // everything when they pass their own rows/columns.\n const rows = (rowsProp ?? (DEMO_ROWS as unknown as T[])) as T[];\n const columns =\n (columnsProp ?? (DEMO_COLUMNS as unknown as DataGridColumn<T>[])) as DataGridColumn<T>[];\n const filters = filtersProp ?? DEMO_FILTERS;\n const bulkActions =\n (bulkActionsProp ?? (DEMO_BULK_ACTIONS as unknown as DataTableBulkAction<T>[])) as DataTableBulkAction<T>[];\n\n const [query, setQuery] = useState('');\n const [filterValues, setFilterValues] = useState<Record<string, string>>(() => {\n const init: Record<string, string> = {};\n for (const f of filters) init[f.key] = f.defaultValue ?? f.options[0]?.value ?? '';\n return init;\n });\n const [selectedIds, setSelectedIds] = useState<(string | number)[]>([]);\n const [page, setPage] = useState(1);\n const [pageSize, setPageSize] = useState(defaultPageSize);\n\n const filtered = useMemo(() => {\n const defaultPred = (row: T) => {\n // Default behavior: substring match on every string field for `query`,\n // and exact-match on filterValues[key] === row[key] (skipping 'all').\n const q = query.toLowerCase();\n if (q) {\n const hasMatch = Object.values(row as Record<string, unknown>).some(\n (v) => typeof v === 'string' && v.toLowerCase().includes(q),\n );\n if (!hasMatch) return false;\n }\n for (const [key, value] of Object.entries(filterValues)) {\n if (!value || value === 'all') continue;\n if ((row as Record<string, unknown>)[key] !== value) return false;\n }\n return true;\n };\n return rows.filter((row) =>\n predicate ? predicate(row, filterValues, query) : defaultPred(row),\n );\n }, [rows, query, filterValues, predicate]);\n\n const allOnPageSelected =\n filtered.length > 0 && filtered.every((r) => selectedIds.includes(r.id));\n const someSelected = selectedIds.length > 0 && !allOnPageSelected;\n\n const selectedRows = useMemo(\n () => rows.filter((r) => selectedIds.includes(r.id)),\n [rows, selectedIds],\n );\n\n const totalPages = Math.max(1, Math.ceil(filtered.length / pageSize));\n const pageRows = filtered.slice((page - 1) * pageSize, page * pageSize);\n\n const augmentedColumns: DataGridColumn<T>[] = [\n {\n key: '__select',\n header: (\n <Checkbox\n checked={allOnPageSelected ? true : someSelected ? 'indeterminate' : false}\n onCheckedChange={(v) =>\n setSelectedIds(v ? filtered.map((r) => r.id) : [])\n }\n aria-label=\"Select all rows\"\n />\n ),\n width: '32px',\n cell: (r: T) => (\n <Checkbox\n checked={selectedIds.includes(r.id)}\n onCheckedChange={(v) =>\n setSelectedIds((prev) =>\n v ? [...prev, r.id] : prev.filter((id) => id !== r.id),\n )\n }\n aria-label=\"Select row\"\n />\n ),\n },\n ...columns,\n ];\n\n return (\n <div className={`space-y-6 ${className ?? ''}`}>\n <header className=\"flex items-end justify-between gap-4\">\n <div>\n {title && (\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">{title}</h1>\n )}\n <p className=\"mt-1 text-sm text-foreground-muted\">\n {subtitle ?? `${filtered.length} item${filtered.length === 1 ? '' : 's'} match your filters.`}\n </p>\n </div>\n {headerActions && <div className=\"flex items-center gap-2\">{headerActions}</div>}\n </header>\n\n {(filters.length > 0 || bulkActions.length > 0) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {filters.map((f) => (\n <Select\n key={f.key}\n value={filterValues[f.key]}\n onValueChange={(v) => setFilterValues((prev) => ({ ...prev, [f.key]: v }))}\n >\n <SelectTrigger className=\"w-40\" placeholder={f.label} />\n <SelectContent>\n {f.options.map((o) => (\n <SelectItem key={o.value} value={o.value}>\n {o.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ))}\n <Button variant=\"outline\" size=\"sm\" leadingIcon={<Filter />}>\n More filters\n </Button>\n </div>\n )}\n\n {selectedIds.length > 0 && bulkActions.length > 0 && (\n <div className=\"flex items-center justify-between rounded-md border border-border bg-background-subtle px-4 py-2\">\n <div className=\"flex items-center gap-3\">\n <Checkbox\n checked={allOnPageSelected ? true : someSelected ? 'indeterminate' : false}\n onCheckedChange={(v) =>\n setSelectedIds(v ? filtered.map((r) => r.id) : [])\n }\n aria-label=\"Select all\"\n />\n <span className=\"text-sm text-foreground\">{selectedIds.length} selected</span>\n </div>\n <div className=\"flex items-center gap-2\">\n {bulkActions.map((a) => (\n <Button\n key={a.label}\n variant={a.variant ?? 'ghost'}\n size=\"sm\"\n leadingIcon={a.icon}\n onClick={() => a.onAction(selectedRows)}\n >\n {a.label}\n </Button>\n ))}\n </div>\n </div>\n )}\n\n <DataGrid\n rows={pageRows}\n filter={{ value: query, onChange: setQuery, placeholder: searchPlaceholder }}\n emptyState={\n emptyState ?? (\n <EmptyState\n title=\"No results\"\n description=\"Try adjusting filters or your search.\"\n className=\"border-0 bg-transparent\"\n />\n )\n }\n columns={augmentedColumns}\n />\n\n <Pagination\n page={page}\n pageCount={totalPages}\n onPageChange={setPage}\n totalItems={filtered.length}\n pageSize={pageSize}\n pageSizeOptions={pageSizeOptions}\n onPageSizeChange={(s) => {\n setPageSize(s);\n setPage(1);\n }}\n />\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Edit2, ExternalLink, Trash2 } from '@/icons';\nimport { Avatar } from '@/components/ui/Avatar';\nimport { Badge } from '@/components/ui/Badge';\nimport { Breadcrumbs } from '@/components/ui/Breadcrumbs';\nimport { Button } from '@/components/ui/Button';\nimport { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card';\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/Tabs';\n\n/* -----------------------------------------------------------------------------\n * RecordDetail — header + tabs + side panel layout for any \"thing detail\n * page\" (user, project, ticket, order).\n * --------------------------------------------------------------------------- */\n\nexport interface RecordDetailHeader {\n title: ReactNode;\n subtitle?: ReactNode;\n /** Optional status pill rendered next to the title. */\n status?: ReactNode;\n /** Right-aligned action buttons. */\n actions?: ReactNode;\n /** Breadcrumb trail rendered above the header. */\n breadcrumbs?: { label: ReactNode; href?: string }[];\n}\n\nexport interface RecordDetailTab {\n id: string;\n label: ReactNode;\n render: () => ReactNode;\n}\n\nexport interface RecordDetailProps {\n header?: RecordDetailHeader;\n tabs?: RecordDetailTab[];\n /** Initial tab id. Defaults to the first tab. */\n defaultTab?: string;\n /** Optional right-side panel (related items, details list, watchers, …). */\n sidePanel?: ReactNode;\n className?: string;\n}\n\n/* -----------------------------------------------------------------------------\n * Defaults — used when consumers render <RecordDetail /> with no props.\n * --------------------------------------------------------------------------- */\n\nconst DEMO_HEADER: RecordDetailHeader = {\n title: 'Pulse onboarding',\n subtitle:\n 'Self-serve onboarding flow for new admins. Owns the first 5 minutes of every workspace.',\n status: (\n <Badge tone=\"success\" dot>\n Active\n </Badge>\n ),\n actions: (\n <>\n <Button variant=\"outline\" leadingIcon={<Edit2 />}>\n Edit\n </Button>\n <Button variant=\"outline\" leadingIcon={<Trash2 />}>\n Archive\n </Button>\n <Button trailingIcon={<ExternalLink />}>Open in app</Button>\n </>\n ),\n breadcrumbs: [{ label: 'Projects', href: '/projects' }, { label: 'Pulse onboarding' }],\n};\n\nconst DEMO_TABS: RecordDetailTab[] = [\n {\n id: 'overview',\n label: 'Overview',\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Summary</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2 leading-relaxed text-foreground-muted\">\n <p>\n The Pulse onboarding flow walks new admins through workspace creation, teammate\n invites, and first-data import in under five minutes.\n </p>\n <p>\n Completion rate sits at 71% (week-over-week +4 pts) and median time to finish is 4 m\n 22 s.\n </p>\n </CardContent>\n </Card>\n ),\n },\n { id: 'activity', label: 'Activity', render: () => <P>Activity feed appears here.</P> },\n { id: 'files', label: 'Files', render: () => <P>Linked documents appear here.</P> },\n { id: 'settings', label: 'Settings', render: () => <P>Project settings appear here.</P> },\n];\n\nconst DEMO_SIDE_PANEL: ReactNode = (\n <>\n <Card>\n <CardHeader>\n <CardTitle>Details</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3 text-sm\">\n <Row label=\"Owner\" value={<><Avatar size=\"xs\" fallback=\"AB\" /> Anu B.</>} />\n <Row label=\"Created\" value=\"12 Feb 2026\" />\n <Row label=\"Updated\" value=\"2 hours ago\" />\n <Row\n label=\"Tags\"\n value={\n <>\n <Badge tone=\"accent\">growth</Badge>{' '}\n <Badge tone=\"neutral\" variant=\"outline\">v2</Badge>\n </>\n }\n />\n </CardContent>\n </Card>\n <Card>\n <CardHeader>\n <CardTitle>Watchers</CardTitle>\n </CardHeader>\n <CardContent>\n <div className=\"flex -space-x-2\">\n <Avatar fallback=\"AB\" />\n <Avatar fallback=\"BE\" />\n <Avatar fallback=\"TG\" />\n <Avatar fallback=\"+2\" />\n </div>\n </CardContent>\n </Card>\n </>\n);\n\n/**\n * Record detail page — header (breadcrumbs + title + actions) + tabs + side panel.\n *\n * @example\n * <RecordDetail\n * header={{\n * title: project.name,\n * subtitle: project.description,\n * status: <Badge tone=\"success\">Active</Badge>,\n * actions: <Button>Share</Button>,\n * breadcrumbs: [{ label: 'Projects', href: '/projects' }, { label: project.name }],\n * }}\n * tabs={[\n * { id: 'overview', label: 'Overview', render: () => <Overview project={project} /> },\n * { id: 'activity', label: 'Activity', render: () => <Activity projectId={project.id} /> },\n * ]}\n * sidePanel={<RelatedItems project={project} />}\n * />\n */\nexport function RecordDetail({\n header = DEMO_HEADER,\n tabs = DEMO_TABS,\n defaultTab,\n sidePanel = DEMO_SIDE_PANEL,\n className,\n}: RecordDetailProps = {}) {\n const initialTab = defaultTab ?? tabs[0]?.id ?? '';\n return (\n <div className={`space-y-6 ${className ?? ''}`}>\n {header.breadcrumbs && header.breadcrumbs.length > 0 && (\n <Breadcrumbs items={header.breadcrumbs} />\n )}\n\n <header className=\"flex items-start justify-between gap-4\">\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-3\">\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">\n {header.title}\n </h1>\n {header.status}\n </div>\n {header.subtitle && (\n <p className=\"max-w-2xl text-sm text-foreground-muted\">{header.subtitle}</p>\n )}\n </div>\n {header.actions && <div className=\"flex items-center gap-2\">{header.actions}</div>}\n </header>\n\n <div\n className={\n sidePanel ? 'grid gap-6 lg:grid-cols-[1fr_320px]' : 'min-w-0'\n }\n >\n <div className=\"min-w-0\">\n <Tabs defaultValue={initialTab}>\n <TabsList>\n {tabs.map((t) => (\n <TabsTrigger key={t.id} value={t.id}>\n {t.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((t) => (\n <TabsContent key={t.id} value={t.id} className=\"space-y-4\">\n {t.render()}\n </TabsContent>\n ))}\n </Tabs>\n </div>\n\n {sidePanel && <aside className=\"space-y-4\">{sidePanel}</aside>}\n </div>\n </div>\n );\n}\n\nfunction Row({ label, value }: { label: string; value: ReactNode }) {\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-foreground-subtle\">{label}</span>\n <span className=\"flex items-center gap-1.5 text-foreground\">{value}</span>\n </div>\n );\n}\n\nfunction P({ children }: { children: ReactNode }) {\n return <p className=\"text-sm text-foreground-muted\">{children}</p>;\n}\n","import { useState, type ReactNode } from 'react';\nimport { ArrowLeft, ArrowRight, CheckCircle2 } from '@/icons';\nimport { Button } from '@/components/ui/Button';\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/Card';\nimport { Input } from '@/components/ui/Input';\nimport { RadioGroup, RadioItem } from '@/components/ui/RadioGroup';\nimport { Stepper } from '@/components/ui/Stepper';\n\n/* -----------------------------------------------------------------------------\n * Onboarding — multi-step wizard. Steps are declared as data; each step\n * renders into a Card with a Stepper at the top and Back/Next controls below.\n * --------------------------------------------------------------------------- */\n\nexport interface OnboardingStepContext<T = unknown> {\n /** Move to the next step. */\n next: () => void;\n /** Move to the previous step. */\n prev: () => void;\n /** Jump to a step by index. */\n goTo: (index: number) => void;\n /** Finish the flow — calls onComplete. */\n finish: () => void;\n /** Current accumulated data across steps. */\n data: T;\n /** Patch the accumulated data. */\n setData: (patch: Partial<T>) => void;\n}\n\nexport interface OnboardingStep<T = unknown> {\n /** Stable id used for keys + analytics. */\n id: string;\n /** Title shown in the Stepper. */\n title: string;\n /** Optional sub-description shown only in vertical Stepper. */\n description?: string;\n /** Card heading rendered when the step is active. */\n heading: ReactNode;\n /** Card description rendered under the heading. */\n subheading?: ReactNode;\n /** Step body. Receives navigation controls + shared data. */\n render: (ctx: OnboardingStepContext<T>) => ReactNode;\n /** Override the Continue / Finish button label. */\n ctaLabel?: string;\n /** Hide the default Back/Next bar — render your own inside `render`. */\n hideNavigation?: boolean;\n}\n\nexport interface OnboardingProps<T = unknown> {\n steps?: OnboardingStep<T>[];\n /** Initial accumulated data. */\n initialData?: T;\n /** Called when the user advances past the last step. */\n onComplete?: (data: T) => void | Promise<void>;\n className?: string;\n}\n\n/* -----------------------------------------------------------------------------\n * Default demo content — used when consumers render <Onboarding /> with no\n * steps prop, and on the showcase preview page.\n * --------------------------------------------------------------------------- */\n\ninterface DemoData {\n workspaceName?: string;\n slug?: string;\n inviteEmail?: string;\n role?: string;\n source?: string;\n}\n\nconst DEMO_STEPS: OnboardingStep<DemoData>[] = [\n {\n id: 'workspace',\n title: 'Workspace',\n heading: 'Create your workspace',\n subheading: 'A workspace is where your team and projects live.',\n render: ({ data, setData }) => (\n <>\n <Input\n label=\"Workspace name\"\n placeholder=\"Acme Inc.\"\n value={data.workspaceName ?? ''}\n onChange={(e) => setData({ workspaceName: e.target.value })}\n />\n <Input\n label=\"URL slug\"\n prefix={<span>acme.app/</span>}\n placeholder=\"acme\"\n value={data.slug ?? ''}\n onChange={(e) => setData({ slug: e.target.value })}\n />\n </>\n ),\n },\n {\n id: 'invite',\n title: 'Invite team',\n heading: 'Invite your team',\n subheading: 'You can always invite more people later.',\n render: ({ data, setData }) => (\n <>\n <Input\n type=\"email\"\n label=\"Invite by email\"\n placeholder=\"teammate@company.com\"\n helperText=\"Separate multiple emails with commas.\"\n value={data.inviteEmail ?? ''}\n onChange={(e) => setData({ inviteEmail: e.target.value })}\n />\n <RadioGroup\n value={data.role ?? 'member'}\n onValueChange={(role) => setData({ role })}\n >\n <RadioItem value=\"admin\" label=\"Admin\" description=\"Can manage workspace and billing.\" />\n <RadioItem value=\"member\" label=\"Member\" description=\"Can create and edit projects.\" />\n <RadioItem value=\"viewer\" label=\"Viewer\" description=\"Read-only access.\" />\n </RadioGroup>\n </>\n ),\n },\n {\n id: 'data',\n title: 'Connect data',\n heading: 'Connect a data source',\n subheading: 'Pick one — others can be added in settings.',\n render: ({ data, setData }) => (\n <>\n <p className=\"text-sm text-foreground-muted\">\n Connect your data source so we can populate your first dashboard.\n </p>\n <div className=\"grid grid-cols-2 gap-2\">\n {['Postgres', 'BigQuery', 'Snowflake', 'CSV upload'].map((src) => {\n const active = data.source === src;\n return (\n <button\n key={src}\n type=\"button\"\n onClick={() => setData({ source: src })}\n aria-pressed={active}\n className={`rounded-lg border bg-card p-4 text-left transition-colors duration-[var(--duration-fast)] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background ${\n active\n ? 'border-accent bg-accent-soft'\n : 'border-border hover:border-border-strong hover:bg-background-subtle'\n }`}\n >\n <p className=\"font-medium text-foreground\">{src}</p>\n <p className=\"mt-1 text-xs text-foreground-subtle\">Quick setup with SSO</p>\n </button>\n );\n })}\n </div>\n </>\n ),\n },\n {\n id: 'done',\n title: 'Done',\n heading: 'Welcome aboard',\n subheading: \"We've set up your starting dashboard.\",\n ctaLabel: 'Open workspace',\n render: () => (\n <div className=\"flex flex-col items-center gap-3 py-6 text-center\">\n <CheckCircle2 className=\"size-10 text-success-text\" aria-hidden />\n <p className=\"text-base font-medium text-foreground\">You're all set.</p>\n <p className=\"max-w-sm text-sm text-foreground-muted\">\n Your workspace is ready. We've sent invites and your first dashboard is loading.\n </p>\n </div>\n ),\n },\n];\n\n/**\n * Multi-step onboarding wizard.\n *\n * @example\n * <Onboarding<{ name: string; email: string }>\n * initialData={{ name: '', email: '' }}\n * steps={[\n * { id: 'name', title: 'Name', heading: 'What should we call you?',\n * render: ({ data, setData }) =>\n * <Input value={data.name} onChange={(e) => setData({ name: e.target.value })} /> },\n * …\n * ]}\n * onComplete={async (data) => api.completeOnboarding(data)}\n * />\n */\nexport function Onboarding<T = DemoData>({\n steps = DEMO_STEPS as unknown as OnboardingStep<T>[],\n initialData = {} as T,\n onComplete,\n className,\n}: OnboardingProps<T> = {}) {\n const [step, setStep] = useState(0);\n const [data, setDataState] = useState<T>(initialData);\n\n const setData = (patch: Partial<T>) =>\n setDataState((prev) => ({ ...prev, ...patch }) as T);\n\n const goTo = (i: number) => setStep(Math.max(0, Math.min(i, steps.length - 1)));\n const next = () => goTo(step + 1);\n const prev = () => goTo(step - 1);\n const finish = async () => {\n if (onComplete) await onComplete(data);\n };\n\n const ctx: OnboardingStepContext<T> = { next, prev, goTo, finish, data, setData };\n const current = steps[step];\n const isLast = step === steps.length - 1;\n\n return (\n <div className={`mx-auto max-w-2xl space-y-8 py-12 ${className ?? ''}`}>\n <Stepper steps={steps.map((s) => ({ title: s.title, description: s.description }))} current={step} />\n\n <Card>\n <CardHeader>\n <CardTitle>{current.heading}</CardTitle>\n {current.subheading && <CardDescription>{current.subheading}</CardDescription>}\n </CardHeader>\n <CardContent className=\"space-y-4\">{current.render(ctx)}</CardContent>\n </Card>\n\n {!current.hideNavigation && (\n <div className=\"flex items-center justify-between\">\n <Button\n variant=\"ghost\"\n leadingIcon={<ArrowLeft />}\n onClick={prev}\n disabled={step === 0}\n >\n Back\n </Button>\n <Button\n trailingIcon={isLast ? undefined : <ArrowRight />}\n onClick={isLast ? finish : next}\n >\n {current.ctaLabel ?? (isLast ? 'Finish' : 'Continue')}\n </Button>\n </div>\n )}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Check } from '@/icons';\nimport { Badge } from '@/components/ui/Badge';\nimport { Button } from '@/components/ui/Button';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Pricing — N-tier comparison grid. Tiers are declared as data so consumers\n * can change copy, count, and CTA behavior without touching the layout.\n * --------------------------------------------------------------------------- */\n\nexport interface PricingTier {\n name: string;\n /** Price string. Pre-formatted — render '$0', '$20', 'Custom', '¥1,200', etc. */\n price: string;\n /** Cadence label rendered next to the price ('per user / month'). */\n cadence?: string;\n description?: string;\n features: string[];\n /** CTA label. */\n cta: string;\n /** Mark this tier as the recommended one — adds accent border + badge. */\n highlighted?: boolean;\n /** Click handler for the CTA. */\n onSelect?: () => void;\n}\n\nexport interface PricingProps {\n /** Top heading. */\n title?: ReactNode;\n /** Subtitle under the heading. */\n subtitle?: ReactNode;\n /** Tier descriptors. */\n tiers?: PricingTier[];\n /** Label shown on the highlighted tier badge. */\n highlightedLabel?: string;\n className?: string;\n}\n\nconst DEFAULT_TIERS: PricingTier[] = [\n {\n name: 'Starter',\n price: '$0',\n cadence: 'forever',\n description: 'For individuals exploring the product.',\n features: ['Up to 3 projects', 'Community support', 'Single workspace'],\n cta: 'Start free',\n },\n {\n name: 'Team',\n price: '$20',\n cadence: 'per user / month',\n description: 'For small teams running real workloads.',\n features: [\n 'Unlimited projects',\n 'Email support, 24h response',\n 'SSO via Google & Microsoft',\n 'Audit log (30 days)',\n ],\n cta: 'Start 14-day trial',\n highlighted: true,\n },\n {\n name: 'Enterprise',\n price: 'Custom',\n cadence: 'annual',\n description: 'For organisations with custom requirements.',\n features: [\n 'Everything in Team',\n 'SAML SSO + SCIM',\n 'Dedicated CSM',\n 'SOC 2 report + DPA',\n 'Audit log (unlimited)',\n ],\n cta: 'Talk to sales',\n },\n];\n\n/**\n * Pricing grid. Defaults to a 3-tier demo if `tiers` is omitted.\n *\n * @example\n * <Pricing\n * title=\"Plans\"\n * tiers={[\n * { name: 'Free', price: '$0', features: ['…'], cta: 'Start' },\n * { name: 'Pro', price: '$12', features: ['…'], cta: 'Upgrade', highlighted: true },\n * ]}\n * />\n */\nexport function Pricing({\n title = 'Plans that scale with your team',\n subtitle = 'Start free, upgrade when you need more. All paid plans include a 14-day trial — no credit card required.',\n tiers = DEFAULT_TIERS,\n highlightedLabel = 'Most popular',\n className,\n}: PricingProps = {}) {\n const cols = tiers.length;\n return (\n <div className={cn('mx-auto max-w-5xl space-y-8 py-16', className)}>\n <header className=\"space-y-3 text-center\">\n <h1 className=\"text-3xl font-semibold tracking-tight text-foreground\">{title}</h1>\n {subtitle && <p className=\"mx-auto max-w-xl text-sm text-foreground-muted\">{subtitle}</p>}\n </header>\n\n <div\n className={cn(\n 'grid gap-4',\n cols === 2 && 'md:grid-cols-2',\n cols === 3 && 'md:grid-cols-3',\n cols === 4 && 'md:grid-cols-2 lg:grid-cols-4',\n cols > 4 && 'md:grid-cols-3',\n )}\n >\n {tiers.map((tier) => (\n <div\n key={tier.name}\n className={cn(\n 'flex flex-col gap-6 rounded-lg border bg-card p-6',\n tier.highlighted ? 'border-accent shadow-sm' : 'border-border',\n )}\n >\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-foreground\">{tier.name}</h2>\n {tier.highlighted && <Badge tone=\"accent\">{highlightedLabel}</Badge>}\n </div>\n {tier.description && (\n <p className=\"text-sm text-foreground-muted\">{tier.description}</p>\n )}\n </div>\n\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"tabular text-3xl font-semibold text-foreground\">{tier.price}</span>\n {tier.cadence && (\n <span className=\"text-sm text-foreground-subtle\">{tier.cadence}</span>\n )}\n </div>\n\n <ul className=\"space-y-2 text-sm\">\n {tier.features.map((f) => (\n <li key={f} className=\"flex items-start gap-2 text-foreground\">\n <Check className=\"mt-0.5 size-4 shrink-0 text-accent\" aria-hidden />\n {f}\n </li>\n ))}\n </ul>\n\n <Button\n variant={tier.highlighted ? 'primary' : 'outline'}\n className=\"mt-auto w-full\"\n onClick={tier.onSelect}\n >\n {tier.cta}\n </Button>\n </div>\n ))}\n </div>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { ArrowRight, Folder, Plus, Upload, Users } from '@/icons';\nimport { Button } from '@/components/ui/Button';\nimport { Card, CardContent } from '@/components/ui/Card';\nimport { EmptyState } from '@/components/ui/EmptyState';\n\n/* -----------------------------------------------------------------------------\n * First-run empty product state. Combines a hero EmptyState with N\n * \"next step\" cards — common pattern across Linear, Notion, Vercel.\n * --------------------------------------------------------------------------- */\n\nexport interface FirstRunNextStep {\n icon?: ReactNode;\n title: string;\n description: string;\n cta: string;\n onSelect?: () => void;\n}\n\nexport interface FirstRunEmptyProps {\n /** Hero icon — typically a folder, sparkles, or product mark. */\n heroIcon?: ReactNode;\n /** Hero title. */\n title?: ReactNode;\n /** Hero subtitle. */\n description?: ReactNode;\n /** Primary CTA inside the hero (top tutorial / overview action). */\n primaryAction?: ReactNode;\n /** Next-step cards rendered below the hero. */\n steps?: FirstRunNextStep[];\n className?: string;\n}\n\nconst DEFAULT_STEPS: FirstRunNextStep[] = [\n {\n icon: <Plus />,\n title: 'Create a project',\n description: 'Track a real piece of work end-to-end.',\n cta: 'New project',\n },\n {\n icon: <Upload />,\n title: 'Import existing data',\n description: 'CSV, Postgres, BigQuery, or Snowflake — connect in a minute.',\n cta: 'Connect source',\n },\n {\n icon: <Users />,\n title: 'Invite your team',\n description: \"Workspaces are better with teammates. We'll send the invites.\",\n cta: 'Invite people',\n },\n];\n\n/**\n * First-run empty product state.\n *\n * @example Default (uses built-in placeholder copy)\n * <FirstRunEmpty />\n *\n * @example Customized\n * <FirstRunEmpty\n * heroIcon={<Illustrations.InboxEmpty className=\"size-16\" />}\n * title=\"Welcome to Atlas\"\n * description=\"Pick a starting point.\"\n * steps={[\n * { icon: <Plus />, title: 'New project', description: '…', cta: 'Create' },\n * { icon: <Github />, title: 'Import repo', description: '…', cta: 'Connect' },\n * ]}\n * />\n */\nexport function FirstRunEmpty({\n heroIcon = <Folder className=\"size-6\" />,\n title = 'Your workspace is ready',\n description = 'Start with one of the steps below — you can always come back to the others.',\n primaryAction = <Button trailingIcon={<ArrowRight />}>Open tutorial</Button>,\n steps = DEFAULT_STEPS,\n className,\n}: FirstRunEmptyProps = {}) {\n return (\n <div className={`mx-auto max-w-3xl space-y-8 py-12 ${className ?? ''}`}>\n <EmptyState icon={heroIcon} title={title} description={description} action={primaryAction} />\n\n {steps.length > 0 && (\n <div className=\"grid gap-3 md:grid-cols-3\">\n {steps.map((s) => (\n <Card key={s.title} variant=\"interactive\">\n <CardContent className=\"space-y-3\">\n {s.icon && (\n <div className=\"inline-flex size-9 items-center justify-center rounded-md bg-accent-soft text-on-accent-soft [&_svg]:size-4\">\n {s.icon}\n </div>\n )}\n <div className=\"space-y-1\">\n <h3 className=\"text-sm font-semibold text-foreground\">{s.title}</h3>\n <p className=\"text-xs text-foreground-muted leading-relaxed\">{s.description}</p>\n </div>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n trailingIcon={<ArrowRight />}\n onClick={s.onSelect}\n >\n {s.cta}\n </Button>\n </CardContent>\n </Card>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"names":["cn","inputs","twMerge","clsx","__idCounter","uid","prefix","useMediaQuery","query","matches","setMatches","useState","useEffect","list","onChange","event","usePrefersReducedMotion","store","listener","t","id","next","useToast","toasts","setToasts","push","useCallback","dismiss","remove","toast","Base","className","children","props","jsx","InboxEmpty","jsxs","NoSearchResults","NotFound","ServerError","Construction","ConnectionLost","Accordion","AccordionPrimitive","AccordionItem","forwardRef","ref","AccordionTrigger","ChevronDown","AccordionContent","alert","cva","iconForVariant","Info","CheckCircle2","AlertTriangle","XCircle","Alert","variant","title","dismissible","onDismiss","icon","open","setOpen","handleDismiss","renderedIcon","X","sizeMap","avatarWrapper","statusColour","Avatar","size","src","alt","fallback","status","AvatarPrimitive","AvatarGroup","max","items","visible","overflow","child","i","badge","dotColour","Badge","tone","dot","Breadcrumbs","maxItems","renderLink","displayItems","it","isLast","MoreHorizontal","ChevronRight","item","labelNode","button","Button","asChild","loading","leadingIcon","trailingIcon","disabled","type","isDisabled","classes","Slot","Loader2","card","Card","padding","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","Checkbox","label","description","error","hideLabel","autoId","useId","fieldId","descId","errorId","CheckboxPrimitive","Minus","Check","Combobox","value","options","loadOptions","helperText","placeholder","searchPlaceholder","emptyText","clearable","helperId","setQuery","loaded","setLoaded","setLoading","cancelled","res","selected","useMemo","o","triggerHeight","triggerPadding","handleClear","e","isError","PopoverPrimitive","ChevronsUpDown","CommandPrimitive","opt","isSelected","v","Command","CommandInput","Search","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","CommandDialog","onOpenChange","DialogPrimitive","useCommandPaletteShortcut","_","force","onKey","n","ContextMenu","ContextMenuPrimitive","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","itemClasses","ContextMenuSubTrigger","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","destructive","ContextMenuCheckboxItem","ContextMenuRadioItem","Circle","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut","DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","inset","DropdownMenuSubContent","DropdownMenuContent","sideOffset","align","DropdownMenuItem","DropdownMenuCheckboxItem","checked","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","iconButton","IconButton","field","innerInput","Input","suffix","onClear","showPassword","setShowPassword","effectiveType","effectiveTone","renderedPrefix","hasValue","p","EyeOff","Eye","Table","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","TableSortHeader","sortKey","currentSort","onSortChange","active","direction","handle","ArrowUp","ArrowDown","ArrowUpDown","Skeleton","DataGrid","columns","rows","sort","filter","emptyState","hidden","setHidden","visibleColumns","c","renderRows","row","Settings","prev","k","d","Calendar","classNames","_ref","DayPicker","orientation","ChevronLeft","formatDate","PickerTrigger","CalendarIcon","DatePicker","fromDate","toDate","DateRangePicker","DesignSystemProvider","tokens","style","css","key","brandPresets","Dialog","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","DialogContent","showClose","DialogHeader","DialogFooter","DialogTitle","DialogDescription","ConfirmationDialog","confirmLabel","cancelLabel","confirmVariant","onConfirm","EmptyState","illustration","action","secondaryAction","presets","ErrorState","onRetry","preset","Form","FormProvider","FormFieldContext","createContext","FormField","Controller","FormItemContext","useFormField","fieldContext","useContext","itemContext","getFieldState","formState","useFormContext","fieldState","FormItem","FormLabel","formItemId","LabelPrimitive","FormControl","formDescriptionId","formMessageId","FormDescription","FormError","body","Kbd","MultiSelect","maxVisibleChips","inputRef","useRef","toggle","x","clear","handleKeyDown","visibleChips","_a","Select","SelectPrimitive","SelectValue","SelectTrigger","scrollBtn","SelectScrollUpButton","ChevronUp","SelectScrollDownButton","SelectContent","position","SelectLabel","SelectItem","SelectSeparator","SelectGroup","pageRange","current","total","window","result","start","end","Pagination","page","pageCount","onPageChange","totalItems","pageSize","pageSizeOptions","onPageSizeChange","showJump","pages","from","to","goto","s","navButtonClass","ChevronsLeft","ChevronsRight","Popover","PopoverTrigger","PopoverAnchor","PopoverClose","PopoverContent","heightMap","fillTone","Progress","indeterminate","ProgressPrimitive","circleTone","ProgressCircle","thickness","isIndeterminate","radius","circumference","offset","RadioGroup","RadioGroupPrimitive","RadioItem","ScrollArea","ScrollAreaPrimitive","ScrollBar","Separator","decorative","SeparatorPrimitive","Sheet","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","sheet","SheetContent","side","SheetHeader","SheetFooter","SheetTitle","SheetDescription","SidebarContext","useSidebar","Sidebar","defaultCollapsed","controlled","onCollapsedChange","header","footer","internal","setInternal","collapsed","setCollapsed","SidebarSection","SidebarItem","href","trailing","sub","Comp","SidebarGroup","defaultOpen","Fragment","Slider","showValue","formatValue","defaultValue","currentValue","isRange","SliderPrimitive","toneMap","Spinner","Stepper","steps","step","state","trackSize","thumbSize","Switch","labelPosition","control","SwitchPrimitive","labelBlock","Tabs","TabsPrimitive","TabsList","TabsTrigger","TabsContent","Textarea","autoResize","minRows","maxRows","innerRef","setRef","node","recompute","el","maxH","ToastProvider","ToastPrimitive","ToastViewport","iconMap","Toast","ToastTitle","ToastDescription","ToastAction","ToastClose","TooltipProvider","delayDuration","skipDelayDuration","TooltipPrimitive","TooltipRoot","TooltipTrigger","TooltipContent","Tooltip","TopNav","logo","nav","search","actions","TopNavLink","CarouselContext","useCarousel","ctx","Carousel","opts","setApi","carouselRef","api","useEmblaCarousel","canPrev","setCanPrev","canNext","setCanNext","onSelect","CarouselContent","CarouselItem","CarouselPrevious","scrollPrev","CarouselNext","scrollNext","useScales","data","w","h","ys","min","range","innerW","innerH","LineChart","height","width","caption","sx","sy","path","AreaChart","top","area","BarChart","gap","barW","Drawer","shouldScaleBackground","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","directionStyles","handleStyles","DrawerContent","hideHandle","isHorizontal","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription","formatSize","bytes","FileUpload","accept","multiple","maxSize","hint","inputId","over","setOver","files","update","addFiles","incoming","arr","f","idx","onDrop","Upload","file","FileIcon","snackbar","Snackbar","onClose","TagInput","separators","draft","setDraft","tags","commit","raw","Timeline","TimelineItem","bullet","TimelineTime","TimelineTitle","TimelineDescription","Tree","defaultExpanded","selectedId","expanded","setExpanded","cur","renderNode","depth","hasChildren","isOpen","DefaultIcon","FolderOpen","Folder","AuthLayout","brand","subtitle","SignInForm","onSubmit","forgotHref","email","setEmail","password","setPassword","ArrowRight","SignUpForm","name","setName","ForgotPasswordForm","Mail","MagicLinkSent","onResend","navigate","hash","DEFAULT_NAV_SECTIONS","Home","Inbox","Users","BarChart3","Bookmark","LayoutGrid","Plug","HelpCircle","DEFAULT_USER","DEFAULT_NOTIFICATIONS","DEFAULT_PROFILE_MENU","User","Sparkles","LogOut","AppShell","navSections","sidebar","topbarActions","user","profileMenu","notifications","onMarkAllNotificationsRead","onViewAllNotifications","ProfileFooter","RenderNavSections","TopBar","sections","section","si","searchNode","Menu","NotificationMenu","ProfileMenu","onMarkAllRead","onViewAll","unread","Bell","DEFAULT_STATS","DEFAULT_ACTIVITY","Dashboard","headerActions","stats","chart","chartTitle","chartDescription","activity","activityTitle","r","DEMO_SECTIONS","Lock","CreditCard","SettingsPage","defaultSection","activeSection","onActiveSectionChange","isControlled","setActive","DEMO_ROWS","STATUS_TONE","DEMO_COLUMNS","DEMO_FILTERS","DEMO_HEADER_ACTIONS","Plus","DEMO_BULK_ACTIONS","Download","Trash2","DataTablePage","rowsProp","columnsProp","filtersProp","predicate","defaultPageSize","bulkActionsProp","filters","bulkActions","filterValues","setFilterValues","init","selectedIds","setSelectedIds","setPage","setPageSize","filtered","defaultPred","q","allOnPageSelected","someSelected","selectedRows","totalPages","pageRows","augmentedColumns","Filter","a","DEMO_HEADER","Edit2","ExternalLink","DEMO_TABS","P","DEMO_SIDE_PANEL","Row","RecordDetail","tabs","defaultTab","sidePanel","initialTab","DEMO_STEPS","setData","role","Onboarding","initialData","onComplete","setStep","setDataState","patch","goTo","finish","ArrowLeft","DEFAULT_TIERS","Pricing","tiers","highlightedLabel","cols","tier","DEFAULT_STEPS","FirstRunEmpty","heroIcon","primaryAction"],"mappings":"ygDAYO,SAASA,KAAMC,EAA8B,CAClD,OAAOC,GAAAA,QAAQC,QAAKF,CAAM,CAAC,CAC7B,CAMA,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OAAA,CAAO,UAAU,QAAA,CAAS,EACtC,MAAAxiB,EAAQ,0BACR,YAAA+D,EAAc,8EACd,cAAA6nB,EAAgBrtB,EAAAA,IAACmE,EAAA,CAAO,aAAcnE,EAAAA,IAAC4kB,EAAAA,WAAA,EAAW,EAAI,SAAA,gBAAa,EACnE,MAAAtK,EAAQ4S,GACR,UAAArtB,CACF,EAAwB,GAAI,CAC1B,cACG,MAAA,CAAI,UAAW,qCAAqCA,GAAa,EAAE,GAClE,SAAA,CAAAG,MAAC+Q,IAAW,KAAMqc,EAAU,MAAA3rB,EAAc,YAAA+D,EAA0B,OAAQ6nB,EAAe,EAE1F/S,EAAM,OAAS,SACb,MAAA,CAAI,UAAU,4BACZ,SAAAA,EAAM,IAAKzE,SACT9Q,EAAA,CAAmB,QAAQ,cAC1B,SAAA7E,EAAAA,KAACkF,EAAA,CAAY,UAAU,YACpB,SAAA,CAAAyQ,EAAE,MACD7V,EAAAA,IAAC,MAAA,CAAI,UAAU,8GACZ,WAAE,KACL,EAEFE,EAAAA,KAAC,MAAA,CAAI,UAAU,YACb,SAAA,CAAAF,EAAAA,IAAC,KAAA,CAAG,UAAU,wCAAyC,SAAA6V,EAAE,MAAM,EAC/D7V,EAAAA,IAAC,IAAA,CAAE,UAAU,gDAAiD,WAAE,WAAA,CAAY,CAAA,EAC9E,EACAA,EAAAA,IAACmE,EAAA,CACC,QAAQ,QACR,KAAK,KACL,mBAAeygB,EAAAA,WAAA,EAAW,EAC1B,QAAS/O,EAAE,SAEV,SAAAA,EAAE,GAAA,CAAA,CACL,CAAA,CACF,CAAA,EAnBSA,EAAE,KAoBb,CACD,CAAA,CACH,CAAA,EAEJ,CAEJ"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/lib/utils.ts","../src/hooks/use-media-query.ts","../src/hooks/use-toast.ts","../src/illustrations/index.tsx","../src/components/ui/Accordion.tsx","../src/components/ui/Alert.tsx","../src/components/ui/Avatar.tsx","../src/components/ui/Badge.tsx","../src/components/ui/Breadcrumbs.tsx","../src/components/ui/Button.tsx","../src/components/ui/Card.tsx","../src/components/ui/Checkbox.tsx","../src/components/ui/Combobox.tsx","../src/components/ui/CommandPalette.tsx","../src/components/ui/ContextMenu.tsx","../src/components/ui/DropdownMenu.tsx","../src/components/ui/IconButton.tsx","../src/components/ui/Input.tsx","../src/components/ui/Table.tsx","../src/components/ui/Skeleton.tsx","../src/components/ui/DataGrid.tsx","../src/components/ui/Calendar.tsx","../src/components/ui/DatePicker.tsx","../src/components/ui/DesignSystemProvider.tsx","../src/components/ui/Dialog.tsx","../src/components/ui/EmptyState.tsx","../src/components/ui/ErrorState.tsx","../src/components/ui/Form.tsx","../src/components/ui/Kbd.tsx","../src/components/ui/MultiSelect.tsx","../src/components/ui/Select.tsx","../src/components/ui/Pagination.tsx","../src/components/ui/Popover.tsx","../src/components/ui/Progress.tsx","../src/components/ui/RadioGroup.tsx","../src/components/ui/ScrollArea.tsx","../src/components/ui/Separator.tsx","../src/components/ui/Sheet.tsx","../src/components/ui/Sidebar.tsx","../src/components/ui/Slider.tsx","../src/components/ui/Spinner.tsx","../src/components/ui/Stepper.tsx","../src/components/ui/Switch.tsx","../src/components/ui/Tabs.tsx","../src/components/ui/Textarea.tsx","../src/components/ui/Toast.tsx","../src/components/ui/Tooltip.tsx","../src/components/ui/TopNav.tsx","../src/components/ui/Carousel.tsx","../src/components/ui/Chart.tsx","../src/components/ui/Drawer.tsx","../src/components/ui/FileUpload.tsx","../src/components/ui/Snackbar.tsx","../src/components/ui/TagInput.tsx","../src/components/ui/Timeline.tsx","../src/components/ui/Tree.tsx","../src/components/patterns/Authentication.tsx","../src/components/patterns/AppShell.tsx","../src/components/patterns/Settings.tsx","../src/components/patterns/DataTablePage.tsx","../src/components/patterns/RecordDetail.tsx","../src/components/patterns/Onboarding.tsx","../src/components/patterns/Pricing.tsx","../src/components/patterns/FirstRunEmpty.tsx"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Compose Tailwind class names safely.\n *\n * - `clsx` handles conditionals, arrays, and objects.\n * - `tailwind-merge` resolves conflicts: `cn('p-2', condition && 'p-4')` returns `'p-4'`.\n *\n * Use this everywhere classes are composed. Never concatenate Tailwind\n * classes with template strings — they will not de-duplicate.\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Tiny helper to build a stable id for label/aria-describedby pairings\n * when the component does not receive an `id` from the consumer.\n */\nlet __idCounter = 0;\nexport function uid(prefix = 'ds'): string {\n __idCounter += 1;\n return `${prefix}-${__idCounter}`;\n}\n","import { useEffect, useState } from 'react';\n\n/**\n * Subscribe to a CSS media query. SSR-safe — returns `false` on the server.\n *\n * @example\n * const isDesktop = useMediaQuery('(min-width: 1024px)');\n */\nexport function useMediaQuery(query: string): boolean {\n const [matches, setMatches] = useState(() => {\n if (typeof window === 'undefined') return false;\n return window.matchMedia(query).matches;\n });\n\n useEffect(() => {\n if (typeof window === 'undefined') return;\n const list = window.matchMedia(query);\n const onChange = (event: MediaQueryListEvent) => setMatches(event.matches);\n setMatches(list.matches);\n list.addEventListener('change', onChange);\n return () => list.removeEventListener('change', onChange);\n }, [query]);\n\n return matches;\n}\n\n/** Convenience: respect `prefers-reduced-motion`. */\nexport function usePrefersReducedMotion(): boolean {\n return useMediaQuery('(prefers-reduced-motion: reduce)');\n}\n","import { useCallback, useEffect, useState, type ReactNode } from 'react';\n\n/* -----------------------------------------------------------------------------\n * Minimal toast queue + hook. The host app mounts a single <ToastHub> near\n * the root which subscribes to this store; any component can call\n * `useToast().push({...})` from anywhere.\n *\n * Kept dependency-free intentionally — no external state library.\n * --------------------------------------------------------------------------- */\n\nexport type ToastVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';\n\nexport interface ToastDescriptor {\n /** Auto-generated; consumers can pass an explicit id to update an in-flight toast. */\n id?: string;\n title?: ReactNode;\n description?: ReactNode;\n variant?: ToastVariant;\n /** Milliseconds before auto-dismiss. Default 5000. Set to 0 to keep open. */\n duration?: number;\n /** Action button. The alt text is used for screen reader announcements. */\n action?: {\n label: ReactNode;\n altText: string;\n onClick: () => void;\n };\n}\n\ninterface InternalToast extends ToastDescriptor {\n id: string;\n open: boolean;\n}\n\ntype Listener = (toasts: InternalToast[]) => void;\n\ninterface ToastStore {\n toasts: InternalToast[];\n listeners: Set<Listener>;\n emit(): void;\n push(t: ToastDescriptor): string;\n dismiss(id: string): void;\n remove(id: string): void;\n}\n\nconst store: ToastStore = {\n toasts: [],\n listeners: new Set<Listener>(),\n emit() {\n for (const listener of this.listeners) listener(this.toasts);\n },\n push(t: ToastDescriptor) {\n const id = t.id ?? `t_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;\n const next: InternalToast = { open: true, duration: 5000, variant: 'default', ...t, id };\n this.toasts = [next, ...this.toasts].slice(0, 3);\n this.emit();\n return id;\n },\n dismiss(id: string) {\n this.toasts = this.toasts.map((t: InternalToast) => (t.id === id ? { ...t, open: false } : t));\n this.emit();\n },\n remove(id: string) {\n this.toasts = this.toasts.filter((t: InternalToast) => t.id !== id);\n this.emit();\n },\n};\n\n/**\n * Subscribe to the toast queue and dispatch new toasts.\n *\n * @example\n * const toast = useToast();\n * toast.push({ variant: 'success', title: 'Saved' });\n *\n * // With an action\n * toast.push({\n * title: 'Project archived',\n * action: { label: 'Undo', altText: 'Undo archive', onClick: undo },\n * });\n */\nexport function useToast() {\n const [toasts, setToasts] = useState<InternalToast[]>(() => [...store.toasts]);\n\n useEffect(() => {\n const listener: Listener = (next) => setToasts([...next]);\n store.listeners.add(listener);\n return () => {\n store.listeners.delete(listener);\n };\n }, []);\n\n const push = useCallback((t: ToastDescriptor) => store.push(t), []);\n const dismiss = useCallback((id: string) => store.dismiss(id), []);\n const remove = useCallback((id: string) => store.remove(id), []);\n\n return { toasts, push, dismiss, remove };\n}\n\n/** Convenience export — dispatch a toast outside React (e.g. from an API client). */\nexport const toast = (t: ToastDescriptor) => store.push(t);\n","import { type SVGProps } from 'react';\nimport { cn } from '@/lib/utils';\n\n/* Refined-minimal line illustrations. Single accent stroke, no fills.\n * Drop into EmptyState / ErrorState / FirstRunEmpty `icon` slots. */\n\ntype Props = SVGProps<SVGSVGElement>;\n\nfunction Base({ className, children, ...props }: Props & { children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 120 120\"\n role=\"img\"\n width=\"120\"\n height=\"120\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn('text-foreground-subtle', className)}\n aria-hidden\n {...props}\n >\n {children}\n </svg>\n );\n}\n\nexport function InboxEmpty(props: Props) {\n return (\n <Base {...props}>\n <path d=\"M22 56l10-28a6 6 0 0 1 6-4h44a6 6 0 0 1 6 4l10 28\" />\n <path d=\"M22 56v32a6 6 0 0 0 6 6h64a6 6 0 0 0 6-6V56\" />\n <path d=\"M22 56h22l4 10h24l4-10h22\" />\n <circle cx=\"60\" cy=\"36\" r=\"2\" className=\"text-accent\" stroke=\"currentColor\" />\n <path d=\"M52 28l8 8M68 28l-8 8\" opacity=\"0.4\" />\n </Base>\n );\n}\n\nexport function NoSearchResults(props: Props) {\n return (\n <Base {...props}>\n <circle cx=\"52\" cy=\"52\" r=\"26\" />\n <path d=\"M72 72l20 20\" />\n <path d=\"M42 52h20\" opacity=\"0.5\" />\n <circle cx=\"98\" cy=\"22\" r=\"1.5\" className=\"text-accent\" stroke=\"currentColor\" />\n <circle cx=\"20\" cy=\"92\" r=\"1.5\" className=\"text-accent\" stroke=\"currentColor\" />\n </Base>\n );\n}\n\nexport function NotFound(props: Props) {\n return (\n <Base {...props}>\n <path d=\"M22 32h76v56a6 6 0 0 1-6 6H28a6 6 0 0 1-6-6V32z\" />\n <path d=\"M22 44h76\" />\n <circle cx=\"32\" cy=\"38\" r=\"1.5\" />\n <circle cx=\"40\" cy=\"38\" r=\"1.5\" />\n <circle cx=\"48\" cy=\"38\" r=\"1.5\" />\n <path d=\"M44 64l32 16M76 64l-32 16\" className=\"text-accent\" stroke=\"currentColor\" />\n <text\n x=\"60\"\n y=\"76\"\n fontFamily=\"ui-monospace,monospace\"\n fontSize=\"9\"\n textAnchor=\"middle\"\n fill=\"currentColor\"\n stroke=\"none\"\n opacity=\"0.6\"\n >\n 404\n </text>\n </Base>\n );\n}\n\nexport function ServerError(props: Props) {\n return (\n <Base {...props}>\n <rect x=\"22\" y=\"28\" width=\"76\" height=\"20\" rx=\"3\" />\n <rect x=\"22\" y=\"54\" width=\"76\" height=\"20\" rx=\"3\" />\n <rect x=\"22\" y=\"80\" width=\"76\" height=\"20\" rx=\"3\" />\n <circle cx=\"32\" cy=\"38\" r=\"2\" className=\"text-danger\" stroke=\"currentColor\" />\n <circle cx=\"32\" cy=\"64\" r=\"2\" className=\"text-danger\" stroke=\"currentColor\" />\n <circle cx=\"32\" cy=\"90\" r=\"2\" className=\"text-warning\" stroke=\"currentColor\" />\n <path d=\"M44 38h44M44 64h44M44 90h28\" opacity=\"0.4\" />\n <path d=\"M82 84l16 16M82 100l16-16\" className=\"text-danger\" stroke=\"currentColor\" />\n </Base>\n );\n}\n\nexport function Construction(props: Props) {\n return (\n <Base {...props}>\n <path d=\"M22 86h76\" />\n <path d=\"M30 86V52l30-22 30 22v34\" />\n <rect x=\"40\" y=\"64\" width=\"14\" height=\"14\" rx=\"1\" />\n <rect x=\"66\" y=\"64\" width=\"14\" height=\"14\" rx=\"1\" />\n <path d=\"M30 52h60\" opacity=\"0.4\" />\n <path d=\"M40 40v6M50 36v10M70 36v10M80 40v6\" className=\"text-accent\" stroke=\"currentColor\" />\n </Base>\n );\n}\n\nexport function ConnectionLost(props: Props) {\n return (\n <Base {...props}>\n <path d=\"M22 60a40 40 0 0 1 76 0\" opacity=\"0.4\" />\n <path d=\"M34 70a28 28 0 0 1 52 0\" opacity=\"0.6\" />\n <path d=\"M46 80a16 16 0 0 1 28 0\" />\n <circle cx=\"60\" cy=\"92\" r=\"3\" />\n <path d=\"M20 20l80 80\" className=\"text-danger\" stroke=\"currentColor\" />\n </Base>\n );\n}\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { ChevronDown } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/**\n * Accessible disclosure list. Supports single (`type=\"single\"`) and multiple\n * (`type=\"multiple\"`) open behaviour — both come from Radix.\n *\n * @example FAQ\n * <Accordion type=\"single\" collapsible>\n * <AccordionItem value=\"q1\">\n * <AccordionTrigger>Can I cancel anytime?</AccordionTrigger>\n * <AccordionContent>Yes — usage stops at the end of the billing period.</AccordionContent>\n * </AccordionItem>\n * …\n * </Accordion>\n *\n * @do Use for FAQs, settings groups, and progressive-disclosure forms.\n * @dont Nest accordions inside accordions — the focus order becomes opaque.\n */\nexport const Accordion = AccordionPrimitive.Root;\n\nexport const AccordionItem = forwardRef<\n ElementRef<typeof AccordionPrimitive.Item>,\n ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(function AccordionItem({ className, ...props }, ref) {\n return (\n <AccordionPrimitive.Item ref={ref} className={cn('border-b border-border', className)} {...props} />\n );\n});\nAccordionItem.displayName = 'AccordionItem';\n\nexport const AccordionTrigger = forwardRef<\n ElementRef<typeof AccordionPrimitive.Trigger>,\n ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(function AccordionTrigger({ className, children, ...props }, ref) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n 'flex flex-1 items-center justify-between gap-2 py-4 text-left text-sm font-medium text-foreground',\n 'outline-none transition-colors duration-[var(--duration-fast)]',\n 'hover:text-accent',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n '[&[data-state=open]>svg]:rotate-180',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDown\n className=\"size-4 shrink-0 text-foreground-subtle transition-transform duration-[var(--duration-base)]\"\n aria-hidden\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n});\nAccordionTrigger.displayName = 'AccordionTrigger';\n\nexport const AccordionContent = forwardRef<\n ElementRef<typeof AccordionPrimitive.Content>,\n ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(function AccordionContent({ className, children, ...props }, ref) {\n return (\n <AccordionPrimitive.Content\n ref={ref}\n className={cn(\n 'overflow-hidden text-sm text-foreground-muted',\n 'data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down',\n )}\n {...props}\n >\n <div className={cn('pb-4 pt-0', className)}>{children}</div>\n </AccordionPrimitive.Content>\n );\n});\nAccordionContent.displayName = 'AccordionContent';\n","import { forwardRef, useState, type HTMLAttributes, type ReactNode } from 'react';\nimport { AlertTriangle, CheckCircle2, Info, X, XCircle } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst alert = cva(\n ['relative flex w-full gap-3 rounded-lg border p-4', 'text-sm'],\n {\n variants: {\n variant: {\n default: 'border-border bg-background-subtle text-foreground',\n info: 'border-info-border-soft bg-info-soft text-info-text',\n success: 'border-success-border-soft bg-success-soft text-success-text',\n warning: 'border-warning-border-soft bg-warning-soft text-warning-text',\n danger: 'border-danger-border-soft bg-danger-soft text-danger-text',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconForVariant = {\n default: null,\n info: <Info className=\"size-4 shrink-0 mt-0.5\" aria-hidden />,\n success: <CheckCircle2 className=\"size-4 shrink-0 mt-0.5\" aria-hidden />,\n warning: <AlertTriangle className=\"size-4 shrink-0 mt-0.5\" aria-hidden />,\n danger: <XCircle className=\"size-4 shrink-0 mt-0.5\" aria-hidden />,\n};\n\nexport interface AlertProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>,\n VariantProps<typeof alert> {\n /** Heading. Renders bold above the description. */\n title?: ReactNode;\n /** Show a dismiss (×) button. */\n dismissible?: boolean;\n /** Called when the user dismisses. */\n onDismiss?: () => void;\n /** Override the variant's default icon. Pass `false` to suppress the icon. */\n icon?: ReactNode | false;\n}\n\n/**\n * Inline banner for static page-level or section-level state. For transient\n * notifications use `Toast` instead.\n *\n * @example Inline error\n * <Alert variant=\"danger\" title=\"Payment failed\">\n * Your card was declined. Update your billing info to retry.\n * </Alert>\n *\n * @example Dismissible info\n * <Alert variant=\"info\" dismissible onDismiss={dismiss}>\n * We're improving search — give us feedback at #search-feedback.\n * </Alert>\n *\n * @do Use the closest semantic variant — `info` for neutral facts,\n * `warning` for \"watch out\", `danger` for \"this is broken\".\n * @dont Use Alert for one-time confirmations — that's Toast.\n */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { className, variant = 'default', title, dismissible, onDismiss, icon, children, ...props },\n ref,\n) {\n const [open, setOpen] = useState(true);\n if (!open) return null;\n\n const handleDismiss = () => {\n setOpen(false);\n onDismiss?.();\n };\n\n const renderedIcon = icon === false ? null : icon ?? iconForVariant[variant ?? 'default'];\n\n return (\n <div ref={ref} role=\"alert\" className={cn(alert({ variant }), className)} {...props}>\n {renderedIcon}\n <div className=\"flex-1 min-w-0\">\n {title && <h5 className=\"font-medium leading-tight mb-1\">{title}</h5>}\n <div className=\"text-sm leading-relaxed [&_p]:leading-relaxed\">{children}</div>\n </div>\n {dismissible && (\n <button\n type=\"button\"\n aria-label=\"Dismiss\"\n onClick={handleDismiss}\n className={cn(\n 'inline-flex size-6 shrink-0 items-center justify-center rounded-md',\n 'hover:bg-current/10 outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n )}\n >\n <X className=\"size-3.5\" aria-hidden />\n </button>\n )}\n </div>\n );\n});\nAlert.displayName = 'Alert';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst sizeMap = {\n xs: 'size-5 text-[10px]',\n sm: 'size-6 text-xs',\n md: 'size-8 text-xs',\n lg: 'size-10 text-sm',\n xl: 'size-12 text-base',\n} as const;\n\n// The wrapper sets size — Root sits inside and clips image/fallback only.\nconst avatarWrapper = cva('relative inline-flex shrink-0', {\n variants: { size: sizeMap },\n defaultVariants: { size: 'md' },\n});\n\nexport interface AvatarProps\n extends ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarWrapper> {\n /** Image URL. If absent or fails to load, fallback initials are shown. */\n src?: string;\n /** Alt text for the image; falls back to fallback when there's no `src`. */\n alt?: string;\n /** Initials shown when image is missing or loading. Pass at most 2 characters. */\n fallback?: string;\n /** Status dot rendered on the bottom-right. */\n status?: 'online' | 'busy' | 'away' | 'offline';\n}\n\nconst statusColour: Record<NonNullable<AvatarProps['status']>, string> = {\n online: 'bg-success',\n busy: 'bg-danger',\n away: 'bg-warning',\n offline: 'bg-foreground-subtle',\n};\n\n/**\n * Avatar with image, initials fallback, and optional status dot.\n *\n * @example\n * <Avatar src={user.photo} alt={user.name} fallback={getInitials(user.name)} status=\"online\" />\n *\n * @example AvatarGroup\n * <AvatarGroup max={3}>\n * {users.map(u => <Avatar key={u.id} src={u.photo} fallback={getInitials(u.name)} />)}\n * </AvatarGroup>\n *\n * @do Provide `alt` for image avatars and meaningful initials for the\n * fallback so screen readers announce something useful.\n * @dont Use the status dot without a tooltip explaining what it means.\n */\nexport const Avatar = forwardRef<ElementRef<typeof AvatarPrimitive.Root>, AvatarProps>(\n function Avatar({ className, size, src, alt, fallback, status, ...props }, ref) {\n return (\n <span className={avatarWrapper({ size })}>\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n 'block size-full overflow-hidden rounded-full bg-background-muted text-foreground-muted',\n className,\n )}\n {...props}\n >\n {src && (\n <AvatarPrimitive.Image\n src={src}\n alt={alt ?? ''}\n className=\"aspect-square size-full object-cover\"\n />\n )}\n <AvatarPrimitive.Fallback\n delayMs={src ? 200 : 0}\n className=\"flex size-full items-center justify-center bg-background-muted font-medium uppercase\"\n >\n {fallback ?? '?'}\n </AvatarPrimitive.Fallback>\n </AvatarPrimitive.Root>\n {status && (\n <span\n aria-label={`Status: ${status}`}\n className={cn(\n 'absolute bottom-0 right-0 block size-[28%] rounded-full ring-2 ring-background',\n statusColour[status],\n )}\n />\n )}\n </span>\n );\n },\n);\nAvatar.displayName = 'Avatar';\n\nexport interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {\n /** Maximum visible avatars before showing a \"+N\" overflow chip. */\n max?: number;\n /** Avatar size applied to children + overflow. */\n size?: keyof typeof sizeMap;\n /** Children — Avatars. */\n children: ReactNode;\n}\n\n/**\n * Overlapping avatars with overflow indicator. Pass plain `<Avatar>` children.\n */\nexport const AvatarGroup = forwardRef<HTMLDivElement, AvatarGroupProps>(function AvatarGroup(\n { max = 4, size = 'md', className, children, ...props },\n ref,\n) {\n const items = Array.isArray(children) ? children : [children];\n const visible = items.slice(0, max);\n const overflow = items.length - visible.length;\n\n return (\n <div ref={ref} className={cn('flex items-center -space-x-2', className)} {...props}>\n {visible.map((child, i) => (\n <div key={i} className=\"ring-2 ring-background rounded-full\">\n {child}\n </div>\n ))}\n {overflow > 0 && (\n <div\n className={cn(\n 'inline-flex items-center justify-center rounded-full bg-background-muted text-foreground-muted ring-2 ring-background',\n sizeMap[size],\n 'font-medium',\n )}\n aria-label={`${overflow} more`}\n >\n +{overflow}\n </div>\n )}\n </div>\n );\n});\nAvatarGroup.displayName = 'AvatarGroup';\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst badge = cva(\n [\n 'inline-flex items-center gap-1 rounded-full px-2 py-0.5',\n 'text-xs font-medium whitespace-nowrap',\n ],\n {\n variants: {\n variant: {\n subtle: '',\n outline: 'border bg-transparent',\n },\n tone: {\n neutral: '',\n accent: '',\n success: '',\n warning: '',\n danger: '',\n info: '',\n },\n },\n compoundVariants: [\n // Subtle — coloured fill + matching text.\n { variant: 'subtle', tone: 'neutral', class: 'bg-background-muted text-foreground-muted' },\n { variant: 'subtle', tone: 'accent', class: 'bg-accent-soft text-on-accent-soft' },\n { variant: 'subtle', tone: 'success', class: 'bg-success-soft text-success-text' },\n { variant: 'subtle', tone: 'warning', class: 'bg-warning-soft text-warning-text' },\n { variant: 'subtle', tone: 'danger', class: 'bg-danger-soft text-danger-text' },\n { variant: 'subtle', tone: 'info', class: 'bg-info-soft text-info-text' },\n // Outline — coloured border + text, transparent fill.\n { variant: 'outline', tone: 'neutral', class: 'border-border text-foreground-muted' },\n { variant: 'outline', tone: 'accent', class: 'border-accent text-accent' },\n { variant: 'outline', tone: 'success', class: 'border-success-border-soft text-success-text' },\n { variant: 'outline', tone: 'warning', class: 'border-warning-border-soft text-warning-text' },\n { variant: 'outline', tone: 'danger', class: 'border-danger-border-soft text-danger-text' },\n { variant: 'outline', tone: 'info', class: 'border-info-border-soft text-info-text' },\n ],\n defaultVariants: { variant: 'subtle', tone: 'neutral' },\n },\n);\n\nexport interface BadgeProps\n extends HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof badge> {\n /** Show a leading status dot in the same tone. */\n dot?: boolean;\n}\n\nconst dotColour = {\n neutral: 'bg-foreground-subtle',\n accent: 'bg-accent',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-danger',\n info: 'bg-info',\n} as const;\n\n/**\n * Status pill. Use `subtle` for high-volume contexts (table cells, lists);\n * `outline` when the badge sits on a busy or coloured background.\n *\n * @example\n * <Badge tone=\"success\" dot>Active</Badge>\n * <Badge tone=\"danger\" variant=\"outline\">Failed</Badge>\n *\n * @do Use badges to summarise state, not to label categories — for taxonomies\n * pick a tone palette and stick with it.\n * @dont Use a badge as a button. Wrap it in a Button or use a Toggle.\n */\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { className, variant, tone = 'neutral', dot, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn(badge({ variant, tone }), className)} {...props}>\n {dot && (\n <span\n aria-hidden\n className={cn('inline-block size-1.5 rounded-full', dotColour[tone ?? 'neutral'])}\n />\n )}\n {children}\n </span>\n );\n});\nBadge.displayName = 'Badge';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { ChevronRight, MoreHorizontal } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface BreadcrumbItem {\n /** Visible label. */\n label: ReactNode;\n /** Optional URL. Last item is treated as current page even if href is set. */\n href?: string;\n}\n\nexport interface BreadcrumbsProps extends HTMLAttributes<HTMLElement> {\n items: BreadcrumbItem[];\n /** Collapse to first + ellipsis + last `n` when items.length exceeds this. */\n maxItems?: number;\n /** Custom link renderer (for next/link, react-router, etc.). */\n renderLink?: (href: string, children: ReactNode) => ReactNode;\n}\n\n/**\n * Breadcrumb trail. Collapses with an ellipsis when there are too many crumbs.\n *\n * @example\n * <Breadcrumbs items={[\n * { label: 'Projects', href: '/projects' },\n * { label: 'Nova', href: '/projects/nova' },\n * { label: 'Settings' },\n * ]} />\n *\n * @example With react-router\n * <Breadcrumbs items={trail} renderLink={(href, c) => <Link to={href}>{c}</Link>} />\n *\n * @do Always omit `href` on the last item — it represents the current page.\n * @dont Use Breadcrumbs for flat navigation. Use TopNav links instead.\n */\nexport const Breadcrumbs = forwardRef<HTMLElement, BreadcrumbsProps>(function Breadcrumbs(\n { items, maxItems = 4, renderLink, className, ...props },\n ref,\n) {\n const shouldCollapse = items.length > maxItems;\n const displayItems =\n !shouldCollapse\n ? items\n : [items[0], { collapsed: true } as const, ...items.slice(-2)];\n\n return (\n <nav ref={ref} aria-label=\"Breadcrumb\" className={cn('text-sm', className)} {...props}>\n <ol className=\"flex flex-wrap items-center gap-1.5 text-foreground-subtle\">\n {displayItems.map((it, i) => {\n const isLast = i === displayItems.length - 1;\n if ('collapsed' in it) {\n return (\n <li key={`ellipsis-${i}`} className=\"flex items-center gap-1.5\">\n <MoreHorizontal className=\"size-4\" aria-hidden />\n <ChevronRight className=\"size-3.5\" aria-hidden />\n </li>\n );\n }\n const item = it as BreadcrumbItem;\n const labelNode = isLast ? (\n <span aria-current=\"page\" className=\"font-medium text-foreground\">\n {item.label}\n </span>\n ) : item.href ? (\n renderLink ? (\n renderLink(item.href, item.label)\n ) : (\n <a\n href={item.href}\n className=\"hover:text-foreground transition-colors duration-[var(--duration-fast)] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm\"\n >\n {item.label}\n </a>\n )\n ) : (\n <span>{item.label}</span>\n );\n return (\n <li key={i} className=\"flex items-center gap-1.5\">\n {labelNode}\n {!isLast && <ChevronRight className=\"size-3.5\" aria-hidden />}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n});\nBreadcrumbs.displayName = 'Breadcrumbs';\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { Loader2 } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Variants — the entire visual surface of the Button.\n *\n * All sizes share the same border radius (md = 6px) per the refined-minimal\n * rules. Focus state is the standardised 2px-ring + 2px-offset on every\n * variant, including `link`.\n * --------------------------------------------------------------------------- */\nconst button = cva(\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'rounded-md text-sm font-medium',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'bg-accent text-on-accent',\n 'hover:bg-accent-700',\n 'active:bg-accent-800',\n ],\n secondary: [\n 'bg-background-muted text-foreground border border-border',\n 'hover:bg-neutral-200 dark:hover:bg-neutral-800',\n 'active:bg-neutral-300 dark:active:bg-neutral-700',\n ],\n outline: [\n 'border border-border bg-transparent text-foreground',\n 'hover:bg-background-muted',\n 'active:bg-background-subtle',\n ],\n ghost: [\n 'bg-transparent text-foreground',\n 'hover:bg-background-muted',\n 'active:bg-background-subtle',\n ],\n destructive: [\n 'bg-danger text-on-danger',\n 'hover:bg-danger-700',\n 'active:bg-danger-800',\n ],\n link: [\n 'bg-transparent text-accent underline-offset-4 px-0',\n 'hover:underline',\n 'active:text-accent-700',\n ],\n },\n size: {\n sm: 'h-8 px-3 text-xs [&_svg]:size-4',\n md: 'h-9 px-3.5 text-sm [&_svg]:size-4',\n lg: 'h-10 px-4 text-sm [&_svg]:size-5',\n icon: 'h-9 w-9 [&_svg]:size-4',\n },\n },\n compoundVariants: [\n // The `link` variant ignores horizontal padding from the size variant.\n { variant: 'link', size: 'sm', class: 'h-auto px-0' },\n { variant: 'link', size: 'md', class: 'h-auto px-0' },\n { variant: 'link', size: 'lg', class: 'h-auto px-0' },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n);\n\nexport interface ButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof button> {\n /**\n * Render as a different element via Radix Slot. Useful when wrapping a\n * link: `<Button asChild><a href=\"…\">…</a></Button>`.\n * @default false\n */\n asChild?: boolean;\n /**\n * Show a spinner in place of the leading icon and disable the button.\n * Use for async actions where the user must wait.\n * @default false\n */\n loading?: boolean;\n /** Icon rendered before the label. Replaced by a spinner when loading. */\n leadingIcon?: ReactNode;\n /** Icon rendered after the label. Hidden while loading. */\n trailingIcon?: ReactNode;\n}\n\n/**\n * Primary interactive element. Variants:\n *\n * - `primary` — accent fill, the single most prominent action on a screen.\n * - `secondary` — neutral fill, sits next to a primary or stands alone for\n * secondary actions.\n * - `outline` — border only, transparent fill. Use when next to a primary.\n * - `ghost` — no border, hover background. Use in dense toolbars and tables.\n * - `destructive` — danger fill, reserved for irreversible actions.\n * - `link` — text styled as a link.\n *\n * @example Two-button row\n * <div className=\"flex gap-2 justify-end\">\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Save changes</Button>\n * </div>\n *\n * @example Loading state\n * <Button loading leadingIcon={<Mail />}>Sending…</Button>\n *\n * @do Use one primary button per major surface. Verb-first labels.\n * @dont Stack three primary buttons in a row — only the most important\n * action gets the primary variant.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n leadingIcon,\n trailingIcon,\n disabled,\n children,\n type = 'button',\n ...props\n },\n ref,\n) {\n const isDisabled = disabled || loading;\n const classes = cn(button({ variant, size }), className);\n\n if (asChild) {\n // Slot requires exactly one element child — pass the consumer's element\n // through untouched. The consumer is responsible for any leading/trailing\n // icons inside that element.\n return (\n <Slot\n ref={ref}\n aria-busy={loading || undefined}\n data-loading={loading || undefined}\n className={classes}\n {...props}\n >\n {children}\n </Slot>\n );\n }\n\n return (\n <button\n ref={ref}\n type={type}\n aria-busy={loading || undefined}\n disabled={isDisabled}\n data-loading={loading || undefined}\n className={classes}\n {...props}\n >\n {loading ? (\n <Loader2 className=\"animate-spin\" aria-hidden=\"true\" />\n ) : (\n leadingIcon\n )}\n {children}\n {!loading && trailingIcon}\n </button>\n );\n});\n\nButton.displayName = 'Button';\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst card = cva(\n [\n 'rounded-lg border bg-card text-card-foreground',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n ],\n {\n variants: {\n variant: {\n default: 'border-border',\n interactive:\n 'border-border hover:border-border-strong hover:bg-background-subtle cursor-pointer',\n },\n padding: {\n none: '',\n sm: 'p-4',\n md: 'p-5',\n lg: 'p-6',\n },\n },\n defaultVariants: {\n variant: 'default',\n padding: 'md',\n },\n },\n);\n\nexport interface CardProps\n extends HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof card> {}\n\n/**\n * Bounded surface used to group related content. Per the refined-minimal\n * rules, cards on the page have a hairline border and no shadow.\n *\n * @example Header + content + footer\n * <Card>\n * <CardHeader>\n * <CardTitle>Storage</CardTitle>\n * <CardDescription>Usage across all projects.</CardDescription>\n * </CardHeader>\n * <CardContent>…</CardContent>\n * <CardFooter><Button>Upgrade</Button></CardFooter>\n * </Card>\n *\n * @example Clickable list row\n * <Card variant=\"interactive\" onClick={open}>…</Card>\n *\n * @do Use the `border` style. If a card needs to \"float\" (modal, dropdown),\n * it isn't a Card — it's a Popover/Dialog.\n * @dont Add `shadow-lg` to Cards. Shadows on inline surfaces violate the\n * refined-minimal direction.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n { className, variant, padding, ...props },\n ref,\n) {\n return <div ref={ref} className={cn(card({ variant, padding }), className)} {...props} />;\n});\nCard.displayName = 'Card';\n\nexport const CardHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CardHeader({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn('flex flex-col gap-1 pb-4', className)}\n {...props}\n />\n );\n },\n);\nCardHeader.displayName = 'CardHeader';\n\nexport const CardTitle = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingElement>>(\n function CardTitle({ className, ...props }, ref) {\n return (\n <h3\n ref={ref}\n className={cn('text-base font-semibold text-foreground leading-tight', className)}\n {...props}\n />\n );\n },\n);\nCardTitle.displayName = 'CardTitle';\n\nexport const CardDescription = forwardRef<\n HTMLParagraphElement,\n HTMLAttributes<HTMLParagraphElement>\n>(function CardDescription({ className, ...props }, ref) {\n return (\n <p\n ref={ref}\n className={cn('text-sm text-foreground-muted', className)}\n {...props}\n />\n );\n});\nCardDescription.displayName = 'CardDescription';\n\nexport const CardContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CardContent({ className, ...props }, ref) {\n return <div ref={ref} className={cn('text-sm text-foreground', className)} {...props} />;\n },\n);\nCardContent.displayName = 'CardContent';\n\nexport const CardFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CardFooter({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn('flex items-center gap-2 pt-4', className)}\n {...props}\n />\n );\n },\n);\nCardFooter.displayName = 'CardFooter';\n","import { forwardRef, useId, type ComponentPropsWithoutRef, type ElementRef, type ReactNode } from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Check, Minus } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface CheckboxProps\n extends Omit<ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'asChild'> {\n /** Visible label rendered to the right of the box. */\n label?: ReactNode;\n /** Secondary description rendered below the label. */\n description?: ReactNode;\n /** Validation error message. */\n error?: ReactNode;\n /** Hide the label visually while keeping it in the a11y tree. */\n hideLabel?: boolean;\n}\n\n/**\n * Checkbox with optional inline label + description. Pass `checked=\"indeterminate\"`\n * for the indeterminate state — Radix renders a `Minus` icon automatically.\n *\n * @example Single\n * <Checkbox label=\"I agree to the terms\" checked={ok} onCheckedChange={setOk} />\n *\n * @example Tri-state header\n * <Checkbox aria-label=\"Select all\"\n * checked={allSelected ? true : someSelected ? 'indeterminate' : false}\n * onCheckedChange={toggleAll} />\n *\n * @do Use indeterminate to summarise child rows in a table header.\n * @dont Use a Checkbox for mutually exclusive choices — use RadioGroup.\n */\nexport const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n function Checkbox({ className, label, description, error, hideLabel, id, disabled, ...props }, ref) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const descId = description ? `${fieldId}-desc` : undefined;\n const errorId = error ? `${fieldId}-error` : undefined;\n\n return (\n <div className={cn('flex flex-col gap-1', className)}>\n <div className=\"flex items-start gap-2.5\">\n <CheckboxPrimitive.Root\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={errorId ?? descId}\n aria-invalid={Boolean(error) || undefined}\n className={cn(\n 'peer mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-sm border',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'data-[state=checked]:bg-accent data-[state=checked]:border-accent data-[state=checked]:text-on-accent',\n 'data-[state=indeterminate]:bg-accent data-[state=indeterminate]:border-accent data-[state=indeterminate]:text-on-accent',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n error ? 'border-danger' : 'border-border-strong',\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center\">\n {props.checked === 'indeterminate' ? (\n <Minus className=\"size-3\" aria-hidden strokeWidth={3} />\n ) : (\n <Check className=\"size-3\" aria-hidden strokeWidth={3} />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n\n {label && (\n <div className={cn('flex flex-col gap-0.5', hideLabel && 'sr-only')}>\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm text-foreground select-none',\n disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n {label}\n </label>\n {description && (\n <p id={descId} className=\"text-xs text-foreground-subtle\">\n {description}\n </p>\n )}\n </div>\n )}\n </div>\n {error && (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n )}\n </div>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n type ReactNode,\n} from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Check, ChevronsUpDown, Loader2, X } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface ComboboxOption {\n value: string;\n label: string;\n description?: string;\n disabled?: boolean;\n}\n\nexport interface ComboboxProps {\n /** Currently selected value (controlled). */\n value: string | null;\n /** Called when a value is picked or cleared. */\n onChange: (value: string | null) => void;\n /** Static options. Ignored if `loadOptions` is provided. */\n options?: ComboboxOption[];\n /**\n * Async loader called with the current query each time it changes.\n * Use for server-side search.\n */\n loadOptions?: (query: string) => Promise<ComboboxOption[]>;\n /** Visible label above the field. */\n label?: ReactNode;\n /** Hint below the field. Hidden when `error` is set. */\n helperText?: ReactNode;\n /** Validation error. */\n error?: ReactNode;\n /** Placeholder shown when no value is selected. */\n placeholder?: string;\n /** Search placeholder inside the popover. */\n searchPlaceholder?: string;\n /** Empty state copy when nothing matches. */\n emptyText?: string;\n /** Allow clearing the selection with an inline ×. */\n clearable?: boolean;\n /** Disable the entire field. */\n disabled?: boolean;\n /** Field size, matches Input. */\n size?: 'sm' | 'md' | 'lg';\n className?: string;\n}\n\n/**\n * Single-select with typeahead. Use `options` for client-side filtering or\n * `loadOptions` for server-side search.\n *\n * @example Client-side\n * <Combobox label=\"Country\" options={countries} value={c} onChange={setC} />\n *\n * @example Server-side\n * <Combobox label=\"Assignee\"\n * value={user}\n * onChange={setUser}\n * loadOptions={async (q) => api.searchUsers(q)} />\n *\n * @do Use Combobox over Select for >12 options or when the user is expected\n * to know what they want.\n * @dont Re-query on every keystroke without debouncing — pass a debounced\n * `loadOptions` to avoid hammering the server.\n */\nexport const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(function Combobox(\n {\n value,\n onChange,\n options,\n loadOptions,\n label,\n helperText,\n error,\n placeholder = 'Select…',\n searchPlaceholder = 'Search…',\n emptyText = 'No results.',\n clearable = true,\n disabled,\n size = 'md',\n className,\n },\n ref,\n) {\n const autoId = useId();\n const helperId = `${autoId}-helper`;\n const errorId = `${autoId}-error`;\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const [loaded, setLoaded] = useState<ComboboxOption[]>([]);\n const [loading, setLoading] = useState(false);\n\n // Resolve options: static or async-loaded.\n const items = loadOptions ? loaded : options ?? [];\n\n useEffect(() => {\n if (!loadOptions || !open) return;\n let cancelled = false;\n setLoading(true);\n loadOptions(query)\n .then((res) => {\n if (!cancelled) setLoaded(res);\n })\n .finally(() => {\n if (!cancelled) setLoading(false);\n });\n return () => {\n cancelled = true;\n };\n }, [query, open, loadOptions]);\n\n const selected = useMemo(\n () => items.find((o) => o.value === value) ?? null,\n [items, value],\n );\n\n const triggerHeight = size === 'sm' ? 'h-8' : size === 'lg' ? 'h-10' : 'h-9';\n const triggerPadding = size === 'sm' ? 'px-2.5' : size === 'lg' ? 'px-3.5' : 'px-3';\n\n const handleClear = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n onChange(null);\n },\n [onChange],\n );\n\n const isError = Boolean(error);\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label htmlFor={autoId} className=\"text-sm font-medium text-foreground\">\n {label}\n </label>\n )}\n\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n <button\n id={autoId}\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-invalid={isError || undefined}\n aria-describedby={isError ? errorId : helperText ? helperId : undefined}\n disabled={disabled}\n className={cn(\n 'inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-sm text-foreground',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n triggerHeight,\n triggerPadding,\n isError\n ? 'border-danger focus-visible:border-danger focus-visible:ring-danger'\n : 'border-border focus-visible:border-accent focus-visible:ring-ring',\n )}\n >\n <span className={cn('truncate', !selected && 'text-foreground-subtle')}>\n {selected ? selected.label : placeholder}\n </span>\n <span className=\"ml-2 flex items-center gap-1 shrink-0\">\n {clearable && selected && !disabled && (\n <span\n role=\"button\"\n tabIndex={-1}\n onClick={handleClear}\n aria-label=\"Clear selection\"\n className=\"text-foreground-subtle hover:text-foreground\"\n >\n <X className=\"size-4\" aria-hidden />\n </span>\n )}\n <ChevronsUpDown className=\"size-4 text-foreground-subtle\" aria-hidden />\n </span>\n </button>\n </PopoverPrimitive.Trigger>\n\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={4}\n className={cn(\n 'z-[var(--z-popover)] w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md',\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 )}\n >\n <CommandPrimitive shouldFilter={!loadOptions} className=\"flex h-full w-full flex-col\">\n <div className=\"flex items-center border-b border-border px-3\">\n <CommandPrimitive.Input\n value={query}\n onValueChange={setQuery}\n placeholder={searchPlaceholder}\n className=\"flex h-9 w-full bg-transparent py-2 text-sm outline-none placeholder:text-foreground-subtle\"\n />\n {loading && (\n <Loader2 className=\"size-4 animate-spin text-foreground-subtle\" aria-hidden />\n )}\n </div>\n <CommandPrimitive.List className=\"max-h-64 overflow-y-auto p-1\">\n {items.map((opt) => {\n const isSelected = opt.value === value;\n return (\n <CommandPrimitive.Item\n key={opt.value}\n value={opt.value}\n disabled={opt.disabled}\n onSelect={(v) => {\n onChange(v);\n setOpen(false);\n }}\n className={cn(\n 'flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground',\n 'data-[selected=true]:bg-background-muted',\n 'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none',\n )}\n >\n <span className=\"flex-1\">{opt.label}</span>\n {opt.description && (\n <span className=\"text-xs text-foreground-subtle\">{opt.description}</span>\n )}\n {isSelected && <Check className=\"size-4 text-accent\" aria-hidden />}\n </CommandPrimitive.Item>\n );\n })}\n {!loading && items.length === 0 && (\n <CommandPrimitive.Empty className=\"px-2 py-6 text-center text-sm text-foreground-subtle\">\n {emptyText}\n </CommandPrimitive.Empty>\n )}\n </CommandPrimitive.List>\n </CommandPrimitive>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n\n {error ? (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-xs text-foreground-subtle\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nCombobox.displayName = 'Combobox';\n","import {\n forwardRef,\n useEffect,\n useState,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Search } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * CommandPalette is a Dialog hosting a `cmdk` Command. It supports grouped\n * items, keyboard navigation (handled by cmdk), an empty state, and a\n * pluggable list of \"recent\" items shown when the search input is empty.\n * --------------------------------------------------------------------------- */\n\nexport const Command = forwardRef<\n ElementRef<typeof CommandPrimitive>,\n ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(function Command({ className, ...props }, ref) {\n return (\n <CommandPrimitive\n ref={ref}\n className={cn(\n 'flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground',\n className,\n )}\n {...props}\n />\n );\n});\nCommand.displayName = 'Command';\n\nexport const CommandInput = forwardRef<\n ElementRef<typeof CommandPrimitive.Input>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(function CommandInput({ className, ...props }, ref) {\n return (\n <div className=\"flex items-center gap-2 border-b border-border px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"size-4 shrink-0 text-foreground-subtle\" aria-hidden />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full bg-transparent py-3 text-sm outline-none',\n 'placeholder:text-foreground-subtle disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n );\n});\nCommandInput.displayName = 'CommandInput';\n\nexport const CommandList = forwardRef<\n ElementRef<typeof CommandPrimitive.List>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(function CommandList({ className, ...props }, ref) {\n return (\n <CommandPrimitive.List\n ref={ref}\n className={cn('max-h-[320px] overflow-y-auto p-1', className)}\n {...props}\n />\n );\n});\nCommandList.displayName = 'CommandList';\n\nexport const CommandEmpty = forwardRef<\n ElementRef<typeof CommandPrimitive.Empty>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>(function CommandEmpty(props, ref) {\n return (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-8 text-center text-sm text-foreground-subtle\"\n {...props}\n />\n );\n});\nCommandEmpty.displayName = 'CommandEmpty';\n\nexport const CommandGroup = forwardRef<\n ElementRef<typeof CommandPrimitive.Group>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(function CommandGroup({ className, ...props }, ref) {\n return (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden text-foreground p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5',\n '[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',\n '[&_[cmdk-group-heading]]:text-foreground-subtle',\n className,\n )}\n {...props}\n />\n );\n});\nCommandGroup.displayName = 'CommandGroup';\n\nexport const CommandSeparator = forwardRef<\n ElementRef<typeof CommandPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(function CommandSeparator({ className, ...props }, ref) {\n return (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\nCommandSeparator.displayName = 'CommandSeparator';\n\nexport const CommandItem = forwardRef<\n ElementRef<typeof CommandPrimitive.Item>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(function CommandItem({ className, ...props }, ref) {\n return (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none',\n 'data-[selected=true]:bg-background-muted data-[selected=true]:text-foreground',\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n '[&_svg]:size-4 [&_svg]:text-foreground-subtle',\n className,\n )}\n {...props}\n />\n );\n});\nCommandItem.displayName = 'CommandItem';\n\nexport function CommandShortcut({ children, className }: { children: ReactNode; className?: string }) {\n return (\n <span\n className={cn(\n 'ml-auto inline-flex items-center gap-0.5 text-xs tracking-widest text-foreground-subtle font-mono',\n className,\n )}\n >\n {children}\n </span>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Dialog wrapper — a ready-to-use ⌘K palette.\n * --------------------------------------------------------------------------- */\n\nexport interface CommandDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n children: ReactNode;\n /** Visible label for screen readers. */\n title?: string;\n}\n\nexport function CommandDialog({ open, onOpenChange, children, title = 'Command palette' }: CommandDialogProps) {\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n )}\n />\n <DialogPrimitive.Content\n className={cn(\n 'fixed left-1/2 top-[20%] z-[var(--z-modal)] -translate-x-1/2',\n 'w-[calc(100%-2rem)] max-w-[640px] overflow-hidden',\n 'rounded-lg border border-border bg-popover text-popover-foreground shadow-lg',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n 'data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95',\n )}\n >\n <DialogPrimitive.Title className=\"sr-only\">{title}</DialogPrimitive.Title>\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n}\n\n/**\n * Hook that wires ⌘K / Ctrl+K to a setter — the canonical way to mount the\n * palette in an app shell.\n *\n * @example\n * const [open, setOpen] = useState(false);\n * useCommandPaletteShortcut(setOpen);\n * …\n * <CommandDialog open={open} onOpenChange={setOpen}>\n * <CommandInput placeholder=\"Type a command…\" />\n * <CommandList>\n * <CommandEmpty>No results.</CommandEmpty>\n * <CommandGroup heading=\"Suggestions\">\n * <CommandItem>Create project</CommandItem>\n * <CommandItem>Invite teammate</CommandItem>\n * </CommandGroup>\n * </CommandList>\n * </CommandDialog>\n *\n * @do Group items by category. Show \"Recent\" first when the query is empty.\n * @dont Hide essential actions behind the palette only — keep at least one\n * button entry in the UI.\n */\nexport function useCommandPaletteShortcut(setOpen: (open: boolean) => void): void {\n const [_, force] = useState(0);\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'k' && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n setOpen(true);\n force((n) => n + 1);\n }\n };\n window.addEventListener('keydown', onKey);\n return () => window.removeEventListener('keydown', onKey);\n }, [setOpen]);\n}\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n} from 'react';\nimport * as ContextMenuPrimitive from '@radix-ui/react-context-menu';\nimport { Check, ChevronRight, Circle } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/**\n * Right-click (or two-finger tap) menu. Visual surface mirrors DropdownMenu\n * for consistency.\n *\n * @example\n * <ContextMenu>\n * <ContextMenuTrigger asChild>\n * <div className=\"grid h-32 place-items-center rounded-lg border border-border\">\n * Right-click me\n * </div>\n * </ContextMenuTrigger>\n * <ContextMenuContent>\n * <ContextMenuItem>Open</ContextMenuItem>\n * <ContextMenuSeparator />\n * <ContextMenuItem destructive>Delete</ContextMenuItem>\n * </ContextMenuContent>\n * </ContextMenu>\n *\n * @do Mirror DropdownMenu items for the same surface — users expect the same\n * operations from both.\n * @dont Hide critical actions behind right-click — they must also exist in\n * a visible button or menu.\n */\nexport const ContextMenu = ContextMenuPrimitive.Root;\nexport const ContextMenuTrigger = ContextMenuPrimitive.Trigger;\nexport const ContextMenuGroup = ContextMenuPrimitive.Group;\nexport const ContextMenuPortal = ContextMenuPrimitive.Portal;\nexport const ContextMenuSub = ContextMenuPrimitive.Sub;\nexport const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst itemClasses = cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none',\n 'data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n);\n\nexport const ContextMenuSubTrigger = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger>\n>(function ContextMenuSubTrigger({ className, children, ...props }, ref) {\n return (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(itemClasses, 'data-[state=open]:bg-background-muted', className)}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto size-4 text-foreground-subtle\" aria-hidden />\n </ContextMenuPrimitive.SubTrigger>\n );\n});\nContextMenuSubTrigger.displayName = 'ContextMenuSubTrigger';\n\nexport const ContextMenuSubContent = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.SubContent>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(function ContextMenuSubContent({ className, ...props }, ref) {\n return (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-[var(--z-popover)] min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md',\n className,\n )}\n {...props}\n />\n );\n});\nContextMenuSubContent.displayName = 'ContextMenuSubContent';\n\nexport const ContextMenuContent = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.Content>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(function ContextMenuContent({ className, ...props }, ref) {\n return (\n <ContextMenuPortal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n 'z-[var(--z-popover)] min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md',\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 </ContextMenuPortal>\n );\n});\nContextMenuContent.displayName = 'ContextMenuContent';\n\nexport const ContextMenuItem = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.Item>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & { destructive?: boolean }\n>(function ContextMenuItem({ className, destructive, ...props }, ref) {\n return (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n itemClasses,\n destructive &&\n 'text-danger-text data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger-text',\n className,\n )}\n {...props}\n />\n );\n});\nContextMenuItem.displayName = 'ContextMenuItem';\n\nexport const ContextMenuCheckboxItem = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(function ContextMenuCheckboxItem({ className, children, ...props }, ref) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Check className=\"size-4 text-accent\" aria-hidden />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n});\nContextMenuCheckboxItem.displayName = 'ContextMenuCheckboxItem';\n\nexport const ContextMenuRadioItem = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(function ContextMenuRadioItem({ className, children, ...props }, ref) {\n return (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Circle className=\"size-2 fill-accent text-accent\" aria-hidden />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n});\nContextMenuRadioItem.displayName = 'ContextMenuRadioItem';\n\nexport const ContextMenuLabel = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.Label>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label>\n>(function ContextMenuLabel({ className, ...props }, ref) {\n return (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-xs font-medium text-foreground-subtle', className)}\n {...props}\n />\n );\n});\nContextMenuLabel.displayName = 'ContextMenuLabel';\n\nexport const ContextMenuSeparator = forwardRef<\n ElementRef<typeof ContextMenuPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(function ContextMenuSeparator({ className, ...props }, ref) {\n return (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\nContextMenuSeparator.displayName = 'ContextMenuSeparator';\n\nexport function ContextMenuShortcut({ className, ...props }: HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest text-foreground-subtle font-mono', className)}\n {...props}\n />\n );\n}\nContextMenuShortcut.displayName = 'ContextMenuShortcut';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n} from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Full dropdown menu surface with submenu support, separators, checkbox /\n * radio items, and keyboard shortcut labels (Kbd).\n * --------------------------------------------------------------------------- */\n\nexport const DropdownMenu = DropdownMenuPrimitive.Root;\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nexport const DropdownMenuGroup = DropdownMenuPrimitive.Group;\nexport const DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\nexport const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst itemClasses = cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none',\n 'data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n 'transition-colors duration-[var(--duration-fast)]',\n);\n\nexport const DropdownMenuSubTrigger = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(function DropdownMenuSubTrigger({ className, inset, children, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(itemClasses, 'data-[state=open]:bg-background-muted', inset && 'pl-8', className)}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto size-4 text-foreground-subtle\" aria-hidden />\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\nexport const DropdownMenuSubContent = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(function DropdownMenuSubContent({ className, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-[var(--z-popover)] min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md',\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 className,\n )}\n {...props}\n />\n );\n});\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\nexport const DropdownMenuContent = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Content>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(function DropdownMenuContent({ className, sideOffset = 4, align = 'end', ...props }, ref) {\n return (\n <DropdownMenuPortal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n align={align}\n className={cn(\n 'z-[var(--z-popover)] min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md',\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-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1',\n className,\n )}\n {...props}\n />\n </DropdownMenuPortal>\n );\n});\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\nexport const DropdownMenuItem = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Item>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n destructive?: boolean;\n }\n>(function DropdownMenuItem({ className, inset, destructive, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n itemClasses,\n inset && 'pl-8',\n destructive &&\n 'text-danger-text data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger-text',\n className,\n )}\n {...props}\n />\n );\n});\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(function DropdownMenuCheckboxItem({ className, children, checked, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n checked={checked}\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"size-4 text-accent\" aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n\nexport const DropdownMenuRadioItem = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(function DropdownMenuRadioItem({ className, children, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"size-2 fill-accent text-accent\" aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n\nexport const DropdownMenuLabel = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Label>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(function DropdownMenuLabel({ className, inset, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-xs font-medium text-foreground-subtle',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n );\n});\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n\nexport const DropdownMenuSeparator = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(function DropdownMenuSeparator({ className, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\n/**\n * Trailing right-aligned shortcut label inside a menu item. Pair with `<Kbd>`\n * inside the Kbd component file if you want stylised keys.\n */\nexport function DropdownMenuShortcut({ className, ...props }: HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest text-foreground-subtle font-mono', className)}\n {...props}\n />\n );\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\n/**\n * @example\n * <DropdownMenu>\n * <DropdownMenuTrigger asChild><IconButton aria-label=\"More\" icon={<MoreHorizontal />} /></DropdownMenuTrigger>\n * <DropdownMenuContent>\n * <DropdownMenuItem>Open<DropdownMenuShortcut>⌘O</DropdownMenuShortcut></DropdownMenuItem>\n * <DropdownMenuItem>Rename</DropdownMenuItem>\n * <DropdownMenuSeparator />\n * <DropdownMenuItem destructive>Delete</DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n *\n * @do Group destructive items at the bottom with a separator.\n * @dont Mix link navigation and action items in the same menu — split into\n * two menus or two groups with labels.\n */\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport { Loader2 } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst iconButton = cva(\n [\n 'inline-flex items-center justify-center shrink-0',\n 'rounded-md',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&_svg]:pointer-events-none',\n ],\n {\n variants: {\n variant: {\n primary: 'bg-accent text-on-accent hover:bg-accent-700 active:bg-accent-800',\n secondary:\n 'bg-background-muted text-foreground border border-border hover:bg-neutral-200 dark:hover:bg-neutral-800',\n outline:\n 'border border-border bg-transparent text-foreground hover:bg-background-muted',\n ghost: 'bg-transparent text-foreground-muted hover:bg-background-muted hover:text-foreground',\n destructive: 'bg-danger text-on-danger hover:bg-danger-700 active:bg-danger-800',\n },\n size: {\n sm: 'h-7 w-7 [&_svg]:size-3.5',\n md: 'h-8 w-8 [&_svg]:size-4',\n lg: 'h-10 w-10 [&_svg]:size-5',\n },\n },\n defaultVariants: {\n variant: 'ghost',\n size: 'md',\n },\n },\n);\n\nexport interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButton> {\n /**\n * Accessible label for screen readers. **Required** — an icon-only button\n * with no label is invisible to assistive tech.\n */\n 'aria-label': string;\n /** The Lucide icon to render. */\n icon: ReactNode;\n /** Show a spinner instead of the icon. */\n loading?: boolean;\n}\n\n/**\n * Square, icon-only button. Default variant is `ghost` because most\n * IconButtons sit in dense toolbars or tables. Always pass `aria-label`.\n *\n * @example Toolbar action\n * <IconButton aria-label=\"Edit row\" icon={<Edit2 />} onClick={onEdit} />\n *\n * @example Dismissible chip\n * <IconButton aria-label=\"Remove tag\" size=\"sm\" icon={<X />} />\n *\n * @do Use `ghost` for in-row actions; `outline` when next to a label-less\n * primary button you want users to consider as an alternative.\n * @dont Use IconButton when the action's meaning isn't universally\n * recognised. If users need to learn the icon, ship a Button with text.\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { className, variant, size, icon, loading, disabled, type = 'button', ...props },\n ref,\n) {\n const isDisabled = disabled || loading;\n return (\n <button\n ref={ref}\n type={type}\n aria-busy={loading || undefined}\n disabled={isDisabled}\n className={cn(iconButton({ variant, size }), className)}\n {...props}\n >\n {loading ? <Loader2 className=\"animate-spin\" aria-hidden=\"true\" /> : icon}\n </button>\n );\n});\n\nIconButton.displayName = 'IconButton';\n","import {\n forwardRef,\n useId,\n useState,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { Eye, EyeOff, Search, X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Field-shell variants. The inner <input> is unstyled background and gets all\n * its visual treatment from this wrapper so prefix / suffix / clear slots\n * share the same border + focus state with no double rings.\n * --------------------------------------------------------------------------- */\nconst field = cva(\n [\n 'group inline-flex items-center w-full',\n 'rounded-md border bg-card text-sm',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'has-disabled:opacity-50 has-disabled:pointer-events-none',\n 'focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-background',\n ],\n {\n variants: {\n size: {\n sm: 'h-8 px-2.5 gap-1.5',\n md: 'h-9 px-3 gap-2',\n lg: 'h-10 px-3.5 gap-2',\n },\n tone: {\n default: 'border-border focus-within:border-accent focus-within:ring-ring',\n error: 'border-danger focus-within:border-danger focus-within:ring-danger',\n },\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst innerInput = cva([\n 'flex-1 min-w-0 bg-transparent outline-none',\n 'placeholder:text-foreground-subtle',\n 'text-foreground',\n 'disabled:cursor-not-allowed',\n]);\n\ntype InputType = 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url';\n\nexport interface InputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'>,\n VariantProps<typeof field> {\n /** Field type. `password` enables a show/hide toggle; `search` adds a clear button. */\n type?: InputType;\n /** Visible label rendered above the input. */\n label?: ReactNode;\n /** Hint below the input. Hidden while `error` is set. */\n helperText?: ReactNode;\n /** Validation message. Renders in `danger` colour and sets `aria-invalid`. */\n error?: ReactNode;\n /** Content rendered inside the field, before the input — icon or short text. */\n prefix?: ReactNode;\n /** Content rendered inside the field, after the input. */\n suffix?: ReactNode;\n /** Show an inline clear (×) button when the input has a value. */\n clearable?: boolean;\n /** Fires when the clear button is pressed. The consumer owns the state. */\n onClear?: () => void;\n /** Visually conceal the label while keeping it for screen readers. */\n hideLabel?: boolean;\n}\n\n/**\n * Text-style input with optional label, helper / error, prefix / suffix,\n * clear, and password show-hide. Wraps a single native `<input>` so it works\n * with `react-hook-form` and any controlled / uncontrolled pattern.\n *\n * @example Email with helper\n * <Input type=\"email\" label=\"Work email\" helperText=\"We never share this.\" />\n *\n * @example Password with show/hide\n * <Input type=\"password\" label=\"Password\" autoComplete=\"current-password\" />\n *\n * @example Search with clear\n * <Input type=\"search\" placeholder=\"Search…\" value={q} onChange={…}\n * clearable onClear={() => setQ('')} />\n *\n * @do Always pair an input with a visible label. If space forces hiding it,\n * use `hideLabel` so the label stays in the accessibility tree.\n * @dont Use placeholder as the only label — placeholders disappear on input\n * and fail accessibility.\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n className,\n type = 'text',\n size,\n tone,\n label,\n helperText,\n error,\n prefix,\n suffix,\n clearable,\n onClear,\n hideLabel,\n id,\n disabled,\n value,\n ...props\n },\n ref,\n) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const helperId = `${fieldId}-helper`;\n const errorId = `${fieldId}-error`;\n\n const [showPassword, setShowPassword] = useState(false);\n const effectiveType =\n type === 'password' ? (showPassword ? 'text' : 'password') : type;\n\n const isError = Boolean(error);\n const effectiveTone = isError ? 'error' : tone;\n\n // Pre-fill prefix slot for search type.\n const renderedPrefix =\n prefix ?? (type === 'search' ? <Search className=\"size-4 text-foreground-subtle\" aria-hidden /> : null);\n\n const hasValue = value !== undefined && value !== '' && value !== null;\n\n return (\n <div className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm font-medium text-foreground',\n hideLabel && 'sr-only',\n )}\n >\n {label}\n </label>\n )}\n\n <div className={cn(field({ size, tone: effectiveTone }))}>\n {renderedPrefix && (\n <span className=\"flex items-center text-foreground-subtle [&_svg]:size-4\">\n {renderedPrefix}\n </span>\n )}\n\n <input\n ref={ref}\n id={fieldId}\n type={effectiveType}\n disabled={disabled}\n value={value}\n aria-invalid={isError || undefined}\n aria-describedby={\n error ? errorId : helperText ? helperId : undefined\n }\n className={cn(innerInput())}\n {...props}\n />\n\n {clearable && hasValue && (\n <button\n type=\"button\"\n onClick={onClear}\n tabIndex={-1}\n aria-label=\"Clear input\"\n className=\"flex items-center text-foreground-subtle hover:text-foreground\"\n >\n <X className=\"size-4\" aria-hidden />\n </button>\n )}\n\n {type === 'password' && (\n <button\n type=\"button\"\n onClick={() => setShowPassword((p) => !p)}\n tabIndex={-1}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n aria-pressed={showPassword}\n className=\"flex items-center text-foreground-subtle hover:text-foreground\"\n >\n {showPassword ? (\n <EyeOff className=\"size-4\" aria-hidden />\n ) : (\n <Eye className=\"size-4\" aria-hidden />\n )}\n </button>\n )}\n\n {suffix && (\n <span className=\"flex items-center text-foreground-subtle [&_svg]:size-4\">\n {suffix}\n </span>\n )}\n </div>\n\n {error ? (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-xs text-foreground-subtle\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nInput.displayName = 'Input';\n","import { forwardRef, type HTMLAttributes, type ThHTMLAttributes, type TdHTMLAttributes } from 'react';\nimport { ArrowDown, ArrowUp, ArrowUpDown } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Table primitives — minimal sugar over <table>. Pair with a sortable\n * header helper (`TableSortHeader`) when you need built-in sort visuals.\n * Empty + loading states are pure composition with the rest of the system.\n * --------------------------------------------------------------------------- */\n\nexport const Table = forwardRef<HTMLTableElement, HTMLAttributes<HTMLTableElement>>(\n function Table({ className, ...props }, ref) {\n return (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn('w-full caption-bottom text-sm border-collapse', className)}\n {...props}\n />\n </div>\n );\n },\n);\nTable.displayName = 'Table';\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableHeader({ className, ...props }, ref) {\n return (\n <thead\n ref={ref}\n className={cn(\n 'sticky top-0 z-10 bg-background-subtle text-foreground-muted',\n '[&_tr]:border-b [&_tr]:border-border',\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableHeader.displayName = 'TableHeader';\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableBody({ className, ...props }, ref) {\n return (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n );\n },\n);\nTableBody.displayName = 'TableBody';\n\nexport const TableFooter = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableFooter({ className, ...props }, ref) {\n return (\n <tfoot\n ref={ref}\n className={cn('border-t border-border bg-background-subtle font-medium', className)}\n {...props}\n />\n );\n },\n);\nTableFooter.displayName = 'TableFooter';\n\nexport const TableRow = forwardRef<\n HTMLTableRowElement,\n HTMLAttributes<HTMLTableRowElement> & { selected?: boolean }\n>(function TableRow({ className, selected, ...props }, ref) {\n return (\n <tr\n ref={ref}\n data-selected={selected || undefined}\n className={cn(\n 'border-b border-border transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-subtle',\n 'data-[selected]:bg-accent-soft data-[selected]:hover:bg-accent-soft',\n className,\n )}\n {...props}\n />\n );\n});\nTableRow.displayName = 'TableRow';\n\nexport const TableHead = forwardRef<\n HTMLTableCellElement,\n ThHTMLAttributes<HTMLTableCellElement>\n>(function TableHead({ className, ...props }, ref) {\n return (\n <th\n ref={ref}\n className={cn(\n 'h-10 px-3 text-left align-middle text-xs font-medium uppercase tracking-wide text-foreground-subtle',\n '[&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0',\n className,\n )}\n {...props}\n />\n );\n});\nTableHead.displayName = 'TableHead';\n\nexport const TableCell = forwardRef<\n HTMLTableCellElement,\n TdHTMLAttributes<HTMLTableCellElement>\n>(function TableCell({ className, ...props }, ref) {\n return (\n <td\n ref={ref}\n className={cn('px-3 py-3 align-middle text-foreground', className)}\n {...props}\n />\n );\n});\nTableCell.displayName = 'TableCell';\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, HTMLAttributes<HTMLTableCaptionElement>>(\n function TableCaption({ className, ...props }, ref) {\n return (\n <caption\n ref={ref}\n className={cn('mt-4 text-sm text-foreground-subtle', className)}\n {...props}\n />\n );\n },\n);\nTableCaption.displayName = 'TableCaption';\n\nexport interface TableSortHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {\n /** Stable column key used in `currentSort.key`. */\n sortKey: string;\n /** Currently sorted column + direction (or null). */\n currentSort: { key: string; direction: 'asc' | 'desc' } | null;\n /** Called when the user clicks the header. */\n onSortChange: (key: string, direction: 'asc' | 'desc') => void;\n}\n\n/**\n * Sortable column header. Click toggles asc → desc → asc; the icon reflects\n * the current state.\n *\n * @example\n * <TableSortHeader sortKey=\"name\" currentSort={sort} onSortChange={onSort}>\n * Name\n * </TableSortHeader>\n *\n * @do Sort by one column at a time. Multi-sort hides state from users.\n * @dont Sort silently — the icon must change so users see what changed.\n */\nexport const TableSortHeader = forwardRef<HTMLTableCellElement, TableSortHeaderProps>(\n function TableSortHeader(\n { sortKey, currentSort, onSortChange, children, className, ...props },\n ref,\n ) {\n const active = currentSort?.key === sortKey;\n const direction = active ? currentSort?.direction : undefined;\n const handle = () => {\n onSortChange(sortKey, active && direction === 'asc' ? 'desc' : 'asc');\n };\n return (\n <TableHead ref={ref} className={cn('p-0', className)} aria-sort={active ? (direction === 'asc' ? 'ascending' : 'descending') : 'none'} {...props}>\n <button\n type=\"button\"\n onClick={handle}\n className={cn(\n 'inline-flex h-10 w-full items-center gap-1.5 px-3 outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:text-foreground focus-visible:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm',\n active && 'text-foreground',\n )}\n >\n {children}\n {direction === 'asc' ? (\n <ArrowUp className=\"size-3.5\" aria-hidden />\n ) : direction === 'desc' ? (\n <ArrowDown className=\"size-3.5\" aria-hidden />\n ) : (\n <ArrowUpDown className=\"size-3.5 opacity-40\" aria-hidden />\n )}\n </button>\n </TableHead>\n );\n },\n);\nTableSortHeader.displayName = 'TableSortHeader';\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n /** Predefined silhouette presets. */\n variant?: 'text' | 'circle' | 'card' | 'avatar';\n}\n\n/**\n * Animated placeholder. Use `Skeleton.Text` / `Skeleton.Avatar` for common\n * shapes; pass `className` directly for one-off sizes.\n *\n * @example List item\n * <div className=\"flex items-center gap-3\">\n * <Skeleton variant=\"avatar\" />\n * <div className=\"space-y-1.5 flex-1\">\n * <Skeleton variant=\"text\" className=\"w-1/3\" />\n * <Skeleton variant=\"text\" className=\"w-1/2\" />\n * </div>\n * </div>\n *\n * @example Card\n * <Skeleton variant=\"card\" className=\"h-32\" />\n *\n * @do Match the silhouette of the eventual content so the layout doesn't\n * shift when data arrives.\n * @dont Show a full-page skeleton for sub-300ms loads — use a single Spinner.\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { className, variant, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n aria-hidden\n className={cn(\n 'animate-pulse bg-background-muted',\n variant === 'text' && 'h-3 rounded-sm',\n variant === 'circle' && 'rounded-full aspect-square',\n variant === 'avatar' && 'size-8 rounded-full',\n variant === 'card' && 'rounded-lg',\n !variant && 'rounded-md',\n className,\n )}\n {...props}\n />\n );\n});\nSkeleton.displayName = 'Skeleton';\n","import { useMemo, useState, type ReactNode } from 'react';\nimport { Settings } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './DropdownMenu';\nimport { IconButton } from './IconButton';\nimport { Input } from './Input';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n TableSortHeader,\n} from './Table';\nimport { Skeleton } from './Skeleton';\n\nexport interface DataGridColumn<TRow> {\n /** Stable key used for visibility, sort, and React lists. */\n key: string;\n /** Header label. */\n header: ReactNode;\n /** Render the cell. Defaults to the value at `row[key]`. */\n cell?: (row: TRow) => ReactNode;\n /** Cell width — passed to `<col>` so the grid keeps shape during loading. */\n width?: string;\n /** Allow sorting on this column. */\n sortable?: boolean;\n /** Right-align numeric / monetary columns. */\n align?: 'left' | 'right';\n}\n\nexport interface DataGridProps<TRow extends { id: string | number }> {\n columns: DataGridColumn<TRow>[];\n rows: TRow[];\n loading?: boolean;\n /** Initial sort state. */\n sort?: { key: string; direction: 'asc' | 'desc' } | null;\n onSortChange?: (sort: { key: string; direction: 'asc' | 'desc' }) => void;\n /** Show a filter input row above the grid. */\n filter?: { value: string; onChange: (q: string) => void; placeholder?: string };\n /** Empty-state node when no rows are visible. */\n emptyState?: ReactNode;\n className?: string;\n}\n\n/**\n * Composite grid built from `Table` + DropdownMenu + Input. Provides\n * column visibility toggle, an inline filter, sortable headers, and\n * loading / empty states.\n *\n * @example\n * <DataGrid\n * columns={[\n * { key: 'name', header: 'Name', sortable: true },\n * { key: 'status', header: 'Status', cell: r => <Badge tone={...}>{r.status}</Badge> },\n * { key: 'updatedAt', header: 'Updated', align: 'right' },\n * ]}\n * rows={rows}\n * filter={{ value: q, onChange: setQ }}\n * sort={sort}\n * onSortChange={setSort}\n * />\n *\n * @do Provide a meaningful empty state with a primary action when the grid\n * starts empty (no items at all, not just filtered out).\n * @dont Render thousands of rows synchronously — virtualise with `@tanstack/react-virtual`\n * and wrap with this component's headers as a shell.\n */\nexport function DataGrid<TRow extends { id: string | number }>({\n columns,\n rows,\n loading,\n sort,\n onSortChange,\n filter,\n emptyState,\n className,\n}: DataGridProps<TRow>) {\n const [hidden, setHidden] = useState<Record<string, boolean>>({});\n const visibleColumns = useMemo(() => columns.filter((c) => !hidden[c.key]), [columns, hidden]);\n\n const renderRows = () => {\n if (loading) {\n return Array.from({ length: 5 }).map((_, i) => (\n <TableRow key={`skel-${i}`}>\n {visibleColumns.map((c) => (\n <TableCell key={c.key}>\n <Skeleton variant=\"text\" className=\"w-3/4\" />\n </TableCell>\n ))}\n </TableRow>\n ));\n }\n if (rows.length === 0) {\n return (\n <TableRow>\n <TableCell colSpan={visibleColumns.length} className=\"h-32 text-center\">\n {emptyState ?? (\n <span className=\"text-foreground-subtle\">No results.</span>\n )}\n </TableCell>\n </TableRow>\n );\n }\n return rows.map((row) => (\n <TableRow key={row.id}>\n {visibleColumns.map((c) => (\n <TableCell\n key={c.key}\n className={cn(c.align === 'right' && 'text-right tabular')}\n >\n {c.cell ? c.cell(row) : (row as Record<string, unknown>)[c.key] as ReactNode}\n </TableCell>\n ))}\n </TableRow>\n ));\n };\n\n return (\n <div className={cn('flex flex-col gap-3', className)}>\n <div className=\"flex items-center justify-between gap-2\">\n {filter ? (\n <Input\n type=\"search\"\n placeholder={filter.placeholder ?? 'Filter…'}\n value={filter.value}\n onChange={(e) => filter.onChange(e.target.value)}\n clearable\n onClear={() => filter.onChange('')}\n className=\"max-w-sm w-full\"\n hideLabel\n label=\"Filter rows\"\n />\n ) : (\n <div />\n )}\n <div className=\"flex items-center gap-2\">\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <IconButton aria-label=\"Column visibility\" icon={<Settings />} variant=\"outline\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuLabel>Columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {columns.map((c) => (\n <DropdownMenuCheckboxItem\n key={c.key}\n checked={!hidden[c.key]}\n onCheckedChange={(v) =>\n setHidden((prev) => ({ ...prev, [c.key]: !v }))\n }\n >\n {c.header}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n </div>\n\n <div className=\"rounded-lg border border-border overflow-hidden\">\n <Table>\n <colgroup>\n {visibleColumns.map((c) => (\n <col key={c.key} style={c.width ? { width: c.width } : undefined} />\n ))}\n </colgroup>\n <TableHeader>\n <TableRow>\n {visibleColumns.map((c) =>\n c.sortable && onSortChange ? (\n <TableSortHeader\n key={c.key}\n sortKey={c.key}\n currentSort={sort ?? null}\n onSortChange={(k, d) => onSortChange({ key: k, direction: d })}\n >\n {c.header}\n </TableSortHeader>\n ) : (\n <TableHead key={c.key} className={cn(c.align === 'right' && 'text-right')}>\n {c.header}\n </TableHead>\n ),\n )}\n </TableRow>\n </TableHeader>\n <TableBody>{renderRows()}</TableBody>\n </Table>\n </div>\n </div>\n );\n}\n","import { forwardRef } from 'react';\nimport { DayPicker, type DayPickerProps } from 'react-day-picker';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport 'react-day-picker/style.css';\nimport { cn } from '@/lib/utils';\n\nexport type CalendarProps = DayPickerProps & { className?: string };\n\n/**\n * Standalone calendar surface. Used by DatePicker, but can also be embedded\n * directly in popovers, sheets, or inline forms. Wraps `react-day-picker` v9.\n */\nexport const Calendar = forwardRef<HTMLDivElement, CalendarProps>(function Calendar(\n { className, classNames, ...props },\n _ref,\n) {\n return (\n <DayPicker\n showOutsideDays\n className={cn('p-3', className)}\n classNames={{\n root: 'rdp',\n months: 'flex flex-col gap-4 sm:flex-row sm:gap-6',\n month: 'flex flex-col gap-3',\n month_caption: 'relative flex h-8 items-center justify-center',\n caption_label: 'text-sm font-medium',\n nav: 'absolute inset-x-0 top-0 flex h-8 items-center justify-between',\n button_previous:\n 'inline-flex h-7 w-7 items-center justify-center rounded-md text-foreground-muted hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring outline-none',\n button_next:\n 'inline-flex h-7 w-7 items-center justify-center rounded-md text-foreground-muted hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring outline-none',\n month_grid: 'w-full border-collapse',\n weekdays: 'grid grid-cols-7',\n weekday:\n 'h-8 w-9 text-center text-[11px] font-medium uppercase tracking-wide text-foreground-subtle',\n week: 'mt-0.5 grid grid-cols-7',\n day: 'relative h-9 w-9 p-0 text-center',\n day_button:\n 'inline-flex h-9 w-9 items-center justify-center rounded-md text-sm hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring outline-none aria-selected:bg-accent aria-selected:text-on-accent aria-selected:hover:bg-accent-700',\n today: '[&_button]:border [&_button]:border-border',\n outside: 'text-foreground-subtle',\n disabled: 'opacity-40 pointer-events-none',\n range_start:\n '[&_button]:bg-accent [&_button]:text-on-accent [&_button]:rounded-r-none',\n range_end:\n '[&_button]:bg-accent [&_button]:text-on-accent [&_button]:rounded-l-none',\n range_middle:\n '[&_button]:bg-accent-soft [&_button]:text-foreground [&_button]:rounded-none',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) =>\n orientation === 'left' ? (\n <ChevronLeft className=\"size-4\" />\n ) : (\n <ChevronRight className=\"size-4\" />\n ),\n }}\n {...props}\n />\n );\n});\n","import { forwardRef, useId, useState, type ReactNode } from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport type { DateRange } from 'react-day-picker';\nimport { Calendar as CalendarIcon } from '@/icons';\nimport { Calendar } from './Calendar';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Two related components share the same trigger shell:\n *\n * <DatePicker value={date} onChange={setDate} /> // single date\n * <DateRangePicker value={range} onChange={setRange} /> // {from,to}\n * --------------------------------------------------------------------------- */\n\nfunction formatDate(d?: Date): string {\n if (!d) return '';\n return d.toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' });\n}\n\nfunction PickerTrigger({\n label,\n placeholder,\n hasValue,\n children,\n error,\n fieldId,\n disabled,\n}: {\n label?: ReactNode;\n placeholder: string;\n hasValue: boolean;\n children: ReactNode;\n error?: ReactNode;\n fieldId: string;\n disabled?: boolean;\n}) {\n return (\n <div className=\"flex flex-col gap-1.5\">\n {label && (\n <label htmlFor={fieldId} className=\"text-sm font-medium text-foreground\">\n {label}\n </label>\n )}\n <PopoverPrimitive.Trigger asChild>\n <button\n id={fieldId}\n type=\"button\"\n disabled={disabled}\n aria-invalid={Boolean(error) || undefined}\n className={cn(\n 'inline-flex h-9 w-full items-center justify-start gap-2 rounded-md border bg-card px-3 text-left text-sm',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n error\n ? 'border-danger focus-visible:border-danger focus-visible:ring-danger'\n : 'border-border focus-visible:border-accent focus-visible:ring-ring',\n !hasValue && 'text-foreground-subtle',\n )}\n >\n <CalendarIcon className=\"size-4 text-foreground-subtle\" aria-hidden />\n <span className=\"truncate\">{hasValue ? children : placeholder}</span>\n </button>\n </PopoverPrimitive.Trigger>\n {error && (\n <p role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n )}\n </div>\n );\n}\n\nexport interface DatePickerProps {\n value?: Date;\n onChange: (date: Date | undefined) => void;\n label?: ReactNode;\n placeholder?: string;\n error?: ReactNode;\n disabled?: boolean;\n /** Restrict to a date range. Days outside are not selectable. */\n fromDate?: Date;\n toDate?: Date;\n className?: string;\n}\n\n/**\n * Single-date picker.\n *\n * @example\n * <DatePicker label=\"Date of birth\" value={dob} onChange={setDob} />\n *\n * @do Use locale-aware formatting via the consumer's display layer.\n * @dont Roll a custom calendar — Radix Popover + react-day-picker handles a11y.\n */\nexport const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(function DatePicker(\n { value, onChange, label, placeholder = 'Pick a date', error, disabled, fromDate, toDate, className },\n ref,\n) {\n const fieldId = useId();\n const [open, setOpen] = useState(false);\n\n return (\n <div ref={ref} className={cn(className)}>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PickerTrigger\n label={label}\n placeholder={placeholder}\n hasValue={Boolean(value)}\n error={error}\n fieldId={fieldId}\n disabled={disabled}\n >\n {formatDate(value)}\n </PickerTrigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={4}\n className=\"z-[var(--z-popover)] rounded-lg border border-border bg-popover text-popover-foreground shadow-md\"\n >\n <Calendar\n mode=\"single\"\n selected={value}\n onSelect={(d) => {\n onChange(d ?? undefined);\n if (d) setOpen(false);\n }}\n startMonth={fromDate}\n endMonth={toDate}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </div>\n );\n});\nDatePicker.displayName = 'DatePicker';\n\nexport interface DateRangePickerProps {\n value?: DateRange;\n onChange: (range: DateRange | undefined) => void;\n label?: ReactNode;\n placeholder?: string;\n error?: ReactNode;\n disabled?: boolean;\n fromDate?: Date;\n toDate?: Date;\n className?: string;\n}\n\n/**\n * Two-date range picker. `value` is `{from, to}`.\n *\n * @example\n * <DateRangePicker label=\"Reporting period\" value={range} onChange={setRange} />\n */\nexport const DateRangePicker = forwardRef<HTMLDivElement, DateRangePickerProps>(function DateRangePicker(\n { value, onChange, label, placeholder = 'Pick a range', error, disabled, fromDate, toDate, className },\n ref,\n) {\n const fieldId = useId();\n const [open, setOpen] = useState(false);\n const hasValue = Boolean(value?.from);\n\n return (\n <div ref={ref} className={cn(className)}>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PickerTrigger\n label={label}\n placeholder={placeholder}\n hasValue={hasValue}\n error={error}\n fieldId={fieldId}\n disabled={disabled}\n >\n {value?.from && value.to\n ? `${formatDate(value.from)} – ${formatDate(value.to)}`\n : value?.from\n ? formatDate(value.from)\n : ''}\n </PickerTrigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={4}\n className=\"z-[var(--z-popover)] rounded-lg border border-border bg-popover text-popover-foreground shadow-md\"\n >\n <Calendar\n mode=\"range\"\n selected={value}\n onSelect={onChange}\n numberOfMonths={2}\n startMonth={fromDate}\n endMonth={toDate}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </div>\n );\n});\nDateRangePicker.displayName = 'DateRangePicker';\n","import { type CSSProperties, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Per-brand token overrides. Keys are CSS variable names (without the `--`\n * prefix); values are CSS values. Any unspecified token falls back to the\n * design system default.\n *\n * @example\n * <DesignSystemProvider tokens={{ 'color-accent': '#ff5555', 'radius-md': '10px' }}>\n * <App />\n * </DesignSystemProvider>\n *\n * @example Multiple brands in one app\n * <DesignSystemProvider tokens={edgelogBrand}>\n * <Card>...</Card>\n * </DesignSystemProvider>\n * <DesignSystemProvider tokens={geregeBrand}>\n * <Card>...</Card>\n * </DesignSystemProvider>\n */\nexport type BrandTokens = Record<string, string>;\n\nexport interface DesignSystemProviderProps extends HTMLAttributes<HTMLDivElement> {\n /** Token overrides (CSS variable name → value). */\n tokens?: BrandTokens;\n /** Children to scope this brand to. */\n children: ReactNode;\n}\n\nexport function DesignSystemProvider({\n tokens,\n className,\n children,\n style,\n ...props\n}: DesignSystemProviderProps) {\n // Build the inline style from tokens — wrapping every key with `--` so\n // consumers can pass either `accent` or `color-accent` without remembering\n // the prefix dance.\n const css: CSSProperties = { ...style };\n if (tokens) {\n for (const [k, v] of Object.entries(tokens)) {\n const key = k.startsWith('--') ? k : `--${k}`;\n (css as Record<string, string>)[key] = v;\n }\n }\n\n return (\n <div data-brand-scope className={cn('contents', className)} style={css} {...props}>\n {children}\n </div>\n );\n}\n\n/**\n * Built-in brand presets — drop-in starters showing how a token override\n * map is shaped. Consumers can fork or replace any value.\n */\nexport const brandPresets = {\n default: {} as BrandTokens,\n /** Cool indigo accent, slightly rounder corners. */\n edgelog: {\n 'color-accent': 'oklch(0.55 0.18 250)',\n 'color-accent-700': 'oklch(0.46 0.16 250)',\n 'color-accent-800': 'oklch(0.38 0.14 250)',\n 'color-accent-soft': 'oklch(0.95 0.04 250)',\n 'radius-md': '8px',\n 'radius-lg': '12px',\n },\n /** Warm copper accent, tighter geometry. */\n gerege: {\n 'color-accent': 'oklch(0.62 0.16 45)',\n 'color-accent-700': 'oklch(0.54 0.16 45)',\n 'color-accent-800': 'oklch(0.46 0.14 45)',\n 'color-accent-soft': 'oklch(0.95 0.04 45)',\n 'radius-md': '4px',\n 'radius-lg': '6px',\n },\n /** Forest green accent. */\n forest: {\n 'color-accent': 'oklch(0.55 0.14 155)',\n 'color-accent-700': 'oklch(0.47 0.14 155)',\n 'color-accent-800': 'oklch(0.39 0.12 155)',\n 'color-accent-soft': 'oklch(0.95 0.04 155)',\n },\n} as const;\n\nexport type BrandName = keyof typeof brandPresets;\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { Button, type ButtonProps } from './Button';\n\nexport const Dialog = DialogPrimitive.Root;\nexport const DialogTrigger = DialogPrimitive.Trigger;\nexport const DialogPortal = DialogPrimitive.Portal;\nexport const DialogClose = DialogPrimitive.Close;\n\nexport const DialogOverlay = forwardRef<\n ElementRef<typeof DialogPrimitive.Overlay>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(function DialogOverlay({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]',\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 );\n});\nDialogOverlay.displayName = 'DialogOverlay';\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {\n /** Show the default close (×) button in the top-right. */\n showClose?: boolean;\n /** Dialog width — `sm` 400 / `md` 520 / `lg` 720. */\n size?: 'sm' | 'md' | 'lg';\n}\n\nexport const DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(function DialogContent({ className, children, showClose = true, size = 'md', ...props }, ref) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-1/2 top-1/2 z-[var(--z-modal)] -translate-x-1/2 -translate-y-1/2',\n 'w-[calc(100%-2rem)] rounded-lg border border-border bg-card text-card-foreground shadow-lg',\n '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 size === 'sm' && 'max-w-[400px]',\n size === 'md' && 'max-w-[520px]',\n size === 'lg' && 'max-w-[720px]',\n className,\n )}\n {...props}\n >\n {children}\n {showClose && (\n <DialogPrimitive.Close\n aria-label=\"Close\"\n className={cn(\n 'absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-foreground-subtle',\n 'hover:bg-background-muted hover:text-foreground',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n <X className=\"size-4\" aria-hidden />\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n});\nDialogContent.displayName = 'DialogContent';\n\nexport function DialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('flex flex-col gap-1 pb-4', className)} {...props} />;\n}\nDialogHeader.displayName = 'DialogHeader';\n\nexport function DialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('flex flex-col-reverse gap-2 pt-6 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\nDialogFooter.displayName = 'DialogFooter';\n\nexport const DialogTitle = forwardRef<\n ElementRef<typeof DialogPrimitive.Title>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(function DialogTitle({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground leading-tight', className)}\n {...props}\n />\n );\n});\nDialogTitle.displayName = 'DialogTitle';\n\nexport const DialogDescription = forwardRef<\n ElementRef<typeof DialogPrimitive.Description>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(function DialogDescription({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-foreground-muted', className)}\n {...props}\n />\n );\n});\nDialogDescription.displayName = 'DialogDescription';\n\n/* -----------------------------------------------------------------------------\n * ConfirmationDialog — pre-composed pattern for destructive/important\n * confirmations. Use this when the body is a single sentence and the only\n * controls are Cancel + Confirm.\n * --------------------------------------------------------------------------- */\n\nexport interface ConfirmationDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: ReactNode;\n description?: ReactNode;\n /** Label of the confirm button. */\n confirmLabel?: string;\n /** Label of the cancel button. */\n cancelLabel?: string;\n /** Variant of the confirm button — typically `primary` or `destructive`. */\n confirmVariant?: ButtonProps['variant'];\n /** Called when the user confirms. Awaited — shows a spinner while pending. */\n onConfirm: () => void | Promise<void>;\n /** Whether the confirm button is currently submitting. */\n loading?: boolean;\n}\n\n/**\n * Confirmation dialog with title, description, cancel + confirm buttons.\n *\n * @example Destructive confirmation\n * <ConfirmationDialog\n * open={open} onOpenChange={setOpen}\n * title=\"Delete project?\"\n * description=\"This permanently deletes the project and all its data.\"\n * confirmLabel=\"Delete project\"\n * confirmVariant=\"destructive\"\n * onConfirm={handleDelete}\n * />\n *\n * @do Lead the title with the action: \"Delete project?\" not \"Are you sure?\".\n * State consequences in the description.\n * @dont Use for low-risk reversible actions — those don't need a dialog.\n */\nexport function ConfirmationDialog({\n open,\n onOpenChange,\n title,\n description,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n confirmVariant = 'primary',\n onConfirm,\n loading,\n}: ConfirmationDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent size=\"sm\">\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n {description && <DialogDescription>{description}</DialogDescription>}\n </DialogHeader>\n <DialogFooter>\n <DialogClose asChild>\n <Button variant=\"outline\">{cancelLabel}</Button>\n </DialogClose>\n <Button variant={confirmVariant} loading={loading} onClick={onConfirm}>\n {confirmLabel}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\nConfirmationDialog.displayName = 'ConfirmationDialog';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\nimport { InboxEmpty } from '@/illustrations';\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /**\n * Small Lucide-sized icon rendered inside a 48px circular container.\n * Use for compact empty states (table cells, sidebar panes, cards).\n */\n icon?: ReactNode;\n /**\n * Full-size illustration rendered without the icon container. Takes\n * precedence over `icon`. If neither is set, the default `InboxEmpty`\n * line illustration is used.\n */\n illustration?: ReactNode;\n /** Heading. One short sentence. */\n title: ReactNode;\n /** Description. One or two sentences max. */\n description?: ReactNode;\n /** Primary action — usually a `<Button>` that creates the missing item. */\n action?: ReactNode;\n /** Secondary helper link — \"Learn more\", \"Import existing\", etc. */\n secondaryAction?: ReactNode;\n}\n\n/**\n * Shown when a list / dataset / surface has no content yet. Tone is helpful,\n * never apologetic.\n *\n * @example Default — uses the built-in InboxEmpty illustration\n * <EmptyState\n * title=\"No projects yet\"\n * description=\"Create a project to start tracking work.\"\n * action={<Button>New project</Button>}\n * />\n *\n * @example Compact — small Lucide icon for dense layouts\n * <EmptyState\n * icon={<Folder className=\"size-6\" />}\n * title=\"No items\"\n * />\n *\n * @example Custom illustration\n * <EmptyState\n * illustration={<Illustrations.NoSearchResults className=\"size-32\" />}\n * title=\"No results\"\n * />\n */\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(\n { icon, illustration, title, description, action, secondaryAction, className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={cn(\n 'flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border bg-background-subtle p-10 text-center',\n className,\n )}\n {...props}\n >\n {/* Visual: illustration > icon > default illustration */}\n {illustration ? (\n illustration\n ) : icon ? (\n <div className=\"inline-flex size-12 items-center justify-center rounded-full bg-background-muted text-foreground-muted [&_svg]:size-6\">\n {icon}\n </div>\n ) : (\n <InboxEmpty className=\"size-24\" />\n )}\n <h3 className=\"text-base font-semibold text-foreground leading-tight\">{title}</h3>\n {description && (\n <p className=\"max-w-md text-sm text-foreground-muted leading-relaxed\">{description}</p>\n )}\n {(action || secondaryAction) && (\n <div className=\"mt-2 flex items-center gap-2\">\n {action}\n {secondaryAction}\n </div>\n )}\n </div>\n );\n});\nEmptyState.displayName = 'EmptyState';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\nimport { NotFound, ServerError, ConnectionLost } from '@/illustrations';\nimport { Button } from './Button';\n\nexport interface ErrorStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** `404` not-found, `500` server, or `generic` (catch-all). */\n variant?: '404' | '500' | 'generic';\n /** Override the default title. */\n title?: ReactNode;\n /** Override the default description. */\n description?: ReactNode;\n /**\n * Override the variant's default illustration. Pass any ReactNode (e.g.\n * `<Illustrations.Construction className=\"size-32\" />`).\n */\n illustration?: ReactNode;\n /** Custom action node. Replaces the default retry button. */\n action?: ReactNode;\n /** When provided, renders a default \"Try again\" button calling this handler. */\n onRetry?: () => void;\n}\n\nconst presets = {\n '404': {\n illustration: <NotFound className=\"size-32\" />,\n title: 'Page not found',\n description: \"We couldn't find what you were looking for.\",\n },\n '500': {\n illustration: <ServerError className=\"size-32\" />,\n title: 'Something went wrong',\n description: \"We're looking into it. Please try again in a moment.\",\n },\n generic: {\n illustration: <ConnectionLost className=\"size-32\" />,\n title: 'Unexpected error',\n description: 'Something interrupted this action.',\n },\n} as const;\n\n/**\n * Page-level error placeholder. Pair with `onRetry` for transient failures.\n *\n * @example 404 (uses built-in line illustration)\n * <ErrorState variant=\"404\" />\n *\n * @example 500 with retry\n * <ErrorState variant=\"500\" onRetry={refetch} />\n *\n * @example Custom\n * <ErrorState\n * title=\"Quota exceeded\"\n * description=\"Your plan allows 1,000 events/day.\"\n * illustration={<Illustrations.Construction className=\"size-32\" />}\n * action={<Button>Upgrade plan</Button>}\n * />\n *\n * @do Match the tone to the cause — server errors apologise, user errors\n * explain. Always offer a next step.\n * @dont Show a raw stack trace to end users.\n */\nexport const ErrorState = forwardRef<HTMLDivElement, ErrorStateProps>(function ErrorState(\n { variant = 'generic', title, description, illustration, action, onRetry, className, ...props },\n ref,\n) {\n const preset = presets[variant];\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(\n 'flex flex-col items-center justify-center gap-3 rounded-lg border border-border bg-background-subtle p-10 text-center',\n className,\n )}\n {...props}\n >\n {illustration ?? preset.illustration}\n <h3 className=\"text-base font-semibold text-foreground leading-tight\">\n {title ?? preset.title}\n </h3>\n <p className=\"max-w-md text-sm text-foreground-muted leading-relaxed\">\n {description ?? preset.description}\n </p>\n {(action || onRetry) && (\n <div className=\"mt-2 flex items-center gap-2\">\n {action ?? (\n <Button onClick={onRetry} variant=\"outline\">\n Try again\n </Button>\n )}\n </div>\n )}\n </div>\n );\n});\nErrorState.displayName = 'ErrorState';\n","import {\n createContext,\n forwardRef,\n useContext,\n useId,\n type HTMLAttributes,\n} from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from 'react-hook-form';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * react-hook-form bindings + accessible label / description / error wiring.\n *\n * Usage:\n * const form = useForm<Values>(…);\n * <Form {...form}>\n * <FormField\n * control={form.control}\n * name=\"email\"\n * render={({ field }) => (\n * <FormItem>\n * <FormLabel>Email</FormLabel>\n * <FormControl><Input type=\"email\" {...field} /></FormControl>\n * <FormDescription>We never share this.</FormDescription>\n * <FormError />\n * </FormItem>\n * )}\n * />\n * </Form>\n * --------------------------------------------------------------------------- */\n\nexport const Form = FormProvider;\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\nconst FormFieldContext = createContext<FormFieldContextValue | null>(null);\n\nexport function FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(props: ControllerProps<TFieldValues, TName>) {\n return (\n <FormFieldContext.Provider value={{ name: props.name as string }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\ninterface FormItemContextValue {\n id: string;\n}\nconst FormItemContext = createContext<FormItemContextValue | null>(null);\n\nexport function useFormField() {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n if (!fieldContext) {\n throw new Error('useFormField must be used inside <FormField>');\n }\n const fieldState = getFieldState(fieldContext.name, formState);\n const id = itemContext?.id ?? '';\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-item`,\n formDescriptionId: `${id}-desc`,\n formMessageId: `${id}-error`,\n ...fieldState,\n };\n}\n\nexport const FormItem = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function FormItem({ className, ...props }, ref) {\n const id = useId();\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\nFormItem.displayName = 'FormItem';\n\nexport const FormLabel = forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(function FormLabel({ className, ...props }, ref) {\n const { formItemId, error } = useFormField();\n return (\n <LabelPrimitive.Root\n ref={ref}\n htmlFor={formItemId}\n className={cn(\n 'text-sm font-medium text-foreground',\n error && 'text-danger-text',\n className,\n )}\n {...props}\n />\n );\n});\nFormLabel.displayName = 'FormLabel';\n\nexport const FormControl = forwardRef<HTMLElement, React.ComponentPropsWithoutRef<typeof Slot>>(\n function FormControl(props, ref) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n },\n);\nFormControl.displayName = 'FormControl';\n\nexport const FormDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(\n function FormDescription({ className, ...props }, ref) {\n const { formDescriptionId } = useFormField();\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-xs text-foreground-subtle', className)}\n {...props}\n />\n );\n },\n);\nFormDescription.displayName = 'FormDescription';\n\nexport const FormError = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(\n function FormError({ className, children, ...props }, ref) {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : children;\n if (!body) return null;\n return (\n <p\n ref={ref}\n id={formMessageId}\n role=\"alert\"\n className={cn('text-xs text-danger-text', className)}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\nFormError.displayName = 'FormError';\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface KbdProps extends HTMLAttributes<HTMLElement> {\n /** Visual size — match the surrounding text. */\n size?: 'sm' | 'md';\n}\n\n/**\n * Stylised keyboard shortcut indicator. Compose multiple `<Kbd>` for chords.\n *\n * @example\n * Press <Kbd>⌘</Kbd>+<Kbd>K</Kbd> to open the command palette.\n *\n * @do Use OS-conventional symbols (⌘ ⇧ ⌥ ⌃ ⏎) — keep visuals consistent\n * across the app.\n * @dont Use Kbd for clickable buttons — it implies a real keyboard input.\n */\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(function Kbd(\n { size = 'sm', className, ...props },\n ref,\n) {\n return (\n <kbd\n ref={ref}\n className={cn(\n 'inline-flex items-center justify-center rounded border border-border bg-background-subtle font-mono',\n 'text-foreground-muted shadow-xs',\n size === 'sm' ? 'h-5 min-w-5 px-1 text-[10px]' : 'h-6 min-w-6 px-1.5 text-xs',\n className,\n )}\n {...props}\n />\n );\n});\nKbd.displayName = 'Kbd';\n","import {\n forwardRef,\n useCallback,\n useId,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Check, ChevronsUpDown, X } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface MultiSelectOption {\n /** Stable, unique value submitted in `onChange`. */\n value: string;\n /** Visible label shown both in the menu and in the selected chip. */\n label: string;\n /** Optional secondary text shown after the label in the menu. */\n description?: string;\n /** Disable selecting this option. */\n disabled?: boolean;\n}\n\nexport interface MultiSelectProps {\n /** All possible options. */\n options: MultiSelectOption[];\n /** Currently selected values. Controlled. */\n value: string[];\n /** Called whenever the selection changes. */\n onChange: (next: string[]) => void;\n /** Visible label above the field. */\n label?: ReactNode;\n /** Hint below the field. Hidden when `error` is set. */\n helperText?: ReactNode;\n /** Validation message. */\n error?: ReactNode;\n /** Empty-state placeholder shown when nothing is selected. */\n placeholder?: string;\n /** Text shown when no options match the search. */\n emptyText?: string;\n /** Max number of chips rendered inline; remainder shown as \"+N more\". */\n maxVisibleChips?: number;\n /** Whether the user can clear all selections with a single click. */\n clearable?: boolean;\n /** Disable the entire field. */\n disabled?: boolean;\n className?: string;\n}\n\n/**\n * Chip-based multi-select with a searchable menu (cmdk under the hood).\n *\n * Keyboard:\n * - Backspace on the input with empty query removes the last chip\n * - Enter / Space toggles the highlighted option\n * - Escape closes the menu\n *\n * @example Tag picker\n * <MultiSelect label=\"Tags\"\n * options={tags}\n * value={selected}\n * onChange={setSelected}\n * placeholder=\"Pick tags\" />\n *\n * @example Bounded with overflow chip\n * <MultiSelect options={users}\n * value={value}\n * onChange={setValue}\n * maxVisibleChips={3} />\n *\n * @do Cap `maxVisibleChips` (3–5) on narrow surfaces so the field doesn't\n * reflow as the user adds selections.\n * @dont Use MultiSelect for fewer than ~6 options. CheckboxGroup is clearer.\n */\nexport const MultiSelect = forwardRef<HTMLDivElement, MultiSelectProps>(function MultiSelect(\n {\n options,\n value,\n onChange,\n label,\n helperText,\n error,\n placeholder = 'Select…',\n emptyText = 'No results.',\n maxVisibleChips = 3,\n clearable = true,\n disabled,\n className,\n },\n ref,\n) {\n const autoId = useId();\n const fieldId = autoId;\n const helperId = `${autoId}-helper`;\n const errorId = `${autoId}-error`;\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const selected = useMemo(\n () => options.filter((o) => value.includes(o.value)),\n [options, value],\n );\n\n const toggle = useCallback(\n (v: string) => {\n if (value.includes(v)) onChange(value.filter((x) => x !== v));\n else onChange([...value, v]);\n },\n [value, onChange],\n );\n\n const clear = useCallback(() => onChange([]), [onChange]);\n\n const handleKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Backspace' && query === '' && value.length > 0) {\n onChange(value.slice(0, -1));\n }\n };\n\n const visibleChips = selected.slice(0, maxVisibleChips);\n const overflow = selected.length - visibleChips.length;\n const isError = Boolean(error);\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label htmlFor={fieldId} className=\"text-sm font-medium text-foreground\">\n {label}\n </label>\n )}\n\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n <div\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={`${fieldId}-list`}\n aria-haspopup=\"listbox\"\n id={fieldId}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleKeyDown}\n aria-disabled={disabled || undefined}\n aria-invalid={isError || undefined}\n aria-describedby={isError ? errorId : helperText ? helperId : undefined}\n className={cn(\n 'flex h-9 w-full cursor-text items-center gap-1.5 overflow-hidden rounded-md border bg-card px-2 py-1 text-sm',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n isError\n ? 'border-danger focus-visible:border-danger focus-visible:ring-danger'\n : 'border-border focus-visible:border-accent focus-visible:ring-ring',\n disabled && 'opacity-50 pointer-events-none',\n )}\n onClick={() => inputRef.current?.focus()}\n >\n {visibleChips.length === 0 && (\n <span className=\"text-foreground-subtle px-1\">{placeholder}</span>\n )}\n {visibleChips.map((opt) => (\n <span\n key={opt.value}\n className=\"inline-flex max-w-[10rem] shrink-0 items-center gap-1 rounded-md bg-accent-soft px-1.5 py-0.5 text-xs font-medium text-on-accent-soft\"\n >\n <span className=\"truncate\">{opt.label}</span>\n <button\n type=\"button\"\n aria-label={`Remove ${opt.label}`}\n className=\"inline-flex items-center text-on-accent-soft hover:text-foreground\"\n onClick={(e) => {\n e.stopPropagation();\n toggle(opt.value);\n }}\n >\n <X className=\"size-3\" aria-hidden />\n </button>\n </span>\n ))}\n {overflow > 0 && (\n <span className=\"shrink-0 rounded-md bg-background-muted px-1.5 py-0.5 text-xs font-medium text-foreground-muted\">\n +{overflow}\n </span>\n )}\n <input\n ref={inputRef}\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n onFocus={() => setOpen(true)}\n className=\"flex-1 min-w-[8ch] bg-transparent text-sm outline-none placeholder:text-foreground-subtle\"\n placeholder={selected.length === 0 ? '' : ''}\n disabled={disabled}\n />\n <span className=\"ml-auto flex items-center gap-1\">\n {clearable && selected.length > 0 && (\n <button\n type=\"button\"\n aria-label=\"Clear all\"\n onClick={(e) => {\n e.stopPropagation();\n clear();\n }}\n className=\"text-foreground-subtle hover:text-foreground\"\n >\n <X className=\"size-4\" aria-hidden />\n </button>\n )}\n <ChevronsUpDown className=\"size-4 text-foreground-subtle\" aria-hidden />\n </span>\n </div>\n </PopoverPrimitive.Trigger>\n\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={4}\n className={cn(\n 'z-[var(--z-popover)] w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md',\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 )}\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n <CommandPrimitive shouldFilter={false} className=\"flex h-full w-full flex-col\">\n <CommandPrimitive.List\n id={`${fieldId}-list`}\n className=\"max-h-64 overflow-y-auto p-1\"\n >\n {options\n .filter((o) => o.label.toLowerCase().includes(query.toLowerCase()))\n .map((opt) => {\n const isSelected = value.includes(opt.value);\n return (\n <CommandPrimitive.Item\n key={opt.value}\n value={opt.value}\n disabled={opt.disabled}\n onSelect={() => toggle(opt.value)}\n className={cn(\n 'flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground',\n 'data-[selected=true]:bg-background-muted',\n 'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none',\n )}\n >\n <span\n aria-hidden\n className={cn(\n 'flex size-4 items-center justify-center rounded-sm border',\n isSelected ? 'border-accent bg-accent text-on-accent' : 'border-border',\n )}\n >\n {isSelected && <Check className=\"size-3\" aria-hidden />}\n </span>\n <span className=\"flex-1\">{opt.label}</span>\n {opt.description && (\n <span className=\"text-xs text-foreground-subtle\">{opt.description}</span>\n )}\n </CommandPrimitive.Item>\n );\n })}\n <CommandPrimitive.Empty className=\"px-2 py-6 text-center text-sm text-foreground-subtle\">\n {emptyText}\n </CommandPrimitive.Empty>\n </CommandPrimitive.List>\n </CommandPrimitive>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n\n {error ? (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-xs text-foreground-subtle\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nMultiSelect.displayName = 'MultiSelect';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { Check, ChevronDown, ChevronUp, ChevronsUpDown } from '@/icons';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Compound API:\n *\n * <Select value={…} onValueChange={…}>\n * <SelectTrigger placeholder=\"Pick one\" />\n * <SelectContent>\n * <SelectGroup label=\"Active\">\n * <SelectItem value=\"a\">Apple</SelectItem>\n * <SelectItem value=\"b\">Banana</SelectItem>\n * </SelectGroup>\n * </SelectContent>\n * </Select>\n *\n * All accessibility is handled by Radix: keyboard navigation, type-ahead,\n * focus trap, ARIA roles. We only style.\n * --------------------------------------------------------------------------- */\n\nexport const Select = SelectPrimitive.Root;\nexport const SelectValue = SelectPrimitive.Value;\n\nexport interface SelectTriggerProps\n extends Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'children'> {\n /** Placeholder shown when no value is selected. */\n placeholder?: string;\n /** Trigger height — matches Input sizes. */\n size?: 'sm' | 'md' | 'lg';\n /** Visual tone — `error` swaps the border + ring to danger. */\n tone?: 'default' | 'error';\n}\n\nexport const SelectTrigger = forwardRef<\n ElementRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(function SelectTrigger({ className, placeholder, size = 'md', tone = 'default', ...props }, ref) {\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-sm text-foreground',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n 'data-[placeholder]:text-foreground-subtle',\n size === 'sm' && 'h-8 px-2.5',\n size === 'md' && 'h-9 px-3',\n size === 'lg' && 'h-10 px-3.5',\n tone === 'default'\n ? 'border-border focus-visible:border-accent focus-visible:ring-ring'\n : 'border-danger focus-visible:border-danger focus-visible:ring-danger',\n className,\n )}\n {...props}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n <SelectPrimitive.Icon asChild>\n <ChevronsUpDown className=\"size-4 text-foreground-subtle shrink-0\" aria-hidden />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n});\nSelectTrigger.displayName = 'SelectTrigger';\n\nconst scrollBtn =\n 'flex h-6 cursor-default items-center justify-center text-foreground-subtle';\n\nexport const SelectScrollUpButton = forwardRef<\n ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(function SelectScrollUpButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollUpButton ref={ref} className={cn(scrollBtn, className)} {...props}>\n <ChevronUp className=\"size-4\" aria-hidden />\n </SelectPrimitive.ScrollUpButton>\n );\n});\nSelectScrollUpButton.displayName = 'SelectScrollUpButton';\n\nexport const SelectScrollDownButton = forwardRef<\n ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(function SelectScrollDownButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollDownButton ref={ref} className={cn(scrollBtn, className)} {...props}>\n <ChevronDown className=\"size-4\" aria-hidden />\n </SelectPrimitive.ScrollDownButton>\n );\n});\nSelectScrollDownButton.displayName = 'SelectScrollDownButton';\n\nexport const SelectContent = forwardRef<\n ElementRef<typeof SelectPrimitive.Content>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(function SelectContent({ className, children, position = 'popper', ...props }, ref) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n className={cn(\n 'z-[var(--z-popover)] min-w-[var(--radix-select-trigger-width)] max-h-96',\n 'overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground',\n 'shadow-md',\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' &&\n 'data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1',\n className,\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport className=\"p-1\">{children}</SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n});\nSelectContent.displayName = 'SelectContent';\n\nexport const SelectLabel = forwardRef<\n ElementRef<typeof SelectPrimitive.Label>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(function SelectLabel({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-xs font-medium text-foreground-subtle', className)}\n {...props}\n />\n );\n});\nSelectLabel.displayName = 'SelectLabel';\n\nexport interface SelectItemProps\n extends ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {\n /** Icon shown to the left of the label. */\n leadingIcon?: ReactNode;\n}\n\nexport const SelectItem = forwardRef<\n ElementRef<typeof SelectPrimitive.Item>,\n SelectItemProps\n>(function SelectItem({ className, children, leadingIcon, ...props }, ref) {\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default select-none items-center gap-2',\n 'rounded-sm px-2 py-1.5 pr-8 text-sm text-foreground outline-none',\n 'data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n {leadingIcon && (\n <span className=\"flex items-center text-foreground-subtle [&_svg]:size-4\">\n {leadingIcon}\n </span>\n )}\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className=\"absolute right-2 flex items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"size-4 text-accent\" aria-hidden />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n});\nSelectItem.displayName = 'SelectItem';\n\nexport const SelectSeparator = forwardRef<\n ElementRef<typeof SelectPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(function SelectSeparator({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\nSelectSeparator.displayName = 'SelectSeparator';\n\n/** Optional grouping with a label header. Pure composition over Radix Group + Label. */\nexport interface SelectGroupProps\n extends ComponentPropsWithoutRef<typeof SelectPrimitive.Group> {\n label?: ReactNode;\n}\nexport const SelectGroup = forwardRef<\n ElementRef<typeof SelectPrimitive.Group>,\n SelectGroupProps\n>(function SelectGroup({ label, children, ...props }, ref) {\n return (\n <SelectPrimitive.Group ref={ref} {...props}>\n {label && <SelectLabel>{label}</SelectLabel>}\n {children}\n </SelectPrimitive.Group>\n );\n});\nSelectGroup.displayName = 'SelectGroup';\n\n/**\n * Compose `Select` + `SelectTrigger` + `SelectContent` + `SelectItem` for a\n * single-choice picker. Keyboard, type-ahead, and ARIA come from Radix.\n *\n * @example Basic\n * <Select onValueChange={setStatus}>\n * <SelectTrigger placeholder=\"Status\" />\n * <SelectContent>\n * <SelectItem value=\"open\">Open</SelectItem>\n * <SelectItem value=\"closed\">Closed</SelectItem>\n * </SelectContent>\n * </Select>\n *\n * @example Grouped\n * <SelectContent>\n * <SelectGroup label=\"People\">\n * <SelectItem value=\"anu\">Anu</SelectItem>\n * <SelectItem value=\"bat\">Bat</SelectItem>\n * </SelectGroup>\n * <SelectSeparator />\n * <SelectGroup label=\"Bots\">\n * <SelectItem value=\"robo\">Robo</SelectItem>\n * </SelectGroup>\n * </SelectContent>\n *\n * @do Use `placeholder` on the trigger when there is no default value.\n * @dont Use Select for more than ~12 options — switch to `Combobox`.\n */\n","import { forwardRef, useMemo, type HTMLAttributes } from 'react';\nimport { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n} from './Select';\n\nexport interface PaginationProps extends HTMLAttributes<HTMLElement> {\n /** 1-indexed current page. */\n page: number;\n /** Total number of pages. Set to 0 to hide page numbers. */\n pageCount: number;\n /** Called with the new page when navigating. */\n onPageChange: (page: number) => void;\n /** Total item count, for the \"Showing 1-20 of 200\" hint. Omit to hide. */\n totalItems?: number;\n /** Items shown per page (controlled if `onPageSizeChange` is provided). */\n pageSize?: number;\n /** Options for the page-size select. */\n pageSizeOptions?: number[];\n /** Called when the user picks a new page size. */\n onPageSizeChange?: (size: number) => void;\n /** Show first/last (« ») jump buttons. Default true. */\n showJump?: boolean;\n}\n\nfunction pageRange(current: number, total: number, max = 7): (number | 'gap')[] {\n if (total <= max) return Array.from({ length: total }, (_, i) => i + 1);\n const window = 1;\n const result: (number | 'gap')[] = [];\n const start = Math.max(2, current - window);\n const end = Math.min(total - 1, current + window);\n\n result.push(1);\n if (start > 2) result.push('gap');\n for (let i = start; i <= end; i++) result.push(i);\n if (end < total - 1) result.push('gap');\n result.push(total);\n return result;\n}\n\n/**\n * Numbered pagination with prev/next, first/last jumps, page-size selector,\n * and item-count summary.\n *\n * @example\n * <Pagination page={page} pageCount={20} onPageChange={setPage}\n * totalItems={400} pageSize={20}\n * pageSizeOptions={[10, 20, 50]} onPageSizeChange={setSize} />\n *\n * @do Place the count summary on the left and controls on the right.\n * @dont Show numbers when there are >100 pages — use a \"jump to\" input instead.\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n page,\n pageCount,\n onPageChange,\n totalItems,\n pageSize,\n pageSizeOptions,\n onPageSizeChange,\n showJump = true,\n className,\n ...props\n },\n ref,\n) {\n const pages = useMemo(() => pageRange(page, pageCount), [page, pageCount]);\n\n const from = pageSize ? (page - 1) * pageSize + 1 : undefined;\n const to = pageSize && totalItems ? Math.min(page * pageSize, totalItems) : undefined;\n\n const goto = (p: number) => {\n if (p < 1 || p > pageCount || p === page) return;\n onPageChange(p);\n };\n\n return (\n <nav\n ref={ref}\n aria-label=\"Pagination\"\n className={cn('flex flex-wrap items-center justify-between gap-3', className)}\n {...props}\n >\n <div className=\"flex items-center gap-3 text-sm text-foreground-muted\">\n {totalItems !== undefined && pageSize !== undefined && (\n <span className=\"tabular\">\n Showing {from}–{to} of {totalItems}\n </span>\n )}\n {pageSizeOptions && onPageSizeChange && pageSize !== undefined && (\n <div className=\"flex items-center gap-2\">\n <label htmlFor=\"page-size\" className=\"sr-only\">\n Rows per page\n </label>\n <Select value={String(pageSize)} onValueChange={(v) => onPageSizeChange(Number(v))}>\n <SelectTrigger size=\"sm\" className=\"w-[7.5rem] whitespace-nowrap\" />\n <SelectContent>\n {pageSizeOptions.map((s) => (\n <SelectItem key={s} value={String(s)}>\n {s} / page\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n )}\n </div>\n\n <ul className=\"flex items-center gap-1\">\n {showJump && (\n <li>\n <button\n type=\"button\"\n aria-label=\"Go to first page\"\n disabled={page === 1}\n onClick={() => goto(1)}\n className={navButtonClass}\n >\n <ChevronsLeft className=\"size-4\" aria-hidden />\n </button>\n </li>\n )}\n <li>\n <button\n type=\"button\"\n aria-label=\"Previous page\"\n disabled={page === 1}\n onClick={() => goto(page - 1)}\n className={navButtonClass}\n >\n <ChevronLeft className=\"size-4\" aria-hidden />\n </button>\n </li>\n {pages.map((p, i) =>\n p === 'gap' ? (\n <li key={`gap-${i}`} className=\"px-2 text-foreground-subtle\">\n …\n </li>\n ) : (\n <li key={p}>\n <button\n type=\"button\"\n aria-label={`Page ${p}`}\n aria-current={p === page ? 'page' : undefined}\n onClick={() => goto(p)}\n className={cn(\n 'inline-flex size-8 items-center justify-center rounded-md text-sm tabular outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n p === page\n ? 'bg-accent text-on-accent font-medium'\n : 'text-foreground-muted hover:bg-background-muted hover:text-foreground',\n )}\n >\n {p}\n </button>\n </li>\n ),\n )}\n <li>\n <button\n type=\"button\"\n aria-label=\"Next page\"\n disabled={page === pageCount}\n onClick={() => goto(page + 1)}\n className={navButtonClass}\n >\n <ChevronRight className=\"size-4\" aria-hidden />\n </button>\n </li>\n {showJump && (\n <li>\n <button\n type=\"button\"\n aria-label=\"Go to last page\"\n disabled={page === pageCount}\n onClick={() => goto(pageCount)}\n className={navButtonClass}\n >\n <ChevronsRight className=\"size-4\" aria-hidden />\n </button>\n </li>\n )}\n </ul>\n </nav>\n );\n});\nPagination.displayName = 'Pagination';\n\nconst navButtonClass = cn(\n 'inline-flex size-8 items-center justify-center rounded-md text-foreground-muted',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-muted hover:text-foreground',\n 'disabled:opacity-50 disabled:pointer-events-none',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n);\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { cn } from '@/lib/utils';\n\nexport const Popover = PopoverPrimitive.Root;\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\nexport const PopoverClose = PopoverPrimitive.Close;\n\nexport const PopoverContent = forwardRef<\n ElementRef<typeof PopoverPrimitive.Content>,\n ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(function PopoverContent({ className, align = 'center', sideOffset = 4, ...props }, ref) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-popover)] w-72 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-md',\n 'outline-none',\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-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1',\n 'data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n});\nPopoverContent.displayName = 'PopoverContent';\n\n/**\n * @example\n * <Popover>\n * <PopoverTrigger asChild><Button variant=\"outline\">Options</Button></PopoverTrigger>\n * <PopoverContent>…</PopoverContent>\n * </Popover>\n *\n * @do Reserve Popover for low-stakes, transient UI — pickers, mini-forms.\n * @dont Use Popover for navigation menus — that's DropdownMenu.\n */\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type SVGProps,\n} from 'react';\nimport * as ProgressPrimitive from '@radix-ui/react-progress';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Linear — bar that fills left-to-right.\n * Circular — SVG ring. Both support determinate (value 0..100) and\n * indeterminate (`value` omitted) states.\n * --------------------------------------------------------------------------- */\n\nexport interface ProgressProps\n extends Omit<ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>, 'value'> {\n /** 0–100. Omit for indeterminate. */\n value?: number | null;\n /** Bar height. */\n size?: 'sm' | 'md' | 'lg';\n /** Visual tone. Use `success`/`danger` to colour-code completion state. */\n tone?: 'accent' | 'success' | 'warning' | 'danger';\n}\n\nconst heightMap = { sm: 'h-1', md: 'h-1.5', lg: 'h-2' } as const;\nconst fillTone = {\n accent: 'bg-accent',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-danger',\n} as const;\n\n/**\n * Linear progress bar.\n *\n * @example\n * <Progress value={uploadPct} aria-label=\"Upload progress\" />\n * <Progress aria-label=\"Loading\" /> // indeterminate\n *\n * @do Always pair Progress with an `aria-label` describing what is progressing.\n * @dont Use a Progress for an unknown-completion task — use a Spinner.\n */\nexport const Progress = forwardRef<ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n function Progress({ className, value, size = 'md', tone = 'accent', ...props }, ref) {\n const indeterminate = value === undefined || value === null;\n return (\n <ProgressPrimitive.Root\n ref={ref}\n value={indeterminate ? undefined : value}\n className={cn(\n 'relative w-full overflow-hidden rounded-full bg-background-muted',\n heightMap[size],\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className={cn(\n 'h-full w-full flex-1 transition-transform',\n fillTone[tone],\n indeterminate && 'animate-[progressIndeterminate_1.4s_ease-in-out_infinite] origin-left',\n )}\n style={\n indeterminate\n ? undefined\n : { transform: `translateX(-${100 - (value ?? 0)}%)` }\n }\n />\n {/* Keyframes inline so consumers don't need to register them globally. */}\n <style>{`\n @keyframes progressIndeterminate {\n 0% { transform: translateX(-100%) scaleX(0.6); }\n 50% { transform: translateX(0%) scaleX(0.4); }\n 100% { transform: translateX(100%) scaleX(0.6); }\n }\n `}</style>\n </ProgressPrimitive.Root>\n );\n },\n);\nProgress.displayName = 'Progress';\n\nexport interface ProgressCircleProps extends SVGProps<SVGSVGElement> {\n /** 0–100. Omit for indeterminate. */\n value?: number;\n /** Pixel size of the SVG. */\n size?: number;\n /** Stroke thickness. */\n thickness?: number;\n /** Visible label for screen readers. */\n 'aria-label': string;\n tone?: 'accent' | 'success' | 'warning' | 'danger';\n}\n\nconst circleTone = {\n accent: 'stroke-accent',\n success: 'stroke-success',\n warning: 'stroke-warning',\n danger: 'stroke-danger',\n} as const;\n\n/**\n * Circular progress ring. Pairs with a numeric label for percentage-style\n * indicators.\n *\n * @example\n * <ProgressCircle value={72} aria-label=\"Storage used\" />\n */\nexport const ProgressCircle = forwardRef<SVGSVGElement, ProgressCircleProps>(function ProgressCircle(\n { value, size = 36, thickness = 3, className, tone = 'accent', ...props },\n ref,\n) {\n const isIndeterminate = value === undefined;\n const radius = (size - thickness) / 2;\n const circumference = 2 * Math.PI * radius;\n const offset = isIndeterminate ? 0 : circumference - (Math.min(100, Math.max(0, value)) / 100) * circumference;\n\n return (\n <svg\n ref={ref}\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={isIndeterminate ? undefined : value}\n className={cn('shrink-0', isIndeterminate && 'animate-spin', className)}\n {...props}\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n strokeWidth={thickness}\n className=\"stroke-background-muted fill-none\"\n />\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n strokeWidth={thickness}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={isIndeterminate ? circumference * 0.7 : offset}\n className={cn(circleTone[tone], 'fill-none transition-[stroke-dashoffset]')}\n transform={`rotate(-90 ${size / 2} ${size / 2})`}\n />\n </svg>\n );\n});\nProgressCircle.displayName = 'ProgressCircle';\n","import {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { cn } from '@/lib/utils';\n\nexport interface RadioGroupProps\n extends ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {\n /** Lay out the radios horizontally (default) or vertically. */\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport const RadioGroup = forwardRef<\n ElementRef<typeof RadioGroupPrimitive.Root>,\n RadioGroupProps\n>(function RadioGroup({ className, orientation = 'vertical', ...props }, ref) {\n return (\n <RadioGroupPrimitive.Root\n ref={ref}\n className={cn(\n 'flex gap-3',\n orientation === 'vertical' ? 'flex-col' : 'flex-row flex-wrap',\n className,\n )}\n {...props}\n />\n );\n});\nRadioGroup.displayName = 'RadioGroup';\n\nexport interface RadioItemProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'asChild'> {\n label?: ReactNode;\n description?: ReactNode;\n hideLabel?: boolean;\n}\n\n/**\n * One radio option with inline label + description.\n *\n * @example\n * <RadioGroup defaultValue=\"weekly\">\n * <RadioItem value=\"daily\" label=\"Daily\" description=\"Every morning at 9am\" />\n * <RadioItem value=\"weekly\" label=\"Weekly\" description=\"Monday mornings\" />\n * <RadioItem value=\"never\" label=\"Never\" />\n * </RadioGroup>\n *\n * @do Pair every RadioItem with a label — naked radios are unreachable for\n * screen reader users.\n * @dont Use RadioGroup for binary choices — use Switch.\n */\nexport const RadioItem = forwardRef<\n ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioItemProps\n>(function RadioItem({ className, label, description, hideLabel, id, disabled, ...props }, ref) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const descId = description ? `${fieldId}-desc` : undefined;\n\n return (\n <div className={cn('flex items-start gap-2.5', className)}>\n <RadioGroupPrimitive.Item\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={descId}\n className={cn(\n 'mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border bg-card',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'data-[state=checked]:border-accent',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'border-border-strong',\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <span className=\"size-2 rounded-full bg-accent\" aria-hidden />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n\n {label && (\n <div className={cn('flex flex-col gap-0.5', hideLabel && 'sr-only')}>\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm text-foreground select-none',\n disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n {label}\n </label>\n {description && (\n <p id={descId} className=\"text-xs text-foreground-subtle\">\n {description}\n </p>\n )}\n </div>\n )}\n </div>\n );\n});\nRadioItem.displayName = 'RadioItem';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\nimport { cn } from '@/lib/utils';\n\n/**\n * Custom scroll container with consistent styled scrollbars across OS / browsers.\n * Use when the default OS scrollbar would visually clash (sidebars, command\n * palettes, code panes). Falls back to native scroll inside the viewport.\n *\n * @example\n * <ScrollArea className=\"h-64 rounded-md border border-border\">\n * <div className=\"p-3\">…long content…</div>\n * </ScrollArea>\n */\nexport const ScrollArea = forwardRef<\n ElementRef<typeof ScrollAreaPrimitive.Root>,\n ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(function ScrollArea({ className, children, ...props }, ref) {\n return (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport const ScrollBar = forwardRef<\n ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(function ScrollBar({ className, orientation = 'vertical', ...props }, ref) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex touch-none select-none transition-colors duration-[var(--duration-fast)]',\n orientation === 'vertical' && 'h-full w-2 border-l border-l-transparent p-px',\n orientation === 'horizontal' && 'h-2 flex-col border-t border-t-transparent p-px',\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border-strong\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n});\nScrollBar.displayName = 'ScrollBar';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport { cn } from '@/lib/utils';\n\n/**\n * Hairline divider. Decorative by default (no role announced). Pass\n * `decorative={false}` when the separator carries semantic meaning, e.g.\n * splitting two regions in a landmark.\n *\n * @example Section divider\n * <Separator className=\"my-6\" />\n *\n * @example Vertical inside a toolbar\n * <Separator orientation=\"vertical\" className=\"h-5 mx-2\" />\n */\nexport const Separator = forwardRef<\n ElementRef<typeof SeparatorPrimitive.Root>,\n ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(function Separator(\n { className, orientation = 'horizontal', decorative = true, ...props },\n ref,\n) {\n return (\n <SeparatorPrimitive.Root\n ref={ref}\n orientation={orientation}\n decorative={decorative}\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});\nSeparator.displayName = 'Separator';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type HTMLAttributes,\n} from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Sheet — drawer-style overlay. Built on Radix Dialog (focus trap, escape,\n * click-outside come from there). Slides in from one of four sides.\n * --------------------------------------------------------------------------- */\n\nexport const Sheet = DialogPrimitive.Root;\nexport const SheetTrigger = DialogPrimitive.Trigger;\nexport const SheetClose = DialogPrimitive.Close;\nexport const SheetPortal = DialogPrimitive.Portal;\n\nconst SheetOverlay = forwardRef<\n ElementRef<typeof DialogPrimitive.Overlay>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(function SheetOverlay({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-[var(--z-overlay)] bg-neutral-950/60 backdrop-blur-[2px]',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n className,\n )}\n {...props}\n />\n );\n});\nSheetOverlay.displayName = 'SheetOverlay';\n\nconst sheet = cva(\n [\n 'fixed z-[var(--z-modal)] bg-card text-card-foreground shadow-lg',\n 'flex flex-col gap-4 p-6',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:duration-[var(--duration-base)] data-[state=open]:duration-[var(--duration-slow)]',\n ],\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b border-border data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top',\n bottom:\n 'inset-x-0 bottom-0 border-t border-border data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 max-w-md border-r border-border data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left',\n right:\n 'inset-y-0 right-0 h-full w-3/4 max-w-md border-l border-border data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right',\n },\n },\n defaultVariants: { side: 'right' },\n },\n);\n\nexport interface SheetContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof sheet> {\n showClose?: boolean;\n}\n\nexport const SheetContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n SheetContentProps\n>(function SheetContent({ className, children, side = 'right', showClose = true, ...props }, ref) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <DialogPrimitive.Content ref={ref} className={cn(sheet({ side }), className)} {...props}>\n {children}\n {showClose && (\n <DialogPrimitive.Close\n aria-label=\"Close\"\n className={cn(\n 'absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-foreground-subtle',\n 'hover:bg-background-muted hover:text-foreground',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n <X className=\"size-4\" aria-hidden />\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </SheetPortal>\n );\n});\nSheetContent.displayName = 'SheetContent';\n\nexport function SheetHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('flex flex-col gap-1', className)} {...props} />;\n}\nSheetHeader.displayName = 'SheetHeader';\n\nexport function SheetFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('mt-auto flex flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\nSheetFooter.displayName = 'SheetFooter';\n\nexport const SheetTitle = forwardRef<\n ElementRef<typeof DialogPrimitive.Title>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(function SheetTitle({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground leading-tight', className)}\n {...props}\n />\n );\n});\nSheetTitle.displayName = 'SheetTitle';\n\nexport const SheetDescription = forwardRef<\n ElementRef<typeof DialogPrimitive.Description>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(function SheetDescription({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-foreground-muted', className)}\n {...props}\n />\n );\n});\nSheetDescription.displayName = 'SheetDescription';\n\n/**\n * @example Right-side filter drawer\n * <Sheet>\n * <SheetTrigger asChild><Button variant=\"outline\">Filters</Button></SheetTrigger>\n * <SheetContent side=\"right\">\n * <SheetHeader>\n * <SheetTitle>Filters</SheetTitle>\n * <SheetDescription>Refine the result set.</SheetDescription>\n * </SheetHeader>\n * …\n * <SheetFooter>\n * <SheetClose asChild><Button variant=\"outline\">Cancel</Button></SheetClose>\n * <Button>Apply</Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n *\n * @do Use right side for filters/inspectors, left for navigation, bottom for\n * mobile sheets.\n * @dont Use a full-screen sheet on desktop — prefer Dialog or a dedicated page.\n */\n","import {\n createContext,\n forwardRef,\n useContext,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { ChevronDown, ChevronsLeft, ChevronsRight } from '@/icons';\nimport { cn } from '@/lib/utils';\n\ninterface SidebarContextValue {\n collapsed: boolean;\n}\nconst SidebarContext = createContext<SidebarContextValue>({ collapsed: false });\n\n/** Read the parent Sidebar's collapsed state. Useful for brand/footer slots\n * that need to swap between full and compact rendering. */\nexport function useSidebar(): SidebarContextValue {\n return useContext(SidebarContext);\n}\n\nexport interface SidebarProps extends HTMLAttributes<HTMLElement> {\n /** Default state on first mount. Use `defaultCollapsed` for uncontrolled. */\n defaultCollapsed?: boolean;\n /** Controlled collapsed state. */\n collapsed?: boolean;\n /** Called when the user toggles via the rail or keyboard. */\n onCollapsedChange?: (next: boolean) => void;\n /** Header slot pinned to the top (brand, workspace switcher, etc.). */\n header?: ReactNode;\n /** Footer slot pinned to the bottom (user card, version, etc.). */\n footer?: ReactNode;\n}\n\n/**\n * App-level navigation rail. Holds `SidebarSection` → `SidebarItem` lists,\n * and optionally a `footer`. Supports collapse to icon-only on desktop.\n *\n * @example\n * <Sidebar footer={<UserCard />}>\n * <SidebarSection label=\"Workspace\">\n * <SidebarItem icon={<Home />} active>Home</SidebarItem>\n * <SidebarItem icon={<Folder />}>Projects</SidebarItem>\n * </SidebarSection>\n * <SidebarSection label=\"Account\">\n * <SidebarItem icon={<Settings />}>Settings</SidebarItem>\n * </SidebarSection>\n * </Sidebar>\n *\n * @do Use 1–3 sections. More than that signals the IA needs restructuring.\n * @dont Hide critical navigation under the collapsed state — keep icons\n * always visible with tooltips.\n */\nexport const Sidebar = forwardRef<HTMLElement, SidebarProps>(function Sidebar(\n {\n defaultCollapsed = false,\n collapsed: controlled,\n onCollapsedChange,\n header,\n footer,\n className,\n children,\n ...props\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultCollapsed);\n const collapsed = controlled ?? internal;\n const setCollapsed = (next: boolean) => {\n if (controlled === undefined) setInternal(next);\n onCollapsedChange?.(next);\n };\n\n return (\n <SidebarContext.Provider value={{ collapsed }}>\n <aside\n ref={ref}\n aria-label=\"Primary\"\n className={cn(\n 'sticky top-0 hidden md:flex h-screen shrink-0 flex-col gap-2 border-r border-border bg-background-subtle',\n 'transition-[width] duration-[var(--duration-base)] ease-[var(--ease-out)]',\n collapsed ? 'w-14' : 'w-60',\n className,\n )}\n {...props}\n >\n {header && (\n <div\n className={cn(\n 'flex h-14 shrink-0 items-center overflow-hidden border-b border-border',\n collapsed ? 'justify-center px-2' : 'px-3',\n )}\n >\n {header}\n </div>\n )}\n <div className=\"flex-1 overflow-y-auto py-3\">{children}</div>\n {footer && (\n <div className=\"border-t border-border p-2\">{footer}</div>\n )}\n <button\n type=\"button\"\n onClick={() => setCollapsed(!collapsed)}\n aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n aria-expanded={!collapsed}\n className={cn(\n 'flex h-8 items-center gap-2 mx-2 mb-2 rounded-md px-2 text-foreground-subtle',\n 'hover:bg-background-muted hover:text-foreground outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n {collapsed ? <ChevronsRight className=\"size-4\" aria-hidden /> : <ChevronsLeft className=\"size-4\" aria-hidden />}\n {!collapsed && <span className=\"text-xs font-medium\">Collapse</span>}\n </button>\n </aside>\n </SidebarContext.Provider>\n );\n});\nSidebar.displayName = 'Sidebar';\n\nexport interface SidebarSectionProps extends HTMLAttributes<HTMLDivElement> {\n /** Visible section header. Hidden when collapsed. */\n label?: ReactNode;\n}\n\nexport function SidebarSection({ label, className, children, ...props }: SidebarSectionProps) {\n const { collapsed } = useContext(SidebarContext);\n return (\n <div className={cn('mb-3', className)} {...props}>\n {label && !collapsed && (\n <div className=\"px-4 pb-1 pt-2 text-xs font-medium text-foreground-subtle uppercase tracking-wide\">\n {label}\n </div>\n )}\n <ul className=\"flex flex-col gap-px\">{children}</ul>\n </div>\n );\n}\nSidebarSection.displayName = 'SidebarSection';\n\nexport interface SidebarItemProps extends HTMLAttributes<HTMLAnchorElement> {\n /** Lucide icon shown to the left. */\n icon?: ReactNode;\n /** Mark as the current page. */\n active?: boolean;\n /** Optional `href` — when absent, renders as a `<button>` so consumers can\n * bind their own handler / routing wrapper via `onClick`. */\n href?: string;\n /** Trailing badge / counter slot. */\n trailing?: ReactNode;\n /** Render a sub-item indented under a parent. */\n sub?: boolean;\n}\n\nexport function SidebarItem({\n icon,\n active,\n href,\n trailing,\n sub,\n className,\n children,\n ...props\n}: SidebarItemProps) {\n const { collapsed } = useContext(SidebarContext);\n const Comp: any = href ? 'a' : 'button';\n return (\n <li>\n <Comp\n href={href}\n aria-current={active ? 'page' : undefined}\n className={cn(\n 'mx-2 flex h-8 items-center gap-2 rounded-md px-2 text-sm outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n active\n ? 'bg-background-muted text-foreground font-medium'\n : 'text-foreground-muted hover:bg-background-muted hover:text-foreground',\n sub && !collapsed && 'ml-6',\n collapsed && 'justify-center',\n className,\n )}\n {...props}\n >\n {icon && <span className=\"flex shrink-0 items-center [&_svg]:size-4\">{icon}</span>}\n {!collapsed && <span className=\"flex-1 truncate text-left\">{children}</span>}\n {!collapsed && trailing && <span className=\"ml-auto\">{trailing}</span>}\n </Comp>\n </li>\n );\n}\nSidebarItem.displayName = 'SidebarItem';\n\n/** Lightweight collapsible sub-section inside the sidebar. */\nexport interface SidebarGroupProps {\n icon?: ReactNode;\n label: ReactNode;\n defaultOpen?: boolean;\n children: ReactNode;\n}\n\nexport function SidebarGroup({ icon, label, defaultOpen = true, children }: SidebarGroupProps) {\n const { collapsed } = useContext(SidebarContext);\n const [open, setOpen] = useState(defaultOpen);\n if (collapsed) return <>{children}</>;\n return (\n <li>\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n aria-expanded={open}\n className={cn(\n 'mx-2 flex h-8 w-[calc(100%-1rem)] items-center gap-2 rounded-md px-2 text-sm text-foreground-muted outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-muted hover:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n )}\n >\n {icon && <span className=\"flex shrink-0 items-center [&_svg]:size-4\">{icon}</span>}\n <span className=\"flex-1 text-left\">{label}</span>\n <ChevronDown className={cn('size-3.5 transition-transform', open && 'rotate-180')} aria-hidden />\n </button>\n {open && <ul className=\"flex flex-col gap-px\">{children}</ul>}\n </li>\n );\n}\nSidebarGroup.displayName = 'SidebarGroup';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as SliderPrimitive from '@radix-ui/react-slider';\nimport { cn } from '@/lib/utils';\n\nexport interface SliderProps\n extends Omit<ComponentPropsWithoutRef<typeof SliderPrimitive.Root>, 'value' | 'defaultValue'> {\n /**\n * Controlled value. Pass `[n]` for a single-thumb slider, `[a, b]` for a range slider.\n */\n value?: number[];\n defaultValue?: number[];\n /** Inline label rendered above the slider. */\n label?: ReactNode;\n /** Show the numeric value next to the label. */\n showValue?: boolean;\n /** Format the displayed value (e.g. `(v) => \\`${v}%\\``). */\n formatValue?: (value: number) => string;\n}\n\n/**\n * Single- or range-thumb slider. Pass one item in `value` for a single\n * thumb, two for a range.\n *\n * @example Single value\n * <Slider label=\"Volume\" showValue defaultValue={[60]} max={100} step={1} />\n *\n * @example Price range\n * <Slider label=\"Price\"\n * defaultValue={[50, 250]}\n * min={0} max={500} step={10}\n * formatValue={(v) => \\`$\\${v}\\`}\n * showValue />\n *\n * @do Use `showValue` when the absolute number matters (price, volume, weight).\n * @dont Hide the value when users will need to reason about exact thresholds.\n */\nexport const Slider = forwardRef<ElementRef<typeof SliderPrimitive.Root>, SliderProps>(\n function Slider(\n {\n className,\n label,\n showValue,\n formatValue = (v) => String(v),\n value,\n defaultValue,\n ...props\n },\n ref,\n ) {\n const currentValue = value ?? defaultValue ?? [0];\n const isRange = currentValue.length > 1;\n\n return (\n <div className={cn('flex flex-col gap-2', className)}>\n {(label || showValue) && (\n <div className=\"flex items-center justify-between\">\n {label && <span className=\"text-sm font-medium text-foreground\">{label}</span>}\n {showValue && (\n <span className=\"text-xs tabular text-foreground-muted font-mono\">\n {isRange\n ? `${formatValue(currentValue[0])} – ${formatValue(currentValue[1])}`\n : formatValue(currentValue[0])}\n </span>\n )}\n </div>\n )}\n\n <SliderPrimitive.Root\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n className=\"relative flex w-full touch-none select-none items-center\"\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-1 w-full grow overflow-hidden rounded-full bg-background-muted\">\n <SliderPrimitive.Range className=\"absolute h-full bg-accent\" />\n </SliderPrimitive.Track>\n {currentValue.map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n className={cn(\n 'block size-4 rounded-full border-2 border-accent bg-card shadow-sm',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'transition-transform duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'hover:scale-110 disabled:pointer-events-none disabled:opacity-50',\n )}\n aria-label={isRange ? (i === 0 ? 'Minimum' : 'Maximum') : (label ? String(label) : 'Value')}\n />\n ))}\n </SliderPrimitive.Root>\n </div>\n );\n },\n);\n\nSlider.displayName = 'Slider';\n","import { forwardRef, type SVGProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface SpinnerProps extends SVGProps<SVGSVGElement> {\n /** Visual weight. */\n tone?: 'accent' | 'neutral' | 'on-accent';\n /** Pixel size. */\n size?: 'sm' | 'md' | 'lg';\n /** Accessible label. Required unless `decorative` is true. */\n label?: string;\n /** Hide from assistive tech (set when a parent already announces busy state). */\n decorative?: boolean;\n}\n\nconst sizeMap = { sm: 'size-3.5', md: 'size-4', lg: 'size-6' };\nconst toneMap = {\n accent: 'text-accent',\n neutral: 'text-foreground-subtle',\n 'on-accent': 'text-on-accent',\n};\n\n/**\n * Small indeterminate progress indicator. Use when the operation duration is\n * unknown and Progress isn't appropriate.\n *\n * @example\n * <Spinner label=\"Loading users\" />\n * <Button loading>Saving…</Button> // uses Spinner internally\n *\n * @do Provide a `label` so the busy state is announced.\n * @dont Use a Spinner for tasks that take 300ms+; use Skeleton instead.\n */\nexport const Spinner = forwardRef<SVGSVGElement, SpinnerProps>(function Spinner(\n { className, tone = 'accent', size = 'md', label, decorative, ...props },\n ref,\n) {\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 24 24\"\n role={decorative ? undefined : 'status'}\n aria-label={decorative ? undefined : label ?? 'Loading'}\n aria-hidden={decorative || undefined}\n className={cn('animate-spin', sizeMap[size], toneMap[tone], className)}\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeOpacity={0.2} fill=\"none\" />\n <path\n d=\"M12 2a10 10 0 0 1 10 10\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n});\nSpinner.displayName = 'Spinner';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { Check } from '@/icons';\nimport { cn } from '@/lib/utils';\n\nexport interface Step {\n /** Step heading. */\n title: ReactNode;\n /** Optional secondary description, only shown in vertical orientation. */\n description?: ReactNode;\n}\n\nexport interface StepperProps extends HTMLAttributes<HTMLOListElement> {\n /** Ordered list of steps. */\n steps: Step[];\n /** 0-indexed active step. Steps before it are marked complete. */\n current: number;\n /** Layout direction. */\n orientation?: 'horizontal' | 'vertical';\n}\n\n/**\n * Multi-step progress indicator. Use the horizontal variant in narrow flows\n * (top of an onboarding modal) and vertical for deeper context.\n *\n * @example Onboarding\n * <Stepper\n * current={step}\n * steps={[\n * { title: 'Workspace' },\n * { title: 'Invite team' },\n * { title: 'Connect data' },\n * { title: 'Done' },\n * ]}\n * />\n *\n * @do Keep titles 1–2 words. Save explanations for the page body.\n * @dont Use Stepper for free-form navigation. It implies a linear flow.\n */\nexport const Stepper = forwardRef<HTMLOListElement, StepperProps>(function Stepper(\n { steps, current, orientation = 'horizontal', className, ...props },\n ref,\n) {\n return (\n <ol\n ref={ref}\n aria-label=\"Progress\"\n className={cn(\n orientation === 'horizontal' ? 'flex w-full items-center' : 'flex flex-col gap-6',\n className,\n )}\n {...props}\n >\n {steps.map((step, i) => {\n const state = i < current ? 'complete' : i === current ? 'current' : 'upcoming';\n const isLast = i === steps.length - 1;\n return (\n <li\n key={i}\n aria-current={state === 'current' ? 'step' : undefined}\n className={cn(\n orientation === 'horizontal'\n ? 'flex flex-1 items-center gap-3 last:flex-initial'\n : 'flex items-start gap-3',\n )}\n >\n <div className={cn(orientation === 'horizontal' ? 'flex items-center gap-3' : 'flex flex-col items-center')}>\n <span\n aria-hidden\n className={cn(\n 'inline-flex size-7 items-center justify-center rounded-full text-xs font-semibold transition-colors',\n state === 'complete' && 'bg-accent text-on-accent',\n state === 'current' && 'bg-card border-2 border-accent text-accent',\n state === 'upcoming' && 'bg-background-muted text-foreground-subtle border border-border',\n )}\n >\n {state === 'complete' ? <Check className=\"size-4\" /> : i + 1}\n </span>\n {orientation === 'vertical' && !isLast && (\n <span\n className={cn(\n 'mt-1 w-px flex-1 min-h-6',\n i < current ? 'bg-accent' : 'bg-border',\n )}\n />\n )}\n </div>\n <div className={cn('flex flex-col', orientation === 'horizontal' && 'min-w-0')}>\n <span\n className={cn(\n 'text-sm font-medium',\n state === 'upcoming' ? 'text-foreground-subtle' : 'text-foreground',\n )}\n >\n {step.title}\n </span>\n {orientation === 'vertical' && step.description && (\n <p className=\"text-xs text-foreground-muted mt-0.5\">{step.description}</p>\n )}\n </div>\n {orientation === 'horizontal' && !isLast && (\n <span\n aria-hidden\n className={cn(\n 'h-px flex-1 mx-2',\n i < current ? 'bg-accent' : 'bg-border',\n )}\n />\n )}\n </li>\n );\n })}\n </ol>\n );\n});\nStepper.displayName = 'Stepper';\n","import {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as SwitchPrimitive from '@radix-ui/react-switch';\nimport { cn } from '@/lib/utils';\n\nexport interface SwitchProps\n extends Omit<ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, 'asChild'> {\n /** Inline label rendered to the right. */\n label?: ReactNode;\n /** Secondary description rendered below the label. */\n description?: ReactNode;\n /** Position the label before the switch instead of after. */\n labelPosition?: 'before' | 'after';\n /** Visual size. */\n size?: 'sm' | 'md';\n /** Hide the label visually while keeping it accessible. */\n hideLabel?: boolean;\n}\n\nconst trackSize = {\n sm: 'h-4 w-7',\n md: 'h-5 w-9',\n} as const;\nconst thumbSize = {\n sm: 'size-3 data-[state=checked]:translate-x-3',\n md: 'size-4 data-[state=checked]:translate-x-4',\n} as const;\n\n/**\n * Binary on/off toggle for instant-apply settings. Use Checkbox when the\n * choice is part of a form that needs explicit submission.\n *\n * @example Instant toggle\n * <Switch label=\"Email digest\" checked={on} onCheckedChange={setOn} />\n *\n * @example With description\n * <Switch label=\"Two-factor authentication\"\n * description=\"Required for admins on production accounts.\"\n * checked={tfa}\n * onCheckedChange={setTfa} />\n *\n * @do Use Switch when the change takes effect immediately. Pair with\n * a toast confirming the new state.\n * @dont Use Switch inside a form that requires submission — Checkbox\n * better matches that mental model.\n */\nexport const Switch = forwardRef<ElementRef<typeof SwitchPrimitive.Root>, SwitchProps>(\n function Switch(\n {\n className,\n label,\n description,\n labelPosition = 'after',\n size = 'md',\n hideLabel,\n id,\n disabled,\n ...props\n },\n ref,\n ) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const descId = description ? `${fieldId}-desc` : undefined;\n\n const control = (\n <SwitchPrimitive.Root\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={descId}\n className={cn(\n 'peer inline-flex shrink-0 items-center rounded-full border-2 border-transparent',\n 'transition-colors duration-[var(--duration-base)] ease-[var(--ease-out)]',\n 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[state=checked]:bg-accent data-[state=unchecked]:bg-neutral-300 dark:data-[state=unchecked]:bg-neutral-700',\n trackSize[size],\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n 'pointer-events-none block rounded-full bg-white shadow-sm',\n 'transition-transform duration-[var(--duration-base)] ease-[var(--ease-out)]',\n 'translate-x-0',\n thumbSize[size],\n )}\n />\n </SwitchPrimitive.Root>\n );\n\n const labelBlock = label && (\n <div className={cn('flex flex-col gap-0.5 select-none', hideLabel && 'sr-only')}>\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm text-foreground',\n disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n {label}\n </label>\n {description && (\n <p id={descId} className=\"text-xs text-foreground-subtle\">\n {description}\n </p>\n )}\n </div>\n );\n\n return (\n <div className={cn('inline-flex items-center gap-2.5', className)}>\n {labelPosition === 'before' && labelBlock}\n {control}\n {labelPosition === 'after' && labelBlock}\n </div>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Two visual variants — `underline` (refined-minimal default) and `pills`.\n * Variant is set on `TabsList`; trigger styles auto-derive via data-attr.\n * --------------------------------------------------------------------------- */\n\nexport const Tabs = TabsPrimitive.Root;\n\nconst list = cva('inline-flex items-center', {\n variants: {\n variant: {\n underline: 'gap-4 border-b border-border w-full',\n pills: 'gap-1 rounded-lg bg-background-muted p-1',\n },\n size: {\n sm: 'h-9 text-xs',\n md: 'h-10 text-sm',\n lg: 'h-11 text-sm',\n },\n },\n defaultVariants: { variant: 'underline', size: 'md' },\n});\n\nexport interface TabsListProps\n extends ComponentPropsWithoutRef<typeof TabsPrimitive.List>,\n VariantProps<typeof list> {}\n\nexport const TabsList = forwardRef<ElementRef<typeof TabsPrimitive.List>, TabsListProps>(\n function TabsList({ className, variant = 'underline', size, ...props }, ref) {\n return (\n <TabsPrimitive.List\n ref={ref}\n data-variant={variant}\n className={cn(list({ variant, size }), className)}\n {...props}\n />\n );\n },\n);\nTabsList.displayName = 'TabsList';\n\nexport const TabsTrigger = forwardRef<\n ElementRef<typeof TabsPrimitive.Trigger>,\n ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(function TabsTrigger({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'inline-flex items-center gap-2 whitespace-nowrap font-medium',\n 'outline-none transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:pointer-events-none disabled:opacity-50',\n // Underline variant\n '[[data-variant=underline]_&]:relative [[data-variant=underline]_&]:h-full',\n '[[data-variant=underline]_&]:px-1 [[data-variant=underline]_&]:text-foreground-muted',\n '[[data-variant=underline]_&]:hover:text-foreground',\n '[[data-variant=underline]_&]:data-[state=active]:text-foreground',\n '[[data-variant=underline]_&]:data-[state=active]:after:absolute',\n '[[data-variant=underline]_&]:data-[state=active]:after:inset-x-0',\n '[[data-variant=underline]_&]:data-[state=active]:after:-bottom-px',\n '[[data-variant=underline]_&]:data-[state=active]:after:h-0.5',\n '[[data-variant=underline]_&]:data-[state=active]:after:bg-accent',\n // Pills variant\n '[[data-variant=pills]_&]:h-full [[data-variant=pills]_&]:rounded-md [[data-variant=pills]_&]:px-3',\n '[[data-variant=pills]_&]:text-foreground-muted',\n '[[data-variant=pills]_&]:hover:text-foreground',\n '[[data-variant=pills]_&]:data-[state=active]:bg-card',\n '[[data-variant=pills]_&]:data-[state=active]:text-foreground',\n '[[data-variant=pills]_&]:data-[state=active]:shadow-xs',\n className,\n )}\n {...props}\n />\n );\n});\nTabsTrigger.displayName = 'TabsTrigger';\n\nexport const TabsContent = forwardRef<\n ElementRef<typeof TabsPrimitive.Content>,\n ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(function TabsContent({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'mt-4 outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n className,\n )}\n {...props}\n />\n );\n});\nTabsContent.displayName = 'TabsContent';\n\n/**\n * @example Underline (default)\n * <Tabs defaultValue=\"overview\">\n * <TabsList>\n * <TabsTrigger value=\"overview\">Overview</TabsTrigger>\n * <TabsTrigger value=\"activity\">Activity</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"overview\">…</TabsContent>\n * <TabsContent value=\"activity\">…</TabsContent>\n * </Tabs>\n *\n * @example Pills\n * <TabsList variant=\"pills\"><TabsTrigger value=\"all\">All</TabsTrigger>…</TabsList>\n *\n * @do Use `underline` at the top of a page or panel. Use `pills` inside a\n * card or for filter-style switches.\n * @dont Mix variants on the same screen — pick one and commit.\n */\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n type TextareaHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface TextareaProps\n extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Visible label above the field. */\n label?: ReactNode;\n /** Hint below the field. Hidden when `error` is set. */\n helperText?: ReactNode;\n /** Validation message. Sets `aria-invalid`. */\n error?: ReactNode;\n /** Grow vertically as content is added. */\n autoResize?: boolean;\n /** Minimum rows when `autoResize`. Defaults to 3. */\n minRows?: number;\n /** Maximum rows before scrolling when `autoResize`. Defaults to 12. */\n maxRows?: number;\n /** Visually hide the label while keeping it accessible. */\n hideLabel?: boolean;\n}\n\n/**\n * Multi-line text input. With `autoResize`, height tracks content from\n * `minRows` to `maxRows`. Without it, behaves like a native `<textarea>`.\n *\n * @example Comment box\n * <Textarea label=\"Note\" autoResize minRows={3} maxRows={10} />\n *\n * @example With error\n * <Textarea label=\"Description\"\n * error={errors.description?.message}\n * {...register('description')} />\n *\n * @do Default to `autoResize` for multi-line free-form input.\n * @dont Add `resize-none` without auto-resize — users will be stuck with a\n * 3-line box for long content.\n */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n {\n className,\n label,\n helperText,\n error,\n autoResize,\n minRows = 3,\n maxRows = 12,\n hideLabel,\n id,\n onChange,\n value,\n defaultValue,\n ...props\n },\n ref,\n) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const helperId = `${fieldId}-helper`;\n const errorId = `${fieldId}-error`;\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n // Stash a ref locally and forward to the consumer.\n const setRef = (node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLTextAreaElement | null>).current = node;\n };\n\n const recompute = useCallback(() => {\n const el = innerRef.current;\n if (!el || !autoResize) return;\n el.style.height = 'auto';\n const lineHeight = parseFloat(getComputedStyle(el).lineHeight) || 20;\n const maxH = lineHeight * maxRows;\n el.style.height = `${Math.min(el.scrollHeight, maxH)}px`;\n el.style.overflowY = el.scrollHeight > maxH ? 'auto' : 'hidden';\n }, [autoResize, maxRows]);\n\n useEffect(() => {\n if (autoResize) recompute();\n }, [autoResize, recompute, value, defaultValue]);\n\n return (\n <div className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-sm font-medium text-foreground',\n hideLabel && 'sr-only',\n )}\n >\n {label}\n </label>\n )}\n <textarea\n ref={setRef}\n id={fieldId}\n rows={minRows}\n value={value}\n defaultValue={defaultValue}\n onChange={(e) => {\n onChange?.(e);\n if (autoResize) recompute();\n }}\n aria-invalid={Boolean(error) || undefined}\n aria-describedby={error ? errorId : helperText ? helperId : undefined}\n className={cn(\n 'rounded-md border bg-card px-3 py-2 text-sm text-foreground',\n 'placeholder:text-foreground-subtle',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n error\n ? 'border-danger focus-visible:border-danger focus-visible:ring-danger'\n : 'border-border focus-visible:border-accent',\n autoResize ? 'resize-none' : 'resize-y min-h-20',\n )}\n {...props}\n />\n {error ? (\n <p id={errorId} role=\"alert\" className=\"text-xs text-danger-text\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-xs text-foreground-subtle\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nTextarea.displayName = 'Textarea';\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactElement,\n} from 'react';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport { AlertTriangle, CheckCircle2, Info, X, XCircle } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nexport const ToastProvider = ToastPrimitive.Provider;\n\nexport const ToastViewport = forwardRef<\n ElementRef<typeof ToastPrimitive.Viewport>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Viewport>\n>(function ToastViewport({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Viewport\n ref={ref}\n className={cn(\n 'fixed bottom-0 right-0 z-[var(--z-toast)] flex max-h-screen w-full flex-col-reverse gap-2 p-6',\n 'sm:bottom-auto sm:top-4 sm:right-4 sm:max-w-sm sm:flex-col',\n className,\n )}\n {...props}\n />\n );\n});\nToastViewport.displayName = 'ToastViewport';\n\nconst toast = cva(\n [\n 'group pointer-events-auto relative flex w-full items-start gap-3',\n 'overflow-hidden rounded-lg border p-4 pr-8 shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-right-full',\n 'data-[state=closed]:slide-out-to-right-full',\n 'data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)]',\n 'data-[swipe=cancel]:translate-x-0 data-[swipe=cancel]:transition-transform',\n 'data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)]',\n ],\n {\n variants: {\n variant: {\n default: 'border-border bg-card text-card-foreground',\n success: 'border-success-border-soft bg-success-soft text-success-text',\n warning: 'border-warning-border-soft bg-warning-soft text-warning-text',\n danger: 'border-danger-border-soft bg-danger-soft text-danger-text',\n info: 'border-info-border-soft bg-info-soft text-info-text',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconMap = {\n default: null,\n success: <CheckCircle2 className=\"size-5 text-success-text shrink-0 mt-0.5\" aria-hidden />,\n warning: <AlertTriangle className=\"size-5 text-warning-text shrink-0 mt-0.5\" aria-hidden />,\n danger: <XCircle className=\"size-5 text-danger-text shrink-0 mt-0.5\" aria-hidden />,\n info: <Info className=\"size-5 text-info-text shrink-0 mt-0.5\" aria-hidden />,\n} satisfies Record<'default' | 'success' | 'warning' | 'danger' | 'info', ReactElement | null>;\n\nexport interface ToastProps\n extends ComponentPropsWithoutRef<typeof ToastPrimitive.Root>,\n VariantProps<typeof toast> {}\n\nexport const Toast = forwardRef<ElementRef<typeof ToastPrimitive.Root>, ToastProps>(\n function Toast({ className, variant = 'default', children, ...props }, ref) {\n return (\n <ToastPrimitive.Root ref={ref} className={cn(toast({ variant }), className)} {...props}>\n {iconMap[variant ?? 'default']}\n <div className=\"flex-1 space-y-1\">{children}</div>\n </ToastPrimitive.Root>\n );\n },\n);\nToast.displayName = 'Toast';\n\nexport const ToastTitle = forwardRef<\n ElementRef<typeof ToastPrimitive.Title>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Title>\n>(function ToastTitle({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Title\n ref={ref}\n className={cn('text-sm font-medium', className)}\n {...props}\n />\n );\n});\nToastTitle.displayName = 'ToastTitle';\n\nexport const ToastDescription = forwardRef<\n ElementRef<typeof ToastPrimitive.Description>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Description>\n>(function ToastDescription({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n );\n});\nToastDescription.displayName = 'ToastDescription';\n\nexport const ToastAction = forwardRef<\n ElementRef<typeof ToastPrimitive.Action>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Action>\n>(function ToastAction({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Action\n ref={ref}\n className={cn(\n 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-current bg-transparent px-3 text-sm font-medium',\n 'transition-colors hover:bg-current/10 outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card',\n className,\n )}\n {...props}\n />\n );\n});\nToastAction.displayName = 'ToastAction';\n\nexport const ToastClose = forwardRef<\n ElementRef<typeof ToastPrimitive.Close>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Close>\n>(function ToastClose({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Close\n ref={ref}\n aria-label=\"Close\"\n className={cn(\n 'absolute right-2 top-2 inline-flex size-7 items-center justify-center rounded-md text-foreground-subtle',\n 'opacity-0 transition-opacity group-hover:opacity-100 hover:text-foreground',\n 'outline-none focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring',\n className,\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-4\" aria-hidden />\n </ToastPrimitive.Close>\n );\n});\nToastClose.displayName = 'ToastClose';\n\n/**\n * @example\n * <ToastProvider>\n * …app…\n * <Toast variant=\"success\">\n * <ToastTitle>Saved</ToastTitle>\n * <ToastDescription>Your changes are live.</ToastDescription>\n * <ToastAction altText=\"Undo\">Undo</ToastAction>\n * <ToastClose />\n * </Toast>\n * <ToastViewport />\n * </ToastProvider>\n *\n * @do Use the `useToast()` hook (in `src/hooks/use-toast.ts`) in app code —\n * the components here are the primitives the hook renders.\n * @dont Stack more than two toasts at a time. Newer toasts replace older ones.\n */\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { cn } from '@/lib/utils';\n\n/**\n * Wrap the app in a single `<TooltipProvider>` near the root. All Tooltips\n * share the same `delayDuration` and `skipDelayDuration`.\n */\nexport const TooltipProvider = ({\n delayDuration = 500,\n skipDelayDuration = 200,\n ...props\n}: ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>) => (\n <TooltipPrimitive.Provider\n delayDuration={delayDuration}\n skipDelayDuration={skipDelayDuration}\n {...props}\n />\n);\n\nexport const TooltipRoot = TooltipPrimitive.Root;\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\nexport const TooltipContent = forwardRef<\n ElementRef<typeof TooltipPrimitive.Content>,\n ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(function TooltipContent({ className, sideOffset = 4, ...props }, ref) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-tooltip)] overflow-hidden rounded-md px-2 py-1 text-xs font-medium',\n 'bg-neutral-900 text-neutral-50',\n 'dark:bg-neutral-50 dark:text-neutral-900',\n 'shadow-sm max-w-xs',\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 className,\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = 'TooltipContent';\n\nexport interface TooltipProps {\n children: ReactNode;\n label: ReactNode;\n side?: 'top' | 'right' | 'bottom' | 'left';\n align?: 'start' | 'center' | 'end';\n /** Disable showing the tooltip (e.g. when text is not truncated). */\n disabled?: boolean;\n /** Override the global delay. */\n delayDuration?: number;\n}\n\n/**\n * Shorthand for the most common Tooltip case.\n *\n * @example\n * <Tooltip label=\"Copy link\"><IconButton aria-label=\"Copy\" icon={<Copy/>} /></Tooltip>\n *\n * @do Keep tooltip text short — one line, no full sentences. Use a Popover\n * for any content that needs structure.\n * @dont Wrap disabled buttons in Tooltip without `asChild + tabIndex={0}`.\n * Disabled elements don't receive focus, so the tooltip never opens.\n */\nexport function Tooltip({\n children,\n label,\n side = 'top',\n align = 'center',\n disabled,\n delayDuration,\n}: TooltipProps) {\n if (disabled) return <>{children}</>;\n return (\n <TooltipRoot delayDuration={delayDuration}>\n <TooltipTrigger asChild>{children}</TooltipTrigger>\n <TooltipContent side={side} align={align}>\n {label}\n </TooltipContent>\n </TooltipRoot>\n );\n}\nTooltip.displayName = 'Tooltip';\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface TopNavProps extends HTMLAttributes<HTMLElement> {\n /** Logo / wordmark slot. Shown on the far left. */\n logo: ReactNode;\n /** Primary navigation links — typically a list of `<TopNavLink>`. */\n nav?: ReactNode;\n /** Search / command bar slot — fills the centre on wide screens. */\n search?: ReactNode;\n /** Right-aligned cluster — notifications, theme toggle, user menu. */\n actions?: ReactNode;\n}\n\n/**\n * App-level top bar. Layout: `logo · nav · search · actions`. Search and nav\n * are optional.\n *\n * @example\n * <TopNav\n * logo={<Logo />}\n * nav={<><TopNavLink href=\"/\" active>Home</TopNavLink>…</>}\n * search={<Input type=\"search\" placeholder=\"Search…\" />}\n * actions={<><Bell /><Avatar /></>}\n * />\n *\n * @do Pick one primary nav style — links here or in the Sidebar, not both.\n * @dont Stack two rows of navigation in the TopNav. If you need tabs as well,\n * put them below the bar inside the page content.\n */\nexport const TopNav = forwardRef<HTMLElement, TopNavProps>(function TopNav(\n { logo, nav, search, actions, className, ...props },\n ref,\n) {\n return (\n <header\n ref={ref}\n className={cn(\n 'sticky top-0 z-[var(--z-sticky)] flex h-14 w-full items-center gap-4',\n 'border-b border-border bg-background/80 px-4 backdrop-blur',\n 'supports-[backdrop-filter]:bg-background/60',\n className,\n )}\n {...props}\n >\n <div className=\"flex items-center gap-6 shrink-0\">\n {logo}\n {nav && <nav className=\"hidden md:flex items-center gap-1\">{nav}</nav>}\n </div>\n {search && <div className=\"flex-1 max-w-md mx-auto\">{search}</div>}\n {actions && <div className=\"ml-auto flex items-center gap-2 shrink-0\">{actions}</div>}\n </header>\n );\n});\nTopNav.displayName = 'TopNav';\n\nexport interface TopNavLinkProps extends HTMLAttributes<HTMLAnchorElement> {\n href: string;\n active?: boolean;\n}\n\nexport const TopNavLink = forwardRef<HTMLAnchorElement, TopNavLinkProps>(function TopNavLink(\n { href, active, className, children, ...props },\n ref,\n) {\n return (\n <a\n ref={ref}\n href={href}\n aria-current={active ? 'page' : undefined}\n className={cn(\n 'inline-flex h-9 items-center rounded-md px-3 text-sm font-medium outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n active ? 'text-foreground' : 'text-foreground-muted hover:text-foreground',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n className,\n )}\n {...props}\n >\n {children}\n </a>\n );\n});\nTopNavLink.displayName = 'TopNavLink';\n","import { createContext, forwardRef, useCallback, useContext, useEffect, useState, type HTMLAttributes } from 'react';\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { IconButton } from './IconButton';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype CarouselOptions = Parameters<typeof useEmblaCarousel>[0];\n\ninterface CarouselContextValue {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: CarouselApi;\n canPrev: boolean;\n canNext: boolean;\n scrollPrev: () => void;\n scrollNext: () => void;\n orientation: 'horizontal' | 'vertical';\n}\n\nconst CarouselContext = createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel() {\n const ctx = useContext(CarouselContext);\n if (!ctx) throw new Error('Carousel components must be used inside <Carousel>');\n return ctx;\n}\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n opts?: CarouselOptions;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n}\n\n/**\n * Embla-backed carousel. Compose with `<CarouselContent>`, `<CarouselItem>`,\n * `<CarouselPrevious>`, and `<CarouselNext>`.\n */\nexport const Carousel = forwardRef<HTMLDivElement, CarouselProps>(function Carousel(\n { opts, orientation = 'horizontal', setApi, className, children, ...props },\n ref,\n) {\n const [carouselRef, api] = useEmblaCarousel({ ...opts, axis: orientation === 'horizontal' ? 'x' : 'y' });\n const [canPrev, setCanPrev] = useState(false);\n const [canNext, setCanNext] = useState(false);\n\n const onSelect = useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanPrev(api.canScrollPrev());\n setCanNext(api.canScrollNext());\n }, []);\n\n useEffect(() => {\n if (!api) return;\n setApi?.(api);\n onSelect(api);\n api.on('reInit', onSelect).on('select', onSelect);\n return () => {\n api.off('reInit', onSelect).off('select', onSelect);\n };\n }, [api, onSelect, setApi]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api,\n canPrev,\n canNext,\n scrollPrev: () => api?.scrollPrev(),\n scrollNext: () => api?.scrollNext(),\n orientation,\n }}\n >\n <div ref={ref} className={cn('relative', className)} role=\"region\" aria-roledescription=\"carousel\" {...props}>\n {children}\n </div>\n </CarouselContext.Provider>\n );\n});\n\nexport const CarouselContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CarouselContent({ className, ...props }, ref) {\n const { carouselRef, orientation } = useCarousel();\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n 'flex',\n orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',\n className,\n )}\n {...props}\n />\n </div>\n );\n },\n);\n\nexport const CarouselItem = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CarouselItem({ className, ...props }, ref) {\n const { orientation } = useCarousel();\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n 'min-w-0 shrink-0 grow-0 basis-full',\n orientation === 'horizontal' ? 'pl-4' : 'pt-4',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nexport function CarouselPrevious({ className }: { className?: string }) {\n const { canPrev, scrollPrev, orientation } = useCarousel();\n return (\n <IconButton\n aria-label=\"Previous\"\n variant=\"outline\"\n disabled={!canPrev}\n onClick={scrollPrev}\n icon={<ChevronLeft />}\n className={cn(\n 'absolute z-10',\n orientation === 'horizontal'\n ? '-left-12 top-1/2 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n />\n );\n}\n\nexport function CarouselNext({ className }: { className?: string }) {\n const { canNext, scrollNext, orientation } = useCarousel();\n return (\n <IconButton\n aria-label=\"Next\"\n variant=\"outline\"\n disabled={!canNext}\n onClick={scrollNext}\n icon={<ChevronRight />}\n className={cn(\n 'absolute z-10',\n orientation === 'horizontal'\n ? '-right-12 top-1/2 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n />\n );\n}\n","import { type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Tiny, dependency-free chart primitives for inline dashboards. For complex\n * visualisations reach for a charting library (Recharts, visx). These suffice\n * for sparklines, KPI cards, and at-a-glance trends.\n */\n\nexport interface ChartPoint {\n x: string | number;\n y: number;\n}\n\nexport interface ChartProps {\n data: ChartPoint[];\n /** Defaults to 24px height per point + 60px padding. */\n height?: number;\n /** Defaults to fluid 100%. */\n width?: number | string;\n /** Tooltip / label rendered above the chart. */\n caption?: ReactNode;\n className?: string;\n}\n\nfunction useScales(data: ChartPoint[], w: number, h: number, padding = 8) {\n const ys = data.map((d) => d.y);\n const min = Math.min(0, ...ys);\n const max = Math.max(...ys, 1);\n const range = max - min || 1;\n const innerW = w - padding * 2;\n const innerH = h - padding * 2;\n const sx = (i: number) =>\n data.length <= 1 ? padding + innerW / 2 : padding + (i / (data.length - 1)) * innerW;\n const sy = (v: number) => padding + innerH - ((v - min) / range) * innerH;\n return { sx, sy, min, max };\n}\n\nexport function LineChart({ data, height = 80, width = '100%', caption, className }: ChartProps) {\n const w = typeof width === 'number' ? width : 320;\n const { sx, sy } = useScales(data, w, height);\n const path = data.map((d, i) => `${i === 0 ? 'M' : 'L'}${sx(i).toFixed(1)},${sy(d.y).toFixed(1)}`).join(' ');\n\n return (\n <figure className={cn('flex flex-col gap-1.5', className)}>\n {caption && <figcaption className=\"text-xs text-foreground-muted\">{caption}</figcaption>}\n <svg viewBox={`0 0 ${w} ${height}`} width={width} height={height} role=\"img\">\n <path d={path} fill=\"none\" stroke=\"var(--color-accent)\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n {data.map((d, i) => (\n <circle key={i} cx={sx(i)} cy={sy(d.y)} r={2} fill=\"var(--color-accent)\" />\n ))}\n </svg>\n </figure>\n );\n}\n\nexport function AreaChart({ data, height = 80, width = '100%', caption, className }: ChartProps) {\n const w = typeof width === 'number' ? width : 320;\n const { sx, sy } = useScales(data, w, height);\n const top = data.map((d, i) => `${i === 0 ? 'M' : 'L'}${sx(i).toFixed(1)},${sy(d.y).toFixed(1)}`).join(' ');\n const area = `${top} L${sx(data.length - 1).toFixed(1)},${height} L${sx(0).toFixed(1)},${height} Z`;\n\n return (\n <figure className={cn('flex flex-col gap-1.5', className)}>\n {caption && <figcaption className=\"text-xs text-foreground-muted\">{caption}</figcaption>}\n <svg viewBox={`0 0 ${w} ${height}`} width={width} height={height} role=\"img\">\n <path d={area} fill=\"var(--color-accent-soft)\" />\n <path d={top} fill=\"none\" stroke=\"var(--color-accent)\" strokeWidth={1.5} />\n </svg>\n </figure>\n );\n}\n\nexport function BarChart({ data, height = 100, width = '100%', caption, className }: ChartProps) {\n const w = typeof width === 'number' ? width : 320;\n const padding = 8;\n const gap = 2;\n const innerW = w - padding * 2;\n const barW = Math.max(2, innerW / data.length - gap);\n const ys = data.map((d) => d.y);\n const max = Math.max(...ys, 1);\n\n return (\n <figure className={cn('flex flex-col gap-1.5', className)}>\n {caption && <figcaption className=\"text-xs text-foreground-muted\">{caption}</figcaption>}\n <svg viewBox={`0 0 ${w} ${height}`} width={width} height={height} role=\"img\">\n {data.map((d, i) => {\n const h = ((d.y / max) * (height - padding * 2));\n return (\n <rect\n key={i}\n x={padding + i * (barW + gap)}\n y={height - padding - h}\n width={barW}\n height={h}\n fill=\"var(--color-accent)\"\n rx={1.5}\n >\n <title>{`${d.x}: ${d.y}`}</title>\n </rect>\n );\n })}\n </svg>\n </figure>\n );\n}\n","import { forwardRef, type ComponentPropsWithoutRef, type ElementRef, type HTMLAttributes } from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport { cn } from '@/lib/utils';\n\ntype Direction = 'top' | 'right' | 'bottom' | 'left';\n\nexport const Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: ComponentPropsWithoutRef<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\n);\nDrawer.displayName = 'Drawer';\n\nexport const DrawerTrigger = DrawerPrimitive.Trigger;\nexport const DrawerPortal = DrawerPrimitive.Portal;\nexport const DrawerClose = DrawerPrimitive.Close;\n\nexport const DrawerOverlay = forwardRef<\n ElementRef<typeof DrawerPrimitive.Overlay>,\n ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(function DrawerOverlay({ className, ...props }, ref) {\n return (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-black/40', className)}\n {...props}\n />\n );\n});\n\nconst directionStyles: Record<Direction, string> = {\n bottom:\n 'inset-x-0 bottom-0 mt-24 flex h-auto max-h-[90vh] flex-col rounded-t-xl border-t border-border',\n top: 'inset-x-0 top-0 mb-24 flex h-auto max-h-[90vh] flex-col rounded-b-xl border-b border-border',\n left: 'inset-y-0 left-0 flex h-full w-[420px] max-w-[90vw] flex-col rounded-r-xl border-r border-border',\n right: 'inset-y-0 right-0 flex h-full w-[420px] max-w-[90vw] flex-col rounded-l-xl border-l border-border',\n};\n\nconst handleStyles: Record<Direction, string> = {\n bottom: 'mx-auto mt-3 h-1.5 w-12 rounded-full bg-border',\n top: 'mx-auto mb-3 h-1.5 w-12 rounded-full bg-border order-last',\n left: 'mx-1.5 my-auto h-12 w-1.5 rounded-full bg-border order-last self-stretch shrink-0',\n right: 'mx-1.5 my-auto h-12 w-1.5 rounded-full bg-border shrink-0 self-stretch',\n};\n\nexport interface DrawerContentProps\n extends ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> {\n /** Side the drawer slides in from. Default `bottom`. */\n direction?: Direction;\n /** Hide the drag handle. */\n hideHandle?: boolean;\n}\n\nexport const DrawerContent = forwardRef<\n ElementRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(function DrawerContent(\n { className, direction = 'bottom', hideHandle, children, ...props },\n ref,\n) {\n const isHorizontal = direction === 'left' || direction === 'right';\n return (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed z-50 bg-card',\n directionStyles[direction],\n isHorizontal && 'flex-row',\n className,\n )}\n {...props}\n >\n {!hideHandle && <div aria-hidden className={handleStyles[direction]} />}\n <div className={cn('min-h-0 min-w-0 flex-1', isHorizontal && 'flex flex-col')}>\n {children}\n </div>\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n});\n\nexport function DrawerHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('grid gap-1 p-4 text-center sm:text-left', className)} {...props} />;\n}\n\nexport function DrawerFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n}\n\nexport const DrawerTitle = forwardRef<\n ElementRef<typeof DrawerPrimitive.Title>,\n ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(function DrawerTitle({ className, ...props }, ref) {\n return (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold', className)}\n {...props}\n />\n );\n});\n\nexport const DrawerDescription = forwardRef<\n ElementRef<typeof DrawerPrimitive.Description>,\n ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(function DrawerDescription({ className, ...props }, ref) {\n return (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn('text-sm text-foreground-muted', className)}\n {...props}\n />\n );\n});\n","import { forwardRef, useCallback, useId, useRef, useState, type DragEvent as ReactDragEvent, type ReactNode } from 'react';\nimport { File as FileIcon, Upload, X } from 'lucide-react';\nimport { cn } from '@/lib/utils';\n\nexport interface FileUploadProps {\n /** Accepted file types, e.g. `image/*` or `.pdf,.docx`. */\n accept?: string;\n /** Allow multiple files. */\n multiple?: boolean;\n /** Max file size in bytes. Files larger than this are rejected. */\n maxSize?: number;\n /** Controlled file list. */\n value?: File[];\n /** Called when files are added or removed. */\n onChange?: (files: File[]) => void;\n /** Helper text inside the drop zone. */\n hint?: ReactNode;\n /** Disable the picker entirely. */\n disabled?: boolean;\n className?: string;\n}\n\nfunction formatSize(bytes: number) {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n}\n\n/**\n * Drag-and-drop file picker with an inline file list. Uncontrolled by default;\n * pass `value` + `onChange` to control externally.\n */\nexport const FileUpload = forwardRef<HTMLDivElement, FileUploadProps>(function FileUpload(\n { accept, multiple, maxSize, value, onChange, hint, disabled, className },\n ref,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n const inputId = useId();\n const [internal, setInternal] = useState<File[]>([]);\n const [over, setOver] = useState(false);\n const files = value ?? internal;\n\n const update = useCallback(\n (next: File[]) => {\n if (value === undefined) setInternal(next);\n onChange?.(next);\n },\n [onChange, value],\n );\n\n const addFiles = useCallback(\n (incoming: FileList | File[]) => {\n const arr = Array.from(incoming).filter(\n (f) => !maxSize || f.size <= maxSize,\n );\n update(multiple ? [...files, ...arr] : arr.slice(0, 1));\n },\n [files, maxSize, multiple, update],\n );\n\n const remove = (idx: number) => update(files.filter((_, i) => i !== idx));\n\n const onDrop = (e: ReactDragEvent<HTMLLabelElement>) => {\n e.preventDefault();\n setOver(false);\n if (disabled) return;\n addFiles(e.dataTransfer.files);\n };\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-3', className)}>\n <label\n htmlFor={inputId}\n onDragOver={(e) => {\n e.preventDefault();\n if (!disabled) setOver(true);\n }}\n onDragLeave={() => setOver(false)}\n onDrop={onDrop}\n className={cn(\n 'group relative flex cursor-pointer flex-col items-center justify-center gap-2',\n 'rounded-md border border-dashed border-border bg-background-subtle px-6 py-8',\n 'text-center transition-colors',\n 'hover:border-border-strong hover:bg-background-muted',\n over && 'border-accent bg-accent-soft',\n disabled && 'pointer-events-none opacity-50',\n )}\n >\n <Upload className=\"size-5 text-foreground-muted\" aria-hidden />\n <div className=\"space-y-1\">\n <p className=\"text-sm font-medium\">Drop files here, or click to browse</p>\n {hint && <p className=\"text-xs text-foreground-muted\">{hint}</p>}\n </div>\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n className=\"sr-only\"\n onChange={(e) => e.target.files && addFiles(e.target.files)}\n />\n </label>\n\n {files.length > 0 && (\n <ul className=\"flex flex-col gap-2\">\n {files.map((file, idx) => (\n <li\n key={`${file.name}-${idx}`}\n className=\"flex items-center gap-3 rounded-md border border-border bg-card px-3 py-2\"\n >\n <FileIcon className=\"size-4 shrink-0 text-foreground-muted\" aria-hidden />\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm\">{file.name}</p>\n <p className=\"text-xs text-foreground-muted\">{formatSize(file.size)}</p>\n </div>\n <button\n type=\"button\"\n onClick={() => remove(idx)}\n className=\"rounded p-1 text-foreground-muted hover:bg-background-muted hover:text-foreground\"\n aria-label={`Remove ${file.name}`}\n >\n <X className=\"size-4\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n});\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { CheckCircle2, Info, AlertTriangle, XCircle, X } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst snackbar = cva(\n [\n 'relative pointer-events-auto w-full max-w-md',\n 'flex items-start gap-3 rounded-md border bg-card p-3 shadow-md',\n 'text-sm text-foreground',\n ],\n {\n variants: {\n variant: {\n default: 'border-border',\n info: 'border-info-border-soft',\n success: 'border-success-border-soft',\n warning: 'border-warning-border-soft',\n danger: 'border-danger-border-soft',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconForVariant: Record<NonNullable<VariantProps<typeof snackbar>['variant']>, ReactNode> = {\n default: null,\n info: <Info className=\"size-4 shrink-0 mt-0.5 text-info-text\" aria-hidden />,\n success: <CheckCircle2 className=\"size-4 shrink-0 mt-0.5 text-success-text\" aria-hidden />,\n warning: <AlertTriangle className=\"size-4 shrink-0 mt-0.5 text-warning-text\" aria-hidden />,\n danger: <XCircle className=\"size-4 shrink-0 mt-0.5 text-danger-text\" aria-hidden />,\n};\n\nexport interface SnackbarProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>,\n VariantProps<typeof snackbar> {\n /** Headline. */\n title?: ReactNode;\n /** Action button rendered on the right. */\n action?: ReactNode;\n /** Show a close (×) button on the right. */\n onClose?: () => void;\n /** Override the variant's default icon. Pass `false` to hide. */\n icon?: ReactNode | false;\n}\n\n/**\n * Persistent inline notification. Unlike Toast, Snackbar does **not** auto-\n * dismiss. Pair with an `action` button or an `onClose` handler.\n */\nexport const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(function Snackbar(\n { className, variant = 'default', title, action, onClose, icon, children, ...props },\n ref,\n) {\n const renderedIcon = icon === false ? null : icon ?? iconForVariant[variant ?? 'default'];\n\n return (\n <div ref={ref} role=\"status\" className={cn(snackbar({ variant }), className)} {...props}>\n {renderedIcon}\n <div className=\"min-w-0 flex-1\">\n {title && <p className=\"font-medium\">{title}</p>}\n {children && <p className=\"text-foreground-muted\">{children}</p>}\n </div>\n {action}\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Dismiss\"\n className=\"rounded p-1 text-foreground-muted hover:bg-background-muted hover:text-foreground\"\n >\n <X className=\"size-4\" />\n </button>\n )}\n </div>\n );\n});\n","import { forwardRef, useCallback, useState, type KeyboardEvent } from 'react';\nimport { X } from 'lucide-react';\nimport { cn } from '@/lib/utils';\n\nexport interface TagInputProps {\n /** Controlled list of tags. */\n value?: string[];\n /** Default tags when uncontrolled. */\n defaultValue?: string[];\n /** Called when the tag list changes. */\n onChange?: (tags: string[]) => void;\n /** Placeholder shown inside the inline input. */\n placeholder?: string;\n /** Maximum number of tags. */\n max?: number;\n /** Disable the editor. */\n disabled?: boolean;\n /** Show a danger border. */\n error?: boolean;\n /** Treat these characters as separators (default: Enter + comma). */\n separators?: string[];\n className?: string;\n}\n\n/**\n * Chip-based multi-value input. Press Enter or comma to add. Backspace on an\n * empty input removes the last tag.\n */\nexport const TagInput = forwardRef<HTMLDivElement, TagInputProps>(function TagInput(\n {\n value,\n defaultValue = [],\n onChange,\n placeholder = 'Add and press Enter',\n max,\n disabled,\n error,\n separators = ['Enter', ','],\n className,\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(defaultValue);\n const [draft, setDraft] = useState('');\n const tags = value ?? internal;\n\n const update = useCallback(\n (next: string[]) => {\n if (value === undefined) setInternal(next);\n onChange?.(next);\n },\n [onChange, value],\n );\n\n const commit = (raw: string) => {\n const t = raw.trim();\n if (!t || tags.includes(t) || (max !== undefined && tags.length >= max)) return;\n update([...tags, t]);\n };\n\n const remove = (idx: number) => update(tags.filter((_, i) => i !== idx));\n\n const onKey = (e: KeyboardEvent<HTMLInputElement>) => {\n if (separators.includes(e.key)) {\n e.preventDefault();\n commit(draft);\n setDraft('');\n } else if (e.key === 'Backspace' && !draft && tags.length) {\n remove(tags.length - 1);\n }\n };\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-card px-2 py-1.5',\n 'transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring',\n error ? 'border-danger focus-within:border-danger focus-within:ring-danger' : 'border-border',\n disabled && 'pointer-events-none opacity-50',\n className,\n )}\n >\n {tags.map((t, i) => (\n <span\n key={`${t}-${i}`}\n className=\"inline-flex items-center gap-1 rounded bg-background-muted px-2 py-0.5 text-xs\"\n >\n {t}\n <button\n type=\"button\"\n onClick={() => remove(i)}\n className=\"rounded p-0.5 text-foreground-muted hover:bg-background-subtle hover:text-foreground\"\n aria-label={`Remove ${t}`}\n >\n <X className=\"size-3\" />\n </button>\n </span>\n ))}\n <input\n value={draft}\n disabled={disabled}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKey}\n onBlur={() => {\n if (draft) {\n commit(draft);\n setDraft('');\n }\n }}\n placeholder={tags.length === 0 ? placeholder : undefined}\n className=\"min-w-[8ch] flex-1 bg-transparent text-sm outline-none placeholder:text-foreground-subtle\"\n />\n </div>\n );\n});\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface TimelineProps extends HTMLAttributes<HTMLOListElement> {}\n\nexport const Timeline = forwardRef<HTMLOListElement, TimelineProps>(function Timeline(\n { className, children, ...props },\n ref,\n) {\n return (\n <ol ref={ref} className={cn('relative flex flex-col gap-6', className)} {...props}>\n {children}\n </ol>\n );\n});\n\nexport interface TimelineItemProps extends HTMLAttributes<HTMLLIElement> {\n /** Optional bullet override. Default: small accent dot. */\n bullet?: ReactNode;\n /** Hide the connector line below this item — use for the last item. */\n isLast?: boolean;\n}\n\nexport const TimelineItem = forwardRef<HTMLLIElement, TimelineItemProps>(function TimelineItem(\n { bullet, isLast, className, children, ...props },\n ref,\n) {\n return (\n <li ref={ref} className={cn('relative flex gap-4 pb-1', className)} {...props}>\n <div className=\"relative flex shrink-0 flex-col items-center\">\n <div className=\"flex size-6 items-center justify-center rounded-full border border-border bg-card text-foreground-muted\">\n {bullet ?? <span className=\"size-2 rounded-full bg-accent\" aria-hidden />}\n </div>\n {!isLast && <span className=\"mt-1 flex-1 w-px bg-border\" aria-hidden />}\n </div>\n <div className=\"min-w-0 flex-1 pb-4\">{children}</div>\n </li>\n );\n});\n\nexport function TimelineTime({ className, children }: { className?: string; children: ReactNode }) {\n return (\n <p className={cn('text-xs text-foreground-subtle', className)}>{children}</p>\n );\n}\n\nexport function TimelineTitle({\n className,\n children,\n}: {\n className?: string;\n children: ReactNode;\n}) {\n return <p className={cn('text-sm font-medium', className)}>{children}</p>;\n}\n\nexport function TimelineDescription({\n className,\n children,\n}: {\n className?: string;\n children: ReactNode;\n}) {\n return <p className={cn('mt-0.5 text-sm text-foreground-muted', className)}>{children}</p>;\n}\n","import { useState, type ReactNode } from 'react';\nimport { ChevronRight, File as FileIcon, Folder, FolderOpen } from 'lucide-react';\nimport { cn } from '@/lib/utils';\n\nexport interface TreeNode {\n id: string;\n label: ReactNode;\n /** If undefined the node is a leaf; if empty array it is an empty folder. */\n children?: TreeNode[];\n /** Optional custom icon (overrides default file/folder icons). */\n icon?: ReactNode;\n}\n\nexport interface TreeProps {\n /** The root nodes. */\n data: TreeNode[];\n /** Ids to expand by default. */\n defaultExpanded?: string[];\n /** Currently selected node id. */\n selectedId?: string;\n onSelect?: (id: string) => void;\n className?: string;\n}\n\n/**\n * Expandable file-tree style list. Single selection. Keyboard a11y is\n * handled at the row level (`tabIndex`, Enter, ArrowRight/Left to toggle).\n */\nexport function Tree({ data, defaultExpanded = [], selectedId, onSelect, className }: TreeProps) {\n const [expanded, setExpanded] = useState<Set<string>>(new Set(defaultExpanded));\n\n const toggle = (id: string) =>\n setExpanded((cur) => {\n const next = new Set(cur);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n\n function renderNode(node: TreeNode, depth: number): ReactNode {\n const hasChildren = !!node.children;\n const isOpen = expanded.has(node.id);\n const isSelected = selectedId === node.id;\n const DefaultIcon = hasChildren ? (isOpen ? FolderOpen : Folder) : FileIcon;\n\n return (\n <li key={node.id} role=\"treeitem\" aria-expanded={hasChildren ? isOpen : undefined}>\n <button\n type=\"button\"\n tabIndex={0}\n onClick={() => {\n onSelect?.(node.id);\n if (hasChildren) toggle(node.id);\n }}\n onKeyDown={(e) => {\n if (e.key === 'ArrowRight' && hasChildren && !isOpen) toggle(node.id);\n else if (e.key === 'ArrowLeft' && hasChildren && isOpen) toggle(node.id);\n }}\n style={{ paddingLeft: depth * 16 + 8 }}\n className={cn(\n 'flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left text-sm',\n 'hover:bg-background-muted focus-visible:bg-background-muted outline-none',\n isSelected && 'bg-accent-soft text-foreground',\n )}\n >\n {hasChildren ? (\n <ChevronRight\n className={cn('size-3.5 shrink-0 text-foreground-subtle transition-transform', isOpen && 'rotate-90')}\n aria-hidden\n />\n ) : (\n <span className=\"w-3.5 shrink-0\" aria-hidden />\n )}\n {node.icon ?? <DefaultIcon className=\"size-4 shrink-0 text-foreground-muted\" aria-hidden />}\n <span className=\"truncate\">{node.label}</span>\n </button>\n {hasChildren && isOpen && (\n <ul role=\"group\" className=\"mt-0.5\">\n {node.children!.map((c) => renderNode(c, depth + 1))}\n </ul>\n )}\n </li>\n );\n }\n\n return (\n <ul role=\"tree\" className={cn('flex flex-col gap-0.5', className)}>\n {data.map((n) => renderNode(n, 0))}\n </ul>\n );\n}\n","import { useState, type FormEvent, type ReactNode } from 'react';\nimport { ArrowRight, CheckCircle2, Mail } from '@/icons';\nimport { Button } from '@/components/ui/Button';\nimport { Input } from '@/components/ui/Input';\nimport { Alert } from '@/components/ui/Alert';\nimport { Separator } from '@/components/ui/Separator';\n\n/* -----------------------------------------------------------------------------\n * Authentication pattern — four screens that share the same shell.\n *\n * <AuthLayout title=\"…\" subtitle=\"…\">…form…</AuthLayout>\n *\n * Below: SignIn, SignUp, ForgotPassword, MagicLinkSent — each composed of\n * primitives. They emit events; the host app handles network calls.\n * --------------------------------------------------------------------------- */\n\nexport interface AuthLayoutProps {\n /** Brand mark shown above the title. */\n brand?: ReactNode;\n /** Page heading. */\n title: ReactNode;\n /** Secondary line under the title. */\n subtitle?: ReactNode;\n /** Form / content. */\n children: ReactNode;\n /** Footer slot — \"Don't have an account? Sign up\". */\n footer?: ReactNode;\n}\n\nexport function AuthLayout({ brand, title, subtitle, children, footer }: AuthLayoutProps) {\n return (\n <main className=\"grid min-h-screen place-items-center bg-background-subtle px-4 py-12\">\n <div className=\"w-full max-w-[400px] space-y-6\">\n {brand && <div className=\"flex justify-center\">{brand}</div>}\n <div className=\"space-y-2 text-center\">\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">{title}</h1>\n {subtitle && <p className=\"text-sm text-foreground-muted\">{subtitle}</p>}\n </div>\n <div className=\"rounded-lg border border-border bg-card p-6\">{children}</div>\n {footer && (\n <p className=\"text-center text-sm text-foreground-muted\">{footer}</p>\n )}\n </div>\n </main>\n );\n}\n\nexport interface SignInFormProps {\n onSubmit: (data: { email: string; password: string }) => void | Promise<void>;\n loading?: boolean;\n error?: ReactNode;\n forgotHref?: string;\n}\n\nexport function SignInForm({ onSubmit, loading, error, forgotHref = '/forgot' }: SignInFormProps) {\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n\n const handle = (e: FormEvent) => {\n e.preventDefault();\n onSubmit({ email, password });\n };\n\n return (\n <form onSubmit={handle} className=\"space-y-4\">\n {error && <Alert variant=\"danger\">{error}</Alert>}\n <Input\n type=\"email\"\n label=\"Email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n autoComplete=\"email\"\n required\n />\n <Input\n type=\"password\"\n label=\"Password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n autoComplete=\"current-password\"\n required\n />\n <div className=\"flex items-center justify-between text-sm\">\n <a\n href={forgotHref}\n className=\"font-medium text-accent hover:underline outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm\"\n >\n Forgot password?\n </a>\n </div>\n <Button type=\"submit\" loading={loading} className=\"w-full\" trailingIcon={<ArrowRight />}>\n Sign in\n </Button>\n </form>\n );\n}\n\nexport interface SignUpFormProps {\n onSubmit: (data: { name: string; email: string; password: string }) => void | Promise<void>;\n loading?: boolean;\n error?: ReactNode;\n}\n\nexport function SignUpForm({ onSubmit, loading, error }: SignUpFormProps) {\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n\n return (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n onSubmit({ name, email, password });\n }}\n className=\"space-y-4\"\n >\n {error && <Alert variant=\"danger\">{error}</Alert>}\n <Input label=\"Full name\" value={name} onChange={(e) => setName(e.target.value)} required />\n <Input\n type=\"email\"\n label=\"Work email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n autoComplete=\"email\"\n required\n />\n <Input\n type=\"password\"\n label=\"Password\"\n helperText=\"At least 8 characters.\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n autoComplete=\"new-password\"\n required\n />\n <Button type=\"submit\" loading={loading} className=\"w-full\">\n Create account\n </Button>\n <p className=\"text-xs text-foreground-subtle text-center\">\n By signing up you agree to our Terms of Service and Privacy Policy.\n </p>\n </form>\n );\n}\n\nexport interface ForgotPasswordFormProps {\n onSubmit: (email: string) => void | Promise<void>;\n loading?: boolean;\n error?: ReactNode;\n}\n\nexport function ForgotPasswordForm({ onSubmit, loading, error }: ForgotPasswordFormProps) {\n const [email, setEmail] = useState('');\n return (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n onSubmit(email);\n }}\n className=\"space-y-4\"\n >\n {error && <Alert variant=\"danger\">{error}</Alert>}\n <Input\n type=\"email\"\n label=\"Email\"\n helperText=\"We'll send a reset link if an account exists.\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n autoComplete=\"email\"\n required\n />\n <Button type=\"submit\" loading={loading} className=\"w-full\" leadingIcon={<Mail />}>\n Send reset link\n </Button>\n </form>\n );\n}\n\nexport interface MagicLinkSentProps {\n email: string;\n onResend?: () => void;\n}\n\nexport function MagicLinkSent({ email, onResend }: MagicLinkSentProps) {\n return (\n <div className=\"space-y-4 text-center\">\n <div className=\"mx-auto inline-flex size-12 items-center justify-center rounded-full bg-success-soft text-success-text\">\n <CheckCircle2 className=\"size-6\" aria-hidden />\n </div>\n <p className=\"text-sm text-foreground-muted\">\n We sent a sign-in link to{' '}\n <span className=\"font-medium text-foreground\">{email}</span>. Open it on this device to\n continue.\n </p>\n <Separator />\n <p className=\"text-xs text-foreground-subtle\">\n Didn't get it?{' '}\n <button\n type=\"button\"\n onClick={onResend}\n className=\"font-medium text-accent hover:underline outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm\"\n >\n Resend\n </button>\n </p>\n </div>\n );\n}\n","import { Fragment, useState, type ReactNode } from 'react';\nimport {\n BarChart3,\n Bell,\n Bookmark,\n Folder,\n HelpCircle,\n Home,\n Inbox,\n LayoutGrid,\n LogOut,\n Menu,\n Plug,\n Search,\n Settings,\n Sparkles,\n User,\n Users,\n} from '@/icons';\nimport { Avatar } from '@/components/ui/Avatar';\nimport { Badge } from '@/components/ui/Badge';\nimport { Card, CardDescription, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';\nimport { LineChart } from '@/components/ui/Chart';\nimport { IconButton } from '@/components/ui/IconButton';\nimport { Input } from '@/components/ui/Input';\nimport { Kbd } from '@/components/ui/Kbd';\nimport { Sheet, SheetContent, SheetTrigger } from '@/components/ui/Sheet';\nimport { Sidebar, SidebarItem, SidebarSection } from '@/components/ui/Sidebar';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/components/ui/Table';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/ui/DropdownMenu';\n\n/* -----------------------------------------------------------------------------\n * Generic AppShell — sidebar (with brand in header + nav + footer) plus a\n * slim topbar holding search + notifications + profile dropdown.\n *\n * Sidebar nav, topbar actions, search, profile, and notifications are all\n * data-driven. Sensible defaults match the legacy demo so existing call\n * sites render unchanged.\n * --------------------------------------------------------------------------- */\n\nfunction navigate(hash: string) {\n if (typeof window === 'undefined') return;\n window.location.hash = hash;\n}\n\n/* -----------------------------------------------------------------------------\n * Public types\n * --------------------------------------------------------------------------- */\n\n/**\n * Legacy nav keys retained for back-compat. The `active` prop now accepts\n * any string — these are kept as a typed alias for consumers that hard-code\n * one of the original demo values.\n */\nexport type AppShellNavKey =\n | 'home'\n | 'projects'\n | 'inbox'\n | 'members'\n | 'insights'\n | 'bookmarks'\n | 'apps'\n | 'settings'\n | 'integrations'\n | 'help';\n\nexport interface AppShellNavItem {\n /** Active-state identifier — matches AppShell's `active` prop. */\n key: string;\n label: ReactNode;\n /** Leading icon. */\n icon?: ReactNode;\n /** Destination. Renders as <a href>; for SPAs intercept onClick. */\n href?: string;\n /** Right-aligned content (Badge, count). */\n trailing?: ReactNode;\n /** Optional click handler. */\n onClick?: () => void;\n}\n\nexport interface AppShellNavSection {\n /** Section heading shown above the items. */\n label?: ReactNode;\n items: AppShellNavItem[];\n}\n\nexport interface AppShellUser {\n name: ReactNode;\n email?: ReactNode;\n /** 1–2 char initials for the Avatar fallback. */\n initials: string;\n /** Online status — drives the Avatar status dot. */\n status?: 'online' | 'busy' | 'away' | 'offline';\n}\n\nexport interface AppShellNotification {\n id: string;\n who: { name: string; initials: string };\n action: ReactNode;\n target: ReactNode;\n when: ReactNode;\n unread?: boolean;\n onClick?: () => void;\n}\n\nexport interface AppShellProfileMenuItem {\n label: ReactNode;\n icon?: ReactNode;\n trailing?: ReactNode;\n onSelect?: () => void;\n /** Renders a separator before this item. */\n separatorAbove?: boolean;\n}\n\nexport interface AppShellProps {\n /** Page content. */\n children: ReactNode;\n /** Logo / wordmark rendered at the top of the sidebar. */\n brand: ReactNode;\n /** Which sidebar item is active. Matches `AppShellNavItem.key`. Defaults to `'home'`. */\n active?: string;\n /**\n * Sidebar nav sections. Defaults to the built-in demo nav. Pass an empty\n * array to hide the nav entirely, or use `sidebar` for a fully custom rail.\n */\n navSections?: AppShellNavSection[];\n /**\n * Escape hatch: replace the entire Sidebar contents. Takes precedence over\n * `navSections`. Use when you need custom section components, groups, etc.\n */\n sidebar?: ReactNode;\n /** Slot for additional topbar actions (left of notifications). */\n topbarActions?: ReactNode;\n /** Topbar search input — pass `false` to hide. */\n search?: ReactNode | false;\n /** Currently signed-in user, shown in the sidebar footer + profile menu. */\n user?: AppShellUser;\n /** Profile dropdown items. Defaults to the demo Profile / Settings / Sign out menu. */\n profileMenu?: AppShellProfileMenuItem[];\n /** Notification feed. Set to an empty array to hide the bell entirely. */\n notifications?: AppShellNotification[];\n /** Fires when the user clicks \"Mark all read\". */\n onMarkAllNotificationsRead?: () => void;\n /** Fires when the user clicks \"View all\" in the notifications menu. */\n onViewAllNotifications?: () => void;\n}\n\n/* -----------------------------------------------------------------------------\n * Default content (matches the legacy demo)\n * --------------------------------------------------------------------------- */\n\nconst DEFAULT_NAV_SECTIONS: AppShellNavSection[] = [\n {\n label: 'Workspace',\n items: [\n { key: 'home', label: 'Home', icon: <Home />, href: '#dashboard' },\n { key: 'projects', label: 'Projects', icon: <Folder />, href: '#data-table', trailing: <Badge tone=\"neutral\">12</Badge> },\n { key: 'inbox', label: 'Inbox', icon: <Inbox />, href: '#first-run', trailing: <Badge tone=\"accent\">5</Badge> },\n { key: 'members', label: 'Members', icon: <Users />, href: '#record', trailing: <Badge tone=\"neutral\">3</Badge> },\n { key: 'insights', label: 'Insights', icon: <BarChart3 />, href: '#dashboard' },\n ],\n },\n {\n label: 'Personal',\n items: [\n { key: 'bookmarks', label: 'Bookmarks', icon: <Bookmark />, href: '#pricing' },\n { key: 'apps', label: 'Apps', icon: <LayoutGrid />, href: '#onboarding' },\n ],\n },\n {\n label: 'Account',\n items: [\n { key: 'settings', label: 'Settings', icon: <Settings />, href: '#settings' },\n { key: 'integrations', label: 'Integrations', icon: <Plug />, href: '#settings' },\n { key: 'help', label: 'Help & docs', icon: <HelpCircle />, href: '#' },\n ],\n },\n];\n\nconst DEFAULT_USER: AppShellUser = {\n name: 'Bay Otgonbayar',\n email: 'bay@craftzbay.com',\n initials: 'BO',\n status: 'online',\n};\n\nconst DEFAULT_NOTIFICATIONS: AppShellNotification[] = [\n { id: 'n1', who: { name: 'Anu B.', initials: 'AB' }, action: 'mentioned you in', target: 'Q2 OKRs', when: '2m', unread: true },\n { id: 'n2', who: { name: 'Bat E.', initials: 'BE' }, action: 'requested review on', target: 'fix/login-flow', when: '18m', unread: true },\n { id: 'n3', who: { name: 'Tuya G.', initials: 'TG' }, action: 'commented on', target: 'feat/segments', when: '1h', unread: true },\n { id: 'n4', who: { name: 'Khulan O.', initials: 'KO' }, action: 'archived', target: 'old-billing-spike', when: '3h' },\n { id: 'n5', who: { name: 'Sara M.', initials: 'SM' }, action: 'invited you to', target: 'Atlas workspace', when: 'Yesterday' },\n];\n\nconst DEFAULT_PROFILE_MENU: AppShellProfileMenuItem[] = [\n { label: 'Profile', icon: <User className=\"size-4\" />, onSelect: () => navigate('record') },\n { label: 'Account settings', icon: <Settings className=\"size-4\" />, onSelect: () => navigate('settings') },\n {\n label: 'Upgrade plan',\n icon: <Sparkles className=\"size-4\" />,\n trailing: <Badge tone=\"accent\" className=\"ml-auto\">Pro</Badge>,\n onSelect: () => navigate('pricing'),\n },\n { label: 'Help & support', icon: <HelpCircle className=\"size-4\" />, onSelect: () => navigate('first-run'), separatorAbove: true },\n { label: 'Sign out', icon: <LogOut className=\"size-4\" />, onSelect: () => navigate('auth-signin'), separatorAbove: true },\n];\n\n/* -----------------------------------------------------------------------------\n * AppShell\n * --------------------------------------------------------------------------- */\n\n/**\n * AppShell — sticky sidebar + topbar shell for SaaS dashboards.\n *\n * @example Default — uses the built-in demo nav, user, notifications\n * <AppShell brand={<Logo />} active=\"home\">\n * <Dashboard />\n * </AppShell>\n *\n * @example Custom nav + user\n * <AppShell\n * brand={<Logo />}\n * active=\"projects\"\n * user={{ name: 'Avery Long', email: 'avery@acme.com', initials: 'AL', status: 'online' }}\n * navSections={[\n * { label: 'Workspace', items: [\n * { key: 'home', label: 'Home', icon: <Home />, href: '/' },\n * { key: 'projects', label: 'Projects', icon: <Folder />, href: '/projects',\n * trailing: <Badge tone=\"neutral\">{count}</Badge> },\n * ]},\n * ]}\n * notifications={data?.notifications ?? []}\n * >\n * <ProjectsPage />\n * </AppShell>\n */\nexport function AppShell({\n children,\n brand,\n active = 'home',\n navSections = DEFAULT_NAV_SECTIONS,\n sidebar,\n topbarActions,\n search,\n user = DEFAULT_USER,\n profileMenu = DEFAULT_PROFILE_MENU,\n notifications = DEFAULT_NOTIFICATIONS,\n onMarkAllNotificationsRead,\n onViewAllNotifications,\n}: AppShellProps) {\n return (\n <div className=\"flex min-h-screen w-full bg-background\">\n <Sidebar defaultCollapsed={false} header={brand} footer={<ProfileFooter user={user} />}>\n {sidebar ?? <RenderNavSections sections={navSections} active={active} />}\n </Sidebar>\n\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <TopBar\n brand={brand}\n active={active}\n navSections={navSections}\n sidebar={sidebar}\n user={user}\n search={search}\n topbarActions={topbarActions}\n notifications={notifications}\n profileMenu={profileMenu}\n onMarkAllNotificationsRead={onMarkAllNotificationsRead}\n onViewAllNotifications={onViewAllNotifications}\n />\n <main className=\"flex-1 overflow-y-auto p-4 md:p-8\">{children}</main>\n </div>\n </div>\n );\n}\n\nfunction RenderNavSections({\n sections,\n active,\n}: {\n sections: AppShellNavSection[];\n active: string;\n}) {\n return (\n <>\n {sections.map((section, si) => (\n <SidebarSection key={si} label={section.label}>\n {section.items.map((item) => (\n <SidebarItem\n key={item.key}\n href={item.href}\n icon={item.icon}\n active={item.key === active}\n trailing={item.trailing}\n onClick={item.onClick}\n >\n {item.label}\n </SidebarItem>\n ))}\n </SidebarSection>\n ))}\n </>\n );\n}\n\nfunction TopBar({\n brand,\n active,\n navSections,\n sidebar,\n user,\n search,\n topbarActions,\n notifications,\n profileMenu,\n onMarkAllNotificationsRead,\n onViewAllNotifications,\n}: {\n brand: ReactNode;\n active: string;\n navSections: AppShellNavSection[];\n sidebar: ReactNode | undefined;\n user: AppShellUser;\n search: ReactNode | false | undefined;\n topbarActions: ReactNode | undefined;\n notifications: AppShellNotification[];\n profileMenu: AppShellProfileMenuItem[];\n onMarkAllNotificationsRead?: () => void;\n onViewAllNotifications?: () => void;\n}) {\n const [open, setOpen] = useState(false);\n\n const searchNode =\n search === false ? null : (\n search ?? (\n <Input\n type=\"search\"\n placeholder=\"Search projects, members, files…\"\n hideLabel\n label=\"Search\"\n prefix={<Search />}\n suffix={<Kbd>⌘K</Kbd>}\n />\n )\n );\n\n return (\n <header className=\"sticky top-0 z-30 flex h-14 items-center gap-3 border-b border-border bg-background/80 px-4 backdrop-blur md:px-6\">\n {/* Mobile-only hamburger + brand */}\n <div className=\"flex items-center gap-2 md:hidden\">\n <Sheet open={open} onOpenChange={setOpen}>\n <SheetTrigger asChild>\n <IconButton aria-label=\"Open menu\" icon={<Menu />} variant=\"ghost\" size=\"sm\" />\n </SheetTrigger>\n <SheetContent side=\"left\" className=\"w-64 p-0\">\n <div className=\"flex h-14 shrink-0 items-center border-b border-border px-3\">\n {brand}\n </div>\n <div className=\"flex-1 overflow-y-auto py-3\" onClick={() => setOpen(false)}>\n {sidebar ?? <RenderNavSections sections={navSections} active={active} />}\n </div>\n <div className=\"border-t border-border p-2\">\n <ProfileFooter user={user} />\n </div>\n </SheetContent>\n </Sheet>\n <div className=\"text-sm\">{brand}</div>\n </div>\n\n {searchNode && (\n <div className=\"relative hidden max-w-xl flex-1 sm:block\">{searchNode}</div>\n )}\n\n <div className=\"ml-auto flex items-center gap-1\">\n {topbarActions}\n {notifications.length > 0 && (\n <NotificationMenu\n notifications={notifications}\n onMarkAllRead={onMarkAllNotificationsRead}\n onViewAll={onViewAllNotifications}\n />\n )}\n <ProfileMenu user={user} items={profileMenu} />\n </div>\n </header>\n );\n}\n\nfunction NotificationMenu({\n notifications,\n onMarkAllRead,\n onViewAll,\n}: {\n notifications: AppShellNotification[];\n onMarkAllRead?: () => void;\n onViewAll?: () => void;\n}) {\n const unread = notifications.filter((n) => n.unread).length;\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n aria-label={`Notifications${unread ? `, ${unread} unread` : ''}`}\n className=\"relative inline-flex size-9 items-center justify-center rounded-md text-foreground-muted outline-none transition-colors hover:bg-background-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n <Bell className=\"size-4\" />\n {unread > 0 && (\n <span\n aria-hidden\n className=\"absolute right-2 top-2 inline-flex h-2 w-2 rounded-full bg-accent ring-2 ring-background\"\n />\n )}\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-80 p-0\">\n <div className=\"flex items-center justify-between border-b border-border px-3 py-2.5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm font-medium\">Notifications</span>\n {unread > 0 && <Badge tone=\"accent\">{unread} new</Badge>}\n </div>\n {onMarkAllRead && (\n <button\n type=\"button\"\n onClick={onMarkAllRead}\n className=\"text-xs text-foreground-muted hover:text-foreground\"\n >\n Mark all read\n </button>\n )}\n </div>\n <ul className=\"max-h-80 overflow-y-auto py-1\">\n {notifications.map((n) => (\n <li key={n.id}>\n <button\n type=\"button\"\n onClick={n.onClick}\n className=\"flex w-full items-start gap-3 px-3 py-2.5 text-left outline-none hover:bg-background-muted focus-visible:bg-background-muted\"\n >\n <div className=\"relative mt-0.5\">\n <Avatar size=\"sm\" fallback={n.who.initials} />\n {n.unread && (\n <span\n aria-hidden\n className=\"absolute -right-0.5 -top-0.5 inline-flex h-2 w-2 rounded-full bg-accent ring-2 ring-background\"\n />\n )}\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm leading-snug\">\n <span className=\"font-medium text-foreground\">{n.who.name}</span>{' '}\n <span className=\"text-foreground-muted\">{n.action}</span>{' '}\n <span className=\"font-medium text-foreground\">{n.target}</span>\n </p>\n <p className=\"mt-0.5 text-xs text-foreground-subtle\">{n.when}</p>\n </div>\n </button>\n </li>\n ))}\n </ul>\n {onViewAll && (\n <div className=\"border-t border-border px-3 py-2 text-center\">\n <button\n type=\"button\"\n onClick={onViewAll}\n className=\"text-xs font-medium text-accent hover:underline\"\n >\n View all notifications\n </button>\n </div>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction ProfileMenu({\n user,\n items,\n}: {\n user: AppShellUser;\n items: AppShellProfileMenuItem[];\n}) {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n aria-label=\"Open profile menu\"\n className=\"flex items-center gap-2 rounded-full p-0.5 outline-none hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n <Avatar size=\"sm\" fallback={user.initials} status={user.status} />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-60\">\n <DropdownMenuLabel>\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"text-sm font-medium text-foreground\">{user.name}</span>\n {user.email && (\n <span className=\"text-xs text-foreground-subtle\">{user.email}</span>\n )}\n </div>\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n {items.map((item, i) => (\n <Fragment key={i}>\n {item.separatorAbove && <DropdownMenuSeparator />}\n <DropdownMenuItem onSelect={item.onSelect}>\n {item.icon}\n {item.label}\n {item.trailing}\n </DropdownMenuItem>\n </Fragment>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction ProfileFooter({ user }: { user: AppShellUser }) {\n return (\n <div className=\"flex items-center gap-2.5 rounded-md px-2 py-1.5\">\n <Avatar fallback={user.initials} size=\"sm\" status={user.status} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-foreground\">{user.name}</p>\n {user.email && (\n <p className=\"truncate text-xs text-foreground-subtle\">{user.email}</p>\n )}\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Dashboard — header, stat cards, chart slot, recent-activity table.\n * Data-driven: pass `stats`, `chart`, `activity`, or override the entire\n * rendering with `children`.\n * --------------------------------------------------------------------------- */\n\nexport interface DashboardStat {\n label: ReactNode;\n value: ReactNode;\n delta?: { value: string; positive?: boolean };\n}\n\nexport interface DashboardActivityRow {\n id: string;\n who: { name: string; initials: string };\n action: ReactNode;\n target: ReactNode;\n when: ReactNode;\n}\n\nexport interface DashboardProps {\n /** Top heading. */\n title?: ReactNode;\n /** Subtitle below the heading. */\n subtitle?: ReactNode;\n /** Top-right slot (date-range picker, segmented control, …). */\n headerActions?: ReactNode;\n /** Stat cards rendered in a responsive grid. */\n stats?: DashboardStat[];\n /** Chart card — any ReactNode (Chart component, SVG, image, placeholder). */\n chart?: ReactNode;\n /** Title above the chart. */\n chartTitle?: ReactNode;\n /** Subtitle under the chart title. */\n chartDescription?: ReactNode;\n /** Activity table rows. */\n activity?: DashboardActivityRow[];\n /** Title for the activity table. */\n activityTitle?: ReactNode;\n}\n\n// Synthetic 30-day active-users series shown by default. Realistic-looking\n// gentle upward drift with weekly periodicity.\nconst DEFAULT_CHART_DATA = Array.from({ length: 30 }, (_, i) => {\n const trend = 2200 + i * 22;\n const weekly = Math.sin(i / 3.5) * 180;\n const noise = (Math.sin(i * 7.3) + Math.cos(i * 3.1)) * 60;\n return { x: i, y: Math.round(trend + weekly + noise) };\n});\n\nconst DEFAULT_STATS: DashboardStat[] = [\n { label: 'Active users', value: '2,840', delta: { value: '+12%', positive: true } },\n { label: 'Sessions today', value: '8,402', delta: { value: '+4%', positive: true } },\n { label: 'Open issues', value: '14', delta: { value: '−6%', positive: true } },\n { label: 'Error rate', value: '0.32%', delta: { value: '+0.05%', positive: false } },\n];\n\nconst DEFAULT_ACTIVITY: DashboardActivityRow[] = [\n { id: '1', who: { name: 'Anu B.', initials: 'AB' }, action: 'merged', target: 'feat/segments', when: '12m ago' },\n { id: '2', who: { name: 'Bat E.', initials: 'BE' }, action: 'opened', target: 'fix/login-flow', when: '34m ago' },\n { id: '3', who: { name: 'Tuya G.', initials: 'TG' }, action: 'commented on', target: 'Q2 OKRs', when: '1h ago' },\n { id: '4', who: { name: 'Khulan O.', initials: 'KO' }, action: 'archived', target: 'old-billing-spike', when: '3h ago' },\n];\n\nexport function Dashboard({\n title = 'Overview',\n subtitle = \"What's happening across your workspace today.\",\n headerActions = (\n <Badge tone=\"neutral\" variant=\"outline\">\n Last 7 days\n </Badge>\n ),\n stats = DEFAULT_STATS,\n chart,\n chartTitle = 'Active users',\n chartDescription = 'Distinct sessions per day, last 30 days.',\n activity = DEFAULT_ACTIVITY,\n activityTitle = 'Recent activity',\n}: DashboardProps = {}) {\n return (\n <div className=\"space-y-8\">\n <header className=\"flex items-end justify-between gap-4\">\n <div>\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">{title}</h1>\n {subtitle && <p className=\"mt-1 text-sm text-foreground-muted\">{subtitle}</p>}\n </div>\n {headerActions && (\n <div className=\"hidden items-center gap-2 md:flex\">{headerActions}</div>\n )}\n </header>\n\n {stats.length > 0 && (\n <section className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n {stats.map((s, i) => (\n <Card key={i}>\n <CardHeader className=\"pb-2\">\n <CardDescription>{s.label}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"flex items-baseline gap-2\">\n <span className=\"tabular text-2xl font-semibold text-foreground\">{s.value}</span>\n {s.delta && (\n <span\n className={\n s.delta.positive\n ? 'tabular text-xs font-medium text-success-text'\n : 'tabular text-xs font-medium text-danger-text'\n }\n >\n {s.delta.value}\n </span>\n )}\n </div>\n </CardContent>\n </Card>\n ))}\n </section>\n )}\n\n {(chart !== undefined || chartTitle) && (\n <Card>\n <CardHeader>\n {chartTitle && <CardTitle>{chartTitle}</CardTitle>}\n {chartDescription && <CardDescription>{chartDescription}</CardDescription>}\n </CardHeader>\n <CardContent>{chart ?? <LineChart data={DEFAULT_CHART_DATA} height={160} className=\"w-full\" />}</CardContent>\n </Card>\n )}\n\n {activity.length > 0 && (\n <Card padding=\"none\">\n <CardHeader className=\"px-5 pt-5\">\n <CardTitle>{activityTitle}</CardTitle>\n </CardHeader>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Who</TableHead>\n <TableHead>Action</TableHead>\n <TableHead>Target</TableHead>\n <TableHead className=\"text-right\">When</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {activity.map((r) => (\n <TableRow key={r.id}>\n <TableCell>\n <div className=\"flex items-center gap-2\">\n <Avatar size=\"xs\" fallback={r.who.initials} />\n <span className=\"text-foreground\">{r.who.name}</span>\n </div>\n </TableCell>\n <TableCell className=\"text-foreground-muted\">{r.action}</TableCell>\n <TableCell>\n <Badge tone=\"neutral\" variant=\"outline\">\n {r.target}\n </Badge>\n </TableCell>\n <TableCell className=\"tabular text-right text-foreground-subtle\">\n {r.when}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Card>\n )}\n </div>\n );\n}\n","import { useState, type ReactNode } from 'react';\nimport { Bell, CreditCard, Lock, User, Users } from '@/icons';\nimport { Avatar } from '@/components/ui/Avatar';\nimport { Button } from '@/components/ui/Button';\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/Card';\nimport { Input } from '@/components/ui/Input';\nimport { Separator } from '@/components/ui/Separator';\nimport { Switch } from '@/components/ui/Switch';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Settings shell with a sticky left sub-nav. Sections are declared as data so\n * consumers can add / remove / reorder without touching the layout.\n * --------------------------------------------------------------------------- */\n\nexport interface SettingsSection {\n id: string;\n label: string;\n icon?: ReactNode;\n render: () => ReactNode;\n}\n\nexport interface SettingsPageProps {\n /** Page title — defaults to \"Settings\". */\n title?: ReactNode;\n /** Subtitle under the heading. */\n subtitle?: ReactNode;\n sections?: SettingsSection[];\n /** Initially active section id. Defaults to the first section. */\n defaultSection?: string;\n /** Controlled active section id. */\n activeSection?: string;\n /** Fires when the active section changes (controlled mode). */\n onActiveSectionChange?: (id: string) => void;\n className?: string;\n}\n\n/* -----------------------------------------------------------------------------\n * Default demo sections — used when the consumer renders <SettingsPage /> with\n * no `sections` prop, and on the showcase preview.\n * --------------------------------------------------------------------------- */\n\nconst DEMO_SECTIONS: SettingsSection[] = [\n {\n id: 'profile',\n label: 'Profile',\n icon: <User />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Profile</CardTitle>\n <CardDescription>Visible to your teammates.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"flex items-center gap-4\">\n <Avatar size=\"xl\" fallback=\"BO\" />\n <div>\n <Button variant=\"outline\" size=\"sm\">Change photo</Button>\n <p className=\"mt-2 text-xs text-foreground-subtle\">JPG or PNG, max 2 MB.</p>\n </div>\n </div>\n <Separator />\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <Input label=\"First name\" defaultValue=\"Bay\" />\n <Input label=\"Last name\" defaultValue=\"Otgonbayar\" />\n </div>\n <Input label=\"Display email\" type=\"email\" defaultValue=\"bay@company.com\" />\n <div className=\"flex justify-end\">\n <Button>Save changes</Button>\n </div>\n </CardContent>\n </Card>\n ),\n },\n {\n id: 'security',\n label: 'Security',\n icon: <Lock />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Security</CardTitle>\n <CardDescription>How you sign in and protect your account.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <Input label=\"Current password\" type=\"password\" />\n <Input label=\"New password\" type=\"password\" helperText=\"At least 8 characters.\" />\n <Separator />\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-foreground\">Two-factor authentication</p>\n <p className=\"text-xs text-foreground-subtle\">Required for admin accounts on production.</p>\n </div>\n <Switch defaultChecked />\n </div>\n <div className=\"flex justify-end\">\n <Button>Update password</Button>\n </div>\n </CardContent>\n </Card>\n ),\n },\n {\n id: 'notifications',\n label: 'Notifications',\n icon: <Bell />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Notifications</CardTitle>\n <CardDescription>Choose what we email and ping you about.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <Switch label=\"Product updates\" description=\"A short note when we ship something.\" defaultChecked />\n <Separator />\n <Switch label=\"Mentions\" description=\"When a teammate @ mentions you in a comment.\" defaultChecked />\n <Separator />\n <Switch label=\"Weekly digest\" description=\"A Monday-morning summary of last week's activity.\" />\n </CardContent>\n </Card>\n ),\n },\n {\n id: 'billing',\n label: 'Billing',\n icon: <CreditCard />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Billing</CardTitle>\n <CardDescription>Your plan, invoices, and payment method.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"rounded-md border border-border bg-background-subtle p-4\">\n <p className=\"text-sm font-medium text-foreground\">Team — $20/user/month</p>\n <p className=\"mt-1 text-xs text-foreground-subtle\">Renews on 1 June 2026 · 12 seats</p>\n </div>\n <div className=\"flex justify-end gap-2\">\n <Button variant=\"outline\">Manage seats</Button>\n <Button>Upgrade plan</Button>\n </div>\n </CardContent>\n </Card>\n ),\n },\n {\n id: 'team',\n label: 'Team',\n icon: <Users />,\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Team</CardTitle>\n <CardDescription>Invite teammates and manage roles.</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"flex gap-2\">\n <Input\n type=\"email\"\n placeholder=\"teammate@company.com\"\n hideLabel\n label=\"Invite email\"\n className=\"flex-1\"\n />\n <Button>Send invite</Button>\n </div>\n <p className=\"text-xs text-foreground-subtle\">\n Invited members will receive a sign-up link by email.\n </p>\n </CardContent>\n </Card>\n ),\n },\n];\n\n/**\n * Settings page with a sticky sub-nav on the left and section cards on the right.\n *\n * @example\n * <SettingsPage\n * sections={[\n * { id: 'profile', label: 'Profile', icon: <User />, render: () => <ProfileForm /> },\n * { id: 'team', label: 'Team', icon: <Users />, render: () => <TeamForm /> },\n * ]}\n * defaultSection=\"profile\"\n * />\n */\nexport function SettingsPage({\n title = 'Settings',\n subtitle = 'Manage your account, preferences, and billing.',\n sections = DEMO_SECTIONS,\n defaultSection,\n activeSection,\n onActiveSectionChange,\n className,\n}: SettingsPageProps = {}) {\n const isControlled = activeSection !== undefined;\n const [internal, setInternal] = useState<string>(\n defaultSection ?? sections[0]?.id ?? '',\n );\n const active = isControlled ? activeSection! : internal;\n const setActive = (id: string) => {\n if (!isControlled) setInternal(id);\n onActiveSectionChange?.(id);\n };\n\n return (\n <div className={cn('mx-auto max-w-5xl space-y-8', className)}>\n {(title || subtitle) && (\n <header>\n {title && (\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">{title}</h1>\n )}\n {subtitle && <p className=\"mt-1 text-sm text-foreground-muted\">{subtitle}</p>}\n </header>\n )}\n\n <div className=\"grid gap-8 md:grid-cols-[200px_1fr]\">\n <nav aria-label=\"Settings sections\" className=\"md:sticky md:top-20 md:self-start\">\n <ul className=\"flex flex-col gap-px\">\n {sections.map((s) => (\n <li key={s.id}>\n <button\n type=\"button\"\n onClick={() => setActive(s.id)}\n className={cn(\n 'flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm transition-colors duration-[var(--duration-fast)] outline-none',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n active === s.id\n ? 'bg-background-muted font-medium text-foreground'\n : 'text-foreground-muted hover:bg-background-muted hover:text-foreground',\n )}\n aria-current={active === s.id ? 'page' : undefined}\n >\n {s.icon && <span className=\"[&_svg]:size-4\">{s.icon}</span>}\n {s.label}\n </button>\n </li>\n ))}\n </ul>\n </nav>\n\n <div className=\"space-y-8\">\n {sections.map((s) => (\n <section key={s.id} id={s.id} hidden={active !== s.id}>\n {s.render()}\n </section>\n ))}\n </div>\n </div>\n </div>\n );\n}\n","import { useMemo, useState, type ReactNode } from 'react';\nimport { Download, Filter, Plus, Trash2, Upload } from '@/icons';\nimport { Badge } from '@/components/ui/Badge';\nimport { Button, type ButtonProps } from '@/components/ui/Button';\nimport { Checkbox } from '@/components/ui/Checkbox';\nimport { DataGrid, type DataGridColumn } from '@/components/ui/DataGrid';\nimport { EmptyState } from '@/components/ui/EmptyState';\nimport { Pagination } from '@/components/ui/Pagination';\nimport { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/Select';\n\n/* -----------------------------------------------------------------------------\n * DataTablePage — generic filter + search + bulk-action + grid + pagination\n * scaffold. Generic over row type T (must have an `id`).\n * --------------------------------------------------------------------------- */\n\nexport interface DataTableFilter {\n /** Field key used by the default predicate, and as the React key. */\n key: string;\n label: string;\n /** First option should be the \"all\" / cleared value. */\n options: { value: string; label: string }[];\n /** Initial value. Defaults to the first option's value. */\n defaultValue?: string;\n}\n\nexport interface DataTableBulkAction<T> {\n label: string;\n /** Optional leading icon. */\n icon?: ReactNode;\n variant?: ButtonProps['variant'];\n /** Receives the selected rows. Awaited — toolbar shows a spinner while pending. */\n onAction: (selected: T[]) => void | Promise<void>;\n}\n\nexport interface DataTablePageProps<T extends { id: string | number }> {\n /** Page heading. */\n title?: ReactNode;\n /** Optional subtitle — defaults to a row-count line. */\n subtitle?: ReactNode;\n /** Right-aligned header actions (e.g. New / Import buttons). */\n headerActions?: ReactNode;\n /** Row data. */\n rows?: T[];\n /** Column descriptors. */\n columns?: DataGridColumn<T>[];\n /** Filter selects to render in the toolbar. */\n filters?: DataTableFilter[];\n /** Custom predicate. Receives the row + the active filter values. */\n predicate?: (row: T, filterValues: Record<string, string>, search: string) => boolean;\n /** Search placeholder. */\n searchPlaceholder?: string;\n /** Available rows-per-page sizes. */\n pageSizeOptions?: number[];\n /** Initial page size. */\n defaultPageSize?: number;\n /** Bulk-action buttons shown when rows are selected. */\n bulkActions?: DataTableBulkAction<T>[];\n /** EmptyState rendered when the filtered rows are empty. */\n emptyState?: ReactNode;\n className?: string;\n}\n\n/* -----------------------------------------------------------------------------\n * Default demo data + columns\n * --------------------------------------------------------------------------- */\n\ninterface DemoProject {\n id: string;\n name: string;\n status: 'active' | 'paused' | 'archived';\n owner: string;\n updatedAt: string;\n}\n\nconst DEMO_ROWS: DemoProject[] = [\n { id: 'p1', name: 'Pulse onboarding', status: 'active', owner: 'Anu B.', updatedAt: '2 hours ago' },\n { id: 'p2', name: 'Q2 OKRs rollout', status: 'active', owner: 'Bat E.', updatedAt: 'Yesterday' },\n { id: 'p3', name: 'Legacy export', status: 'paused', owner: 'Tuya G.', updatedAt: '3 days ago' },\n { id: 'p4', name: 'Billing spike', status: 'archived', owner: 'Khulan O.', updatedAt: 'Last week' },\n { id: 'p5', name: 'Marketing refresh', status: 'active', owner: 'Anu B.', updatedAt: 'Last week' },\n];\n\nconst STATUS_TONE = {\n active: { tone: 'success' as const, label: 'Active' },\n paused: { tone: 'warning' as const, label: 'Paused' },\n archived: { tone: 'neutral' as const, label: 'Archived' },\n};\n\nconst DEMO_COLUMNS: DataGridColumn<DemoProject>[] = [\n {\n key: 'name',\n header: 'Name',\n sortable: true,\n cell: (r) => <span className=\"font-medium text-foreground\">{r.name}</span>,\n },\n {\n key: 'status',\n header: 'Status',\n cell: (r) => (\n <Badge tone={STATUS_TONE[r.status].tone} dot>\n {STATUS_TONE[r.status].label}\n </Badge>\n ),\n },\n { key: 'owner', header: 'Owner' },\n { key: 'updatedAt', header: 'Updated', align: 'right' },\n];\n\nconst DEMO_FILTERS: DataTableFilter[] = [\n {\n key: 'status',\n label: 'Status',\n options: [\n { value: 'all', label: 'All statuses' },\n { value: 'active', label: 'Active' },\n { value: 'paused', label: 'Paused' },\n { value: 'archived', label: 'Archived' },\n ],\n },\n];\n\nconst DEMO_HEADER_ACTIONS: ReactNode = (\n <>\n <Button variant=\"outline\" leadingIcon={<Upload />}>Import</Button>\n <Button leadingIcon={<Plus />}>New project</Button>\n </>\n);\n\nconst DEMO_BULK_ACTIONS: DataTableBulkAction<DemoProject>[] = [\n { label: 'Export', icon: <Download />, variant: 'ghost', onAction: () => {} },\n { label: 'Delete', icon: <Trash2 />, variant: 'ghost', onAction: () => {} },\n];\n\n/**\n * Generic data-table page.\n *\n * @example\n * interface User { id: string; name: string; role: string; status: 'active' | 'invited' }\n *\n * <DataTablePage<User>\n * title=\"Members\"\n * rows={users}\n * columns={[\n * { key: 'name', header: 'Name', sortable: true },\n * { key: 'role', header: 'Role' },\n * { key: 'status', header: 'Status', cell: (r) => <Badge>{r.status}</Badge> },\n * ]}\n * filters={[\n * { key: 'status', label: 'Status', options: [\n * { value: 'all', label: 'All' },\n * { value: 'active', label: 'Active' },\n * { value: 'invited', label: 'Invited' },\n * ]},\n * ]}\n * bulkActions={[\n * { label: 'Remove', variant: 'destructive', onAction: (rows) => api.remove(rows) },\n * ]}\n * />\n */\nexport function DataTablePage<T extends { id: string | number }>({\n title = 'Projects',\n subtitle,\n headerActions = DEMO_HEADER_ACTIONS,\n rows: rowsProp,\n columns: columnsProp,\n filters: filtersProp,\n predicate,\n searchPlaceholder = 'Search…',\n pageSizeOptions = [10, 20, 50],\n defaultPageSize = 10,\n bulkActions: bulkActionsProp,\n emptyState,\n className,\n}: DataTablePageProps<T> = {}) {\n // Defaults — typed back through `T` via assertions. Consumers replace\n // everything when they pass their own rows/columns.\n const rows = (rowsProp ?? (DEMO_ROWS as unknown as T[])) as T[];\n const columns =\n (columnsProp ?? (DEMO_COLUMNS as unknown as DataGridColumn<T>[])) as DataGridColumn<T>[];\n const filters = filtersProp ?? DEMO_FILTERS;\n const bulkActions =\n (bulkActionsProp ?? (DEMO_BULK_ACTIONS as unknown as DataTableBulkAction<T>[])) as DataTableBulkAction<T>[];\n\n const [query, setQuery] = useState('');\n const [filterValues, setFilterValues] = useState<Record<string, string>>(() => {\n const init: Record<string, string> = {};\n for (const f of filters) init[f.key] = f.defaultValue ?? f.options[0]?.value ?? '';\n return init;\n });\n const [selectedIds, setSelectedIds] = useState<(string | number)[]>([]);\n const [page, setPage] = useState(1);\n const [pageSize, setPageSize] = useState(defaultPageSize);\n\n const filtered = useMemo(() => {\n const defaultPred = (row: T) => {\n // Default behavior: substring match on every string field for `query`,\n // and exact-match on filterValues[key] === row[key] (skipping 'all').\n const q = query.toLowerCase();\n if (q) {\n const hasMatch = Object.values(row as Record<string, unknown>).some(\n (v) => typeof v === 'string' && v.toLowerCase().includes(q),\n );\n if (!hasMatch) return false;\n }\n for (const [key, value] of Object.entries(filterValues)) {\n if (!value || value === 'all') continue;\n if ((row as Record<string, unknown>)[key] !== value) return false;\n }\n return true;\n };\n return rows.filter((row) =>\n predicate ? predicate(row, filterValues, query) : defaultPred(row),\n );\n }, [rows, query, filterValues, predicate]);\n\n const allOnPageSelected =\n filtered.length > 0 && filtered.every((r) => selectedIds.includes(r.id));\n const someSelected = selectedIds.length > 0 && !allOnPageSelected;\n\n const selectedRows = useMemo(\n () => rows.filter((r) => selectedIds.includes(r.id)),\n [rows, selectedIds],\n );\n\n const totalPages = Math.max(1, Math.ceil(filtered.length / pageSize));\n const pageRows = filtered.slice((page - 1) * pageSize, page * pageSize);\n\n const augmentedColumns: DataGridColumn<T>[] = [\n {\n key: '__select',\n header: (\n <Checkbox\n checked={allOnPageSelected ? true : someSelected ? 'indeterminate' : false}\n onCheckedChange={(v) =>\n setSelectedIds(v ? filtered.map((r) => r.id) : [])\n }\n aria-label=\"Select all rows\"\n />\n ),\n width: '32px',\n cell: (r: T) => (\n <Checkbox\n checked={selectedIds.includes(r.id)}\n onCheckedChange={(v) =>\n setSelectedIds((prev) =>\n v ? [...prev, r.id] : prev.filter((id) => id !== r.id),\n )\n }\n aria-label=\"Select row\"\n />\n ),\n },\n ...columns,\n ];\n\n return (\n <div className={`space-y-6 ${className ?? ''}`}>\n <header className=\"flex items-end justify-between gap-4\">\n <div>\n {title && (\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">{title}</h1>\n )}\n <p className=\"mt-1 text-sm text-foreground-muted\">\n {subtitle ?? `${filtered.length} item${filtered.length === 1 ? '' : 's'} match your filters.`}\n </p>\n </div>\n {headerActions && <div className=\"flex items-center gap-2\">{headerActions}</div>}\n </header>\n\n {(filters.length > 0 || bulkActions.length > 0) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {filters.map((f) => (\n <Select\n key={f.key}\n value={filterValues[f.key]}\n onValueChange={(v) => setFilterValues((prev) => ({ ...prev, [f.key]: v }))}\n >\n <SelectTrigger className=\"w-40\" placeholder={f.label} />\n <SelectContent>\n {f.options.map((o) => (\n <SelectItem key={o.value} value={o.value}>\n {o.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ))}\n <Button variant=\"outline\" size=\"sm\" leadingIcon={<Filter />}>\n More filters\n </Button>\n </div>\n )}\n\n {selectedIds.length > 0 && bulkActions.length > 0 && (\n <div className=\"flex items-center justify-between rounded-md border border-border bg-background-subtle px-4 py-2\">\n <div className=\"flex items-center gap-3\">\n <Checkbox\n checked={allOnPageSelected ? true : someSelected ? 'indeterminate' : false}\n onCheckedChange={(v) =>\n setSelectedIds(v ? filtered.map((r) => r.id) : [])\n }\n aria-label=\"Select all\"\n />\n <span className=\"text-sm text-foreground\">{selectedIds.length} selected</span>\n </div>\n <div className=\"flex items-center gap-2\">\n {bulkActions.map((a) => (\n <Button\n key={a.label}\n variant={a.variant ?? 'ghost'}\n size=\"sm\"\n leadingIcon={a.icon}\n onClick={() => a.onAction(selectedRows)}\n >\n {a.label}\n </Button>\n ))}\n </div>\n </div>\n )}\n\n <DataGrid\n rows={pageRows}\n filter={{ value: query, onChange: setQuery, placeholder: searchPlaceholder }}\n emptyState={\n emptyState ?? (\n <EmptyState\n title=\"No results\"\n description=\"Try adjusting filters or your search.\"\n className=\"border-0 bg-transparent\"\n />\n )\n }\n columns={augmentedColumns}\n />\n\n <Pagination\n page={page}\n pageCount={totalPages}\n onPageChange={setPage}\n totalItems={filtered.length}\n pageSize={pageSize}\n pageSizeOptions={pageSizeOptions}\n onPageSizeChange={(s) => {\n setPageSize(s);\n setPage(1);\n }}\n />\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Edit2, ExternalLink, Trash2 } from '@/icons';\nimport { Avatar } from '@/components/ui/Avatar';\nimport { Badge } from '@/components/ui/Badge';\nimport { Breadcrumbs } from '@/components/ui/Breadcrumbs';\nimport { Button } from '@/components/ui/Button';\nimport { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card';\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/Tabs';\n\n/* -----------------------------------------------------------------------------\n * RecordDetail — header + tabs + side panel layout for any \"thing detail\n * page\" (user, project, ticket, order).\n * --------------------------------------------------------------------------- */\n\nexport interface RecordDetailHeader {\n title: ReactNode;\n subtitle?: ReactNode;\n /** Optional status pill rendered next to the title. */\n status?: ReactNode;\n /** Right-aligned action buttons. */\n actions?: ReactNode;\n /** Breadcrumb trail rendered above the header. */\n breadcrumbs?: { label: ReactNode; href?: string }[];\n}\n\nexport interface RecordDetailTab {\n id: string;\n label: ReactNode;\n render: () => ReactNode;\n}\n\nexport interface RecordDetailProps {\n header?: RecordDetailHeader;\n tabs?: RecordDetailTab[];\n /** Initial tab id. Defaults to the first tab. */\n defaultTab?: string;\n /** Optional right-side panel (related items, details list, watchers, …). */\n sidePanel?: ReactNode;\n className?: string;\n}\n\n/* -----------------------------------------------------------------------------\n * Defaults — used when consumers render <RecordDetail /> with no props.\n * --------------------------------------------------------------------------- */\n\nconst DEMO_HEADER: RecordDetailHeader = {\n title: 'Pulse onboarding',\n subtitle:\n 'Self-serve onboarding flow for new admins. Owns the first 5 minutes of every workspace.',\n status: (\n <Badge tone=\"success\" dot>\n Active\n </Badge>\n ),\n actions: (\n <>\n <Button variant=\"outline\" leadingIcon={<Edit2 />}>\n Edit\n </Button>\n <Button variant=\"outline\" leadingIcon={<Trash2 />}>\n Archive\n </Button>\n <Button trailingIcon={<ExternalLink />}>Open in app</Button>\n </>\n ),\n breadcrumbs: [{ label: 'Projects', href: '/projects' }, { label: 'Pulse onboarding' }],\n};\n\nconst DEMO_TABS: RecordDetailTab[] = [\n {\n id: 'overview',\n label: 'Overview',\n render: () => (\n <Card>\n <CardHeader>\n <CardTitle>Summary</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2 leading-relaxed text-foreground-muted\">\n <p>\n The Pulse onboarding flow walks new admins through workspace creation, teammate\n invites, and first-data import in under five minutes.\n </p>\n <p>\n Completion rate sits at 71% (week-over-week +4 pts) and median time to finish is 4 m\n 22 s.\n </p>\n </CardContent>\n </Card>\n ),\n },\n { id: 'activity', label: 'Activity', render: () => <P>Activity feed appears here.</P> },\n { id: 'files', label: 'Files', render: () => <P>Linked documents appear here.</P> },\n { id: 'settings', label: 'Settings', render: () => <P>Project settings appear here.</P> },\n];\n\nconst DEMO_SIDE_PANEL: ReactNode = (\n <>\n <Card>\n <CardHeader>\n <CardTitle>Details</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3 text-sm\">\n <Row label=\"Owner\" value={<><Avatar size=\"xs\" fallback=\"AB\" /> Anu B.</>} />\n <Row label=\"Created\" value=\"12 Feb 2026\" />\n <Row label=\"Updated\" value=\"2 hours ago\" />\n <Row\n label=\"Tags\"\n value={\n <>\n <Badge tone=\"accent\">growth</Badge>{' '}\n <Badge tone=\"neutral\" variant=\"outline\">v2</Badge>\n </>\n }\n />\n </CardContent>\n </Card>\n <Card>\n <CardHeader>\n <CardTitle>Watchers</CardTitle>\n </CardHeader>\n <CardContent>\n <div className=\"flex -space-x-2\">\n <Avatar fallback=\"AB\" />\n <Avatar fallback=\"BE\" />\n <Avatar fallback=\"TG\" />\n <Avatar fallback=\"+2\" />\n </div>\n </CardContent>\n </Card>\n </>\n);\n\n/**\n * Record detail page — header (breadcrumbs + title + actions) + tabs + side panel.\n *\n * @example\n * <RecordDetail\n * header={{\n * title: project.name,\n * subtitle: project.description,\n * status: <Badge tone=\"success\">Active</Badge>,\n * actions: <Button>Share</Button>,\n * breadcrumbs: [{ label: 'Projects', href: '/projects' }, { label: project.name }],\n * }}\n * tabs={[\n * { id: 'overview', label: 'Overview', render: () => <Overview project={project} /> },\n * { id: 'activity', label: 'Activity', render: () => <Activity projectId={project.id} /> },\n * ]}\n * sidePanel={<RelatedItems project={project} />}\n * />\n */\nexport function RecordDetail({\n header = DEMO_HEADER,\n tabs = DEMO_TABS,\n defaultTab,\n sidePanel = DEMO_SIDE_PANEL,\n className,\n}: RecordDetailProps = {}) {\n const initialTab = defaultTab ?? tabs[0]?.id ?? '';\n return (\n <div className={`space-y-6 ${className ?? ''}`}>\n {header.breadcrumbs && header.breadcrumbs.length > 0 && (\n <Breadcrumbs items={header.breadcrumbs} />\n )}\n\n <header className=\"flex items-start justify-between gap-4\">\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-3\">\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">\n {header.title}\n </h1>\n {header.status}\n </div>\n {header.subtitle && (\n <p className=\"max-w-2xl text-sm text-foreground-muted\">{header.subtitle}</p>\n )}\n </div>\n {header.actions && <div className=\"flex items-center gap-2\">{header.actions}</div>}\n </header>\n\n <div\n className={\n sidePanel ? 'grid gap-6 lg:grid-cols-[1fr_320px]' : 'min-w-0'\n }\n >\n <div className=\"min-w-0\">\n <Tabs defaultValue={initialTab}>\n <TabsList>\n {tabs.map((t) => (\n <TabsTrigger key={t.id} value={t.id}>\n {t.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((t) => (\n <TabsContent key={t.id} value={t.id} className=\"space-y-4\">\n {t.render()}\n </TabsContent>\n ))}\n </Tabs>\n </div>\n\n {sidePanel && <aside className=\"space-y-4\">{sidePanel}</aside>}\n </div>\n </div>\n );\n}\n\nfunction Row({ label, value }: { label: string; value: ReactNode }) {\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-foreground-subtle\">{label}</span>\n <span className=\"flex items-center gap-1.5 text-foreground\">{value}</span>\n </div>\n );\n}\n\nfunction P({ children }: { children: ReactNode }) {\n return <p className=\"text-sm text-foreground-muted\">{children}</p>;\n}\n","import { useState, type ReactNode } from 'react';\nimport { ArrowLeft, ArrowRight, CheckCircle2 } from '@/icons';\nimport { Button } from '@/components/ui/Button';\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/Card';\nimport { Input } from '@/components/ui/Input';\nimport { RadioGroup, RadioItem } from '@/components/ui/RadioGroup';\nimport { Stepper } from '@/components/ui/Stepper';\n\n/* -----------------------------------------------------------------------------\n * Onboarding — multi-step wizard. Steps are declared as data; each step\n * renders into a Card with a Stepper at the top and Back/Next controls below.\n * --------------------------------------------------------------------------- */\n\nexport interface OnboardingStepContext<T = unknown> {\n /** Move to the next step. */\n next: () => void;\n /** Move to the previous step. */\n prev: () => void;\n /** Jump to a step by index. */\n goTo: (index: number) => void;\n /** Finish the flow — calls onComplete. */\n finish: () => void;\n /** Current accumulated data across steps. */\n data: T;\n /** Patch the accumulated data. */\n setData: (patch: Partial<T>) => void;\n}\n\nexport interface OnboardingStep<T = unknown> {\n /** Stable id used for keys + analytics. */\n id: string;\n /** Title shown in the Stepper. */\n title: string;\n /** Optional sub-description shown only in vertical Stepper. */\n description?: string;\n /** Card heading rendered when the step is active. */\n heading: ReactNode;\n /** Card description rendered under the heading. */\n subheading?: ReactNode;\n /** Step body. Receives navigation controls + shared data. */\n render: (ctx: OnboardingStepContext<T>) => ReactNode;\n /** Override the Continue / Finish button label. */\n ctaLabel?: string;\n /** Hide the default Back/Next bar — render your own inside `render`. */\n hideNavigation?: boolean;\n}\n\nexport interface OnboardingProps<T = unknown> {\n steps?: OnboardingStep<T>[];\n /** Initial accumulated data. */\n initialData?: T;\n /** Called when the user advances past the last step. */\n onComplete?: (data: T) => void | Promise<void>;\n className?: string;\n}\n\n/* -----------------------------------------------------------------------------\n * Default demo content — used when consumers render <Onboarding /> with no\n * steps prop, and on the showcase preview page.\n * --------------------------------------------------------------------------- */\n\ninterface DemoData {\n workspaceName?: string;\n slug?: string;\n inviteEmail?: string;\n role?: string;\n source?: string;\n}\n\nconst DEMO_STEPS: OnboardingStep<DemoData>[] = [\n {\n id: 'workspace',\n title: 'Workspace',\n heading: 'Create your workspace',\n subheading: 'A workspace is where your team and projects live.',\n render: ({ data, setData }) => (\n <>\n <Input\n label=\"Workspace name\"\n placeholder=\"Acme Inc.\"\n value={data.workspaceName ?? ''}\n onChange={(e) => setData({ workspaceName: e.target.value })}\n />\n <Input\n label=\"URL slug\"\n prefix={<span>acme.app/</span>}\n placeholder=\"acme\"\n value={data.slug ?? ''}\n onChange={(e) => setData({ slug: e.target.value })}\n />\n </>\n ),\n },\n {\n id: 'invite',\n title: 'Invite team',\n heading: 'Invite your team',\n subheading: 'You can always invite more people later.',\n render: ({ data, setData }) => (\n <>\n <Input\n type=\"email\"\n label=\"Invite by email\"\n placeholder=\"teammate@company.com\"\n helperText=\"Separate multiple emails with commas.\"\n value={data.inviteEmail ?? ''}\n onChange={(e) => setData({ inviteEmail: e.target.value })}\n />\n <RadioGroup\n value={data.role ?? 'member'}\n onValueChange={(role) => setData({ role })}\n >\n <RadioItem value=\"admin\" label=\"Admin\" description=\"Can manage workspace and billing.\" />\n <RadioItem value=\"member\" label=\"Member\" description=\"Can create and edit projects.\" />\n <RadioItem value=\"viewer\" label=\"Viewer\" description=\"Read-only access.\" />\n </RadioGroup>\n </>\n ),\n },\n {\n id: 'data',\n title: 'Connect data',\n heading: 'Connect a data source',\n subheading: 'Pick one — others can be added in settings.',\n render: ({ data, setData }) => (\n <>\n <p className=\"text-sm text-foreground-muted\">\n Connect your data source so we can populate your first dashboard.\n </p>\n <div className=\"grid grid-cols-2 gap-2\">\n {['Postgres', 'BigQuery', 'Snowflake', 'CSV upload'].map((src) => {\n const active = data.source === src;\n return (\n <button\n key={src}\n type=\"button\"\n onClick={() => setData({ source: src })}\n aria-pressed={active}\n className={`rounded-lg border bg-card p-4 text-left transition-colors duration-[var(--duration-fast)] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background ${\n active\n ? 'border-accent bg-accent-soft'\n : 'border-border hover:border-border-strong hover:bg-background-subtle'\n }`}\n >\n <p className=\"font-medium text-foreground\">{src}</p>\n <p className=\"mt-1 text-xs text-foreground-subtle\">Quick setup with SSO</p>\n </button>\n );\n })}\n </div>\n </>\n ),\n },\n {\n id: 'done',\n title: 'Done',\n heading: 'Welcome aboard',\n subheading: \"We've set up your starting dashboard.\",\n ctaLabel: 'Open workspace',\n render: () => (\n <div className=\"flex flex-col items-center gap-3 py-6 text-center\">\n <CheckCircle2 className=\"size-10 text-success-text\" aria-hidden />\n <p className=\"text-base font-medium text-foreground\">You're all set.</p>\n <p className=\"max-w-sm text-sm text-foreground-muted\">\n Your workspace is ready. We've sent invites and your first dashboard is loading.\n </p>\n </div>\n ),\n },\n];\n\n/**\n * Multi-step onboarding wizard.\n *\n * @example\n * <Onboarding<{ name: string; email: string }>\n * initialData={{ name: '', email: '' }}\n * steps={[\n * { id: 'name', title: 'Name', heading: 'What should we call you?',\n * render: ({ data, setData }) =>\n * <Input value={data.name} onChange={(e) => setData({ name: e.target.value })} /> },\n * …\n * ]}\n * onComplete={async (data) => api.completeOnboarding(data)}\n * />\n */\nexport function Onboarding<T = DemoData>({\n steps = DEMO_STEPS as unknown as OnboardingStep<T>[],\n initialData = {} as T,\n onComplete,\n className,\n}: OnboardingProps<T> = {}) {\n const [step, setStep] = useState(0);\n const [data, setDataState] = useState<T>(initialData);\n\n const setData = (patch: Partial<T>) =>\n setDataState((prev) => ({ ...prev, ...patch }) as T);\n\n const goTo = (i: number) => setStep(Math.max(0, Math.min(i, steps.length - 1)));\n const next = () => goTo(step + 1);\n const prev = () => goTo(step - 1);\n const finish = async () => {\n if (onComplete) await onComplete(data);\n };\n\n const ctx: OnboardingStepContext<T> = { next, prev, goTo, finish, data, setData };\n const current = steps[step];\n const isLast = step === steps.length - 1;\n\n return (\n <div className={`mx-auto max-w-2xl space-y-8 py-12 ${className ?? ''}`}>\n <Stepper steps={steps.map((s) => ({ title: s.title, description: s.description }))} current={step} />\n\n <Card>\n <CardHeader>\n <CardTitle>{current.heading}</CardTitle>\n {current.subheading && <CardDescription>{current.subheading}</CardDescription>}\n </CardHeader>\n <CardContent className=\"space-y-4\">{current.render(ctx)}</CardContent>\n </Card>\n\n {!current.hideNavigation && (\n <div className=\"flex items-center justify-between\">\n <Button\n variant=\"ghost\"\n leadingIcon={<ArrowLeft />}\n onClick={prev}\n disabled={step === 0}\n >\n Back\n </Button>\n <Button\n trailingIcon={isLast ? undefined : <ArrowRight />}\n onClick={isLast ? finish : next}\n >\n {current.ctaLabel ?? (isLast ? 'Finish' : 'Continue')}\n </Button>\n </div>\n )}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Check } from '@/icons';\nimport { Badge } from '@/components/ui/Badge';\nimport { Button } from '@/components/ui/Button';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Pricing — N-tier comparison grid. Tiers are declared as data so consumers\n * can change copy, count, and CTA behavior without touching the layout.\n * --------------------------------------------------------------------------- */\n\nexport interface PricingTier {\n name: string;\n /** Price string. Pre-formatted — render '$0', '$20', 'Custom', '¥1,200', etc. */\n price: string;\n /** Cadence label rendered next to the price ('per user / month'). */\n cadence?: string;\n description?: string;\n features: string[];\n /** CTA label. */\n cta: string;\n /** Mark this tier as the recommended one — adds accent border + badge. */\n highlighted?: boolean;\n /** Click handler for the CTA. */\n onSelect?: () => void;\n}\n\nexport interface PricingProps {\n /** Top heading. */\n title?: ReactNode;\n /** Subtitle under the heading. */\n subtitle?: ReactNode;\n /** Tier descriptors. */\n tiers?: PricingTier[];\n /** Label shown on the highlighted tier badge. */\n highlightedLabel?: string;\n className?: string;\n}\n\nconst DEFAULT_TIERS: PricingTier[] = [\n {\n name: 'Starter',\n price: '$0',\n cadence: 'forever',\n description: 'For individuals exploring the product.',\n features: ['Up to 3 projects', 'Community support', 'Single workspace'],\n cta: 'Start free',\n },\n {\n name: 'Team',\n price: '$20',\n cadence: 'per user / month',\n description: 'For small teams running real workloads.',\n features: [\n 'Unlimited projects',\n 'Email support, 24h response',\n 'SSO via Google & Microsoft',\n 'Audit log (30 days)',\n ],\n cta: 'Start 14-day trial',\n highlighted: true,\n },\n {\n name: 'Enterprise',\n price: 'Custom',\n cadence: 'annual',\n description: 'For organisations with custom requirements.',\n features: [\n 'Everything in Team',\n 'SAML SSO + SCIM',\n 'Dedicated CSM',\n 'SOC 2 report + DPA',\n 'Audit log (unlimited)',\n ],\n cta: 'Talk to sales',\n },\n];\n\n/**\n * Pricing grid. Defaults to a 3-tier demo if `tiers` is omitted.\n *\n * @example\n * <Pricing\n * title=\"Plans\"\n * tiers={[\n * { name: 'Free', price: '$0', features: ['…'], cta: 'Start' },\n * { name: 'Pro', price: '$12', features: ['…'], cta: 'Upgrade', highlighted: true },\n * ]}\n * />\n */\nexport function Pricing({\n title = 'Plans that scale with your team',\n subtitle = 'Start free, upgrade when you need more. All paid plans include a 14-day trial — no credit card required.',\n tiers = DEFAULT_TIERS,\n highlightedLabel = 'Most popular',\n className,\n}: PricingProps = {}) {\n const cols = tiers.length;\n return (\n <div className={cn('mx-auto max-w-5xl space-y-8 py-16', className)}>\n <header className=\"space-y-3 text-center\">\n <h1 className=\"text-3xl font-semibold tracking-tight text-foreground\">{title}</h1>\n {subtitle && <p className=\"mx-auto max-w-xl text-sm text-foreground-muted\">{subtitle}</p>}\n </header>\n\n <div\n className={cn(\n 'grid gap-4',\n cols === 2 && 'md:grid-cols-2',\n cols === 3 && 'md:grid-cols-3',\n cols === 4 && 'md:grid-cols-2 lg:grid-cols-4',\n cols > 4 && 'md:grid-cols-3',\n )}\n >\n {tiers.map((tier) => (\n <div\n key={tier.name}\n className={cn(\n 'flex flex-col gap-6 rounded-lg border bg-card p-6',\n tier.highlighted ? 'border-accent shadow-sm' : 'border-border',\n )}\n >\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-foreground\">{tier.name}</h2>\n {tier.highlighted && <Badge tone=\"accent\">{highlightedLabel}</Badge>}\n </div>\n {tier.description && (\n <p className=\"text-sm text-foreground-muted\">{tier.description}</p>\n )}\n </div>\n\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"tabular text-3xl font-semibold text-foreground\">{tier.price}</span>\n {tier.cadence && (\n <span className=\"text-sm text-foreground-subtle\">{tier.cadence}</span>\n )}\n </div>\n\n <ul className=\"space-y-2 text-sm\">\n {tier.features.map((f) => (\n <li key={f} className=\"flex items-start gap-2 text-foreground\">\n <Check className=\"mt-0.5 size-4 shrink-0 text-accent\" aria-hidden />\n {f}\n </li>\n ))}\n </ul>\n\n <Button\n variant={tier.highlighted ? 'primary' : 'outline'}\n className=\"mt-auto w-full\"\n onClick={tier.onSelect}\n >\n {tier.cta}\n </Button>\n </div>\n ))}\n </div>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { ArrowRight, Folder, Plus, Upload, Users } from '@/icons';\nimport { Button } from '@/components/ui/Button';\nimport { Card, CardContent } from '@/components/ui/Card';\nimport { EmptyState } from '@/components/ui/EmptyState';\n\n/* -----------------------------------------------------------------------------\n * First-run empty product state. Combines a hero EmptyState with N\n * \"next step\" cards — common pattern across Linear, Notion, Vercel.\n * --------------------------------------------------------------------------- */\n\nexport interface FirstRunNextStep {\n icon?: ReactNode;\n title: string;\n description: string;\n cta: string;\n onSelect?: () => void;\n}\n\nexport interface FirstRunEmptyProps {\n /** Hero icon — typically a folder, sparkles, or product mark. */\n heroIcon?: ReactNode;\n /** Hero title. */\n title?: ReactNode;\n /** Hero subtitle. */\n description?: ReactNode;\n /** Primary CTA inside the hero (top tutorial / overview action). */\n primaryAction?: ReactNode;\n /** Next-step cards rendered below the hero. */\n steps?: FirstRunNextStep[];\n className?: string;\n}\n\nconst DEFAULT_STEPS: FirstRunNextStep[] = [\n {\n icon: <Plus />,\n title: 'Create a project',\n description: 'Track a real piece of work end-to-end.',\n cta: 'New project',\n },\n {\n icon: <Upload />,\n title: 'Import existing data',\n description: 'CSV, Postgres, BigQuery, or Snowflake — connect in a minute.',\n cta: 'Connect source',\n },\n {\n icon: <Users />,\n title: 'Invite your team',\n description: \"Workspaces are better with teammates. We'll send the invites.\",\n cta: 'Invite people',\n },\n];\n\n/**\n * First-run empty product state.\n *\n * @example Default (uses built-in placeholder copy)\n * <FirstRunEmpty />\n *\n * @example Customized\n * <FirstRunEmpty\n * heroIcon={<Illustrations.InboxEmpty className=\"size-16\" />}\n * title=\"Welcome to Atlas\"\n * description=\"Pick a starting point.\"\n * steps={[\n * { icon: <Plus />, title: 'New project', description: '…', cta: 'Create' },\n * { icon: <Github />, title: 'Import repo', description: '…', cta: 'Connect' },\n * ]}\n * />\n */\nexport function FirstRunEmpty({\n heroIcon = <Folder className=\"size-6\" />,\n title = 'Your workspace is ready',\n description = 'Start with one of the steps below — you can always come back to the others.',\n primaryAction = <Button trailingIcon={<ArrowRight />}>Open tutorial</Button>,\n steps = DEFAULT_STEPS,\n className,\n}: FirstRunEmptyProps = {}) {\n return (\n <div className={`mx-auto max-w-3xl space-y-8 py-12 ${className ?? ''}`}>\n <EmptyState icon={heroIcon} title={title} description={description} action={primaryAction} />\n\n {steps.length > 0 && (\n <div className=\"grid gap-3 md:grid-cols-3\">\n {steps.map((s) => (\n <Card key={s.title} variant=\"interactive\">\n <CardContent className=\"space-y-3\">\n {s.icon && (\n <div className=\"inline-flex size-9 items-center justify-center rounded-md bg-accent-soft text-on-accent-soft [&_svg]:size-4\">\n {s.icon}\n </div>\n )}\n <div className=\"space-y-1\">\n <h3 className=\"text-sm font-semibold text-foreground\">{s.title}</h3>\n <p className=\"text-xs text-foreground-muted leading-relaxed\">{s.description}</p>\n </div>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n trailingIcon={<ArrowRight />}\n onClick={s.onSelect}\n >\n {s.cta}\n </Button>\n </CardContent>\n </Card>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"names":["cn","inputs","twMerge","clsx","__idCounter","uid","prefix","useMediaQuery","query","matches","setMatches","useState","useEffect","list","onChange","event","usePrefersReducedMotion","store","listener","t","id","next","useToast","toasts","setToasts","push","useCallback","dismiss","remove","toast","Base","className","children","props","jsx","InboxEmpty","jsxs","NoSearchResults","NotFound","ServerError","Construction","ConnectionLost","Accordion","AccordionPrimitive","AccordionItem","forwardRef","ref","AccordionTrigger","ChevronDown","AccordionContent","alert","cva","iconForVariant","Info","CheckCircle2","AlertTriangle","XCircle","Alert","variant","title","dismissible","onDismiss","icon","open","setOpen","handleDismiss","renderedIcon","X","sizeMap","avatarWrapper","statusColour","Avatar","size","src","alt","fallback","status","AvatarPrimitive","AvatarGroup","max","items","visible","overflow","child","i","badge","dotColour","Badge","tone","dot","Breadcrumbs","maxItems","renderLink","displayItems","it","isLast","MoreHorizontal","ChevronRight","item","labelNode","button","Button","asChild","loading","leadingIcon","trailingIcon","disabled","type","isDisabled","classes","Slot","Loader2","card","Card","padding","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","Checkbox","label","description","error","hideLabel","autoId","useId","fieldId","descId","errorId","CheckboxPrimitive","Minus","Check","Combobox","value","options","loadOptions","helperText","placeholder","searchPlaceholder","emptyText","clearable","helperId","setQuery","loaded","setLoaded","setLoading","cancelled","res","selected","useMemo","o","triggerHeight","triggerPadding","handleClear","e","isError","PopoverPrimitive","ChevronsUpDown","CommandPrimitive","opt","isSelected","v","Command","CommandInput","Search","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","CommandDialog","onOpenChange","DialogPrimitive","useCommandPaletteShortcut","_","force","onKey","n","ContextMenu","ContextMenuPrimitive","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","itemClasses","ContextMenuSubTrigger","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","destructive","ContextMenuCheckboxItem","ContextMenuRadioItem","Circle","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut","DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","inset","DropdownMenuSubContent","DropdownMenuContent","sideOffset","align","DropdownMenuItem","DropdownMenuCheckboxItem","checked","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","iconButton","IconButton","field","innerInput","Input","suffix","onClear","showPassword","setShowPassword","effectiveType","effectiveTone","renderedPrefix","hasValue","p","EyeOff","Eye","Table","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","TableSortHeader","sortKey","currentSort","onSortChange","active","direction","handle","ArrowUp","ArrowDown","ArrowUpDown","Skeleton","DataGrid","columns","rows","sort","filter","emptyState","hidden","setHidden","visibleColumns","c","renderRows","row","Settings","prev","k","d","Calendar","classNames","_ref","DayPicker","orientation","ChevronLeft","formatDate","PickerTrigger","CalendarIcon","DatePicker","fromDate","toDate","DateRangePicker","DesignSystemProvider","tokens","style","css","key","brandPresets","Dialog","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","DialogContent","showClose","DialogHeader","DialogFooter","DialogTitle","DialogDescription","ConfirmationDialog","confirmLabel","cancelLabel","confirmVariant","onConfirm","EmptyState","illustration","action","secondaryAction","presets","ErrorState","onRetry","preset","Form","FormProvider","FormFieldContext","createContext","FormField","Controller","FormItemContext","useFormField","fieldContext","useContext","itemContext","getFieldState","formState","useFormContext","fieldState","FormItem","FormLabel","formItemId","LabelPrimitive","FormControl","formDescriptionId","formMessageId","FormDescription","FormError","body","Kbd","MultiSelect","maxVisibleChips","inputRef","useRef","toggle","x","clear","handleKeyDown","visibleChips","_a","Select","SelectPrimitive","SelectValue","SelectTrigger","scrollBtn","SelectScrollUpButton","ChevronUp","SelectScrollDownButton","SelectContent","position","SelectLabel","SelectItem","SelectSeparator","SelectGroup","pageRange","current","total","window","result","start","end","Pagination","page","pageCount","onPageChange","totalItems","pageSize","pageSizeOptions","onPageSizeChange","showJump","pages","from","to","goto","s","navButtonClass","ChevronsLeft","ChevronsRight","Popover","PopoverTrigger","PopoverAnchor","PopoverClose","PopoverContent","heightMap","fillTone","Progress","indeterminate","ProgressPrimitive","circleTone","ProgressCircle","thickness","isIndeterminate","radius","circumference","offset","RadioGroup","RadioGroupPrimitive","RadioItem","ScrollArea","ScrollAreaPrimitive","ScrollBar","Separator","decorative","SeparatorPrimitive","Sheet","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","sheet","SheetContent","side","SheetHeader","SheetFooter","SheetTitle","SheetDescription","SidebarContext","useSidebar","Sidebar","defaultCollapsed","controlled","onCollapsedChange","header","footer","internal","setInternal","collapsed","setCollapsed","SidebarSection","SidebarItem","href","trailing","sub","Comp","SidebarGroup","defaultOpen","Fragment","Slider","showValue","formatValue","defaultValue","currentValue","isRange","SliderPrimitive","toneMap","Spinner","Stepper","steps","step","state","trackSize","thumbSize","Switch","labelPosition","control","SwitchPrimitive","labelBlock","Tabs","TabsPrimitive","TabsList","TabsTrigger","TabsContent","Textarea","autoResize","minRows","maxRows","innerRef","setRef","node","recompute","el","maxH","ToastProvider","ToastPrimitive","ToastViewport","iconMap","Toast","ToastTitle","ToastDescription","ToastAction","ToastClose","TooltipProvider","delayDuration","skipDelayDuration","TooltipPrimitive","TooltipRoot","TooltipTrigger","TooltipContent","Tooltip","TopNav","logo","nav","search","actions","TopNavLink","CarouselContext","useCarousel","ctx","Carousel","opts","setApi","carouselRef","api","useEmblaCarousel","canPrev","setCanPrev","canNext","setCanNext","onSelect","CarouselContent","CarouselItem","CarouselPrevious","scrollPrev","CarouselNext","scrollNext","useScales","data","w","h","ys","min","range","innerW","innerH","LineChart","height","width","caption","sx","sy","path","AreaChart","top","area","BarChart","gap","barW","Drawer","shouldScaleBackground","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","directionStyles","handleStyles","DrawerContent","hideHandle","isHorizontal","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription","formatSize","bytes","FileUpload","accept","multiple","maxSize","hint","inputId","over","setOver","files","update","addFiles","incoming","arr","f","idx","onDrop","Upload","file","FileIcon","snackbar","Snackbar","onClose","TagInput","separators","draft","setDraft","tags","commit","raw","Timeline","TimelineItem","bullet","TimelineTime","TimelineTitle","TimelineDescription","Tree","defaultExpanded","selectedId","expanded","setExpanded","cur","renderNode","depth","hasChildren","isOpen","DefaultIcon","FolderOpen","Folder","AuthLayout","brand","subtitle","SignInForm","onSubmit","forgotHref","email","setEmail","password","setPassword","ArrowRight","SignUpForm","name","setName","ForgotPasswordForm","Mail","MagicLinkSent","onResend","navigate","hash","DEFAULT_NAV_SECTIONS","Home","Inbox","Users","BarChart3","Bookmark","LayoutGrid","Plug","HelpCircle","DEFAULT_USER","DEFAULT_NOTIFICATIONS","DEFAULT_PROFILE_MENU","User","Sparkles","LogOut","AppShell","navSections","sidebar","topbarActions","user","profileMenu","notifications","onMarkAllNotificationsRead","onViewAllNotifications","ProfileFooter","RenderNavSections","TopBar","sections","section","si","searchNode","Menu","NotificationMenu","ProfileMenu","onMarkAllRead","onViewAll","unread","Bell","DEFAULT_CHART_DATA","trend","weekly","noise","DEFAULT_STATS","DEFAULT_ACTIVITY","Dashboard","headerActions","stats","chart","chartTitle","chartDescription","activity","activityTitle","r","DEMO_SECTIONS","Lock","CreditCard","SettingsPage","defaultSection","activeSection","onActiveSectionChange","isControlled","setActive","DEMO_ROWS","STATUS_TONE","DEMO_COLUMNS","DEMO_FILTERS","DEMO_HEADER_ACTIONS","Plus","DEMO_BULK_ACTIONS","Download","Trash2","DataTablePage","rowsProp","columnsProp","filtersProp","predicate","defaultPageSize","bulkActionsProp","filters","bulkActions","filterValues","setFilterValues","init","selectedIds","setSelectedIds","setPage","setPageSize","filtered","defaultPred","q","allOnPageSelected","someSelected","selectedRows","totalPages","pageRows","augmentedColumns","Filter","a","DEMO_HEADER","Edit2","ExternalLink","DEMO_TABS","P","DEMO_SIDE_PANEL","Row","RecordDetail","tabs","defaultTab","sidePanel","initialTab","DEMO_STEPS","setData","role","Onboarding","initialData","onComplete","setStep","setDataState","patch","goTo","finish","ArrowLeft","DEFAULT_TIERS","Pricing","tiers","highlightedLabel","cols","tier","DEFAULT_STEPS","FirstRunEmpty","heroIcon","primaryAction"],"mappings":"ygDAYO,SAASA,KAAMC,EAA8B,CAClD,OAAOC,GAAAA,QAAQC,QAAKF,CAAM,CAAC,CAC7B,CAMA,IAAIG,GAAc,EACX,SAASC,GAAIC,EAAS,KAAc,CACzC,OAAAF,IAAe,EACR,GAAGE,CAAM,IAAIF,EAAW,EACjC,CChBO,SAASG,GAAcC,EAAwB,CACpD,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,IACjC,OAAO,OAAW,IAAoB,GACnC,OAAO,WAAWH,CAAK,EAAE,OACjC,EAEDI,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAI,OAAO,OAAW,IAAa,OACnC,MAAMC,EAAO,OAAO,WAAWL,CAAK,EAC9BM,EAAYC,GAA+BL,EAAWK,EAAM,OAAO,EACzE,OAAAL,EAAWG,EAAK,OAAO,EACvBA,EAAK,iBAAiB,SA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