@craftzbay/ui 0.1.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/LICENSE +21 -0
- package/README.md +157 -0
- package/dist-lib/components/patterns/AppShell.d.ts +9 -0
- package/dist-lib/components/patterns/Authentication.d.ts +45 -0
- package/dist-lib/components/patterns/DataTablePage.d.ts +1 -0
- package/dist-lib/components/patterns/FirstRunEmpty.d.ts +1 -0
- package/dist-lib/components/patterns/Onboarding.d.ts +1 -0
- package/dist-lib/components/patterns/Pricing.d.ts +1 -0
- package/dist-lib/components/patterns/RecordDetail.d.ts +1 -0
- package/dist-lib/components/patterns/Settings.d.ts +1 -0
- package/dist-lib/components/ui/Accordion.d.ts +21 -0
- package/dist-lib/components/ui/Alert.d.ts +35 -0
- package/dist-lib/components/ui/Avatar.d.ts +52 -0
- package/dist-lib/components/ui/Badge.d.ts +24 -0
- package/dist-lib/components/ui/Breadcrumbs.d.ts +31 -0
- package/dist-lib/components/ui/Button.d.ts +50 -0
- package/dist-lib/components/ui/Card.d.ts +37 -0
- package/dist-lib/components/ui/Checkbox.d.ts +28 -0
- package/dist-lib/components/ui/Combobox.d.ts +58 -0
- package/dist-lib/components/ui/CommandPalette.d.ts +109 -0
- package/dist-lib/components/ui/ContextMenu.d.ts +45 -0
- package/dist-lib/components/ui/DataGrid.d.ts +66 -0
- package/dist-lib/components/ui/DatePicker.d.ts +42 -0
- package/dist-lib/components/ui/Dialog.d.ts +62 -0
- package/dist-lib/components/ui/DropdownMenu.d.ts +47 -0
- package/dist-lib/components/ui/EmptyState.d.ts +31 -0
- package/dist-lib/components/ui/ErrorState.d.ts +29 -0
- package/dist-lib/components/ui/Form.d.ts +22 -0
- package/dist-lib/components/ui/IconButton.d.ts +34 -0
- package/dist-lib/components/ui/Input.d.ts +49 -0
- package/dist-lib/components/ui/Kbd.d.ts +16 -0
- package/dist-lib/components/ui/MultiSelect.d.ts +62 -0
- package/dist-lib/components/ui/Pagination.d.ts +32 -0
- package/dist-lib/components/ui/Popover.d.ts +16 -0
- package/dist-lib/components/ui/Progress.d.ts +40 -0
- package/dist-lib/components/ui/RadioGroup.d.ts +27 -0
- package/dist-lib/components/ui/ScrollArea.d.ts +13 -0
- package/dist-lib/components/ui/Select.d.ts +56 -0
- package/dist-lib/components/ui/Separator.d.ts +13 -0
- package/dist-lib/components/ui/Sheet.d.ts +46 -0
- package/dist-lib/components/ui/Sidebar.d.ts +67 -0
- package/dist-lib/components/ui/Skeleton.d.ts +26 -0
- package/dist-lib/components/ui/Slider.d.ts +33 -0
- package/dist-lib/components/ui/Spinner.d.ts +23 -0
- package/dist-lib/components/ui/Stepper.d.ts +34 -0
- package/dist-lib/components/ui/Switch.d.ts +33 -0
- package/dist-lib/components/ui/Table.d.ts +35 -0
- package/dist-lib/components/ui/Tabs.d.ts +32 -0
- package/dist-lib/components/ui/Textarea.d.ts +34 -0
- package/dist-lib/components/ui/Toast.d.ts +33 -0
- package/dist-lib/components/ui/Tooltip.d.ts +35 -0
- package/dist-lib/components/ui/TopNav.d.ts +33 -0
- package/dist-lib/hooks/use-media-query.d.ts +9 -0
- package/dist-lib/hooks/use-toast.d.ts +43 -0
- package/dist-lib/icons/index.d.ts +11 -0
- package/dist-lib/index.cjs +8 -0
- package/dist-lib/index.cjs.map +1 -0
- package/dist-lib/index.d.ts +58 -0
- package/dist-lib/index.js +4336 -0
- package/dist-lib/index.js.map +1 -0
- package/dist-lib/lib/cva.d.ts +6 -0
- package/dist-lib/lib/utils.d.ts +12 -0
- package/dist-lib/styles.css +1 -0
- package/package.json +118 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/lib/utils.ts","../src/hooks/use-media-query.ts","../src/hooks/use-toast.ts","../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/DatePicker.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/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\nconst store = {\n toasts: [] as InternalToast[],\n listeners: new Set<Listener>(),\n emit(this: typeof store) {\n for (const listener of this.listeners) listener(this.toasts);\n },\n push(this: typeof store, 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(this: typeof store, id: string) {\n this.toasts = this.toasts.map((t) => (t.id === id ? { ...t, open: false } : t));\n this.emit();\n },\n remove(this: typeof store, id: string) {\n this.toasts = this.toasts.filter((t) => 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 {\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 HTMLAttributes<HTMLDivElement>,\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\nconst avatar = cva(\n [\n 'relative inline-flex shrink-0 overflow-hidden rounded-full',\n 'bg-background-muted text-foreground-muted',\n ],\n {\n variants: {\n size: sizeMap,\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nexport interface AvatarProps\n extends ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatar> {\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 <AvatarPrimitive.Root ref={ref} className={cn(avatar({ size }), className)} {...props}>\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 {status && (\n <span\n aria-label={`Status: ${status}`}\n className={cn(\n 'absolute bottom-0 right-0 block size-1/4 rounded-full ring-2 ring-background',\n statusColour[status],\n )}\n />\n )}\n </AvatarPrimitive.Root>\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 Comp: any = asChild ? Slot : 'button';\n const isDisabled = disabled || loading;\n\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : type}\n aria-busy={loading || undefined}\n disabled={asChild ? undefined : isDisabled}\n data-loading={loading || undefined}\n className={cn(button({ variant, size }), className)}\n {...props}\n >\n {loading ? (\n <Loader2 className=\"animate-spin\" aria-hidden=\"true\" />\n ) : (\n leadingIcon\n )}\n {children}\n {!loading && trailingIcon}\n </Comp>\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 { Filter, 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, useId, useState, type ReactNode } from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { DayPicker, type DateRange } from 'react-day-picker';\nimport 'react-day-picker/style.css';\nimport { Calendar, ChevronLeft, ChevronRight } from '@/icons';\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\nconst calendarClassNames = {\n root: 'p-3',\n month: 'space-y-2',\n caption: 'flex items-center justify-between px-1 pb-2',\n caption_label: 'text-sm font-medium text-foreground',\n nav: 'flex items-center gap-1',\n nav_button:\n 'inline-flex size-7 items-center justify-center rounded-md text-foreground-muted hover:bg-background-muted hover:text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring',\n table: 'w-full border-collapse',\n head_row: 'flex',\n head_cell: 'w-9 text-xs font-medium text-foreground-subtle',\n row: 'flex w-full mt-1',\n cell: 'relative size-9 p-0 text-center',\n day: 'inline-flex size-9 items-center justify-center rounded-md text-sm text-foreground transition-colors outline-none hover:bg-background-muted focus-visible:ring-2 focus-visible:ring-ring',\n day_selected: 'bg-accent text-on-accent hover:bg-accent hover:text-on-accent',\n day_today: 'font-semibold text-accent',\n day_outside: 'text-foreground-subtle opacity-50',\n day_disabled: 'text-foreground-subtle opacity-50 pointer-events-none',\n day_range_start: 'rounded-l-md',\n day_range_end: 'rounded-r-md',\n day_range_middle: 'bg-accent-soft text-on-accent-soft rounded-none',\n} as const;\n\nconst calendarComponents = {\n IconLeft: () => <ChevronLeft className=\"size-4\" aria-hidden />,\n IconRight: () => <ChevronRight className=\"size-4\" aria-hidden />,\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 <Calendar 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 <DayPicker\n mode=\"single\"\n selected={value}\n onSelect={(d) => {\n onChange(d ?? undefined);\n if (d) setOpen(false);\n }}\n fromDate={fromDate}\n toDate={toDate}\n classNames={calendarClassNames}\n components={calendarComponents}\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 <DayPicker\n mode=\"range\"\n selected={value}\n onSelect={onChange}\n numberOfMonths={2}\n fromDate={fromDate}\n toDate={toDate}\n classNames={calendarClassNames}\n components={calendarComponents}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </div>\n );\n});\nDateRangePicker.displayName = 'DateRangePicker';\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';\n\nexport interface EmptyStateProps extends HTMLAttributes<HTMLDivElement> {\n /** Visual marker — small Lucide icon or custom illustration. */\n icon?: 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\n * <EmptyState\n * icon={<Folder className=\"size-6\" />}\n * title=\"No projects yet\"\n * description=\"Create a project to start tracking work.\"\n * action={<Button>New project</Button>}\n * />\n *\n * @do Lead with the next action. The icon is decoration; the button is the\n * point.\n * @dont Use elaborate illustrations on internal product surfaces — they\n * break the refined-minimal direction.\n */\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(\n { icon, 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 {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 <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 { AlertTriangle, XCircle } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { Button } from './Button';\n\nexport interface ErrorStateProps extends HTMLAttributes<HTMLDivElement> {\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 /** 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 icon: <AlertTriangle />,\n title: 'Page not found',\n description: \"We couldn't find what you were looking for.\",\n },\n '500': {\n icon: <XCircle />,\n title: 'Something went wrong',\n description: \"We're looking into it. Please try again in a moment.\",\n },\n generic: {\n icon: <AlertTriangle />,\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 500\n * <ErrorState variant=\"500\" onRetry={refetch} />\n *\n * @example Custom\n * <ErrorState title=\"Quota exceeded\"\n * description=\"Your plan allows 1,000 events/day.\"\n * action={<Button>Upgrade plan</Button>} />\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, 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 <div className=\"inline-flex size-12 items-center justify-center rounded-full bg-danger-soft text-danger-text [&_svg]:size-6\">\n {preset.icon}\n </div>\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 = 4,\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 w-full min-h-9 cursor-text flex-wrap items-center gap-1.5 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 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 {opt.label}\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=\"rounded-md bg-background-muted px-1.5 py-0.5 text-xs font-medium text-foreground-muted\">\n +{overflow} more\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-20\" />\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\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 /** 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 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 <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, 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);\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 { 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 { type ReactNode } from 'react';\nimport { Bell, Folder, Home, Search, Settings, Users } 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 { 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 { TopNav } from '@/components/ui/TopNav';\nimport { Badge as Pill } from '@/components/ui/Badge';\n\n/* -----------------------------------------------------------------------------\n * Generic AppShell — Sidebar + TopNav + content slot. Used by Dashboard and\n * most other authenticated pages.\n * --------------------------------------------------------------------------- */\n\nexport interface AppShellProps {\n /** Page content. */\n children: ReactNode;\n /** Logo / wordmark for the TopNav. */\n brand: ReactNode;\n}\n\nexport function AppShell({ children, brand }: AppShellProps) {\n return (\n <div className=\"flex min-h-screen w-full bg-background\">\n <Sidebar\n defaultCollapsed={false}\n footer={\n <SidebarItem icon={<Avatar fallback=\"BO\" size=\"xs\" />} className=\"!h-10\">\n Bay Otgonbayar\n </SidebarItem>\n }\n >\n <SidebarSection label=\"Workspace\">\n <SidebarItem icon={<Home />} active>\n Home\n </SidebarItem>\n <SidebarItem icon={<Folder />}>Projects</SidebarItem>\n <SidebarItem icon={<Users />} trailing={<Pill tone=\"accent\">3</Pill>}>\n Members\n </SidebarItem>\n </SidebarSection>\n <SidebarSection label=\"Account\">\n <SidebarItem icon={<Settings />}>Settings</SidebarItem>\n </SidebarSection>\n </Sidebar>\n\n <div className=\"flex flex-1 flex-col min-w-0\">\n <TopNav\n logo={brand}\n search={\n <Input\n type=\"search\"\n placeholder=\"Search…\"\n hideLabel\n label=\"Search\"\n prefix={<Search />}\n />\n }\n actions={\n <>\n <IconButton aria-label=\"Notifications\" icon={<Bell />} variant=\"ghost\" />\n <Avatar size=\"sm\" fallback=\"BO\" />\n </>\n }\n />\n <main className=\"flex-1 overflow-y-auto p-6 md:p-8\">{children}</main>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Dashboard pattern — header, 4 stat cards, a chart placeholder, recent\n * activity table.\n * --------------------------------------------------------------------------- */\n\ninterface Stat {\n label: string;\n value: string;\n delta?: { value: string; positive?: boolean };\n}\n\nconst sampleStats: Stat[] = [\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\ninterface ActivityRow {\n id: string;\n who: { name: string; initials: string };\n action: string;\n target: string;\n when: string;\n}\n\nconst sampleActivity: ActivityRow[] = [\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 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\">Overview</h1>\n <p className=\"text-sm text-foreground-muted mt-1\">\n What's happening across your workspace today.\n </p>\n </div>\n <div className=\"hidden md:flex items-center gap-2\">\n <Pill tone=\"neutral\" variant=\"outline\">\n Last 7 days\n </Pill>\n </div>\n </header>\n\n <section className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n {sampleStats.map((s) => (\n <Card key={s.label}>\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=\"text-2xl font-semibold tabular text-foreground\">{s.value}</span>\n {s.delta && (\n <span\n className={\n s.delta.positive\n ? 'text-xs font-medium text-success-text tabular'\n : 'text-xs font-medium text-danger-text tabular'\n }\n >\n {s.delta.value}\n </span>\n )}\n </div>\n </CardContent>\n </Card>\n ))}\n </section>\n\n <Card>\n <CardHeader>\n <CardTitle>Active users</CardTitle>\n <CardDescription>Distinct sessions per day, last 30 days.</CardDescription>\n </CardHeader>\n <CardContent>\n {/* Chart goes here — placeholder maintains layout */}\n <div\n role=\"img\"\n aria-label=\"Active users sparkline\"\n className=\"h-48 w-full rounded-md border border-dashed border-border bg-background-subtle\"\n />\n </CardContent>\n </Card>\n\n <Card padding=\"none\">\n <CardHeader className=\"px-5 pt-5\">\n <CardTitle>Recent activity</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 {sampleActivity.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=\"text-right tabular text-foreground-subtle\">{r.when}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Card>\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 anchor-linked so\n * deep links land on the right card. Keep section copy short — the goal of\n * Settings is recall, not reading.\n * --------------------------------------------------------------------------- */\n\ninterface NavSection {\n id: string;\n label: string;\n icon: ReactNode;\n}\n\nconst sections: NavSection[] = [\n { id: 'profile', label: 'Profile', icon: <User /> },\n { id: 'security', label: 'Security', icon: <Lock /> },\n { id: 'notifications', label: 'Notifications', icon: <Bell /> },\n { id: 'billing', label: 'Billing', icon: <CreditCard /> },\n { id: 'team', label: 'Team', icon: <Users /> },\n];\n\nexport function SettingsPage() {\n const [active, setActive] = useState('profile');\n\n return (\n <div className=\"mx-auto max-w-5xl space-y-8\">\n <header>\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">Settings</h1>\n <p className=\"text-sm text-foreground-muted mt-1\">\n Manage your account, preferences, and billing.\n </p>\n </header>\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 <a\n href={`#${s.id}`}\n onClick={() => setActive(s.id)}\n className={cn(\n 'flex h-9 items-center gap-2 rounded-md px-2 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 text-foreground font-medium'\n : 'text-foreground-muted hover:bg-background-muted hover:text-foreground',\n )}\n aria-current={active === s.id ? 'page' : undefined}\n >\n <span className=\"[&_svg]:size-4\">{s.icon}</span>\n {s.label}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n\n <div className=\"space-y-8\">\n <section id=\"profile\">\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=\"text-xs text-foreground-subtle mt-2\">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 </section>\n\n <section id=\"security\">\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\">\n Required for admin accounts on production.\n </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 </section>\n\n <section id=\"notifications\">\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 </section>\n\n <section id=\"billing\">\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=\"text-xs text-foreground-subtle mt-1\">\n Renews on 1 June 2026 · 12 seats\n </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 </section>\n\n <section id=\"team\">\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 </section>\n </div>\n </div>\n </div>\n );\n}\n","import { useMemo, useState } from 'react';\nimport { Download, Filter, Plus, Trash2, Upload } from '@/icons';\nimport { Badge } from '@/components/ui/Badge';\nimport { Button } from '@/components/ui/Button';\nimport { Checkbox } from '@/components/ui/Checkbox';\nimport { DataGrid } from '@/components/ui/DataGrid';\nimport { EmptyState } from '@/components/ui/EmptyState';\nimport { IconButton } from '@/components/ui/IconButton';\nimport { Pagination } from '@/components/ui/Pagination';\nimport { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/Select';\n\n/* -----------------------------------------------------------------------------\n * Data table page — filters + search + bulk action bar + grid + pagination.\n * All state stays local so the file is drop-in reviewable.\n * --------------------------------------------------------------------------- */\n\ninterface Project {\n id: string;\n name: string;\n status: 'active' | 'paused' | 'archived';\n owner: string;\n updatedAt: string;\n}\n\nconst sample: Project[] = [\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 statusTone = {\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\nexport function DataTablePage() {\n const [query, setQuery] = useState('');\n const [status, setStatus] = useState<string>('all');\n const [selected, setSelected] = useState<string[]>([]);\n const [page, setPage] = useState(1);\n const [pageSize, setPageSize] = useState(10);\n\n const filtered = useMemo(() => {\n return sample.filter((p) => {\n const matchesQuery = p.name.toLowerCase().includes(query.toLowerCase());\n const matchesStatus = status === 'all' || p.status === status;\n return matchesQuery && matchesStatus;\n });\n }, [query, status]);\n\n const allSelected = filtered.length > 0 && selected.length === filtered.length;\n const someSelected = selected.length > 0 && !allSelected;\n\n return (\n <div className=\"space-y-6\">\n <header className=\"flex items-end justify-between gap-4\">\n <div>\n <h1 className=\"text-2xl font-semibold tracking-tight text-foreground\">Projects</h1>\n <p className=\"text-sm text-foreground-muted mt-1\">\n {filtered.length} project{filtered.length === 1 ? '' : 's'} match your filters.\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" leadingIcon={<Upload />}>\n Import\n </Button>\n <Button leadingIcon={<Plus />}>New project</Button>\n </div>\n </header>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n <Select value={status} onValueChange={setStatus}>\n <SelectTrigger className=\"w-36\" placeholder=\"Status\" />\n <SelectContent>\n <SelectItem value=\"all\">All statuses</SelectItem>\n <SelectItem value=\"active\">Active</SelectItem>\n <SelectItem value=\"paused\">Paused</SelectItem>\n <SelectItem value=\"archived\">Archived</SelectItem>\n </SelectContent>\n </Select>\n <Button variant=\"outline\" size=\"sm\" leadingIcon={<Filter />}>\n More filters\n </Button>\n </div>\n\n {selected.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={allSelected ? true : someSelected ? 'indeterminate' : false}\n onCheckedChange={(v) => setSelected(v ? filtered.map((p) => p.id) : [])}\n aria-label=\"Select all\"\n />\n <span className=\"text-sm text-foreground\">\n {selected.length} selected\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button variant=\"ghost\" size=\"sm\" leadingIcon={<Download />}>\n Export\n </Button>\n <Button variant=\"ghost\" size=\"sm\" leadingIcon={<Trash2 />}>\n Delete\n </Button>\n </div>\n </div>\n )}\n\n <DataGrid\n rows={filtered.slice((page - 1) * pageSize, page * pageSize)}\n filter={{ value: query, onChange: setQuery, placeholder: 'Search projects…' }}\n emptyState={\n <EmptyState\n title=\"No projects match\"\n description=\"Try adjusting filters or creating a new project.\"\n action={<Button leadingIcon={<Plus />}>New project</Button>}\n className=\"border-0 bg-transparent\"\n />\n }\n columns={[\n {\n key: 'select',\n header: (\n <Checkbox\n checked={allSelected ? true : someSelected ? 'indeterminate' : false}\n onCheckedChange={(v) => setSelected(v ? filtered.map((p) => p.id) : [])}\n aria-label=\"Select all rows\"\n />\n ),\n width: '32px',\n cell: (r) => (\n <Checkbox\n checked={selected.includes(r.id)}\n onCheckedChange={(v) =>\n setSelected((prev) => (v ? [...prev, r.id] : prev.filter((id) => id !== r.id)))\n }\n aria-label={`Select ${r.name}`}\n />\n ),\n },\n { key: 'name', header: 'Name', sortable: true, cell: (r) => <span className=\"font-medium text-foreground\">{r.name}</span> },\n {\n key: 'status',\n header: 'Status',\n cell: (r) => (\n <Badge tone={statusTone[r.status].tone} dot>\n {statusTone[r.status].label}\n </Badge>\n ),\n },\n { key: 'owner', header: 'Owner' },\n { key: 'updatedAt', header: 'Updated', align: 'right' },\n ]}\n />\n\n <Pagination\n page={page}\n pageCount={Math.max(1, Math.ceil(filtered.length / pageSize))}\n onPageChange={setPage}\n totalItems={filtered.length}\n pageSize={pageSize}\n pageSizeOptions={[10, 20, 50]}\n onPageSizeChange={(s) => {\n setPageSize(s);\n setPage(1);\n }}\n />\n </div>\n );\n}\n","import { 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 { Separator } from '@/components/ui/Separator';\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/Tabs';\n\nexport function RecordDetail() {\n return (\n <div className=\"space-y-6\">\n <Breadcrumbs\n items={[\n { label: 'Projects', href: '/projects' },\n { label: 'Pulse onboarding' },\n ]}\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 Pulse onboarding\n </h1>\n <Badge tone=\"success\" dot>\n Active\n </Badge>\n </div>\n <p className=\"text-sm text-foreground-muted max-w-2xl\">\n Self-serve onboarding flow for new admins. Owns the first 5 minutes of every\n workspace.\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\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 </div>\n </header>\n\n <div className=\"grid gap-6 lg:grid-cols-[1fr_320px]\">\n <div className=\"min-w-0\">\n <Tabs defaultValue=\"overview\">\n <TabsList>\n <TabsTrigger value=\"overview\">Overview</TabsTrigger>\n <TabsTrigger value=\"activity\">Activity</TabsTrigger>\n <TabsTrigger value=\"files\">Files</TabsTrigger>\n <TabsTrigger value=\"settings\">Settings</TabsTrigger>\n </TabsList>\n <TabsContent value=\"overview\" className=\"space-y-4\">\n <Card>\n <CardHeader>\n <CardTitle>Summary</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2 text-foreground-muted leading-relaxed\">\n <p>\n The Pulse onboarding flow walks new admins through workspace creation,\n teammate 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\n finish is 4 m 22 s.\n </p>\n </CardContent>\n </Card>\n </TabsContent>\n <TabsContent value=\"activity\">\n <p className=\"text-sm text-foreground-muted\">Activity feed appears here.</p>\n </TabsContent>\n <TabsContent value=\"files\">\n <p className=\"text-sm text-foreground-muted\">Linked documents appear here.</p>\n </TabsContent>\n <TabsContent value=\"settings\">\n <p className=\"text-sm text-foreground-muted\">Project settings appear here.</p>\n </TabsContent>\n </Tabs>\n </div>\n\n <aside className=\"space-y-4\">\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 label=\"Tags\" value={<><Badge tone=\"accent\">growth</Badge> <Badge tone=\"neutral\" variant=\"outline\">v2</Badge></>} />\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 </aside>\n </div>\n </div>\n );\n}\n\nfunction Row({ label, value }: { label: string; value: React.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","import { useState } 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\nconst steps = [\n { title: 'Workspace' },\n { title: 'Invite team' },\n { title: 'Connect data' },\n { title: 'Done' },\n];\n\nexport function Onboarding() {\n const [step, setStep] = useState(0);\n const next = () => setStep((s) => Math.min(s + 1, steps.length - 1));\n const back = () => setStep((s) => Math.max(s - 1, 0));\n\n return (\n <div className=\"mx-auto max-w-2xl space-y-8 py-12\">\n <Stepper steps={steps} current={step} />\n <Card>\n <CardHeader>\n <CardTitle>{stepHeader[step].title}</CardTitle>\n <CardDescription>{stepHeader[step].description}</CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {step === 0 && (\n <>\n <Input label=\"Workspace name\" placeholder=\"Acme Inc.\" />\n <Input label=\"URL slug\" prefix={<span>acme.app/</span>} placeholder=\"acme\" />\n </>\n )}\n {step === 1 && (\n <>\n <Input\n type=\"email\"\n label=\"Invite by email\"\n placeholder=\"teammate@company.com\"\n helperText=\"Separate multiple emails with commas.\"\n />\n <RadioGroup defaultValue=\"member\">\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 {step === 2 && (\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 <button\n key={src}\n type=\"button\"\n className=\"rounded-lg border border-border bg-card p-4 text-left hover:border-border-strong hover:bg-background-subtle 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 >\n <p className=\"font-medium text-foreground\">{src}</p>\n <p className=\"text-xs text-foreground-subtle mt-1\">Quick setup with SSO</p>\n </button>\n ))}\n </div>\n </>\n )}\n {step === 3 && (\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=\"text-sm text-foreground-muted max-w-sm\">\n Your workspace is ready. We've sent invites and your first dashboard is loading.\n </p>\n </div>\n )}\n </CardContent>\n </Card>\n\n <div className=\"flex items-center justify-between\">\n <Button variant=\"ghost\" leadingIcon={<ArrowLeft />} onClick={back} disabled={step === 0}>\n Back\n </Button>\n {step < steps.length - 1 ? (\n <Button trailingIcon={<ArrowRight />} onClick={next}>\n {step === steps.length - 2 ? 'Finish' : 'Continue'}\n </Button>\n ) : (\n <Button>Open workspace</Button>\n )}\n </div>\n </div>\n );\n}\n\nconst stepHeader = [\n { title: 'Create your workspace', description: 'A workspace is where your team and projects live.' },\n { title: 'Invite your team', description: 'You can always invite more people later.' },\n { title: 'Connect a data source', description: 'Pick one — others can be added in settings.' },\n { title: 'Welcome aboard', description: \"We've set up your starting dashboard.\" },\n];\n","import { Check } from '@/icons';\nimport { Badge } from '@/components/ui/Badge';\nimport { Button } from '@/components/ui/Button';\nimport { cn } from '@/lib/utils';\n\ninterface Tier {\n name: string;\n price: string;\n cadence: string;\n description: string;\n features: string[];\n cta: string;\n highlighted?: boolean;\n}\n\nconst tiers: Tier[] = [\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\nexport function Pricing() {\n return (\n <div className=\"mx-auto max-w-5xl space-y-8 py-16\">\n <header className=\"text-center space-y-3\">\n <h1 className=\"text-3xl font-semibold tracking-tight text-foreground\">\n Plans that scale with your team\n </h1>\n <p className=\"text-sm text-foreground-muted max-w-xl mx-auto\">\n Start free, upgrade when you need more. All paid plans include a 14-day trial — no\n credit card required.\n </p>\n </header>\n\n <div className=\"grid gap-4 md:grid-cols-3\">\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\">Most popular</Badge>}\n </div>\n <p className=\"text-sm text-foreground-muted\">{tier.description}</p>\n </div>\n\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"text-3xl font-semibold tabular text-foreground\">{tier.price}</span>\n <span className=\"text-sm text-foreground-subtle\">{tier.cadence}</span>\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=\"size-4 text-accent shrink-0 mt-0.5\" 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 >\n {tier.cta}\n </Button>\n </div>\n ))}\n </div>\n </div>\n );\n}\n","import { 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 three\n * \"next step\" cards — common pattern across Linear, Notion, Vercel.\n * --------------------------------------------------------------------------- */\n\ninterface NextStep {\n icon: React.ReactNode;\n title: string;\n description: string;\n cta: string;\n}\n\nconst steps: NextStep[] = [\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\nexport function FirstRunEmpty() {\n return (\n <div className=\"mx-auto max-w-3xl space-y-8 py-12\">\n <EmptyState\n icon={<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 action={<Button trailingIcon={<ArrowRight />}>Open tutorial</Button>}\n />\n\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 <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 <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 variant=\"ghost\" size=\"sm\" trailingIcon={<ArrowRight />}>\n {s.cta}\n </Button>\n </CardContent>\n </Card>\n ))}\n </div>\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","Accordion","AccordionPrimitive","AccordionItem","forwardRef","className","props","ref","jsx","AccordionTrigger","children","jsxs","ChevronDown","AccordionContent","alert","cva","iconForVariant","Info","CheckCircle2","AlertTriangle","XCircle","Alert","variant","title","dismissible","onDismiss","icon","open","setOpen","handleDismiss","renderedIcon","X","sizeMap","avatar","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","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","calendarClassNames","calendarComponents","ChevronLeft","formatDate","PickerTrigger","Calendar","DatePicker","fromDate","toDate","DayPicker","DateRangePicker","Dialog","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","DialogContent","showClose","DialogHeader","DialogFooter","DialogTitle","DialogDescription","ConfirmationDialog","confirmLabel","cancelLabel","confirmVariant","onConfirm","EmptyState","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","orientation","RadioGroupPrimitive","RadioItem","ScrollArea","ScrollAreaPrimitive","ScrollBar","Separator","decorative","SeparatorPrimitive","Sheet","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","sheet","SheetContent","side","SheetHeader","SheetFooter","SheetTitle","SheetDescription","SidebarContext","Sidebar","defaultCollapsed","controlled","onCollapsedChange","footer","internal","setInternal","collapsed","setCollapsed","SidebarSection","SidebarItem","href","trailing","sub","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","AuthLayout","brand","subtitle","SignInForm","onSubmit","forgotHref","email","setEmail","password","setPassword","ArrowRight","SignUpForm","name","setName","ForgotPasswordForm","Mail","MagicLinkSent","onResend","AppShell","Home","Folder","Users","Pill","Bell","sampleStats","sampleActivity","Dashboard","r","sections","User","Lock","CreditCard","SettingsPage","setActive","sample","statusTone","DataTablePage","setStatus","setSelected","setPage","setPageSize","filtered","matchesQuery","matchesStatus","allSelected","someSelected","Upload","Plus","Filter","Download","Trash2","RecordDetail","Edit2","ExternalLink","Row","Onboarding","setStep","back","stepHeader","ArrowLeft","tiers","Pricing","tier","f","FirstRunEmpty"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAASA,KAAMC,GAA8B;AAClD,SAAOC,GAAQC,GAAKF,CAAM,CAAC;AAC7B;AAMA,IAAIG,KAAc;AACX,SAASC,GAAIC,IAAS,MAAc;AACzC,SAAAF,MAAe,GACR,GAAGE,CAAM,IAAIF,EAAW;AACjC;AChBO,SAASG,GAAcC,GAAwB;AACpD,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,MACjC,OAAO,SAAW,MAAoB,KACnC,OAAO,WAAWH,CAAK,EAAE,OACjC;AAED,SAAAI,GAAU,MAAM;AACd,QAAI,OAAO,SAAW,IAAa;AACnC,UAAMC,IAAO,OAAO,WAAWL,CAAK,GAC9BM,IAAW,CAACC,MAA+BL,EAAWK,EAAM,OAAO;AACzE,WAAAL,EAAWG,EAAK,OAAO,GACvBA,EAAK,iBAAiB,UAAUC,CAAQ,GACjC,MAAMD,EAAK,oBAAo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