@bison-lab/ui 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +235 -21
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +470 -145
- package/dist/index.mjs.map +1 -1
- package/dist/validators.d.mts +74 -0
- package/dist/validators.d.mts.map +1 -0
- package/dist/validators.mjs +62 -0
- package/dist/validators.mjs.map +1 -0
- package/package.json +6 -2
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["SlotPrimitive","PasswordToggleField","LabelPrimitive","SelectPrimitive","PopoverPrimitive","CalendarIcon","useIsomorphicLayoutEffect","CalendarIcon","SeparatorPrimitive","TooltipPrimitive","UnderlineIcon","LinkIcon","Underline","Link","CheckboxPrimitive","RadioGroupPrimitive","SwitchPrimitives","SliderPrimitive","AvatarPrimitive","DialogPrimitive","AlertDialogPrimitive","SheetPrimitive","DropdownMenuPrimitive","SonnerToaster","TabsPrimitive","AccordionPrimitive","ProgressPrimitive","ScrollAreaPrimitive","ContextMenuPrimitive","NavigationMenuPrimitive","SlotPrimitive","CommandPrimitive","AspectRatioPrimitive","CollapsiblePrimitive","SlotPrimitive","ImageIcon"],"sources":["../src/lib/semantic-action-tones.ts","../src/hooks/use-scroll-reveal.ts","../src/hooks/use-mobile.ts","../src/providers/theme-provider.tsx","../src/providers/density-provider.tsx","../src/providers/bison-provider.tsx","../src/providers/theme-scope.tsx","../src/form/form.tsx","../src/components/outlined-field.tsx","../src/form/form-field.tsx","../src/form/form-error.tsx","../src/components/button.tsx","../src/lib/surface-classes.ts","../src/components/input.tsx","../src/components/password-input.tsx","../src/components/code-input.tsx","../src/components/currency-input.tsx","../src/components/phone-input.tsx","../src/components/label.tsx","../src/components/input-group.tsx","../src/components/textarea.tsx","../src/components/select.tsx","../src/components/calendar.tsx","../src/components/popover.tsx","../src/components/date-picker.tsx","../src/components/time-picker.tsx","../src/components/date-range-picker.tsx","../src/components/separator.tsx","../src/components/tooltip.tsx","../src/components/text-editor.tsx","../src/components/text-content.tsx","../src/components/checkbox.tsx","../src/components/radio-group.tsx","../src/components/switch.tsx","../src/components/slider.tsx","../src/components/card.tsx","../src/components/alert.tsx","../src/lib/semantic-tint-tones.ts","../src/components/badge.tsx","../src/components/avatar.tsx","../src/components/dialog.tsx","../src/components/alert-dialog.tsx","../src/components/sheet.tsx","../src/components/dropdown-menu.tsx","../src/components/toast.tsx","../src/components/tabs.tsx","../src/components/stepper.tsx","../src/components/accordion.tsx","../src/components/table.tsx","../src/components/data-table.tsx","../src/components/progress.tsx","../src/components/progress-bar.tsx","../src/components/scroll-area.tsx","../src/components/skeleton.tsx","../src/components/rating.tsx","../src/components/spinner.tsx","../src/components/saved-ping.tsx","../src/components/context-menu.tsx","../src/components/navigation-menu.tsx","../src/components/breadcrumb.tsx","../src/components/pagination.tsx","../src/components/command.tsx","../src/components/editable-title.tsx","../src/components/aspect-ratio.tsx","../src/components/collapsible.tsx","../src/components/sidebar.tsx","../src/blocks/auth/social-providers.tsx","../src/blocks/auth/sign-in-block.tsx","../src/blocks/auth/sign-up-block.tsx","../src/blocks/auth/forgot-password-block.tsx","../src/blocks/auth/reset-password-block.tsx","../src/blocks/auth/verify-block.tsx","../src/blocks/error/not-found-block.tsx","../src/blocks/error/server-error-block.tsx","../src/blocks/error/maintenance-block.tsx","../src/blocks/error/empty-state-block.tsx","../src/blocks/layout/page-shell.tsx","../src/blocks/layout/header-block.tsx","../src/blocks/layout/sidebar-block.tsx","../src/blocks/layout/footer-block.tsx","../src/blocks/layout/app-sidebar/team-switcher.tsx","../src/blocks/layout/app-sidebar/sidebar-nav.tsx","../src/blocks/layout/app-sidebar/sidebar-user.tsx","../src/blocks/layout/app-sidebar/app-sidebar-block.tsx","../src/blocks/data-display/media-card.tsx","../src/blocks/data-display/reviews-block.tsx","../src/blocks/settings/profile-settings-block.tsx","../src/blocks/settings/account-settings-block.tsx","../src/blocks/settings/notification-settings-block.tsx"],"sourcesContent":["/**\n * Reusable “soft” icon tiles: same border + shadow language, hue from semantic scales.\n * Pair with `Button` variants `actionNeutral` | `actionPositive` | `actionNegative` and `size=\"icon\"`.\n *\n * Requires `--success-*` and `--destructive-*` scales from BisonProvider / tailwind preset.\n */\nexport const actionNeutralToneClasses =\n 'border border-border bg-muted/80 text-muted-foreground shadow-sm hover:border-border-strong hover:bg-muted hover:text-foreground dark:border-border dark:bg-muted/50 dark:hover:bg-muted/80 dark:hover:text-foreground';\n\nexport const actionPositiveToneClasses =\n 'border border-success-200/90 bg-success-100 text-success-600 shadow-sm hover:border-success-300 hover:bg-success-200 hover:text-success-700 focus-visible:ring-success-500/40 dark:border-success-800/55 dark:bg-success-950/40 dark:text-success-400 dark:hover:border-success-700 dark:hover:bg-success-950/60 dark:hover:text-success-300';\n\nexport const actionNegativeToneClasses =\n 'border border-destructive-200/90 bg-destructive-100 text-destructive-600 shadow-sm hover:border-destructive-300 hover:bg-destructive-200 hover:text-destructive-700 focus-visible:ring-destructive-500/40 dark:border-destructive-800/55 dark:bg-destructive-950/45 dark:text-destructive-400 dark:hover:border-destructive-700 dark:hover:bg-destructive-950/65 dark:hover:text-destructive-300';\n\n/** @deprecated Use `actionNeutralToneClasses` + `variant=\"actionNeutral\"` on Button. */\nexport const actionNeutralIconChromeClasses = actionNeutralToneClasses;\n","\"use client\";\n\nimport * as React from \"react\";\n\nexport interface UseScrollRevealOptions {\n /** Trigger only once (default: true) */\n once?: boolean;\n /** Root margin for IntersectionObserver (default: \"-50px\") */\n margin?: string;\n /** Visibility threshold 0–1 (default: 0) */\n threshold?: number;\n}\n\n/**\n * Returns a ref and a boolean indicating whether the element is in view.\n * Uses IntersectionObserver internally — no Framer Motion dependency required.\n *\n * @example\n * ```tsx\n * const { ref, isInView } = useScrollReveal();\n * <div ref={ref} style={{ opacity: isInView ? 1 : 0 }}>Content</div>\n * ```\n */\nexport function useScrollReveal<T extends HTMLElement = HTMLDivElement>(\n options: UseScrollRevealOptions = {}\n): { ref: React.RefObject<T | null>; isInView: boolean } {\n const { once = true, margin = \"-50px\", threshold = 0 } = options;\n const ref = React.useRef<T | null>(null);\n const [isInView, setIsInView] = React.useState(false);\n\n React.useEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry.isIntersecting) {\n setIsInView(true);\n if (once) observer.unobserve(el);\n } else if (!once) {\n setIsInView(false);\n }\n },\n { rootMargin: margin, threshold }\n );\n\n observer.observe(el);\n return () => observer.disconnect();\n }, [once, margin, threshold]);\n\n return { ref, isInView };\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n mql.addEventListener(\"change\", onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n}\n","'use client';\n\nimport * as React from 'react';\n\ntype Theme = 'light' | 'dark' | 'system';\ntype ResolvedTheme = 'light' | 'dark';\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n defaultTheme?: Theme;\n storageKey?: string;\n attribute?: string;\n}\n\ninterface ThemeProviderState {\n /** The user's selected theme — can be `\"system\"`. Use `resolvedTheme` for the value actually applied to the DOM. */\n theme: Theme;\n /** The theme actually applied to the DOM (`\"light\"` or `\"dark\"`). `undefined` until the client mounts (avoids SSR/hydration mismatches). */\n resolvedTheme: ResolvedTheme | undefined;\n /** The user's OS-level color scheme preference. `undefined` until the client mounts. */\n systemTheme: ResolvedTheme | undefined;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeProviderContext = React.createContext<\n ThemeProviderState | undefined\n>(undefined);\n\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n storageKey = 'bison-theme',\n attribute = 'data-theme',\n ...props\n}: ThemeProviderProps) {\n const [theme, setTheme] = React.useState<Theme>(defaultTheme);\n const [systemTheme, setSystemTheme] = React.useState<\n ResolvedTheme | undefined\n >(undefined);\n\n React.useEffect(() => {\n const stored = localStorage.getItem(storageKey) as Theme | null;\n if (stored) setTheme(stored);\n }, [storageKey]);\n\n React.useEffect(() => {\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n setSystemTheme(media.matches ? 'dark' : 'light');\n\n const handleChange = (event: MediaQueryListEvent) => {\n setSystemTheme(event.matches ? 'dark' : 'light');\n };\n media.addEventListener('change', handleChange);\n return () => media.removeEventListener('change', handleChange);\n }, []);\n\n const resolvedTheme: ResolvedTheme | undefined =\n theme === 'light' || theme === 'dark' ? theme : systemTheme;\n\n React.useEffect(() => {\n if (!resolvedTheme) return;\n const root = window.document.documentElement;\n\n if (attribute === 'class') {\n root.classList.remove('light', 'dark');\n root.classList.add(resolvedTheme);\n } else {\n root.setAttribute(attribute, resolvedTheme);\n }\n }, [resolvedTheme, attribute]);\n\n const value = React.useMemo(\n () => ({\n theme,\n resolvedTheme,\n systemTheme,\n setTheme: (newTheme: Theme) => {\n localStorage.setItem(storageKey, newTheme);\n setTheme(newTheme);\n },\n }),\n [theme, resolvedTheme, systemTheme, storageKey],\n );\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n );\n}\n\nexport function useTheme() {\n const context = React.useContext(ThemeProviderContext);\n if (!context) throw new Error('useTheme must be used within a ThemeProvider');\n return context;\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\ntype Density = \"compact\" | \"default\" | \"spacious\";\n\ninterface DensityProviderProps {\n children: React.ReactNode;\n density?: Density;\n}\n\nconst DensityContext = React.createContext<Density>(\"default\");\n\nconst densityClasses: Record<Density, string> = {\n compact: \"bison-density-compact\",\n default: \"bison-density-default\",\n spacious: \"bison-density-spacious\",\n};\n\nexport function DensityProvider({ children, density = \"default\" }: DensityProviderProps) {\n return (\n <DensityContext.Provider value={density}>\n <div className={densityClasses[density]}>{children}</div>\n </DensityContext.Provider>\n );\n}\n\nexport function useDensity() {\n return React.useContext(DensityContext);\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n deriveLightPalette,\n deriveDarkPalette,\n generateBrandScales,\n generateScaleCSS,\n generateDestructiveScaleCSS,\n radiusPresets,\n shadowPresets,\n motionPresets,\n densityPresets,\n defaultFontWeights,\n zIndexTokens,\n} from \"@bison-lab/tokens\";\nimport type {\n BrandColors,\n RadiusPreset,\n ShadowPreset,\n MotionPreset,\n DensityPreset,\n FontWeightMap,\n} from \"@bison-lab/tokens\";\nimport { ThemeProvider } from \"./theme-provider\";\nimport { DensityProvider } from \"./density-provider\";\n\ntype Theme = \"light\" | \"dark\" | \"system\";\n\ninterface GoogleFontConfig {\n /** Google Font family name, e.g. \"Inter\", \"Roboto\", \"Playfair Display\" */\n family: string;\n /** Font weights to load. Defaults to [400, 500, 600, 700] */\n weights?: number[];\n /** Whether to load italic variants. Defaults to false */\n italic?: boolean;\n}\n\nexport interface BisonProviderProps {\n children: React.ReactNode;\n\n /** Brand colors used to derive the full semantic palette */\n brandColors: BrandColors;\n\n /** Border radius preset. Defaults to \"rounded\" */\n radius?: RadiusPreset;\n /** Shadow preset. Defaults to \"subtle\" */\n shadow?: ShadowPreset;\n /** Motion preset. Defaults to \"smooth\" */\n motion?: MotionPreset;\n /** Density preset. Defaults to \"default\" */\n density?: DensityPreset;\n\n /**\n * HTML attribute used to toggle dark mode on the root element.\n * Use \"class\" for the common `.dark` class convention (Tailwind default),\n * or \"data-theme\" for `[data-theme=\"dark\"]` attribute convention.\n * Defaults to \"class\".\n */\n attribute?: \"class\" | \"data-theme\";\n\n /** Default theme mode. Defaults to \"system\" */\n defaultTheme?: Theme;\n /** localStorage key for theme persistence. Defaults to \"bison-theme\" */\n storageKey?: string;\n\n /** Google Font for body/UI text. Defaults to Inter */\n bodyFont?: GoogleFontConfig;\n /** Google Font for headings. Falls back to bodyFont if not provided */\n headingFont?: GoogleFontConfig;\n /** Google Font for monospace/code. Defaults to JetBrains Mono */\n monoFont?: GoogleFontConfig;\n\n /** Custom font weight map. Defaults to 400/500/600/700 */\n fontWeights?: FontWeightMap;\n}\n\nfunction buildGoogleFontsUrl(fonts: GoogleFontConfig[]): string {\n const families = fonts.map((font) => {\n const weights = font.weights ?? [400, 500, 600, 700];\n const sortedWeights = [...weights].sort((a, b) => a - b);\n\n if (font.italic) {\n const ital = sortedWeights\n .flatMap((w) => [`0,${w}`, `1,${w}`])\n .join(\";\");\n return `family=${font.family.replace(/ /g, \"+\")}:ital,wght@${ital}`;\n }\n\n return `family=${font.family.replace(/ /g, \"+\")}:wght@${sortedWeights.join(\";\")}`;\n });\n\n return `https://fonts.googleapis.com/css2?${families.join(\"&\")}&display=swap`;\n}\n\nfunction fontFamilyValue(font: GoogleFontConfig, fallback: string): string {\n return `\"${font.family}\", ${fallback}`;\n}\n\nexport function BisonProvider({\n children,\n brandColors,\n radius = \"rounded\",\n shadow = \"subtle\",\n motion = \"smooth\",\n density = \"default\",\n attribute = \"class\",\n defaultTheme = \"system\",\n storageKey = \"bison-theme\",\n bodyFont = { family: \"Inter\", weights: [400, 500, 600, 700] },\n headingFont,\n monoFont = { family: \"JetBrains Mono\", weights: [400, 500, 600, 700] },\n fontWeights = defaultFontWeights,\n}: BisonProviderProps) {\n const resolvedHeadingFont = headingFont ?? bodyFont;\n\n // Derive color palettes + brand scales\n const lightPalette = React.useMemo(() => deriveLightPalette(brandColors), [brandColors]);\n const darkPalette = React.useMemo(() => deriveDarkPalette(brandColors), [brandColors]);\n const scaleCSS = React.useMemo(() => {\n const scales = generateBrandScales(brandColors);\n return `${generateScaleCSS(scales)}\\n${generateDestructiveScaleCSS()}`;\n }, [brandColors]);\n\n // Build Google Fonts URL\n const fontsUrl = React.useMemo(() => {\n const fonts: GoogleFontConfig[] = [bodyFont];\n if (headingFont && headingFont.family !== bodyFont.family) {\n fonts.push(headingFont);\n }\n if (monoFont.family !== bodyFont.family) {\n fonts.push(monoFont);\n }\n return buildGoogleFontsUrl(fonts);\n }, [bodyFont, headingFont, monoFont]);\n\n // Build CSS custom properties style string\n const styleContent = React.useMemo(() => {\n const radiusVars = radiusPresets[radius];\n const shadowVars = shadowPresets[shadow];\n const motionVars = motionPresets[motion];\n const densityVars = densityPresets[density];\n\n const fontVars = {\n \"--font-body\": fontFamilyValue(bodyFont, \"ui-sans-serif, system-ui, sans-serif\"),\n \"--font-heading\": fontFamilyValue(resolvedHeadingFont, \"ui-sans-serif, system-ui, sans-serif\"),\n \"--font-mono\": fontFamilyValue(monoFont, \"ui-monospace, monospace\"),\n \"--font-weight-normal\": String(fontWeights.normal),\n \"--font-weight-medium\": String(fontWeights.medium),\n \"--font-weight-semibold\": String(fontWeights.semibold),\n \"--font-weight-bold\": String(fontWeights.bold),\n ...(fontWeights.extrabold != null && {\n \"--font-weight-extrabold\": String(fontWeights.extrabold),\n }),\n };\n\n const lightColorVars = Object.entries(lightPalette)\n .map(([key, value]) => ` --${key}: ${value};`)\n .join(\"\\n\");\n\n const darkColorVars = Object.entries(darkPalette)\n .map(([key, value]) => ` --${key}: ${value};`)\n .join(\"\\n\");\n\n const zIndexVars = Object.entries(zIndexTokens)\n .map(([key, value]) => ` ${key}: ${value};`)\n .join(\"\\n\");\n\n const presetVars = [\n ...Object.entries(radiusVars),\n ...Object.entries(shadowVars),\n ...Object.entries(motionVars),\n ...Object.entries(densityVars),\n ...Object.entries(fontVars),\n ]\n .map(([key, value]) => ` ${key}: ${value};`)\n .join(\"\\n\");\n\n const darkSelector = attribute === \"class\" ? \".dark\" : '[data-theme=\"dark\"]';\n\n return `:root {\\n${lightColorVars}\\n\\n${scaleCSS}\\n${presetVars}\\n${zIndexVars}\\n font-family: var(--font-body);\\n}\\n\\n${darkSelector} {\\n${darkColorVars}\\n}`;\n }, [\n radius,\n shadow,\n motion,\n density,\n attribute,\n bodyFont,\n resolvedHeadingFont,\n monoFont,\n fontWeights,\n lightPalette,\n darkPalette,\n scaleCSS,\n ]);\n\n return (\n <>\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossOrigin=\"anonymous\" />\n <link rel=\"stylesheet\" href={fontsUrl} />\n <style dangerouslySetInnerHTML={{ __html: styleContent }} />\n <ThemeProvider defaultTheme={defaultTheme} storageKey={storageKey} attribute={attribute}>\n <DensityProvider density={density}>\n {children}\n </DensityProvider>\n </ThemeProvider>\n </>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface ThemeScopeProps extends React.HTMLAttributes<HTMLDivElement> {\n /** CSS custom property overrides applied to the scoped subtree */\n overrides: Record<string, string>;\n}\n\nconst ThemeScope = React.forwardRef<HTMLDivElement, ThemeScopeProps>(\n ({ overrides, className, style, children, ...props }, ref) => {\n const scopeStyle = React.useMemo(\n () => ({ ...overrides, ...style }),\n [overrides, style]\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"contents\", className)}\n style={scopeStyle}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nThemeScope.displayName = \"ThemeScope\";\n\nexport { ThemeScope };\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { ZodSchema, ZodError } from \"zod\";\n\nexport type FormMode = \"native\" | \"rhf\";\n\ninterface FormContextValue {\n errors: Record<string, string>;\n touched: Record<string, boolean>;\n setFieldError: (name: string, error: string) => void;\n clearFieldError: (name: string) => void;\n setFieldTouched: (name: string) => void;\n isSubmitting: boolean;\n formMode: FormMode;\n /**\n * Bumped on every submit that yields validation errors. Fields read this to\n * replay the error shake on each failed submit — error strings alone don't\n * change between identical resubmits, so the animation wouldn't otherwise\n * re-trigger.\n */\n errorVersion: number;\n}\n\nconst FormContext = React.createContext<FormContextValue | undefined>(undefined);\n\nexport function useFormContext() {\n return React.useContext(FormContext);\n}\n\nexport interface FormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, \"onSubmit\"> {\n onSubmit?: (data: Record<string, FormDataEntryValue>) => void | Promise<void>;\n schema?: ZodSchema;\n formMode?: FormMode;\n children: React.ReactNode;\n}\n\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n ({ onSubmit, schema, formMode = \"native\", children, className, ...props }, ref) => {\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [touched, setTouched] = React.useState<Record<string, boolean>>({});\n const [isSubmitting, setIsSubmitting] = React.useState(false);\n const [errorVersion, setErrorVersion] = React.useState(0);\n\n const setFieldError = React.useCallback((name: string, error: string) => {\n setErrors((prev) => ({ ...prev, [name]: error }));\n }, []);\n\n const clearFieldError = React.useCallback((name: string) => {\n setErrors((prev) => {\n const next = { ...prev };\n delete next[name];\n return next;\n });\n }, []);\n\n const setFieldTouched = React.useCallback((name: string) => {\n setTouched((prev) => ({ ...prev, [name]: true }));\n }, []);\n\n const handleSubmit = React.useCallback(\n async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n setIsSubmitting(true);\n setErrors({});\n\n const formData = new FormData(e.currentTarget);\n const data = Object.fromEntries(formData.entries());\n\n if (schema) {\n try {\n schema.parse(data);\n } catch (err) {\n const zodError = err as ZodError;\n const fieldErrors: Record<string, string> = {};\n for (const issue of zodError.issues) {\n const path = issue.path.join(\".\");\n if (!fieldErrors[path]) {\n fieldErrors[path] = issue.message;\n }\n }\n setErrors(fieldErrors);\n setErrorVersion((v) => v + 1);\n setIsSubmitting(false);\n return;\n }\n }\n\n try {\n await onSubmit?.(data);\n } finally {\n setIsSubmitting(false);\n }\n },\n [onSubmit, schema]\n );\n\n const contextValue = React.useMemo(\n () => ({ errors, touched, setFieldError, clearFieldError, setFieldTouched, isSubmitting, formMode, errorVersion }),\n [errors, touched, setFieldError, clearFieldError, setFieldTouched, isSubmitting, formMode, errorVersion]\n );\n\n return (\n <FormContext.Provider value={contextValue}>\n <form ref={ref} onSubmit={handleSubmit} className={className} {...props}>\n {children}\n </form>\n </FormContext.Provider>\n );\n }\n);\nForm.displayName = \"Form\";\n","'use client';\n\nimport { motion } from 'motion/react';\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\n\n/**\n * Strips border / ring from nested form controls so the outer outlined shell\n * owns the chrome. Targets inputs, textareas, and select triggers (buttons).\n */\nexport const outlinedFieldNestResetClasses = cn(\n '[&_input]:!h-full [&_input]:min-h-0 [&_input]:border-0 [&_input]:bg-transparent [&_input]:shadow-none',\n '[&_input]:focus-visible:ring-0 [&_input]:focus-visible:ring-offset-0',\n '[&_textarea]:box-border [&_textarea]:min-h-[72px] [&_textarea]:h-auto [&_textarea]:!h-auto [&_textarea]:flex-1 [&_textarea]:resize-y',\n '[&_textarea]:border-0 [&_textarea]:bg-transparent [&_textarea]:shadow-none',\n '[&_textarea]:focus-visible:ring-0 [&_textarea]:focus-visible:ring-offset-0',\n '[&_button]:h-full [&_button]:min-h-0 [&_button]:border-0 [&_button]:bg-transparent [&_button]:shadow-none',\n '[&_button]:focus-visible:ring-0 [&_button]:focus-visible:ring-offset-0',\n);\n\nexport interface OutlinedFieldProps {\n /** Field label; shown on the top border (Material-style notch). */\n label: React.ReactNode;\n /** Associates the label with the control (`htmlFor` on the notch label). */\n htmlFor?: string;\n /** Validation error shown below the field. */\n error?: string;\n /**\n * Bumped by the parent `Form` on each failed submit so the error shake\n * replays even when the error text is unchanged. Optional for standalone use.\n */\n errorVersion?: number;\n /** Helper text below the field (hidden when `error` is set). */\n hint?: string;\n /** Renders a required indicator next to the label. */\n required?: boolean;\n className?: string;\n /** The control (Input, PhoneInput, Textarea, SelectTrigger, PasswordInput, etc.). */\n children: React.ReactNode;\n}\n\ntype ControlKind = 'input' | 'textarea' | 'other';\n\nfunction readValueFromShell(shell: HTMLElement): boolean {\n const input = shell.querySelector('input');\n const textarea = shell.querySelector('textarea');\n const el = textarea ?? input;\n if (el) return Boolean((el as HTMLInputElement).value);\n return true;\n}\n\nfunction detectControlKind(shell: HTMLElement): ControlKind {\n if (shell.querySelector('textarea')) return 'textarea';\n if (shell.querySelector('input')) return 'input';\n return 'other';\n}\n\nconst OutlinedField = React.forwardRef<HTMLDivElement, OutlinedFieldProps>(\n ({ label, htmlFor, error, errorVersion = 0, hint, required, className, children }, ref) => {\n const shellRef = React.useRef<HTMLDivElement>(null);\n const [focused, setFocused] = React.useState(false);\n const [hasValue, setHasValue] = React.useState(false);\n const [controlKind, setControlKind] = React.useState<ControlKind>('input');\n\n const syncFromDom = React.useCallback(() => {\n const shell = shellRef.current;\n if (!shell) return;\n setControlKind(detectControlKind(shell));\n setHasValue(readValueFromShell(shell));\n }, []);\n\n React.useLayoutEffect(() => {\n syncFromDom();\n }, [children, syncFromDom]);\n\n React.useEffect(() => {\n const shell = shellRef.current;\n if (!shell) return;\n\n const onFocusIn = () => setFocused(true);\n const onFocusOut = (ev: FocusEvent) => {\n if (!shell.contains(ev.relatedTarget as Node)) {\n setFocused(false);\n syncFromDom();\n }\n };\n\n shell.addEventListener('focusin', onFocusIn);\n shell.addEventListener('focusout', onFocusOut);\n return () => {\n shell.removeEventListener('focusin', onFocusIn);\n shell.removeEventListener('focusout', onFocusOut);\n };\n }, [syncFromDom]);\n\n // Replay the error shake on each failed submit (errorVersion bumps even\n // when the error text is unchanged).\n React.useEffect(() => {\n const el = shellRef.current;\n if (!el || !error) return;\n el.style.animation = 'none';\n void el.offsetWidth;\n el.style.animation = '';\n }, [errorVersion, error]);\n\n const isFloated = controlKind === 'other' ? true : focused || hasValue;\n\n const handleInputCapture = React.useCallback(\n (e: React.FormEvent<HTMLDivElement>) => {\n const t = e.target;\n if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {\n setHasValue(Boolean(t.value));\n }\n },\n [],\n );\n\n const isTextarea = controlKind === 'textarea';\n\n const labelAnimate =\n isTextarea && !isFloated\n ? { top: 20, left: 12, x: 0, y: 0 }\n : isFloated\n ? { top: 0, left: 10, x: 0, y: '-50%' }\n : { top: '50%', left: 12, x: 0, y: '-50%' };\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n <div\n ref={shellRef}\n className={cn(\n 'group/outlined relative w-full min-w-0 rounded-md border border-input bg-background',\n 'ring-offset-background',\n 'focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 focus-within:ring-offset-0',\n error && 'border-destructive bison-shake',\n outlinedFieldNestResetClasses,\n isTextarea\n ? 'flex min-h-[80px] flex-col py-2'\n : 'flex h-[var(--density-height-md)] items-stretch pointer-coarse:min-h-11',\n !isFloated &&\n !focused &&\n '[&_input]:placeholder:text-transparent [&_textarea]:placeholder:text-transparent',\n )}\n onInputCapture={handleInputCapture}\n >\n <motion.label\n htmlFor={htmlFor}\n className={cn(\n 'pointer-events-none absolute z-10 bg-background px-1 font-medium leading-none text-muted-foreground',\n isFloated ? 'text-xs' : 'text-base',\n focused && 'text-primary',\n )}\n style={{ transformOrigin: 'left center' }}\n initial={false}\n animate={labelAnimate}\n transition={{ type: 'spring', stiffness: 520, damping: 34 }}\n >\n {label}\n {required ? (\n <span className=\"ml-0.5 text-destructive\">*</span>\n ) : null}\n </motion.label>\n <div\n className={cn(\n 'box-border flex min-h-0 min-w-0 flex-1',\n isTextarea\n ? 'items-stretch pt-4 [&>*]:flex [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:flex-1'\n : 'items-stretch [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:flex-1',\n )}\n >\n {children}\n </div>\n </div>\n {error ? (\n <p className=\"text-sm leading-none text-destructive\">{error}</p>\n ) : null}\n {!error && hint ? (\n <p className=\"text-sm leading-none text-muted-foreground\">{hint}</p>\n ) : null}\n </div>\n );\n },\n);\nOutlinedField.displayName = 'OutlinedField';\n\nexport { OutlinedField };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { OutlinedField } from '../components/outlined-field';\nimport { useFormContext } from './form';\n\nexport interface FormFieldProps {\n name: string;\n label?: string;\n description?: string;\n required?: boolean;\n /**\n * `stack`: label above the control (default).\n * `outlined`: Material-style label on the top border (requires `label`).\n */\n labelLayout?: 'stack' | 'outlined';\n className?: string;\n children: React.ReactNode;\n}\n\nexport function FormField({\n name,\n label,\n description,\n required,\n labelLayout = 'stack',\n className,\n children,\n}: FormFieldProps) {\n const formCtx = useFormContext();\n const errorMessage = formCtx?.errors[name];\n const errorVersion = formCtx?.errorVersion ?? 0;\n const wrapRef = React.useRef<HTMLDivElement>(null);\n\n // Replay the error shake on every failed submit. Error strings don't change\n // between identical resubmits, so toggling the CSS class alone wouldn't\n // re-trigger the animation — restart it imperatively when errorVersion bumps.\n React.useEffect(() => {\n const el = wrapRef.current;\n if (!el || !errorMessage) return;\n el.style.animation = 'none';\n void el.offsetWidth;\n el.style.animation = '';\n }, [errorVersion, errorMessage]);\n\n if (label && labelLayout === 'outlined') {\n return (\n <OutlinedField\n label={label}\n htmlFor={name}\n required={required}\n error={errorMessage}\n errorVersion={errorVersion}\n hint={description}\n className={className}\n >\n {children}\n </OutlinedField>\n );\n }\n\n return (\n <div\n ref={wrapRef}\n className={cn('flex flex-col', errorMessage && 'bison-shake', className)}\n >\n {label && (\n <label\n htmlFor={name}\n className=\"mb-1.5 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </label>\n )}\n {children}\n {description && !errorMessage && (\n <p className=\"mt-1.5 text-sm leading-none text-muted-foreground\">\n {description}\n </p>\n )}\n {errorMessage && (\n <p className=\"mt-1.5 text-sm leading-none text-destructive\">\n {errorMessage}\n </p>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface FormErrorProps {\n message?: string;\n className?: string;\n}\n\nexport function FormError({ message, className }: FormErrorProps) {\n if (!message) return null;\n\n return (\n <div\n className={cn(\n \"rounded-md border border-destructive/50 bg-destructive/10 px-4 py-3 text-sm text-destructive\",\n className\n )}\n role=\"alert\"\n >\n {message}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { LoaderCircle } from \"lucide-react\";\nimport {\n actionNegativeToneClasses,\n actionNeutralToneClasses,\n actionPositiveToneClasses,\n} from \"../lib/semantic-action-tones\";\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n // pointer-coarse:min-h-11/min-w-11 enforce a 44px minimum tap target on touch\n // devices (WCAG 2.5.5) without altering the visual density-driven height on\n // fine (mouse) pointers, so desktop sizing and form-control alignment are\n // unchanged. Applies across every size and the icon button.\n \"relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-[color,background-color,border-color,box-shadow] duration-fast ease-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer pointer-coarse:min-h-11 pointer-coarse:min-w-11\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-700 hover:shadow-md\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary-700 hover:shadow-md\",\n accent:\n \"bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600 hover:shadow-md\",\n highlight:\n \"bg-highlight text-highlight-foreground hover:bg-highlight-600 hover:shadow-md\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-700 hover:shadow-md\",\n outline:\n \"border border-border-strong bg-background text-foreground hover:bg-accent hover:text-accent-foreground hover:shadow-sm\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n /** Soft neutral tile (edit / secondary icon actions). */\n actionNeutral: actionNeutralToneClasses,\n /** Soft success tint + strong success icon (inline confirm, row actions). */\n actionPositive: actionPositiveToneClasses,\n /** Soft danger tint + strong destructive icon (inline cancel, row delete). */\n actionNegative: actionNegativeToneClasses,\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n sm: \"h-[var(--density-height-sm)] px-3 text-xs\",\n md: \"h-[var(--density-height-md)] px-4 py-2\",\n lg: \"h-[var(--density-height-lg)] px-8 text-base rounded-lg\",\n icon: \"h-[var(--density-height-md)] w-[var(--density-height-md)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n fullWidth: false,\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * When true, replaces the button's content with a centered spinner while\n * preserving the button's original width. The button is also disabled and\n * marked `aria-busy` for assistive tech. Ignored when `asChild` is set,\n * since Slot requires a single child.\n */\n loading?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n fullWidth,\n asChild = false,\n loading = false,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n if (asChild) {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, fullWidth, className }),\n )}\n ref={ref}\n aria-busy={loading || undefined}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n const spinnerSizeClass =\n size === \"sm\" ? \"h-3 w-3\" : size === \"lg\" ? \"h-5 w-5\" : \"h-4 w-4\";\n\n return (\n <button\n className={cn(buttonVariants({ variant, size, fullWidth, className }))}\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n data-loading={loading || undefined}\n {...props}\n >\n {loading ? (\n <>\n <span className=\"invisible inline-flex items-center justify-center\">\n {children}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 flex items-center justify-center\"\n >\n <LoaderCircle\n className={cn(\"animate-spin\", spinnerSizeClass)}\n />\n </span>\n </>\n ) : (\n children\n )}\n </button>\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","/**\n * Shared surface class strings extracted to a single source of truth.\n *\n * These patterns appear in multiple components that must stay in lockstep\n * visually (same border, same focus ring, same scrim, etc.). When any of\n * these visuals change, update here once — every consumer tracks.\n *\n * See components: input, textarea, password-input, currency-input,\n * select, dropdown-menu, context-menu, command, dialog, alert-dialog,\n * sheet, popover, tooltip.\n */\n\n// ─── Input family ──────────────────────────────────────────────────────────\n\n/**\n * Common chrome for form input surfaces: border, background, ring-offset,\n * placeholder color, disabled state. Does NOT include sizing or focus —\n * consumers add `inputSizingClasses` (or their own) + `inputFocusClasses`.\n *\n * Used by: Input, Textarea, PasswordInput, CurrencyInput, Select Trigger,\n * DatePicker trigger, DateRangePicker trigger.\n */\nexport const inputSurfaceClasses =\n 'flex w-full rounded-md border border-input bg-background text-base sm:text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50';\n\n/**\n * Focus-visible ring for input surfaces. Keyboard focus only (`focus-visible`)\n * so mouse clicks don't show the ring — matches WAI-ARIA expectations.\n */\nexport const inputFocusClasses =\n 'focus-visible:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-0';\n\nexport type InputSize = 'sm' | 'md' | 'lg';\n\n/**\n * Standard single-line input sizing per size: density height + horizontal\n * padding + vertical padding, scaled per size. Textarea uses `min-h-[80px]`\n * instead of any of these.\n *\n * `pointer-coarse:min-h-11` floors the height at 44px on touch pointers on\n * every size, matching the Button primitive (and Button-based DatePicker /\n * DateRangePicker triggers) so inputs, selects, and buttons stay the same\n * height when combined in a form. Fine (mouse) pointers keep the exact\n * density height for the chosen size.\n *\n * `'md'` (the default) is byte-identical to the original fixed sizing this\n * function replaced — every existing caller passes `'md'` explicitly and\n * renders unchanged.\n */\nconst inputSizingClassesBySize: Record<InputSize, string> = {\n sm: 'h-[var(--density-height-sm)] px-3 py-1 text-sm pointer-coarse:min-h-11',\n md: 'h-[var(--density-height-md)] px-3 py-2 pointer-coarse:min-h-11',\n lg: 'h-[var(--density-height-lg)] px-3 py-2.5 text-base pointer-coarse:min-h-11',\n};\n\nexport function inputSizingClasses(size: InputSize = 'md'): string {\n return inputSizingClassesBySize[size];\n}\n\n// ─── Touch targets ─────────────────────────────────────────────────────────\n\n/**\n * Minimum 44px tap target on touch (coarse) pointers, applied to the element\n * itself. For standalone icon buttons that can safely grow their box on touch\n * without crowding neighbors (e.g. Dialog / Sheet close). Pair with\n * `inline-flex items-center justify-center` to keep the glyph centered. Fine\n * (mouse) pointers are unchanged, so desktop chrome is pixel-identical. Mirrors\n * the Button primitive's own coarse-pointer floor (WCAG 2.5.5).\n *\n * Used by: Dialog Close, Sheet Close.\n */\nexport const touchTargetClasses = 'pointer-coarse:min-h-11 pointer-coarse:min-w-11';\n\n/**\n * Expanded 44px tap target for small controls whose *visual* size must stay\n * fixed (a 44px checkbox would look broken). Renders a centered, transparent\n * 44px pseudo-element that captures pointer events on touch (coarse) pointers\n * only, so the drawn control is unchanged on every pointer and desktop layouts\n * (dense tables, tight forms) stay pixel-identical. Includes `relative`; the\n * host element must not be `overflow-hidden` or the pseudo is clipped.\n *\n * Used by: Checkbox, Radio, Switch, Slider thumb.\n */\nexport const coarseHitAreaClasses =\n \"relative before:absolute before:left-1/2 before:top-1/2 before:hidden before:size-11 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] pointer-coarse:before:block\";\n\n// ─── Menu / popover surfaces ───────────────────────────────────────────────\n\n/**\n * Menu surface chrome shared by floating menus and popovers:\n * Select Content, DropdownMenu Content, ContextMenu Content, Command.\n *\n * Uses `--z-dropdown` (500 after z-index refactor) so menus open *above*\n * modals they're triggered from — critical for Select inside a Dialog, etc.\n */\nexport const menuSurfaceClasses =\n 'z-[var(--z-dropdown)] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md';\n\n/**\n * Base menu item: focus styling, disabled state, selection-ready.\n * Used by: Select Item, DropdownMenu Item, ContextMenu Item, Command Item.\n */\nexport const menuItemClasses =\n 'relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-default';\n\n/**\n * Menu item variant with indicator gutter on the left (for checkbox/radio\n * indicators on Select, DropdownMenu, ContextMenu).\n */\nexport const menuItemWithIndicatorClasses =\n 'relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-default';\n\n/**\n * Menu separator: horizontal rule sitting between menu groups.\n */\nexport const menuSeparatorClasses = '-mx-1 my-1 h-px bg-muted';\n\n// ─── Floating animations ───────────────────────────────────────────────────\n\n/**\n * transitions.dev \"menu dropdown\" (05): scale-pop + fade from the Radix\n * popper transform-origin, with distinct open/close timing. Driven by the\n * --dropdown-* tokens. Used by Select Content, DropdownMenu Content,\n * ContextMenu Content, Popover Content, Command popovers. Tooltip has its\n * own faster, subtler timing — see `tooltipAnimationClasses`.\n */\nexport const floatingAnimationClasses =\n 'origin-[var(--radix-popper-transform-origin)] data-[state=open]:bison-pop-in data-[state=closed]:bison-pop-out';\n\n/**\n * transitions.dev \"tooltip\" (17): faster scale-pop driven by the --tt-*\n * tokens. Used by Tooltip Content. NB: Radix Tooltip's open state is\n * `delayed-open` / `instant-open` (not `open` like other overlays), so the\n * enter animation keys off both.\n */\nexport const tooltipAnimationClasses =\n 'origin-[var(--radix-popper-transform-origin)] data-[state=delayed-open]:bison-tooltip-in data-[state=instant-open]:bison-tooltip-in data-[state=closed]:bison-tooltip-out';\n\n// ─── Modal / overlay ───────────────────────────────────────────────────────\n\n/**\n * Scrim (backdrop) shared by Dialog, AlertDialog, Sheet.\n */\nexport const overlayScrimClasses =\n 'fixed inset-0 z-[var(--z-modal-backdrop)] bg-black/80 data-[state=open]:bison-scrim-in data-[state=closed]:bison-scrim-out';\n\n/**\n * Centered modal content positioning + chrome (Dialog, AlertDialog).\n * Sheet has its own side-anchored variants in `sheet.tsx`.\n */\nexport const centeredModalContentClasses =\n 'fixed left-[50%] top-[50%] z-[var(--z-modal)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg rounded-lg data-[state=open]:bison-modal-in data-[state=closed]:bison-modal-out';\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nInput.displayName = 'Input';\n\nexport { Input };\n","'use client';\n\nimport * as React from 'react';\nimport { unstable_PasswordToggleField as PasswordToggleField } from 'radix-ui';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\n\nexport interface PasswordInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof PasswordToggleField.Input>,\n 'type'\n > {}\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n ({ className, ...props }, ref) => {\n return (\n <PasswordToggleField.Root>\n <div className=\"relative\">\n <PasswordToggleField.Input\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'pr-10 file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm',\n className,\n )}\n ref={ref}\n {...props}\n />\n <PasswordToggleField.Toggle\n className=\"absolute right-0 top-0 flex h-full w-10 items-center justify-center text-muted-foreground hover:text-foreground transition-colors disabled:pointer-events-none disabled:opacity-50\"\n disabled={props.disabled}\n >\n <PasswordToggleField.Icon\n visible={<EyeOff className=\"h-4 w-4\" />}\n hidden={<Eye className=\"h-4 w-4\" />}\n />\n </PasswordToggleField.Toggle>\n </div>\n </PasswordToggleField.Root>\n );\n },\n);\nPasswordInput.displayName = 'PasswordInput';\n\nexport { PasswordInput };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Input } from \"./input\";\n\nexport interface CodeInputProps {\n /** Number of digits. @default 6 */\n length?: number;\n /** Called with the full code string when all digits are filled. */\n onComplete?: (code: string) => void;\n /** Called on every change with the current partial/full code string. */\n onChange?: (code: string) => void;\n loading?: boolean;\n disabled?: boolean;\n className?: string;\n}\n\nconst CodeInput = React.forwardRef<HTMLDivElement, CodeInputProps>(\n (\n {\n length = 6,\n onComplete,\n onChange,\n loading = false,\n disabled = false,\n className,\n },\n ref,\n ) => {\n const [code, setCode] = React.useState<string[]>(Array(length).fill(\"\"));\n const inputRefs = React.useRef<(HTMLInputElement | null)[]>([]);\n\n const updateCode = React.useCallback(\n (newCode: string[]) => {\n setCode(newCode);\n const joined = newCode.join(\"\");\n onChange?.(joined);\n if (joined.length === length && newCode.every(Boolean)) {\n onComplete?.(joined);\n }\n },\n [length, onChange, onComplete],\n );\n\n const handleChange = React.useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n const newCode = [...code];\n newCode[index] = value.slice(-1);\n updateCode(newCode);\n\n if (value && index < length - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n },\n [code, length, updateCode],\n );\n\n const handleKeyDown = React.useCallback(\n (index: number, e: React.KeyboardEvent) => {\n if (e.key === \"Backspace\" && !code[index] && index > 0) {\n inputRefs.current[index - 1]?.focus();\n }\n },\n [code],\n );\n\n const handlePaste = React.useCallback(\n (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pasted = e.clipboardData\n .getData(\"text\")\n .replace(/\\D/g, \"\")\n .slice(0, length);\n const newCode = Array(length).fill(\"\") as string[];\n for (let i = 0; i < pasted.length; i++) {\n newCode[i] = pasted[i];\n }\n updateCode(newCode);\n if (pasted.length < length) {\n inputRefs.current[pasted.length]?.focus();\n }\n },\n [length, updateCode],\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"flex justify-center gap-2\", className)}\n onPaste={handlePaste}\n >\n {code.map((digit, index) => (\n <Input\n key={index}\n ref={(el) => {\n inputRefs.current[index] = el;\n }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onChange={(e) => handleChange(index, e.target.value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n disabled={loading || disabled}\n className=\"h-12 w-12 text-center text-lg font-semibold\"\n autoFocus={index === 0}\n />\n ))}\n </div>\n );\n },\n);\nCodeInput.displayName = \"CodeInput\";\n\nexport { CodeInput };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\n\nexport interface CurrencyInputProps\n extends Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'type' | 'inputMode' | 'onChange' | 'value'\n > {\n /** Current value in cents (integer). */\n value: number;\n /** Called with the new value in cents */\n onChange: (cents: number) => void;\n /** Currency symbol displayed as a prefix. Defaults to \"$\" */\n symbol?: string;\n}\n\n/** Strips everything except digits and a single decimal point, limits to 2 decimal places. */\nfunction sanitize(raw: string): string {\n let cleaned = raw.replace(/[^\\d.]/g, '');\n const parts = cleaned.split('.');\n if (parts.length > 2) {\n cleaned = parts[0] + '.' + parts.slice(1).join('');\n }\n if (parts.length === 2 && parts[1].length > 2) {\n cleaned = parts[0] + '.' + parts[1].slice(0, 2);\n }\n return cleaned;\n}\n\n/** Converts a dollar string to cents: \"25\" → 2500, \"25.50\" → 2550 */\nfunction toCents(raw: string): number {\n if (!raw) return 0;\n const num = parseFloat(raw);\n if (isNaN(num) || num <= 0) return 0;\n return Math.round(num * 100);\n}\n\n/** Formats cents to a display string: 2500 → \"25.00\", 0 → \"\" */\nfunction fromCents(cents: number): string {\n if (cents <= 0) return '';\n return (cents / 100).toFixed(2);\n}\n\nconst CurrencyInput = React.forwardRef<HTMLInputElement, CurrencyInputProps>(\n ({ className, value, onChange, symbol = '$', ...props }, ref) => {\n const [display, setDisplay] = React.useState(() => fromCents(value));\n\n // Sync display when value changes externally (e.g. reset to 0)\n const prevValue = React.useRef(value);\n if (value !== prevValue.current) {\n prevValue.current = value;\n const expected = fromCents(value);\n // Only overwrite display if the external value actually changed meaning\n // (avoids fighting with the user's in-progress typing)\n if (toCents(display) !== value) {\n setDisplay(expected);\n }\n }\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n const cleaned = sanitize(e.target.value);\n setDisplay(cleaned);\n onChange(toCents(cleaned));\n }\n\n function handleBlur() {\n // Format to XX.00 on blur\n const cents = toCents(display);\n setDisplay(fromCents(cents));\n }\n\n return (\n <div className=\"relative\">\n <span\n className=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 select-none text-muted-foreground\"\n aria-hidden=\"true\"\n >\n {symbol}\n </span>\n <input\n ref={ref}\n type=\"text\"\n inputMode=\"decimal\"\n autoComplete=\"off\"\n value={display}\n onChange={handleChange}\n onBlur={handleBlur}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'pl-7 pr-3 text-sm',\n className,\n )}\n {...props}\n />\n </div>\n );\n },\n);\nCurrencyInput.displayName = 'CurrencyInput';\n\nexport { CurrencyInput };\n","'use client';\n\nimport * as React from 'react';\n\nimport { Input } from './input';\n\nconst PHONE_MAX_DIGITS = 10;\nconst PHONE_MAX_LENGTH = 14;\n\n/** Strips non-digits and caps at 10 (US NANP). */\nexport function parseUsPhoneDigits(value: string): string {\n return value.replace(/\\D/g, '').slice(0, PHONE_MAX_DIGITS);\n}\n\n/** Formats a phone value (digits, E.164, or any mixed string) as `(XXX) XXX-XXXX`. */\nexport function formatUsPhone(value: string): string {\n const d = parseUsPhoneDigits(value);\n if (d.length <= 3) return d;\n if (d.length <= 6) return `(${d.slice(0, 3)}) ${d.slice(3)}`;\n return `(${d.slice(0, 3)}) ${d.slice(3, 6)}-${d.slice(6)}`;\n}\n\n/**\n * US phone field: shows `(555) 123-4567` while `value` / `onChange` use digits\n * only (`5551234567`), matching {@link CurrencyInput} (display vs semantic value).\n */\nexport interface PhoneInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Input>,\n 'type' | 'inputMode' | 'maxLength' | 'value' | 'defaultValue' | 'onChange'\n > {\n /** Digits only, up to 10 characters. Use with `onChange` for controlled usage. */\n value?: string;\n /** Initial digits when uncontrolled. */\n defaultValue?: string;\n /** Called with digits-only value on each edit (empty string when cleared). */\n onChange?: (digits: string) => void;\n}\n\nconst PhoneInput = React.forwardRef<HTMLInputElement, PhoneInputProps>(\n function PhoneInput(\n {\n value: valueProp,\n defaultValue = '',\n onChange,\n autoComplete = 'tel',\n ...props\n },\n ref,\n ) {\n const isControlled = valueProp !== undefined;\n const [uncontrolledDigits, setUncontrolledDigits] = React.useState(() =>\n parseUsPhoneDigits(defaultValue),\n );\n\n const digits = isControlled\n ? parseUsPhoneDigits(valueProp ?? '')\n : uncontrolledDigits;\n\n const display = formatUsPhone(digits);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const next = parseUsPhoneDigits(event.target.value);\n if (!isControlled) {\n setUncontrolledDigits(next);\n }\n onChange?.(next);\n }\n\n return (\n <Input\n ref={ref}\n {...props}\n type=\"text\"\n inputMode=\"tel\"\n autoComplete={autoComplete}\n maxLength={PHONE_MAX_LENGTH}\n value={display}\n onChange={handleChange}\n />\n );\n },\n);\n\nPhoneInput.displayName = 'PhoneInput';\n\nexport { PhoneInput };\n","'use client';\n\nimport * as React from 'react';\nimport { Label as LabelPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst labelVariants = cva(\n 'inline-block text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n {\n variants: {\n /** `stack`: label above a field (default). `inline`: beside checkbox, radio, switch. */\n layout: {\n stack: 'mb-2 leading-none',\n inline: 'mb-0 leading-snug',\n },\n },\n defaultVariants: {\n layout: 'stack',\n },\n },\n);\n\nconst Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, layout, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants({ layout }), className)}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\nimport { OutlinedField } from './outlined-field';\n\nexport interface InputGroupProps {\n /** Field label text. */\n label: string;\n /** Associates the label with the input via `htmlFor`. Should match the input's `id`. */\n htmlFor?: string;\n /** Validation error message displayed below the input. */\n error?: string;\n /** Helper text displayed below the input (hidden when error is present). */\n hint?: string;\n /** Marks the field as required with a visual indicator. */\n required?: boolean;\n /**\n * `stack`: label above the control (default).\n * `outlined`: Material-style label notch on the top border; nested controls lose their own border.\n */\n labelLayout?: 'stack' | 'outlined';\n className?: string;\n children: React.ReactNode;\n}\n\nconst InputGroup = React.forwardRef<HTMLDivElement, InputGroupProps>(\n (\n {\n label,\n htmlFor,\n error,\n hint,\n required,\n labelLayout = 'stack',\n className,\n children,\n },\n ref,\n ) => {\n if (labelLayout === 'outlined') {\n return (\n <OutlinedField\n ref={ref}\n label={label}\n htmlFor={htmlFor}\n error={error}\n hint={hint}\n required={required}\n className={className}\n >\n {children}\n </OutlinedField>\n );\n }\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', className)}>\n <Label htmlFor={htmlFor}>\n {label}\n {required && <span className=\"ml-0.5 text-destructive\">*</span>}\n </Label>\n {children}\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n {!error && hint && (\n <p className=\"text-sm text-muted-foreground\">{hint}</p>\n )}\n </div>\n );\n },\n);\nInputGroup.displayName = 'InputGroup';\n\nexport { InputGroup };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { inputFocusClasses, inputSurfaceClasses } from '../lib/surface-classes';\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n inputSurfaceClasses,\n 'min-h-[80px] px-3 py-2',\n inputFocusClasses,\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","'use client';\n\nimport * as React from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\n\nconst Select = SelectPrimitive.Root;\nconst SelectGroup = SelectPrimitive.Group;\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'items-center justify-between [&>span]:line-clamp-1',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n menuSurfaceClasses,\n floatingAnimationClasses,\n 'relative max-h-96 p-0',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, 'w-full', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nconst Calendar = ({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) => {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row gap-2\",\n month: \"flex flex-col gap-4\",\n month_caption: \"flex justify-center pt-1 relative items-center w-full\",\n caption_label: \"text-sm font-medium\",\n nav: \"flex items-center gap-1\",\n button_previous:\n \"absolute left-1 inline-flex items-center justify-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md z-10\",\n button_next:\n \"absolute right-1 inline-flex items-center justify-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md z-10\",\n month_grid: \"w-full border-collapse space-x-1\",\n weekdays: \"flex\",\n weekday:\n \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n week: \"flex w-full mt-2\",\n day: cn(\n \"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50\",\n props.mode === \"range\"\n ? \"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n : \"[&:has([aria-selected])]:rounded-md\",\n ),\n day_button: cn(\n \"inline-flex items-center justify-center h-9 w-9 p-0 font-normal aria-selected:opacity-100 rounded-md\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\",\n ),\n range_start: \"day-range-start rounded-l-md\",\n range_end: \"day-range-end rounded-r-md\",\n selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n today: \"bg-accent text-accent-foreground\",\n outside:\n \"day-outside text-muted-foreground aria-selected:text-muted-foreground opacity-50 aria-selected:opacity-30\",\n disabled: \"text-muted-foreground opacity-50\",\n range_middle:\n \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) =>\n orientation === \"left\" ? (\n <ChevronLeft className=\"h-4 w-4\" />\n ) : (\n <ChevronRight className=\"h-4 w-4\" />\n ),\n }}\n {...props}\n />\n );\n};\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n","'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport { floatingAnimationClasses } from '../lib/surface-classes';\n\nconst Popover = PopoverPrimitive.Root;\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\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-md border bg-popover p-4 text-popover-foreground shadow-md outline-none',\n floatingAnimationClasses,\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { format } from \"date-fns\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport interface DatePickerProps {\n /** The selected date */\n value?: Date;\n /** Callback when the date changes */\n onChange?: (date: Date | undefined) => void;\n /** Placeholder text when no date is selected */\n placeholder?: string;\n /** Date format string (date-fns format) */\n dateFormat?: string;\n /** Disable the date picker */\n disabled?: boolean;\n /** Additional class names for the trigger button */\n className?: string;\n /** Minimum selectable date */\n fromDate?: Date;\n /** Maximum selectable date */\n toDate?: Date;\n /** Dates that should be disabled */\n disabledDates?: Date[];\n}\n\nconst DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Pick a date\",\n dateFormat = \"PPP\",\n disabled = false,\n className,\n fromDate,\n toDate,\n disabledDates,\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false);\n\n const handleSelect = (date: Date | undefined) => {\n onChange?.(date);\n setOpen(false);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n className\n )}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? format(value, dateFormat) : <span>{placeholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={value}\n onSelect={handleSelect}\n disabled={disabledDates ? disabledDates : undefined}\n startMonth={fromDate}\n endMonth={toDate}\n autoFocus\n />\n </PopoverContent>\n </Popover>\n );\n }\n);\nDatePicker.displayName = \"DatePicker\";\n\nexport { DatePicker };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { inputSizingClasses, type InputSize } from '../lib/surface-classes';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from './select';\n\n// useLayoutEffect warns on the server; this library targets Next.js\n// consumers, so fall back to useEffect there. Matches tabs.tsx's helper.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nexport type TimePeriod = 'AM' | 'PM';\n\n/** Curated minute-increment presets, matching this library's finite-preset philosophy. */\nexport type MinuteStep = 1 | 5 | 10 | 15 | 30;\n\nexport interface TimeParts {\n /** 1-12 */\n hour12: number;\n /** 0-59 */\n minute: number;\n period: TimePeriod;\n}\n\n/** Zero-pads a number to a 2-digit string (\"5\" → \"05\"). */\nfunction pad2(n: number): string {\n return String(n).padStart(2, '0');\n}\n\n/**\n * A segment's controlled Select value: zero-padded, or `''` when unset.\n *\n * Radix's Select.Root treats `''` as \"clear the selection and show the\n * placeholder\" (see @radix-ui/react-select's own SelectItem invariant: a\n * SelectItem's value may never be `''` for exactly this reason) while still\n * remaining fully controlled by us. Passing `undefined` instead would leave\n * Select.Root uncontrolled whenever a segment is unset, and Radix's internal\n * uncontrolled fallback state -- populated only by the user's own picks via\n * onValueChange -- does not reset just because our `value` prop returns to\n * `undefined`, so a cleared, previously-picked trigger would keep showing\n * its last value. Always passing a defined string avoids that entirely.\n */\nfunction toSegmentValue(n: number | undefined): string {\n return n === undefined ? '' : pad2(n);\n}\n\nconst HOUR_OPTIONS = Array.from({ length: 12 }, (_, i) => pad2(i + 1));\n\n/** Generates zero-padded minute option strings (\"00\", \"05\", ...) stepped by `step`. */\nexport function getMinuteOptions(step: MinuteStep): string[] {\n const options: string[] = [];\n for (let minute = 0; minute < 60; minute += step) {\n options.push(pad2(minute));\n }\n return options;\n}\n\n/** Parses a 24-hour \"HH:mm\" string into 12-hour parts. Returns {} for undefined/malformed input. */\nexport function parseTimeValue(value: string | undefined): Partial<TimeParts> {\n if (!value) return {};\n const match = /^([01]\\d|2[0-3]):([0-5]\\d)$/.exec(value);\n if (!match) return {};\n const hour24 = Number(match[1]);\n const minute = Number(match[2]);\n const period: TimePeriod = hour24 >= 12 ? 'PM' : 'AM';\n const hour12 = hour24 % 12 === 0 ? 12 : hour24 % 12;\n return { hour12, minute, period };\n}\n\n/** Formats 12-hour parts back into a 24-hour \"HH:mm\" string. */\nexport function formatTimeValue(parts: TimeParts): string {\n let hour24 = parts.hour12 % 12;\n if (parts.period === 'PM') hour24 += 12;\n return `${pad2(hour24)}:${pad2(parts.minute)}`;\n}\n\nexport interface TimePickerProps {\n /** Current time, 24-hour \"HH:mm\" format, e.g. \"14:30\" */\n value?: string;\n /** Fires only once hour, minute, and period are all selected */\n onChange?: (value: string) => void;\n /** Minute increment, restricted to a curated preset. Default: 5 */\n minuteStep?: MinuteStep;\n /** Field size. Default: \"md\" */\n size?: InputSize;\n disabled?: boolean;\n /** Placeholder text per segment. Defaults: \"HH\" / \"MM\" / \"AM\" */\n placeholder?: { hour?: string; minute?: string; period?: string };\n /** Applied to the wrapping row element */\n className?: string;\n}\n\nconst TimePicker = React.forwardRef<HTMLDivElement, TimePickerProps>(\n (\n {\n value,\n onChange,\n minuteStep = 5,\n size = 'md',\n disabled = false,\n placeholder,\n className,\n },\n ref,\n ) => {\n const [partial, setPartial] = React.useState<Partial<TimeParts>>({});\n // A `value` only counts as \"controlled\" once it fully parses — an\n // unparseable non-empty string (or \"\") is treated the same as\n // `undefined`, so segment picks still accumulate in local state instead\n // of being silently discarded just because `value` happened to be\n // truthy. `parseTimeValue` never returns a partial result (its regex\n // match sets all three fields together or none), so checking `hour12`\n // alone is a reliable proxy for \"did this value actually parse.\"\n const parsedValue = parseTimeValue(value);\n const isControlled = parsedValue.hour12 !== undefined;\n const parts = isControlled ? parsedValue : partial;\n\n // If a controlled value is cleared (or becomes unparseable) after having\n // been set, drop any stale local selection so the picker falls back to\n // placeholders instead of showing the last value it had before it\n // became controlled. useIsomorphicLayoutEffect (not useEffect) so this\n // correction lands before paint -- the transition render below already\n // computes `parts` from the stale `partial`, and running the reset after\n // paint would let that stale value flash on screen for a frame first.\n const wasControlledRef = React.useRef(isControlled);\n useIsomorphicLayoutEffect(() => {\n if (wasControlledRef.current && !isControlled) {\n setPartial({});\n }\n wasControlledRef.current = isControlled;\n }, [isControlled]);\n\n const minuteOptions = React.useMemo(() => {\n const options = getMinuteOptions(minuteStep);\n // A `value` supplied directly (not picked via this UI) may carry a\n // minute that isn't a multiple of `minuteStep` — include it so the\n // trigger reflects the true value instead of falling back to the\n // placeholder as if nothing were selected.\n if (parts.minute !== undefined) {\n const minuteStr = pad2(parts.minute);\n if (!options.includes(minuteStr)) {\n return [...options, minuteStr].sort();\n }\n }\n return options;\n }, [minuteStep, parts.minute]);\n\n function commit(next: Partial<TimeParts>) {\n if (!isControlled) {\n setPartial(next);\n }\n if (\n next.hour12 !== undefined &&\n next.minute !== undefined &&\n next.period !== undefined\n ) {\n onChange?.(\n formatTimeValue({\n hour12: next.hour12,\n minute: next.minute,\n period: next.period,\n }),\n );\n }\n }\n\n const triggerClassName = cn(inputSizingClasses(size), 'w-auto min-w-0');\n\n return (\n <div ref={ref} className={cn('flex gap-2', className)}>\n <Select\n disabled={disabled}\n value={toSegmentValue(parts.hour12)}\n onValueChange={(hour) => commit({ ...parts, hour12: Number(hour) })}\n >\n <SelectTrigger aria-label=\"Hour\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.hour ?? 'HH'} />\n </SelectTrigger>\n <SelectContent>\n {HOUR_OPTIONS.map((hour) => (\n <SelectItem key={hour} value={hour}>\n {hour}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Select\n disabled={disabled}\n value={toSegmentValue(parts.minute)}\n onValueChange={(minute) =>\n commit({ ...parts, minute: Number(minute) })\n }\n >\n <SelectTrigger aria-label=\"Minute\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.minute ?? 'MM'} />\n </SelectTrigger>\n <SelectContent>\n {minuteOptions.map((minute) => (\n <SelectItem key={minute} value={minute}>\n {minute}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Select\n disabled={disabled}\n value={parts.period ?? ''}\n onValueChange={(period) =>\n commit({ ...parts, period: period as TimePeriod })\n }\n >\n <SelectTrigger aria-label=\"AM or PM\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.period ?? 'AM'} />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"AM\">AM</SelectItem>\n <SelectItem value=\"PM\">PM</SelectItem>\n </SelectContent>\n </Select>\n </div>\n );\n },\n);\nTimePicker.displayName = 'TimePicker';\n\nexport { TimePicker };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n format,\n subDays,\n startOfWeek,\n startOfMonth,\n startOfYear,\n endOfWeek,\n endOfMonth,\n subMonths,\n subYears,\n} from \"date-fns\";\nimport { Calendar as CalendarIcon, CircleX } from \"lucide-react\";\nimport type { DateRange } from \"react-day-picker\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport interface DateRangePreset {\n /** Display label for the preset */\n label: string;\n /** Function that returns the date range for this preset */\n range: () => DateRange;\n}\n\n/** Built-in preset range generators */\nexport const dateRangePresets = {\n today: (): DateRangePreset => ({\n label: \"Today\",\n range: () => {\n const today = new Date();\n return { from: today, to: today };\n },\n }),\n yesterday: (): DateRangePreset => ({\n label: \"Yesterday\",\n range: () => {\n const yesterday = subDays(new Date(), 1);\n return { from: yesterday, to: yesterday };\n },\n }),\n last7Days: (): DateRangePreset => ({\n label: \"Last 7 days\",\n range: () => ({ from: subDays(new Date(), 6), to: new Date() }),\n }),\n last14Days: (): DateRangePreset => ({\n label: \"Last 14 days\",\n range: () => ({ from: subDays(new Date(), 13), to: new Date() }),\n }),\n last30Days: (): DateRangePreset => ({\n label: \"Last 30 days\",\n range: () => ({ from: subDays(new Date(), 29), to: new Date() }),\n }),\n last90Days: (): DateRangePreset => ({\n label: \"Last 90 days\",\n range: () => ({ from: subDays(new Date(), 89), to: new Date() }),\n }),\n thisWeek: (): DateRangePreset => ({\n label: \"This week\",\n range: () => ({ from: startOfWeek(new Date()), to: endOfWeek(new Date()) }),\n }),\n lastWeek: (): DateRangePreset => ({\n label: \"Last week\",\n range: () => {\n const lastWeek = subDays(new Date(), 7);\n return { from: startOfWeek(lastWeek), to: endOfWeek(lastWeek) };\n },\n }),\n thisMonth: (): DateRangePreset => ({\n label: \"This month\",\n range: () => ({\n from: startOfMonth(new Date()),\n to: endOfMonth(new Date()),\n }),\n }),\n lastMonth: (): DateRangePreset => ({\n label: \"Last month\",\n range: () => {\n const lastMonth = subMonths(new Date(), 1);\n return { from: startOfMonth(lastMonth), to: endOfMonth(lastMonth) };\n },\n }),\n thisYear: (): DateRangePreset => ({\n label: \"This year\",\n range: () => ({ from: startOfYear(new Date()), to: new Date() }),\n }),\n lastYear: (): DateRangePreset => ({\n label: \"Last year\",\n range: () => {\n const lastYear = subYears(new Date(), 1);\n return { from: startOfYear(lastYear), to: new Date() };\n },\n }),\n} as const;\n\nexport interface DateRangePickerProps {\n /** The selected date range */\n value?: DateRange;\n /** Callback when the date range changes */\n onChange?: (range: DateRange | undefined) => void;\n /** Placeholder text when no range is selected */\n placeholder?: string;\n /** Date format string (date-fns format) */\n dateFormat?: string;\n /** Disable the date range picker */\n disabled?: boolean;\n /** Additional class names for the trigger button */\n className?: string;\n /** Preset ranges to display in the sidebar */\n presets?: DateRangePreset[];\n /** Number of months to display */\n numberOfMonths?: number;\n /** Minimum selectable date */\n fromDate?: Date;\n /** Maximum selectable date */\n toDate?: Date;\n /** When true, shows an X-in-circle clear button on the right when a value is selected. Defaults to true. */\n clearable?: boolean;\n /** Accessible label for the clear button. Defaults to \"Clear date range\". */\n clearLabel?: string;\n}\n\nconst DateRangePicker = React.forwardRef<\n HTMLButtonElement,\n DateRangePickerProps\n>(\n (\n {\n value,\n onChange,\n placeholder = \"Pick a date range\",\n dateFormat = \"LLL dd, y\",\n disabled = false,\n className,\n presets,\n numberOfMonths = 2,\n fromDate,\n toDate,\n clearable = true,\n clearLabel = \"Clear date range\",\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n\n const handlePresetClick = (preset: DateRangePreset) => {\n const range = preset.range();\n onChange?.(range);\n };\n\n const showClear = clearable && !disabled && Boolean(value?.from);\n\n const handleClear = (e: React.MouseEvent | React.KeyboardEvent) => {\n e.stopPropagation();\n e.preventDefault();\n onChange?.(undefined);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <div className=\"relative w-full\">\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n showClear && \"pr-9\",\n className,\n )}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value?.from ? (\n value.to ? (\n <>\n {format(value.from, dateFormat)} –{\" \"}\n {format(value.to, dateFormat)}\n </>\n ) : (\n format(value.from, dateFormat)\n )\n ) : (\n <span>{placeholder}</span>\n )}\n </Button>\n </PopoverTrigger>\n {showClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onClick={handleClear}\n onPointerDown={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n handleClear(e);\n }\n }}\n className=\"absolute right-2 top-1/2 -translate-y-1/2 rounded-full text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1\"\n >\n <CircleX className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <div\n className={cn(\"flex\", presets && presets.length > 0 && \"flex-row\")}\n >\n {presets && presets.length > 0 && (\n <div className=\"flex flex-col gap-1 border-r p-3 min-w-[160px]\">\n <p className=\"mb-1 text-xs font-medium text-muted-foreground\">\n Quick select\n </p>\n {presets.map((preset) => (\n <Button\n key={preset.label}\n variant=\"ghost\"\n size=\"sm\"\n className=\"justify-start text-left text-sm font-normal\"\n onClick={() => handlePresetClick(preset)}\n >\n {preset.label}\n </Button>\n ))}\n </div>\n )}\n <div>\n <Calendar\n mode=\"range\"\n defaultMonth={value?.from}\n selected={value}\n onSelect={onChange}\n numberOfMonths={numberOfMonths}\n startMonth={fromDate}\n endMonth={toDate}\n autoFocus\n />\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n },\n);\nDateRangePicker.displayName = \"DateRangePicker\";\n\nexport { DateRangePicker };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Separator as SeparatorPrimitive } from \"radix-ui\";\nimport { cn } from \"../lib/utils\";\n\nconst Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport { tooltipAnimationClasses } from '../lib/surface-classes';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\nconst Tooltip = TooltipPrimitive.Root;\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md',\n tooltipAnimationClasses,\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useEditor, EditorContent, type Editor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Link from \"@tiptap/extension-link\";\nimport Underline from \"@tiptap/extension-underline\";\nimport TextAlign from \"@tiptap/extension-text-align\";\nimport {\n AlignCenter,\n AlignLeft,\n AlignRight,\n Bold,\n Code,\n Heading1,\n Heading2,\n Heading3,\n Italic,\n Link as LinkIcon,\n List,\n ListOrdered,\n Minus,\n Quote,\n Redo,\n Strikethrough,\n Underline as UnderlineIcon,\n Undo,\n Unlink,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Separator } from \"./separator\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"./tooltip\";\n\nexport interface TextEditorProps {\n /** The HTML content of the editor */\n value?: string;\n /** Callback when content changes (returns HTML) */\n onChange?: (html: string) => void;\n /** Placeholder text */\n placeholder?: string;\n /** Disable the editor */\n disabled?: boolean;\n /** Additional class names for the outer wrapper */\n className?: string;\n /** Additional class names for the editor content area */\n contentClassName?: string;\n /** Minimum height of the editor content area */\n minHeight?: string;\n /** Hide the toolbar */\n hideToolbar?: boolean;\n /** Toolbar features to show. Defaults to all. */\n toolbar?: Array<\n | \"bold\"\n | \"italic\"\n | \"underline\"\n | \"strike\"\n | \"code\"\n | \"heading\"\n | \"bulletList\"\n | \"orderedList\"\n | \"blockquote\"\n | \"horizontalRule\"\n | \"link\"\n | \"align\"\n | \"undo\"\n | \"redo\"\n >;\n /** Called when the editor is created */\n onEditorReady?: (editor: Editor) => void;\n}\n\ninterface ToolbarButtonProps {\n onClick: () => void;\n isActive?: boolean;\n disabled?: boolean;\n tooltip: string;\n children: React.ReactNode;\n}\n\nconst ToolbarButton = ({\n onClick,\n isActive,\n disabled,\n tooltip,\n children,\n}: ToolbarButtonProps) => (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={disabled}\n className={cn(\n \"h-8 w-8 p-0\",\n isActive && \"bg-accent text-accent-foreground\",\n )}\n onClick={onClick}\n >\n {children}\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\">\n <p className=\"text-xs\">{tooltip}</p>\n </TooltipContent>\n </Tooltip>\n);\n\nconst defaultToolbar: TextEditorProps[\"toolbar\"] = [\n \"bold\",\n \"italic\",\n \"underline\",\n \"strike\",\n \"code\",\n \"heading\",\n \"bulletList\",\n \"orderedList\",\n \"blockquote\",\n \"horizontalRule\",\n \"link\",\n \"align\",\n \"undo\",\n \"redo\",\n];\n\nconst EditorToolbar = ({\n editor,\n toolbar = defaultToolbar,\n}: {\n editor: Editor;\n toolbar?: TextEditorProps[\"toolbar\"];\n}) => {\n const has = (feature: string) => toolbar?.includes(feature as never) ?? false;\n\n const handleLink = () => {\n if (editor.isActive(\"link\")) {\n editor.chain().focus().unsetLink().run();\n return;\n }\n const url = window.prompt(\"Enter URL:\");\n if (url) {\n editor\n .chain()\n .focus()\n .extendMarkRange(\"link\")\n .setLink({ href: url })\n .run();\n }\n };\n\n return (\n <TooltipProvider delayDuration={300}>\n <div className=\"flex flex-wrap items-center gap-0.5 border-b px-2 py-1\">\n {has(\"bold\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBold().run()}\n isActive={editor.isActive(\"bold\")}\n tooltip=\"Bold\"\n >\n <Bold className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"italic\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleItalic().run()}\n isActive={editor.isActive(\"italic\")}\n tooltip=\"Italic\"\n >\n <Italic className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"underline\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n isActive={editor.isActive(\"underline\")}\n tooltip=\"Underline\"\n >\n <UnderlineIcon className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"strike\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleStrike().run()}\n isActive={editor.isActive(\"strike\")}\n tooltip=\"Strikethrough\"\n >\n <Strikethrough className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"code\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleCode().run()}\n isActive={editor.isActive(\"code\")}\n tooltip=\"Code\"\n >\n <Code className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n\n {(has(\"bold\") ||\n has(\"italic\") ||\n has(\"underline\") ||\n has(\"strike\") ||\n has(\"code\")) &&\n (has(\"heading\") ||\n has(\"bulletList\") ||\n has(\"orderedList\") ||\n has(\"blockquote\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"heading\") && (\n <>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 1 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 1 })}\n tooltip=\"Heading 1\"\n >\n <Heading1 className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 2 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 2 })}\n tooltip=\"Heading 2\"\n >\n <Heading2 className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 3 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 3 })}\n tooltip=\"Heading 3\"\n >\n <Heading3 className=\"h-4 w-4\" />\n </ToolbarButton>\n </>\n )}\n\n {has(\"bulletList\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBulletList().run()}\n isActive={editor.isActive(\"bulletList\")}\n tooltip=\"Bullet list\"\n >\n <List className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"orderedList\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleOrderedList().run()}\n isActive={editor.isActive(\"orderedList\")}\n tooltip=\"Ordered list\"\n >\n <ListOrdered className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"blockquote\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBlockquote().run()}\n isActive={editor.isActive(\"blockquote\")}\n tooltip=\"Blockquote\"\n >\n <Quote className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"horizontalRule\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().setHorizontalRule().run()}\n tooltip=\"Horizontal rule\"\n >\n <Minus className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n\n {(has(\"heading\") ||\n has(\"bulletList\") ||\n has(\"orderedList\") ||\n has(\"blockquote\")) &&\n (has(\"link\") || has(\"align\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"link\") && (\n <ToolbarButton\n onClick={handleLink}\n isActive={editor.isActive(\"link\")}\n tooltip={editor.isActive(\"link\") ? \"Remove link\" : \"Add link\"}\n >\n {editor.isActive(\"link\") ? (\n <Unlink className=\"h-4 w-4\" />\n ) : (\n <LinkIcon className=\"h-4 w-4\" />\n )}\n </ToolbarButton>\n )}\n\n {has(\"align\") && (\n <>\n <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign(\"left\").run()}\n isActive={editor.isActive({ textAlign: \"left\" })}\n tooltip=\"Align left\"\n >\n <AlignLeft className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().setTextAlign(\"center\").run()\n }\n isActive={editor.isActive({ textAlign: \"center\" })}\n tooltip=\"Align center\"\n >\n <AlignCenter className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign(\"right\").run()}\n isActive={editor.isActive({ textAlign: \"right\" })}\n tooltip=\"Align right\"\n >\n <AlignRight className=\"h-4 w-4\" />\n </ToolbarButton>\n </>\n )}\n\n {(has(\"link\") || has(\"align\")) && (has(\"undo\") || has(\"redo\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"undo\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().undo().run()}\n disabled={!editor.can().undo()}\n tooltip=\"Undo\"\n >\n <Undo className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"redo\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().redo().run()}\n disabled={!editor.can().redo()}\n tooltip=\"Redo\"\n >\n <Redo className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n </div>\n </TooltipProvider>\n );\n};\n\nconst TextEditor = React.forwardRef<HTMLDivElement, TextEditorProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Start writing...\",\n disabled = false,\n className,\n contentClassName,\n minHeight = \"150px\",\n hideToolbar = false,\n toolbar = defaultToolbar,\n onEditorReady,\n },\n ref,\n ) => {\n const editor = useEditor({\n immediatelyRender: false,\n extensions: [\n StarterKit.configure({\n heading: { levels: [1, 2, 3] },\n }),\n Placeholder.configure({ placeholder }),\n Underline,\n Link.configure({\n openOnClick: false,\n HTMLAttributes: {\n class: \"text-primary underline underline-offset-4 cursor-pointer\",\n },\n }),\n TextAlign.configure({\n types: [\"heading\", \"paragraph\"],\n }),\n ],\n content: value,\n editable: !disabled,\n onUpdate: ({ editor: e }) => {\n onChange?.(e.getHTML());\n },\n onCreate: ({ editor: e }) => {\n onEditorReady?.(e);\n },\n });\n\n React.useEffect(() => {\n if (editor && disabled !== undefined) {\n editor.setEditable(!disabled);\n }\n }, [editor, disabled]);\n\n React.useEffect(() => {\n if (editor && value !== undefined && editor.getHTML() !== value) {\n editor.commands.setContent(value);\n }\n }, [editor, value]);\n\n if (!editor) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n \"rounded-md border border-input bg-background ring-offset-background focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 focus-within:ring-offset-0\",\n disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n >\n {!hideToolbar && <EditorToolbar editor={editor} toolbar={toolbar} />}\n <EditorContent\n editor={editor}\n className={cn(\n \"prose prose-base sm:prose-sm dark:prose-invert max-w-none px-3 py-2 focus:outline-none [&_.tiptap]:outline-none [&_.tiptap.ProseMirror]:outline-none\",\n `[&_.tiptap]:min-h-[${minHeight}]`,\n \"[&_.tiptap_p.is-editor-empty:first-child::before]:text-muted-foreground [&_.tiptap_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.tiptap_p.is-editor-empty:first-child::before]:float-left [&_.tiptap_p.is-editor-empty:first-child::before]:h-0 [&_.tiptap_p.is-editor-empty:first-child::before]:pointer-events-none\",\n contentClassName,\n )}\n style={{ minHeight }}\n />\n </div>\n );\n },\n);\nTextEditor.displayName = \"TextEditor\";\n\nexport { TextEditor };\nexport type { Editor };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface TextContentProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The HTML content to render (from TextEditor output) */\n content: string;\n}\n\nconst TextContent = React.forwardRef<HTMLDivElement, TextContentProps>(\n ({ content, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"prose prose-sm dark:prose-invert max-w-none\",\n \"prose-headings:font-heading prose-headings:tracking-tight\",\n \"prose-a:text-primary prose-a:underline prose-a:underline-offset-4\",\n \"prose-blockquote:border-l-primary\",\n \"prose-code:rounded prose-code:bg-muted prose-code:px-1.5 prose-code:py-0.5 prose-code:text-sm prose-code:font-mono\",\n \"prose-pre:bg-muted prose-pre:rounded-md\",\n \"prose-hr:border-border\",\n className\n )}\n dangerouslySetInnerHTML={{ __html: content }}\n {...props}\n />\n );\n }\n);\nTextContent.displayName = \"TextContent\";\n\nexport { TextContent };\n","'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport { coarseHitAreaClasses } from '../lib/surface-classes';\nimport { cn } from '../lib/utils';\n\nfunction CheckIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn('shrink-0', className)}\n aria-hidden\n >\n <path\n d=\"M2.5 6.25 5 8.75 9.5 3.25\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction IndeterminateIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn('shrink-0', className)}\n aria-hidden\n >\n <path\n d=\"M2.5 6h7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, checked, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n checked={checked}\n className={cn(\n 'peer h-4 w-4 shrink-0 cursor-pointer rounded-[2px] border border-primary bg-background ring-offset-background transition-[color,background-color,border-color] duration-fast ease-default focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/35 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground',\n coarseHitAreaClasses,\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n 'flex h-full w-full items-center justify-center text-current',\n )}\n >\n {checked === 'indeterminate' ? (\n <IndeterminateIcon className=\"h-[10px] w-[10px]\" />\n ) : (\n <CheckIcon className=\"h-[10px] w-[10px]\" />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","'use client';\n\nimport * as React from 'react';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\nimport { coarseHitAreaClasses } from '../lib/surface-classes';\nimport { cn } from '../lib/utils';\n\nconst RadioGroup = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root\n className={cn('grid gap-2', className)}\n {...props}\n ref={ref}\n />\n));\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-primary bg-background text-primary ring-offset-background focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/35 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary',\n coarseHitAreaClasses,\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex h-full w-full items-center justify-center\">\n <span\n aria-hidden\n className=\"block h-2 w-2 rounded-full bg-current\"\n />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Switch as SwitchPrimitives } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { coarseHitAreaClasses } from \"../lib/surface-classes\";\nimport { cn } from \"../lib/utils\";\n\nconst switchVariants = cva(\n \"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast ease-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n {\n variants: {\n size: {\n sm: \"h-5 w-9\",\n md: \"h-6 w-11\",\n lg: \"h-7 w-14\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\n// Thumb size + checked translate are paired to each track so the thumb slides\n// exactly to the far edge (translate = track inner width − thumb width).\nconst switchThumbVariants = cva(\n \"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform duration-fast ease-default data-[state=unchecked]:translate-x-0\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 data-[state=checked]:translate-x-4\",\n md: \"h-5 w-5 data-[state=checked]:translate-x-5\",\n lg: \"h-6 w-6 data-[state=checked]:translate-x-7\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\nexport interface SwitchProps\n extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,\n VariantProps<typeof switchVariants> {}\n\nconst Switch = React.forwardRef<React.ComponentRef<typeof SwitchPrimitives.Root>, SwitchProps>(\n ({ className, size, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(switchVariants({ size }), coarseHitAreaClasses, className)}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb className={cn(switchThumbVariants({ size }))} />\n </SwitchPrimitives.Root>\n ),\n);\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch, switchVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slider as SliderPrimitive } from \"radix-ui\";\nimport { coarseHitAreaClasses } from \"../lib/surface-classes\";\nimport { cn } from \"../lib/utils\";\n\nconst Slider = React.forwardRef<\n React.ComponentRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex w-full touch-none select-none items-center\",\n className,\n )}\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary\">\n <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb\n className={cn(\n \"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n coarseHitAreaClasses,\n )}\n />\n </SliderPrimitive.Root>\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-lg border bg-card text-card-foreground shadow-sm\", className)}\n {...props}\n />\n )\n);\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-[var(--density-padding-xl)]\", className)}\n {...props}\n />\n )\n);\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-2xl font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n )\n);\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n )\n);\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-[var(--density-padding-xl)] pt-0\", className)} {...props} />\n )\n);\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-[var(--density-padding-xl)] pt-0\", className)}\n {...props}\n />\n )\n);\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\n","'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n CircleAlert,\n CircleCheck,\n Info,\n ShieldAlert,\n TriangleAlert,\n X,\n} from 'lucide-react';\nimport { cn } from '../lib/utils';\n\nconst alertVariants = cva(\n 'flex w-full items-start gap-3 rounded-[var(--radius-md)] border p-4 text-sm',\n {\n variants: {\n variant: {\n default:\n 'bg-muted/50 text-foreground border-border [&_[data-alert-icon]]:text-muted-foreground dark:bg-muted/30 dark:border-border-strong',\n destructive:\n 'border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300',\n success:\n 'border-success-300 bg-success-50 text-success-900 [&_[data-alert-icon]]:text-success-600 dark:border-success-700 dark:bg-success-900/60 dark:text-success-100 dark:[&_[data-alert-icon]]:text-success-300',\n warning:\n 'border-warning-300 bg-warning-50 text-warning-900 [&_[data-alert-icon]]:text-warning-600 dark:border-warning-700 dark:bg-warning-900/60 dark:text-warning-100 dark:[&_[data-alert-icon]]:text-warning-300',\n /**\n * @deprecated Use `variant=\"destructive\"` instead — `danger` is a\n * visual duplicate and will be removed in a future major release.\n */\n danger:\n 'border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300',\n info: 'border-primary-300 bg-primary-50 text-primary-900 [&_[data-alert-icon]]:text-primary-600 dark:border-primary-700 dark:bg-primary-900/60 dark:text-primary-100 dark:[&_[data-alert-icon]]:text-primary-300',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nconst defaultIcons: Record<string, React.ReactNode> = {\n default: <Info className=\"size-4\" />,\n destructive: <ShieldAlert className=\"size-4\" />,\n success: <CircleCheck className=\"size-4\" />,\n warning: <TriangleAlert className=\"size-4\" />,\n danger: <CircleAlert className=\"size-4\" />,\n info: <Info className=\"size-4\" />,\n};\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof alertVariants> {\n /**\n * Whether to render a leading icon. When `true` and no `icon` is provided,\n * the variant's built-in default icon is rendered. Defaults to `false`.\n */\n showIcon?: boolean;\n /**\n * Renders any React node as the leading icon (e.g. `<FontAwesomeIcon … />`,\n * a Lucide icon, or an inline SVG). When set, this takes precedence over\n * `showIcon` and replaces the default icon entirely.\n */\n icon?: React.ReactNode;\n /** Whether the alert can be dismissed. Defaults to `false`. */\n dismissable?: boolean;\n /** Callback fired when the dismiss button is clicked. */\n onDismiss?: () => void;\n}\n\nconst Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = 'default',\n showIcon = false,\n icon,\n dismissable = false,\n onDismiss,\n children,\n ...props\n },\n ref,\n ) => {\n const [dismissed, setDismissed] = React.useState(false);\n\n if (dismissed) return null;\n\n const resolvedIcon =\n icon ?? (showIcon ? defaultIcons[variant ?? 'default'] : null);\n\n const leading = resolvedIcon ? (\n <span\n className=\"mt-0.5 inline-flex shrink-0 [&_svg]:shrink-0\"\n data-alert-icon=\"\"\n aria-hidden\n >\n {resolvedIcon}\n </span>\n ) : null;\n\n const handleDismiss = () => {\n setDismissed(true);\n onDismiss?.();\n };\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), 'min-w-0', className)}\n {...props}\n >\n {leading}\n <div className=\"min-w-0 flex-1\">{children}</div>\n {dismissable ? (\n <button\n type=\"button\"\n onClick={handleDismiss}\n className=\"shrink-0 self-start rounded-[var(--radius-sm)] p-1.5 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2\"\n aria-label=\"Dismiss\"\n >\n <X className=\"size-4\" />\n </button>\n ) : null}\n </div>\n );\n },\n);\nAlert.displayName = 'Alert';\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn('mb-1 font-medium leading-none tracking-tight', className)}\n {...props}\n />\n));\nAlertTitle.displayName = 'AlertTitle';\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm [&_p]:leading-relaxed', className)}\n {...props}\n />\n));\nAlertDescription.displayName = 'AlertDescription';\n\nexport { Alert, AlertTitle, AlertDescription, alertVariants };\n","/**\n * Soft semantic tints — used for status indicators (badges, callouts) where\n * the element is informational/passive (not an interactive tile or button).\n *\n * Pattern: `border-{color}-500/30 bg-{color}-500/10 text-{color}-700`\n * with dark-mode shifts to `*-400` shades. Yields a subtle, non-clickable\n * \"I am a {success|warning|error|info} indicator\" look.\n *\n * Distinct from `semantic-action-tones.ts`:\n * - Action tones (positive/negative): brighter, clickable tile look\n * (`bg-X-100 + border-X-200/0.9 + text-X-600 + shadow-sm`). Used by Button.\n * - Tint tones (here): subtler, indicator look. Used by Badge.\n *\n * If you find yourself reaching for \"soft semantic background\" — interactive\n * → use action tones; passive → use these.\n */\n\nexport const tintToneSuccess =\n 'border-success-500/30 bg-success-500/10 text-success-700 dark:border-success-400/30 dark:bg-success-400/10 dark:text-success-400';\n\nexport const tintToneWarning =\n 'border-warning-500/30 bg-warning-500/10 text-warning-700 dark:border-warning-400/30 dark:bg-warning-400/10 dark:text-warning-400';\n\nexport const tintToneDestructive =\n 'border-destructive-500/30 bg-destructive-500/10 text-destructive-700 dark:border-destructive-400/30 dark:bg-destructive-400/10 dark:text-destructive-400';\n\nexport const tintToneInfo =\n 'border-primary-500/30 bg-primary-500/10 text-primary-700 dark:border-primary-400/30 dark:bg-primary-400/10 dark:text-primary-400';\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\nimport {\n tintToneDestructive,\n tintToneInfo,\n tintToneSuccess,\n tintToneWarning,\n} from \"../lib/semantic-tint-tones\";\n\nconst badgeVariants = cva(\n \"inline-flex h-6 items-center justify-center rounded-md border px-2.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-border bg-muted text-muted-foreground hover:bg-muted/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary-700\",\n accent:\n \"border-transparent bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600\",\n highlight:\n \"border-transparent bg-highlight text-highlight-foreground hover:bg-highlight-600\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive-700\",\n outline: \"text-foreground\",\n success: tintToneSuccess,\n warning: tintToneWarning,\n error: tintToneDestructive,\n info: tintToneInfo,\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport interface BadgeProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n <div className={cn(badgeVariants({ variant }), className)} {...props} />\n );\n}\n\nexport { Badge, badgeVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst avatarVariants = cva(\n \"relative flex h-10 w-10 shrink-0\",\n {\n variants: {\n shape: {\n circle: \"rounded-full\",\n rounded: \"rounded-2xl\",\n square: \"rounded-lg\",\n },\n },\n defaultVariants: {\n shape: \"circle\",\n },\n }\n);\n\ninterface AvatarProps\n extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {\n /**\n * Clip content to the avatar shape. Defaults to `true`. Set `false` to let an\n * overlay that a source bakes into the image extend past the shape — e.g. a\n * Google \"Local Guide\" star badge composited into the corner of a profile\n * photo, which a circular clip would otherwise cut off.\n */\n clip?: boolean;\n}\n\nconst Avatar = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Root>,\n AvatarProps\n>(({ className, shape, clip = true, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n avatarVariants({ shape }),\n clip ? \"overflow-hidden\" : \"overflow-visible\",\n className,\n )}\n {...props}\n />\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nconst AvatarImage = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image ref={ref} className={cn(\"aspect-square h-full w-full\", className)} {...props} />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\"flex h-full w-full items-center justify-center rounded-full bg-muted\", className)}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\nexport { Avatar, AvatarImage, AvatarFallback, avatarVariants };\nexport type { AvatarProps };\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { X } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n centeredModalContentClasses,\n overlayScrimClasses,\n touchTargetClasses,\n} from '../lib/surface-classes';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(overlayScrimClasses, className)}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(centeredModalContentClasses, className)}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className={cn(\n 'absolute right-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',\n touchTargetClasses,\n )}\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-1.5 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport {\n centeredModalContentClasses,\n overlayScrimClasses,\n} from '../lib/surface-classes';\nimport { buttonVariants } from './button';\n\nconst AlertDialog = AlertDialogPrimitive.Root;\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(overlayScrimClasses, className)}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(centeredModalContentClasses, className)}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-2 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\n\nconst AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold', className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: 'outline' }),\n 'mt-2 sm:mt-0',\n className,\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as SheetPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport { overlayScrimClasses, touchTargetClasses } from '../lib/surface-classes';\n\nconst Sheet = SheetPrimitive.Root;\nconst SheetTrigger = SheetPrimitive.Trigger;\nconst SheetClose = SheetPrimitive.Close;\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(overlayScrimClasses, className)}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariants = cva(\n 'fixed z-[var(--z-modal)] gap-4 bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:[animation-duration:var(--panel-open-dur)] data-[state=closed]:[animation-duration:var(--panel-close-dur)] data-[state=open]:[animation-timing-function:var(--panel-ease)] data-[state=closed]:[animation-timing-function:var(--panel-ease)]',\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left',\n right:\n 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right',\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n xl: '',\n full: '',\n },\n },\n defaultVariants: {\n side: 'right',\n size: 'sm',\n },\n compoundVariants: [\n { side: 'left', size: 'sm', className: 'sm:max-w-sm' },\n { side: 'left', size: 'md', className: 'sm:max-w-md' },\n { side: 'left', size: 'lg', className: 'sm:max-w-lg' },\n { side: 'left', size: 'xl', className: 'sm:max-w-xl' },\n { side: 'left', size: 'full', className: 'sm:max-w-full' },\n { side: 'right', size: 'sm', className: 'sm:max-w-sm' },\n { side: 'right', size: 'md', className: 'sm:max-w-md' },\n { side: 'right', size: 'lg', className: 'sm:max-w-lg' },\n { side: 'right', size: 'xl', className: 'sm:max-w-xl' },\n { side: 'right', size: 'full', className: 'sm:max-w-full' },\n ],\n },\n);\n\ninterface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = 'right', size = 'sm', className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n ref={ref}\n className={cn(sheetVariants({ side, size }), className)}\n {...props}\n >\n {children}\n <SheetPrimitive.Close\n className={cn(\n 'absolute right-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary',\n touchTargetClasses,\n )}\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-2 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\n\nconst SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n","'use client';\n\n/**\n * DropdownMenu — visually mirrored by `context-menu.tsx`. Both pull chrome\n * from `lib/surface-classes.ts` (menuSurfaceClasses, menuItemClasses, etc.)\n * so they stay in lockstep. Edit the shared classes file, not this one or\n * context-menu.tsx, when tweaking menu visuals.\n */\n\nimport * as React from 'react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n menuItemClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[state=open]:bg-accent',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n menuSurfaceClasses,\n floatingAnimationClasses,\n 'shadow-lg',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(menuItemClasses, inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n);\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n","\"use client\";\n\nimport { Toaster as SonnerToaster, toast } from \"sonner\";\n\nexport interface ToasterProps {\n position?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\" | \"top-center\" | \"bottom-center\";\n richColors?: boolean;\n closeButton?: boolean;\n className?: string;\n}\n\nfunction Toaster({ position = \"bottom-right\", richColors = true, closeButton = true, ...props }: ToasterProps) {\n return (\n <SonnerToaster\n position={position}\n richColors={richColors}\n closeButton={closeButton}\n toastOptions={{\n classNames: {\n toast: \"group border-border bg-background text-foreground shadow-lg\",\n description: \"text-muted-foreground\",\n actionButton: \"bg-primary text-primary-foreground\",\n cancelButton: \"bg-muted text-muted-foreground\",\n },\n }}\n {...props}\n />\n );\n}\n\nexport { Toaster, toast };\n","'use client';\n\nimport * as React from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\n\nconst Tabs = TabsPrimitive.Root;\n\n// useLayoutEffect warns on the server; fall back to useEffect there.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nconst TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, children, ...props }, forwardedRef) => {\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n const pillRef = React.useRef<HTMLSpanElement | null>(null);\n\n // Merge the forwarded ref with our internal one.\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n innerRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n // Slide the pill behind whichever trigger Radix has marked active. The pill\n // shares the list as its offset parent, so a trigger's offsetLeft/offsetWidth\n // map directly to the pill's translateX/width.\n const move = React.useCallback((animate: boolean) => {\n const list = innerRef.current;\n const pill = pillRef.current;\n if (!list || !pill) return;\n\n const active = list.querySelector<HTMLElement>(\n '[role=\"tab\"][data-state=\"active\"]',\n );\n if (!active) {\n pill.style.opacity = '0';\n return;\n }\n\n // Suspend via transition-property (not the `transition` shorthand) so the\n // inline duration/easing from the --tabs-* tokens survive the snap.\n if (!animate) pill.style.transitionProperty = 'none';\n pill.style.opacity = '1';\n pill.style.transform = `translateX(${active.offsetLeft}px)`;\n pill.style.width = `${active.offsetWidth}px`;\n if (!animate) {\n // Force a reflow so the snap applies before transitions are restored.\n void pill.offsetWidth;\n pill.style.transitionProperty = '';\n }\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n move(false);\n\n const list = innerRef.current;\n if (!list) return;\n\n // Radix flips data-state on triggers for both pointer and keyboard nav.\n const observer = new MutationObserver(() => move(true));\n observer.observe(list, {\n subtree: true,\n attributes: true,\n attributeFilter: ['data-state'],\n childList: true,\n });\n\n const resize = new ResizeObserver(() => move(false));\n resize.observe(list);\n\n return () => {\n observer.disconnect();\n resize.disconnect();\n };\n }, [move]);\n\n return (\n <TabsPrimitive.List\n ref={setRef}\n className={cn(\n 'relative isolate inline-flex h-[var(--density-height-md)] items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',\n className,\n )}\n {...props}\n >\n <span\n ref={pillRef}\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute bottom-1 left-0 top-1 z-0 rounded-sm opacity-0 shadow-sm',\n 'bg-[var(--bison-tab-active-bg,hsl(var(--primary)))]',\n 'transition-[transform,width] motion-reduce:transition-none',\n )}\n style={{\n transitionDuration: 'var(--tabs-dur)',\n transitionTimingFunction: 'var(--tabs-ease)',\n }}\n />\n {children}\n </TabsPrimitive.List>\n );\n});\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'relative z-[1] inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-[var(--bison-tab-active-fg,hsl(var(--primary-foreground)))]',\n className,\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Check, FastForward } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { tintToneSuccess, tintToneWarning } from \"../lib/semantic-tint-tones\";\n\nexport type StepperState = \"completed\" | \"active\" | \"skipped\" | \"upcoming\";\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\n// Indicator size — kept as a constant so connector positioning math is exact.\nconst INDICATOR_SIZE_PX = 36; // matches h-9/w-9\nconst INDICATOR_CENTER_PX = INDICATOR_SIZE_PX / 2; // 18\nconst CONNECTOR_THICKNESS_PX = 2; // h-0.5 / w-0.5\n// Minimum connector length when there's no surrounding content to push items\n// apart. Keeps the visual rhythm consistent.\nconst MIN_CONNECTOR_LENGTH_PX = 24;\n\ntype StepperContextValue = {\n orientation: StepperOrientation;\n interactive: boolean;\n allowSkipAhead: boolean;\n onStepClick?: (index: number) => void;\n};\n\nconst StepperContext = React.createContext<StepperContextValue | null>(null);\n\nfunction useStepperContext(component: string) {\n const ctx = React.useContext(StepperContext);\n if (!ctx) {\n throw new Error(`<${component}> must be used inside <Stepper>`);\n }\n return ctx;\n}\n\ntype StepperItemContextValue = {\n state: StepperState;\n index: number;\n isLast: boolean;\n disabled: boolean;\n};\n\nconst StepperItemContext = React.createContext<StepperItemContextValue | null>(\n null,\n);\n\nfunction useStepperItemContext(component: string) {\n const ctx = React.useContext(StepperItemContext);\n if (!ctx) {\n throw new Error(`<${component}> must be used inside <StepperItem>`);\n }\n return ctx;\n}\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: StepperOrientation;\n interactive?: boolean;\n allowSkipAhead?: boolean;\n onStepClick?: (index: number) => void;\n}\n\nconst Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n (\n {\n className,\n orientation = \"horizontal\",\n interactive = false,\n allowSkipAhead = false,\n onStepClick,\n children,\n ...props\n },\n ref,\n ) => {\n const value = React.useMemo<StepperContextValue>(\n () => ({\n orientation,\n interactive,\n allowSkipAhead,\n onStepClick,\n }),\n [orientation, interactive, allowSkipAhead, onStepClick],\n );\n\n // Derive each item's index and `isLast` flag from its JSX position rather\n // than from a shared mutable counter. The counter approach was unsound:\n // it relied on every `<StepperItem>` re-rendering exactly once per\n // `<Stepper>` render, in order. React 19 strict-mode double renders,\n // concurrent renders, and out-of-band item re-renders can all break that\n // contract, causing indices (and therefore `isLast`) to drift — which\n // shows up as wrong step numbers and a stray trailing connector.\n //\n // Instead we walk the children once here, count `<StepperItem>` matches\n // up-front, then `cloneElement` each item with `_index` and `_isLast`\n // injected as internal props. Non-item children pass through untouched.\n const childArray = React.Children.toArray(children);\n const totalItems = childArray.reduce<number>(\n (acc, child) =>\n React.isValidElement(child) &&\n (child.type as { displayName?: string })?.displayName === \"StepperItem\"\n ? acc + 1\n : acc,\n 0,\n );\n\n let itemIndex = 0;\n const decoratedChildren = childArray.map((child) => {\n if (\n !React.isValidElement(child) ||\n (child.type as { displayName?: string })?.displayName !== \"StepperItem\"\n ) {\n return child;\n }\n const index = itemIndex;\n itemIndex += 1;\n return React.cloneElement(child as React.ReactElement<StepperItemProps>, {\n _index: index,\n _isLast: index === totalItems - 1,\n });\n });\n\n return (\n <StepperContext.Provider value={value}>\n <div\n ref={ref}\n role={interactive ? \"tablist\" : undefined}\n aria-orientation={orientation}\n className={cn(\n \"flex w-full\",\n orientation === \"horizontal\"\n ? \"flex-row items-start\"\n : \"flex-col items-stretch\",\n className,\n )}\n {...props}\n >\n {decoratedChildren}\n </div>\n </StepperContext.Provider>\n );\n },\n);\nStepper.displayName = \"Stepper\";\n\nconst stepperItemVariants = cva(\n \"group/stepper-item relative flex transition-colors\",\n {\n variants: {\n orientation: {\n // Horizontal items grow to share the row equally. Indicator at top,\n // label/description block below. Trailing connector is absolutely\n // positioned at the indicator's vertical center.\n horizontal: \"min-w-0 flex-1 flex-col items-center text-center\",\n // Vertical items have indicator on the left, label/description block\n // on the right. Trailing connector is absolutely positioned at the\n // indicator's horizontal center.\n vertical: \"flex-row items-start gap-3 text-left\",\n },\n interactive: {\n true: \"cursor-pointer rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60\",\n false: \"\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n interactive: false,\n },\n },\n);\n\nexport interface StepperItemProps extends Omit<\n React.HTMLAttributes<HTMLDivElement | HTMLButtonElement>,\n \"onClick\"\n> {\n state?: StepperState;\n /**\n * Color of the connector that follows this item. Defaults to the item's own\n * `state`, which yields a \"fills in\" effect as the user progresses.\n */\n connectorState?: StepperState;\n /**\n * Hide the trailing connector for this item. Useful if you need a custom\n * separator. The last item never renders a connector regardless of this prop.\n */\n hideConnector?: boolean;\n disabled?: boolean;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /**\n * @internal Injected by the parent `<Stepper>` based on JSX position. Do\n * not pass directly — `<Stepper>` clones each `<StepperItem>` to set this.\n */\n _index?: number;\n /**\n * @internal Injected by the parent `<Stepper>` based on JSX position. Do\n * not pass directly — `<Stepper>` clones each `<StepperItem>` to set this.\n */\n _isLast?: boolean;\n}\n\nconst StepperItem = React.forwardRef<HTMLElement, StepperItemProps>(\n (\n {\n state = \"upcoming\",\n connectorState,\n hideConnector = false,\n disabled: disabledProp,\n className,\n onClick,\n children,\n _index,\n _isLast,\n ...props\n },\n ref,\n ) => {\n const { orientation, interactive, allowSkipAhead, onStepClick } =\n useStepperContext(\"StepperItem\");\n\n // `_index` and `_isLast` are injected by the parent `<Stepper>` based on\n // JSX position. We default them defensively so a `<StepperItem>` rendered\n // in isolation (e.g. a snapshot test) still produces sensible output —\n // it's treated as the only/last step.\n const index = _index ?? 0;\n const isLast = _isLast ?? true;\n\n const disabled =\n disabledProp ?? (interactive && state === \"upcoming\" && !allowSkipAhead);\n\n const itemValue = React.useMemo<StepperItemContextValue>(\n () => ({ state, index, isLast, disabled }),\n [state, index, isLast, disabled],\n );\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) return;\n onClick?.(event);\n onStepClick?.(index);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!interactive) return;\n const target = event.currentTarget;\n const items = Array.from(\n target.parentElement?.querySelectorAll<HTMLElement>(\n '[data-stepper-item=\"true\"]:not([disabled])',\n ) ?? [],\n );\n const currentIdx = items.indexOf(target);\n if (currentIdx < 0) return;\n\n const nextKey = orientation === \"horizontal\" ? \"ArrowRight\" : \"ArrowDown\";\n const prevKey = orientation === \"horizontal\" ? \"ArrowLeft\" : \"ArrowUp\";\n\n if (event.key === nextKey) {\n event.preventDefault();\n items[(currentIdx + 1) % items.length]?.focus();\n } else if (event.key === prevKey) {\n event.preventDefault();\n items[(currentIdx - 1 + items.length) % items.length]?.focus();\n } else if (event.key === \"Home\") {\n event.preventDefault();\n items[0]?.focus();\n } else if (event.key === \"End\") {\n event.preventDefault();\n items[items.length - 1]?.focus();\n }\n };\n\n const showConnector = !isLast && !hideConnector;\n const resolvedConnectorState = connectorState ?? state;\n\n // Ensure each item has enough length for the connector to be visible even\n // when the content is short. Padding stays inside the item so the next\n // item's indicator sits flush against the end of the connector.\n const itemSpacing = !showConnector\n ? \"\"\n : orientation === \"vertical\"\n ? \"pb-8\"\n : \"\";\n\n const sharedProps = {\n \"data-stepper-item\": \"true\" as const,\n \"data-state\": state,\n \"aria-current\": state === \"active\" ? (\"step\" as const) : undefined,\n className: cn(\n stepperItemVariants({ orientation, interactive }),\n itemSpacing,\n className,\n ),\n };\n\n // Split children into the indicator and everything else, then wrap the\n // \"rest\" in a labelled content block. This lets users write:\n //\n // <StepperItem>\n // <StepperIndicator />\n // <StepperLabel>...</StepperLabel>\n // <StepperDescription>...</StepperDescription>\n // </StepperItem>\n //\n // …without manually grouping label + description in a wrapper div.\n const { indicator, rest } = splitIndicator(children);\n\n const content = (\n <StepperItemContext.Provider value={itemValue}>\n {indicator}\n {rest.length > 0 ? (\n <div\n className={cn(\n \"relative z-10 flex min-w-0 flex-col gap-1\",\n orientation === \"horizontal\"\n ? \"mt-2 items-center\"\n : \"flex-1 items-start\",\n )}\n >\n {rest}\n </div>\n ) : null}\n {showConnector ? (\n <Connector orientation={orientation} state={resolvedConnectorState} />\n ) : null}\n </StepperItemContext.Provider>\n );\n\n if (interactive) {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n role=\"tab\"\n aria-selected={state === \"active\"}\n disabled={disabled}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n {...sharedProps}\n {...(props as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div\n ref={ref as React.Ref<HTMLDivElement>}\n {...sharedProps}\n {...(props as React.HTMLAttributes<HTMLDivElement>)}\n >\n {content}\n </div>\n );\n },\n);\nStepperItem.displayName = \"StepperItem\";\n\n/**\n * Trailing connector line, absolutely positioned along the indicator's\n * center axis. By anchoring to the item box (not to a flex sibling) the\n * line is guaranteed to align with the indicator regardless of how much\n * content sits below or beside it.\n *\n * - Horizontal: line runs from the right edge of this item's indicator to\n * the left edge of the next item's indicator. Top = indicator center.\n * - Vertical: line runs from the bottom edge of this item's indicator to\n * the top edge of the next item's indicator. Left = indicator center.\n */\nfunction Connector({\n orientation,\n state,\n}: {\n orientation: StepperOrientation;\n state: StepperState;\n}) {\n if (orientation === \"horizontal\") {\n return (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute z-0 h-0.5 transition-colors\",\n connectorColor(state),\n )}\n style={{\n top: INDICATOR_CENTER_PX - CONNECTOR_THICKNESS_PX / 2,\n left: `calc(50% + ${INDICATOR_CENTER_PX}px)`,\n right: `calc(-50% + ${INDICATOR_CENTER_PX}px)`,\n }}\n />\n );\n }\n\n return (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute z-0 w-0.5 transition-colors\",\n connectorColor(state),\n )}\n style={{\n left: INDICATOR_CENTER_PX - CONNECTOR_THICKNESS_PX / 2,\n top: INDICATOR_SIZE_PX,\n bottom: 0,\n }}\n />\n );\n}\n\n/**\n * Pulls the first <StepperIndicator> out of a children list. Returns the\n * indicator (or null) and the remaining children. Identity-checked so it\n * works with forwardRef wrappers regardless of displayName quirks.\n */\nfunction splitIndicator(children: React.ReactNode): {\n indicator: React.ReactNode | null;\n rest: React.ReactNode[];\n} {\n let indicator: React.ReactNode | null = null;\n const rest: React.ReactNode[] = [];\n\n React.Children.forEach(children, (child) => {\n if (\n indicator === null &&\n React.isValidElement(child) &&\n child.type === StepperIndicator\n ) {\n indicator = child;\n } else {\n rest.push(child);\n }\n });\n\n return { indicator, rest };\n}\n\nfunction connectorColor(state: StepperState): string {\n switch (state) {\n case \"completed\":\n return \"bg-success-500 dark:bg-success-400\";\n case \"active\":\n return \"bg-primary\";\n case \"skipped\":\n return \"bg-warning-500 dark:bg-warning-400\";\n case \"upcoming\":\n default:\n return \"bg-border\";\n }\n}\n\nconst stepperIndicatorVariants = cva(\n \"relative z-10 inline-flex shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors\",\n {\n variants: {\n state: {\n completed: tintToneSuccess,\n active:\n \"border-primary bg-primary text-primary-foreground ring-2 ring-primary/30 ring-offset-2 ring-offset-background\",\n skipped: tintToneWarning,\n upcoming: \"border-border bg-muted text-muted-foreground\",\n },\n },\n defaultVariants: { state: \"upcoming\" },\n },\n);\n\nexport interface StepperIndicatorProps\n extends\n Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\">,\n VariantProps<typeof stepperIndicatorVariants> {\n /**\n * Optional icon to render when the step is `active` or `upcoming`. Pass any\n * React node (`<FontAwesomeIcon … />`, a Lucide icon, an inline SVG, etc.).\n * Ignored for `completed` (always check) and `skipped` (always forward) states.\n */\n icon?: React.ReactNode;\n /**\n * Override the auto-generated step number. Pass a string/number to display\n * custom content for `active` / `upcoming` states.\n */\n children?: React.ReactNode;\n}\n\nconst StepperIndicator = React.forwardRef<\n HTMLSpanElement,\n StepperIndicatorProps\n>(({ className, icon, children, style, ...props }, ref) => {\n const { state, index } = useStepperItemContext(\"StepperIndicator\");\n\n let inner: React.ReactNode;\n if (state === \"completed\") {\n inner = <Check className=\"h-4 w-4\" aria-hidden=\"true\" />;\n } else if (state === \"skipped\") {\n inner = <FastForward className=\"h-4 w-4\" aria-hidden=\"true\" />;\n } else if (icon !== undefined && icon !== null) {\n inner = (\n <span className=\"inline-flex h-4 w-4 items-center justify-center [&_svg]:h-4 [&_svg]:w-4\">\n {icon}\n </span>\n );\n } else if (children !== undefined) {\n inner = children;\n } else {\n inner = index + 1;\n }\n\n return (\n <span\n ref={ref}\n aria-hidden={state !== \"active\"}\n className={cn(stepperIndicatorVariants({ state }), className)}\n style={{\n height: INDICATOR_SIZE_PX,\n width: INDICATOR_SIZE_PX,\n ...style,\n }}\n {...props}\n >\n {inner}\n </span>\n );\n});\nStepperIndicator.displayName = \"StepperIndicator\";\n\nconst stepperLabelVariants = cva(\"text-sm font-medium transition-colors\", {\n variants: {\n state: {\n completed: \"text-foreground\",\n active: \"text-foreground\",\n skipped: \"text-muted-foreground line-through\",\n upcoming: \"text-muted-foreground\",\n },\n },\n defaultVariants: { state: \"upcoming\" },\n});\n\nconst StepperLabel = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => {\n const { state } = useStepperItemContext(\"StepperLabel\");\n return (\n <span\n ref={ref}\n className={cn(stepperLabelVariants({ state }), className)}\n {...props}\n />\n );\n});\nStepperLabel.displayName = \"StepperLabel\";\n\nconst StepperDescription = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n className={cn(\"text-xs text-muted-foreground\", className)}\n {...props}\n />\n));\nStepperDescription.displayName = \"StepperDescription\";\n\n/**\n * Backwards-compatible no-op separator.\n *\n * The connector line between steps is now rendered automatically by each\n * `<StepperItem>`. Continue using `<StepperSeparator>` between items if you\n * prefer the explicit syntax — it renders nothing and the auto-connector\n * handles the visual.\n *\n * @deprecated Connectors are rendered automatically by `<StepperItem>`.\n * This component is now a no-op kept for source compatibility.\n */\nconst StepperSeparator: React.FC<{\n state?: StepperState;\n className?: string;\n}> = () => null;\nStepperSeparator.displayName = \"StepperSeparator\";\n\nexport {\n Stepper,\n StepperItem,\n StepperIndicator,\n StepperLabel,\n StepperDescription,\n StepperSeparator,\n stepperItemVariants,\n stepperIndicatorVariants,\n stepperLabelVariants,\n};\n\nexport { INDICATOR_SIZE_PX, INDICATOR_CENTER_PX };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Accordion as AccordionPrimitive } from \"radix-ui\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 transition-transform duration-normal\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n","import * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(\n ({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table ref={ref} className={cn(\"w-full caption-bottom text-sm\", className)} {...props} />\n </div>\n )\n);\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <thead ref={ref} className={cn(\"[&_tr]:border-b\", className)} {...props} />\n);\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tbody ref={ref} className={cn(\"[&_tr:last-child]:border-0\", className)} {...props} />\n);\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tfoot ref={ref} className={cn(\"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0\", className)} {...props} />\n);\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr ref={ref} className={cn(\"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\", className)} {...props} />\n )\n);\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <th ref={ref} className={cn(\"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\", className)} {...props} />\n )\n);\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <td ref={ref} className={cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className)} {...props} />\n )\n);\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(\n ({ className, ...props }, ref) => <caption ref={ref} className={cn(\"mt-4 text-sm text-muted-foreground\", className)} {...props} />\n);\nTableCaption.displayName = \"TableCaption\";\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n flexRender,\n type ColumnDef,\n type SortingState,\n type ColumnFiltersState,\n type VisibilityState,\n type RowSelectionState,\n type PaginationState,\n type Table as TanstackTable,\n type OnChangeFn,\n} from \"@tanstack/react-table\";\nimport {\n ArrowDown,\n ArrowUp,\n ArrowUpDown,\n ChevronLeft,\n ChevronRight,\n ChevronsLeft,\n ChevronsRight,\n Settings2,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Table, TableHeader, TableBody, TableHead, TableRow, TableCell } from \"./table\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Checkbox } from \"./checkbox\";\nimport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n} from \"./select\";\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuCheckboxItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n} from \"./dropdown-menu\";\n\n// ---------------------------------------------------------------------------\n// Re-exports\n// ---------------------------------------------------------------------------\n\nexport type { ColumnDef } from \"@tanstack/react-table\";\n\n// ---------------------------------------------------------------------------\n// Size / Density\n// ---------------------------------------------------------------------------\n\ntype DataTableSize = \"sm\" | \"md\" | \"lg\";\n\nconst sizeClasses: Record<DataTableSize, { cell: string; header: string }> = {\n sm: { cell: \"px-3 py-1.5 text-xs\", header: \"h-9 px-3 text-xs\" },\n md: { cell: \"px-4 py-2 text-sm\", header: \"h-10 px-4 text-sm\" },\n lg: { cell: \"px-4 py-3 text-sm\", header: \"h-12 px-4 text-sm\" },\n};\n\nconst densitySizeMap: Record<string, DataTableSize> = {\n compact: \"sm\",\n default: \"md\",\n spacious: \"lg\",\n};\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface DataTableProps<TData> {\n /** Column definitions (TanStack Table ColumnDef). */\n columns: ColumnDef<TData, unknown>[];\n /** Data array to render. */\n data: TData[];\n\n // --- Filtering ---\n /** Column id used for the filter input. Omit to disable the built-in filter. */\n filterColumn?: string;\n /** Placeholder text for the filter input. @default \"Filter...\" */\n filterPlaceholder?: string;\n\n // --- Pagination ---\n /** Enable pagination. @default true */\n pagination?: boolean;\n /** Number of rows per page. @default 10 */\n pageSize?: number;\n /** Page size options in the dropdown. @default [10, 20, 30, 50] */\n pageSizeOptions?: number[];\n\n // --- Row selection ---\n /** Show a checkbox column for row selection. @default false */\n enableRowSelection?: boolean;\n /** Callback when selection changes. Receives a record of row-id to boolean. */\n onRowSelectionChange?: (selection: RowSelectionState) => void;\n\n // --- Server-side / manual mode ---\n /** Total row count for server-side pagination. Enables manual mode when set. */\n totalRows?: number;\n /** Controlled pagination state for server-side mode. */\n paginationState?: PaginationState;\n /** Callback when pagination changes (server-side). */\n onPaginationChange?: OnChangeFn<PaginationState>;\n /** Controlled sorting state for server-side mode. */\n sortingState?: SortingState;\n /** Callback when sorting changes (server-side). */\n onSortingChange?: OnChangeFn<SortingState>;\n /** Controlled column filter state for server-side mode. */\n filterState?: ColumnFiltersState;\n /** Callback when column filters change (server-side). */\n onFilterChange?: OnChangeFn<ColumnFiltersState>;\n\n // --- Toolbar ---\n /** Show the column visibility toggle in the toolbar. @default true */\n showColumnToggle?: boolean;\n /** Additional actions rendered at the end of the toolbar. */\n toolbarActions?: React.ReactNode;\n\n // --- Sizing ---\n /** Override density-derived size. When omitted, reads from the nearest DensityProvider. */\n size?: DataTableSize;\n\n // --- Display ---\n /** Message shown when there are no rows. @default \"No results.\" */\n emptyMessage?: string;\n /** Additional class name on the root wrapper. */\n className?: string;\n}\n\n// ---------------------------------------------------------------------------\n// DataTableColumnHeader\n// ---------------------------------------------------------------------------\n\nexport interface DataTableColumnHeaderProps {\n column: {\n getCanSort: () => boolean;\n getIsSorted: () => false | \"asc\" | \"desc\";\n toggleSorting: (desc?: boolean, multi?: boolean) => void;\n };\n title: string;\n className?: string;\n}\n\nfunction DataTableColumnHeader({ column, title, className }: DataTableColumnHeaderProps) {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n const sorted = column.getIsSorted();\n\n return (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\"-ml-3 h-8 data-[state=open]:bg-accent\", className)}\n onClick={() => column.toggleSorting(sorted === \"asc\")}\n >\n {title}\n {sorted === \"asc\" ? (\n <ArrowUp className=\"ml-2 h-3.5 w-3.5\" />\n ) : sorted === \"desc\" ? (\n <ArrowDown className=\"ml-2 h-3.5 w-3.5\" />\n ) : (\n <ArrowUpDown className=\"ml-2 h-3.5 w-3.5 text-muted-foreground/50\" />\n )}\n </Button>\n );\n}\nDataTableColumnHeader.displayName = \"DataTableColumnHeader\";\n\n// ---------------------------------------------------------------------------\n// Internal: selection column factory\n// ---------------------------------------------------------------------------\n\nfunction createSelectionColumn<TData>(): ColumnDef<TData, unknown> {\n return {\n id: \"_select\",\n header: ({ table }) => (\n <Checkbox\n checked={table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && \"indeterminate\")}\n onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n aria-label=\"Select all\"\n className=\"translate-y-[2px]\"\n />\n ),\n cell: ({ row }) => (\n <Checkbox\n checked={row.getIsSelected()}\n onCheckedChange={(value) => row.toggleSelected(!!value)}\n aria-label=\"Select row\"\n className=\"translate-y-[2px]\"\n />\n ),\n enableSorting: false,\n enableHiding: false,\n size: 40,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Internal: detect density from DOM\n// ---------------------------------------------------------------------------\n\nfunction useDensitySize(): DataTableSize {\n const ref = React.useRef<HTMLDivElement>(null);\n const [size, setSize] = React.useState<DataTableSize>(\"md\");\n\n React.useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const container = el.closest(\".bison-density-compact, .bison-density-default, .bison-density-spacious\");\n if (!container) return;\n for (const [cls, sz] of Object.entries(densitySizeMap)) {\n if (container.classList.contains(`bison-density-${cls}`)) {\n setSize(sz);\n return;\n }\n }\n }, []);\n\n return size;\n}\n\n// ---------------------------------------------------------------------------\n// DataTable\n// ---------------------------------------------------------------------------\n\nfunction DataTableInner<TData>(\n {\n columns,\n data,\n filterColumn,\n filterPlaceholder = \"Filter...\",\n pagination = true,\n pageSize = 10,\n pageSizeOptions = [10, 20, 30, 50],\n enableRowSelection = false,\n onRowSelectionChange,\n totalRows,\n paginationState: controlledPagination,\n onPaginationChange,\n sortingState: controlledSorting,\n onSortingChange: onSortingChangeProp,\n filterState: controlledFilters,\n onFilterChange,\n showColumnToggle = true,\n toolbarActions,\n size: sizeProp,\n emptyMessage = \"No results.\",\n className,\n }: DataTableProps<TData>,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const isServerSide = totalRows !== undefined;\n\n // --- Internal state (client-side) ---\n const [internalSorting, setInternalSorting] = React.useState<SortingState>([]);\n const [internalFilters, setInternalFilters] = React.useState<ColumnFiltersState>([]);\n const [internalPagination, setInternalPagination] = React.useState<PaginationState>({\n pageIndex: 0,\n pageSize,\n });\n const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>({});\n const [rowSelection, setRowSelection] = React.useState<RowSelectionState>({});\n\n // Resolve controlled vs uncontrolled state\n const sorting = controlledSorting ?? internalSorting;\n const setSorting = onSortingChangeProp ?? setInternalSorting;\n const columnFilters = controlledFilters ?? internalFilters;\n const setColumnFilters = onFilterChange ?? setInternalFilters;\n const paginationVal = controlledPagination ?? internalPagination;\n const setPaginationVal = onPaginationChange ?? setInternalPagination;\n\n // Notify consumer of selection changes\n const handleRowSelectionChange: OnChangeFn<RowSelectionState> = React.useCallback(\n (updater) => {\n setRowSelection((prev) => {\n const next = typeof updater === \"function\" ? updater(prev) : updater;\n onRowSelectionChange?.(next);\n return next;\n });\n },\n [onRowSelectionChange]\n );\n\n // Prepend selection column\n const finalColumns = React.useMemo(() => {\n if (!enableRowSelection) return columns;\n return [createSelectionColumn<TData>(), ...columns];\n }, [columns, enableRowSelection]);\n\n const table = useReactTable({\n data,\n columns: finalColumns,\n state: {\n sorting,\n columnFilters,\n columnVisibility,\n rowSelection,\n pagination: paginationVal,\n },\n onSortingChange: setSorting,\n onColumnFiltersChange: setColumnFilters,\n onColumnVisibilityChange: setColumnVisibility,\n onRowSelectionChange: handleRowSelectionChange,\n onPaginationChange: setPaginationVal,\n getCoreRowModel: getCoreRowModel(),\n ...(isServerSide\n ? {\n manualPagination: true,\n manualSorting: true,\n manualFiltering: true,\n pageCount: Math.ceil(totalRows / paginationVal.pageSize),\n }\n : {\n getSortedRowModel: getSortedRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n ...(pagination && { getPaginationRowModel: getPaginationRowModel() }),\n }),\n enableRowSelection,\n });\n\n // --- Density / size ---\n const densitySize = useDensitySize();\n const resolvedSize = sizeProp ?? densitySize;\n const sc = sizeClasses[resolvedSize];\n\n // --- Toolbar visibility ---\n const hasToolbar = filterColumn || showColumnToggle || toolbarActions;\n\n const selectedCount = Object.keys(rowSelection).length;\n const totalFilteredRows = isServerSide ? totalRows : table.getFilteredRowModel().rows.length;\n\n return (\n <div ref={ref} className={cn(\"space-y-4\", className)}>\n {/* Toolbar */}\n {hasToolbar && (\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex flex-1 items-center gap-2\">\n {filterColumn && (\n <Input\n placeholder={filterPlaceholder}\n value={(table.getColumn(filterColumn)?.getFilterValue() as string) ?? \"\"}\n onChange={(event) => table.getColumn(filterColumn)?.setFilterValue(event.target.value)}\n className=\"max-w-sm\"\n />\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {toolbarActions}\n {showColumnToggle && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto h-8\">\n <Settings2 className=\"mr-2 h-4 w-4\" />\n Columns\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-40\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((col) => col.getCanHide())\n .map((col) => (\n <DropdownMenuCheckboxItem\n key={col.id}\n className=\"capitalize\"\n checked={col.getIsVisible()}\n onCheckedChange={(value) => col.toggleVisibility(!!value)}\n >\n {col.id}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n )}\n\n {/* Table */}\n <div className=\"rounded-md border\">\n <Table>\n <TableHeader>\n {table.getHeaderGroups().map((headerGroup) => (\n <TableRow key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <TableHead\n key={header.id}\n className={sc.header}\n style={{ width: header.column.id === \"_select\" ? 40 : (header.getSize() !== 150 ? header.getSize() : undefined) }}\n >\n {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody>\n {table.getRowModel().rows?.length ? (\n table.getRowModel().rows.map((row) => (\n <TableRow key={row.id} data-state={row.getIsSelected() && \"selected\"}>\n {row.getVisibleCells().map((cell) => (\n <TableCell key={cell.id} className={sc.cell}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell colSpan={finalColumns.length} className=\"h-24 text-center\">\n {emptyMessage}\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n\n {/* Footer: selection info + pagination */}\n {(pagination || enableRowSelection) && (\n <div className=\"flex items-center justify-between px-2\">\n <div className=\"flex-1 text-sm text-muted-foreground\">\n {enableRowSelection\n ? `${selectedCount} of ${totalFilteredRows} row(s) selected`\n : `${totalFilteredRows} row(s) total`}\n </div>\n {pagination && (\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={`${paginationVal.pageSize}`}\n onValueChange={(value) => {\n setPaginationVal((old: PaginationState) => ({\n ...old,\n pageIndex: 0,\n pageSize: Number(value),\n }));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={`${paginationVal.pageSize}`} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {pageSizeOptions.map((s) => (\n <SelectItem key={s} value={`${s}`}>\n {s}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {paginationVal.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(0)}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <ChevronsLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <ChevronsRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nconst DataTable = React.forwardRef(DataTableInner) as <TData>(\n props: DataTableProps<TData> & { ref?: React.ForwardedRef<HTMLDivElement> }\n) => React.ReactElement;\n\n(DataTable as { displayName?: string }).displayName = \"DataTable\";\n\nexport { DataTable, DataTableColumnHeader };\n","'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\n\nconst Progress = React.forwardRef<\n React.ComponentRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\n 'relative h-4 w-full overflow-hidden rounded-full bg-muted',\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-primary transition-all duration-normal ease-default\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n","'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst progressBarVariants = cva(\n 'h-full rounded-full transition-all duration-normal ease-default',\n {\n variants: {\n color: {\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n highlight: 'bg-highlight',\n destructive: 'bg-destructive',\n brand: 'bg-brand-accent',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n },\n);\n\nconst progressBarTrackVariants = cva(\n 'relative w-full overflow-hidden rounded-full bg-muted',\n {\n variants: {\n size: {\n sm: 'h-1.5',\n md: 'h-2.5',\n lg: 'h-4',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nexport type ProgressBarFormat = 'percent' | 'currency';\n\nexport interface ProgressBarProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n VariantProps<typeof progressBarVariants>,\n VariantProps<typeof progressBarTrackVariants> {\n /** Current value. When format is \"percent\", this is 0–100. When format is \"currency\", this is the raw amount (e.g. cents). */\n value?: number;\n /** Maximum value. Default: 100. When format is \"currency\", this is the goal amount in the same unit as value. */\n max?: number;\n /** Label rendered above the bar */\n label?: React.ReactNode;\n /** Whether to show the formatted value text */\n showValue?: boolean;\n /**\n * Display format for the value text.\n * - \"percent\" (default): shows percentage (e.g. \"65%\")\n * - \"currency\": formats value and max as currency (e.g. \"$2,500 of $5,000\")\n */\n format?: ProgressBarFormat;\n /** Intl.NumberFormat locale for currency formatting. Defaults to \"en-US\". */\n locale?: string;\n /** ISO 4217 currency code. Defaults to \"USD\". */\n currency?: string;\n /** Divisor to convert raw value to display value (e.g. 100 for cents → dollars). Defaults to 1. */\n currencyDivisor?: number;\n}\n\nfunction formatCurrency(\n amount: number,\n divisor: number,\n locale: string,\n currency: string,\n): string {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }).format(amount / divisor);\n}\n\nconst ProgressBar = React.forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n className,\n value = 0,\n max = 100,\n color,\n size,\n label,\n showValue,\n format = 'percent',\n locale = 'en-US',\n currency = 'USD',\n currencyDivisor = 1,\n ...props\n },\n ref,\n ) => {\n const pct = Math.min(100, Math.max(0, (value / max) * 100));\n\n const formattedValue = React.useMemo(() => {\n if (format === 'currency') {\n const current = formatCurrency(\n value,\n currencyDivisor,\n locale,\n currency,\n );\n const goal = formatCurrency(max, currencyDivisor, locale, currency);\n return `${current} of ${goal}`;\n }\n return `${Math.round(pct)}%`;\n }, [format, value, max, pct, currencyDivisor, locale, currency]);\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {(label || showValue) && (\n <div className=\"mb-1.5 flex items-center justify-between text-sm\">\n {label && (\n <span className=\"font-medium text-foreground\">{label}</span>\n )}\n {showValue && (\n <span className=\"text-content-secondary tabular-nums\">\n {formattedValue}\n </span>\n )}\n </div>\n )}\n <div\n className={cn(progressBarTrackVariants({ size }))}\n role=\"progressbar\"\n aria-valuenow={value}\n aria-valuemin={0}\n aria-valuemax={max}\n >\n <div\n className={cn(progressBarVariants({ color }))}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n },\n);\nProgressBar.displayName = 'ProgressBar';\n\nexport { ProgressBar, progressBarVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ScrollArea as ScrollAreaPrimitive } from \"radix-ui\";\nimport { cn } from \"../lib/utils\";\n\nconst ScrollArea = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root ref={ref} className={cn(\"relative overflow-hidden\", className)} {...props}>\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n","import { cn } from \"../lib/utils\";\n\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"animate-pulse rounded-md bg-muted\", className)} {...props} />;\n}\n\nexport { Skeleton };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Star } from \"lucide-react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\n// Filled stars use `fill-current`/`stroke-current`, so the star color follows\n// the element's text color. The default `text-highlight` keeps ratings on brand,\n// and consumers can override per-use with any text-color utility (e.g.\n// `text-primary`) via `className` — tailwind-merge lets the override win.\nconst ratingVariants = cva(\"inline-flex items-center text-highlight\", {\n variants: {\n size: {\n sm: \"gap-0.5 [&_svg]:size-3.5\",\n md: \"gap-0.5 [&_svg]:size-4\",\n lg: \"gap-1 [&_svg]:size-5\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\ninterface RatingProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"role\" | \"aria-label\">,\n VariantProps<typeof ratingVariants> {\n /** The rating to display, e.g. 4.3. Clamped to the range [0, count]. */\n rate: number;\n /** Number of stars to render. Defaults to 5. */\n count?: number;\n /** Accessible label. Defaults to \"Rated {rate} out of {count}\". */\n label?: string;\n}\n\n/**\n * Read-only star rating display with fractional fill. A single filled-star layer\n * is clipped to the fractional width over an empty-star track, so a rating like\n * 4.3 shows four full stars and a partial fifth. Presentation only — for input,\n * compose a separate control.\n */\nconst Rating = React.forwardRef<HTMLDivElement, RatingProps>(\n ({ rate, count = 5, size, label, className, ...props }, ref) => {\n const clamped = Math.max(0, Math.min(rate, count));\n const stars = Array.from({ length: count });\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={label ?? `Rated ${clamped} out of ${count}`}\n className={cn(ratingVariants({ size }), className)}\n {...props}\n >\n {stars.map((_, i) => {\n // Fraction of THIS star that should be filled: 1 fully below the rating,\n // 0 fully above, fractional for the single straddling star.\n const fill = Math.max(0, Math.min(1, clamped - i));\n return (\n <span key={i} className=\"relative inline-flex shrink-0\">\n <Star className=\"fill-muted stroke-muted-foreground/40\" />\n {fill > 0 && (\n <span\n className=\"absolute inset-0 overflow-hidden\"\n style={{ width: `${fill * 100}%` }}\n >\n <Star className=\"fill-current stroke-current\" />\n </span>\n )}\n </span>\n );\n })}\n </div>\n );\n },\n);\nRating.displayName = \"Rating\";\n\nexport { Rating, ratingVariants };\nexport type { RatingProps };\n","import * as React from \"react\";\nimport { LoaderCircle } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst spinnerVariants = cva(\"text-muted-foreground\", {\n variants: {\n size: {\n sm: \"h-4 w-4\",\n md: \"h-6 w-6\",\n lg: \"h-8 w-8\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\nexport interface SpinnerProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof spinnerVariants> {}\n\nfunction Spinner({ className, size, ...props }: SpinnerProps) {\n return (\n <span className={cn(spinnerVariants({ size }), className)} {...props}>\n <LoaderCircle className=\"h-full w-full animate-spin\" />\n </span>\n );\n}\n\nexport { Spinner, spinnerVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface SavedPingProps {\n /**\n * Increments on every successful save. Parents should key this component on\n * `pingCount` (e.g. `<SavedPing key={pingCount} pingCount={pingCount} />`)\n * so each increment remounts the component and replays the animation.\n * Renders nothing while `pingCount === 0`.\n */\n pingCount: number;\n /** Label shown next to the checkmark. Defaults to `\"Saved\"`. */\n label?: string;\n /** Extra classes appended to the pill container. */\n className?: string;\n /** Passed through to the container for test queries. */\n \"data-testid\"?: string;\n}\n\n/**\n * A bespoke \"saved!\" confirmation pill — quieter than a standard toast.\n * Intended for background autosave flows where success needs acknowledgment\n * without interrupting the user. Uses the `success-*` semantic color scale so\n * it inherits the theme's success hue.\n *\n * Visual: small circle with light success fill, darker success border, and an\n * animated SVG checkmark that draws in. The whole pill fades in, drifts up,\n * holds briefly, then fades out.\n */\nconst SavedPing = React.forwardRef<HTMLDivElement, SavedPingProps>(\n (\n { pingCount, label = \"Saved\", className, \"data-testid\": dataTestId },\n ref,\n ) => {\n if (pingCount === 0) return null;\n\n return (\n <motion.div\n ref={ref}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={label}\n data-testid={dataTestId}\n initial={{ opacity: 0, y: 14, scale: 0.92 }}\n animate={{\n opacity: [0, 1, 1, 0],\n y: [14, 0, -6, -16],\n scale: [0.92, 1, 1, 0.96],\n }}\n transition={{\n duration: 1.4,\n times: [0, 0.15, 0.75, 1],\n ease: [0.22, 1, 0.36, 1],\n }}\n className={cn(\n \"pointer-events-none flex h-9 items-center gap-2 rounded-full border border-success-500 bg-success-50 pr-3.5 pl-2 text-sm font-medium text-success-700 shadow-sm shadow-success-500/10 dark:border-success-400 dark:bg-success-950/60 dark:text-success-200 dark:shadow-success-500/20\",\n className,\n )}\n >\n <span\n aria-hidden\n className=\"flex h-6 w-6 items-center justify-center rounded-full border border-success-500 bg-success-100/80 dark:border-success-400 dark:bg-success-900/60\"\n >\n <svg\n viewBox=\"0 0 20 20\"\n className=\"h-3.5 w-3.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <motion.path\n d=\"M4 10.5 L8.5 15 L16 6\"\n initial={{ pathLength: 0, opacity: 0 }}\n animate={{ pathLength: 1, opacity: 1 }}\n transition={{\n pathLength: { delay: 0.18, duration: 0.32, ease: \"easeOut\" },\n opacity: { delay: 0.18, duration: 0.05 },\n }}\n />\n </svg>\n </span>\n <span>{label}</span>\n </motion.div>\n );\n },\n);\nSavedPing.displayName = \"SavedPing\";\n\nexport { SavedPing };\n","'use client';\n\n/**\n * ContextMenu mirrors `dropdown-menu.tsx` visually — Radix UI ships them as\n * separate primitives because the trigger semantics differ (right-click vs\n * click), but the rendered chrome is identical. Both import from\n * `lib/surface-classes.ts` so any visual tweak updates both automatically.\n *\n * If you need to change the look of menus, edit `surface-classes.ts`\n * (the `menuSurfaceClasses` / `menuItemClasses` exports). Do NOT edit one\n * of these files without the other.\n */\n\nimport * as React from 'react';\nimport { ContextMenu as ContextMenuPrimitive } from 'radix-ui';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n menuItemClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\n\nconst ContextMenu = ContextMenuPrimitive.Root;\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(menuItemClasses, inset && 'pl-8', className)}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold text-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { NavigationMenu as NavigationMenuPrimitive } from \"radix-ui\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cva } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root> & {\n /**\n * When `true` (default) all panels render into a single shared, animated\n * viewport centered under the menu. When `false`, each panel renders in\n * place and anchors directly under its own trigger — the right choice for\n * hover mega-menu headers where panels should drop beneath their item.\n */\n viewport?: boolean;\n }\n>(({ className, children, viewport = true, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n data-viewport={viewport}\n className={cn(\n \"group/navigation-menu relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className,\n )}\n {...props}\n >\n {children}\n {viewport ? <NavigationMenuViewport /> : null}\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\n// `relative` so that, in `viewport={false}` mode, each `NavigationMenuContent`\n// anchors to its own item instead of the menu root.\nconst NavigationMenuItem = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Item ref={ref} className={cn(\"relative\", className)} {...props} />\n));\nNavigationMenuItem.displayName = NavigationMenuPrimitive.Item.displayName;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-[var(--density-height-md)] w-max items-center justify-center rounded-md bg-transparent px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\"\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto\",\n // viewport={false}: become a standalone popover surface anchored under the trigger\n \"group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow-lg group-data-[viewport=false]/navigation-menu:duration-200 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & { separator?: React.ReactNode }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />);\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<\"ol\">>(\n ({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n )\n);\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"inline-flex items-center gap-1.5\", className)} {...props} />\n )\n);\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & { asChild?: boolean }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? SlotPrimitive.Slot : \"a\";\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<\"span\">>(\n ({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n )\n);\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<\"li\">) => (\n <li role=\"presentation\" aria-hidden=\"true\" className={cn(\"[&>svg]:h-3.5 [&>svg]:w-3.5\", className)} {...props}>\n {children ?? <ChevronRight />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbEllipsis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { type ButtonProps, buttonVariants } from \"./button\";\n\nconst Pagination = ({ className, ...props }: React.ComponentProps<\"nav\">) => (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n);\nPagination.displayName = \"Pagination\";\n\nconst PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentPropsWithoutRef<\"ul\">>(\n ({ className, ...props }, ref) => (\n <ul ref={ref} className={cn(\"flex flex-row items-center gap-1\", className)} {...props} />\n )\n);\nPaginationContent.displayName = \"PaginationContent\";\n\nconst PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => <li ref={ref} className={cn(\"\", className)} {...props} />\n);\nPaginationItem.displayName = \"PaginationItem\";\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<ButtonProps, \"size\"> &\n React.ComponentProps<\"a\">;\n\nconst PaginationLink = ({ className, isActive, size = \"icon\", ...props }: PaginationLinkProps) => (\n <a\n aria-current={isActive ? \"page\" : undefined}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n);\nPaginationLink.displayName = \"PaginationLink\";\n\nconst PaginationPrevious = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink aria-label=\"Go to previous page\" size=\"md\" className={cn(\"gap-1 pl-2.5\", className)} {...props}>\n <ChevronLeft className=\"h-4 w-4\" />\n <span>Previous</span>\n </PaginationLink>\n);\nPaginationPrevious.displayName = \"PaginationPrevious\";\n\nconst PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink aria-label=\"Go to next page\" size=\"md\" className={cn(\"gap-1 pr-2.5\", className)} {...props}>\n <span>Next</span>\n <ChevronRight className=\"h-4 w-4\" />\n </PaginationLink>\n);\nPaginationNext.displayName = \"PaginationNext\";\n\nconst PaginationEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span aria-hidden className={cn(\"flex h-9 w-9 items-center justify-center\", className)} {...props}>\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n);\nPaginationEllipsis.displayName = \"PaginationEllipsis\";\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport { menuItemClasses } from '../lib/surface-classes';\nimport { Dialog, DialogContent } from './dialog';\n\nconst Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n 'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ninterface CommandDialogProps\n extends React.ComponentPropsWithoutRef<typeof Dialog> {}\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n);\n\nconst CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full rounded-md bg-transparent py-3 text-base sm:text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 h-px bg-border', className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Check, Pencil, X } from 'lucide-react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\nconst editableTitleVariants = cva(\n 'inline-flex items-center gap-2 font-semibold text-foreground',\n {\n variants: {\n size: {\n sm: 'text-lg',\n md: 'text-2xl',\n lg: 'text-4xl',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst editableTitleInputVariants = cva(\n 'bg-transparent border-b-2 border-primary outline-none font-semibold text-foreground w-full min-w-0',\n {\n variants: {\n size: {\n sm: 'text-lg pb-0.5',\n md: 'text-2xl pb-1',\n lg: 'text-4xl pb-1.5',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\n/**\n * Fixed square chrome for edit / confirm / cancel: outer box is identical regardless of glyph.\n * Overrides `Button` `size=\"icon\"` density vars so all three match exactly.\n */\nfunction titleActionButtonClass(size: 'sm' | 'md' | 'lg' | null | undefined) {\n switch (size) {\n case 'sm':\n return 'box-border aspect-square size-6 min-h-6 min-w-6 max-h-6 max-w-6 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-3 [&_svg]:shrink-0';\n case 'lg':\n return 'box-border aspect-square size-10 min-h-10 min-w-10 max-h-10 max-w-10 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-5 [&_svg]:shrink-0';\n default:\n return 'box-border aspect-square size-8 min-h-8 min-w-8 max-h-8 max-w-8 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-4 [&_svg]:shrink-0';\n }\n}\n\n/** Loading affordance: same outer square as action buttons. */\nfunction loadingSpinnerWrapClass(size: 'sm' | 'md' | 'lg' | null | undefined) {\n switch (size) {\n case 'sm':\n return 'box-border size-6 min-h-6 min-w-6 max-h-6 max-w-6 [&_svg]:size-3';\n case 'lg':\n return 'box-border size-10 min-h-10 min-w-10 max-h-10 max-w-10 [&_svg]:size-5';\n default:\n return 'box-border size-8 min-h-8 min-w-8 max-h-8 max-w-8 [&_svg]:size-4';\n }\n}\n\nexport interface EditableTitleProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof editableTitleVariants> {\n /** The current title value */\n value: string;\n /** Callback when the title is saved */\n onSave?: (value: string) => void;\n /** Callback on every keystroke while editing */\n onChange?: (value: string) => void;\n /** Placeholder text when the title is empty */\n placeholder?: string;\n /** Whether the title is editable */\n disabled?: boolean;\n /** Whether a save operation is in progress */\n loading?: boolean;\n /** Maximum character length */\n maxLength?: number;\n}\n\nconst EditableTitle = React.forwardRef<HTMLDivElement, EditableTitleProps>(\n (\n {\n className,\n size,\n value,\n onSave,\n onChange,\n placeholder = 'Untitled',\n disabled = false,\n loading = false,\n maxLength,\n ...props\n },\n ref,\n ) => {\n const [isEditing, setIsEditing] = React.useState(false);\n const [draft, setDraft] = React.useState(value);\n /** Avoids a flash: after save/cancel the pointer often sits where the pen mounts, so hover would show it immediately. */\n const [suppressPenReveal, setSuppressPenReveal] = React.useState(false);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n React.useEffect(() => {\n if (!suppressPenReveal) return;\n const t = window.setTimeout(() => setSuppressPenReveal(false), 200);\n return () => clearTimeout(t);\n }, [suppressPenReveal]);\n\n React.useEffect(() => {\n if (!isEditing) {\n setDraft(value);\n }\n }, [value, isEditing]);\n\n React.useEffect(() => {\n if (isEditing && inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n }, [isEditing]);\n\n const startEditing = () => {\n if (disabled || loading) return;\n setSuppressPenReveal(false);\n setDraft(value);\n setIsEditing(true);\n };\n\n const endEditing = () => {\n setSuppressPenReveal(true);\n setIsEditing(false);\n };\n\n const save = () => {\n const trimmed = draft.trim();\n if (trimmed && trimmed !== value) {\n onSave?.(trimmed);\n }\n endEditing();\n };\n\n const cancel = () => {\n setDraft(value);\n endEditing();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n save();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n cancel();\n }\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n if (maxLength && newValue.length > maxLength) return;\n setDraft(newValue);\n onChange?.(newValue);\n };\n\n if (isEditing) {\n return (\n <div\n ref={ref}\n className={cn(editableTitleVariants({ size }), className)}\n {...props}\n >\n <input\n ref={inputRef}\n type=\"text\"\n value={draft}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onBlur={save}\n placeholder={placeholder}\n maxLength={maxLength}\n className={cn(\n editableTitleInputVariants({ size }),\n 'min-w-0 flex-1',\n )}\n aria-label=\"Edit title\"\n />\n <Button\n type=\"button\"\n variant=\"actionPositive\"\n size=\"icon\"\n className={titleActionButtonClass(size)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={save}\n aria-label=\"Save title\"\n >\n <Check />\n </Button>\n <Button\n type=\"button\"\n variant=\"actionNegative\"\n size=\"icon\"\n className={titleActionButtonClass(size)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={cancel}\n aria-label=\"Cancel editing\"\n >\n <X />\n </Button>\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n className={cn(editableTitleVariants({ size }), 'group', className)}\n {...props}\n >\n <span\n className={cn(\n 'cursor-pointer hover:text-primary transition-colors duration-fast ease-default',\n disabled && 'cursor-default hover:text-foreground',\n loading && 'cursor-wait hover:text-foreground opacity-70',\n )}\n onClick={startEditing}\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n startEditing();\n }\n }}\n aria-label={disabled ? value : `Edit title: ${value}`}\n >\n {value || placeholder}\n </span>\n {!disabled && !loading && (\n <Button\n type=\"button\"\n variant=\"actionNeutral\"\n size=\"icon\"\n className={cn(\n 'transition-opacity duration-fast ease-default',\n titleActionButtonClass(size),\n suppressPenReveal\n ? 'pointer-events-none opacity-0'\n : 'opacity-0 group-hover:opacity-100 group-focus-within:opacity-100',\n )}\n onClick={startEditing}\n tabIndex={-1}\n aria-hidden=\"true\"\n >\n <Pencil />\n </Button>\n )}\n {loading && (\n <span\n className={cn(\n 'inline-flex items-center justify-center shrink-0 rounded-md text-muted-foreground',\n loadingSpinnerWrapClass(size),\n 'animate-spin pointer-events-none',\n )}\n aria-label=\"Saving\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n </span>\n )}\n </div>\n );\n },\n);\nEditableTitle.displayName = 'EditableTitle';\n\nexport { EditableTitle, editableTitleVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { AspectRatio as AspectRatioPrimitive } from \"radix-ui\";\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n","\"use client\";\n\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\n\nfunction Collapsible({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n {...props}\n />\n );\n}\n\nfunction CollapsibleContent({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n {...props}\n />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { PanelLeft } from \"lucide-react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\n\nimport { useIsMobile } from \"../hooks/use-mobile\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Separator } from \"./separator\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"./sheet\";\nimport { Skeleton } from \"./skeleton\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"./tooltip\";\n\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\";\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\nconst SIDEBAR_WIDTH = \"16rem\";\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\";\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\n }\n return context;\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}) {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n const [_open, _setOpen] = React.useState(defaultOpen);\n const open = openProp ?? _open;\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\n },\n [setOpenProp, open]\n );\n\n const toggleSidebar = React.useCallback(() => {\n return isMobile\n ? setOpenMobile((open) => !open)\n : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [toggleSidebar]);\n\n const state = open ? \"expanded\" : \"collapsed\";\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n data-slot=\"sidebar-wrapper\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n}\n\nfunction Sidebar({\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\";\n variant?: \"sidebar\" | \"floating\" | \"inset\";\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === \"none\") {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn(\n \"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n className=\"group peer hidden text-sidebar-foreground md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n \"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\"\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n className={cn(\n \"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className=\"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n}\n\nfunction SidebarTrigger({\n className,\n onClick,\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"size-7\", className)}\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeft />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<\"button\">) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<\"main\">) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex w-full flex-1 flex-col bg-background\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInput({\n className,\n ...props\n}: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn(\"h-8 w-full bg-background shadow-none\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn(\"mx-2 w-auto bg-sidebar-border\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupLabel({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & { asChild?: boolean }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"div\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n data-sidebar=\"group-label\"\n className={cn(\n \"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupAction({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> & { asChild?: boolean }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-action\"\n data-sidebar=\"group-action\"\n className={cn(\n \"absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupContent({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n );\n}\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:p-0!\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nfunction SidebarMenuButton({\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\n} & VariantProps<typeof sidebarMenuButtonVariants>) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n data-slot=\"sidebar-menu-button\"\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n };\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n );\n}\n\nfunction SidebarMenuAction({\n className,\n asChild = false,\n showOnHover = false,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n showOnHover?: boolean;\n}) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-action\"\n data-sidebar=\"menu-action\"\n className={cn(\n \"absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuBadge({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n \"pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSkeleton({\n className,\n showIcon = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showIcon?: boolean;\n}) {\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n );\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n \"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubItem({\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubButton({\n asChild = false,\n size = \"md\",\n isActive = false,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & {\n asChild?: boolean;\n size?: \"sm\" | \"md\";\n isActive?: boolean;\n}) {\n const Comp = asChild ? SlotPrimitive.Slot : \"a\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport type SocialProvider = \"google\" | \"facebook\" | \"github\" | \"apple\";\n\ninterface SocialProvidersProps {\n providers: SocialProvider[];\n onSocialLogin: (provider: SocialProvider) => void;\n loading?: boolean;\n disabled?: boolean;\n className?: string;\n}\n\nconst providerConfig: Record<\n SocialProvider,\n { label: string; icon: React.ReactNode }\n> = {\n google: {\n label: \"Google\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z\"\n fill=\"#4285F4\"\n />\n <path\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n fill=\"#34A853\"\n />\n <path\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n fill=\"#FBBC05\"\n />\n <path\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n fill=\"#EA4335\"\n />\n </svg>\n ),\n },\n facebook: {\n label: \"Facebook\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"#1877F2\">\n <path d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\" />\n </svg>\n ),\n },\n github: {\n label: \"GitHub\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z\" />\n </svg>\n ),\n },\n apple: {\n label: \"Apple\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z\" />\n </svg>\n ),\n },\n};\n\nexport function SocialProviders({\n providers,\n onSocialLogin,\n loading,\n disabled,\n className,\n}: SocialProvidersProps) {\n return (\n <div className={cn(\"grid gap-2\", className)}>\n {providers.map((provider) => {\n const config = providerConfig[provider];\n return (\n <Button\n key={provider}\n variant=\"outline\"\n type=\"button\"\n disabled={loading || disabled}\n onClick={() => onSocialLogin(provider)}\n className=\"w-full\"\n >\n {config.icon}\n <span className=\"ml-2\">Continue with {config.label}</span>\n </Button>\n );\n })}\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport { motion, AnimatePresence } from 'motion/react';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../../components/button';\nimport { CodeInput } from '../../components/code-input';\nimport { Input } from '../../components/input';\nimport { InputGroup } from '../../components/input-group';\nimport { PasswordInput } from '../../components/password-input';\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../../components/card';\nimport { Spinner } from '../../components/spinner';\nimport { FormError } from '../../form/form-error';\nimport { SocialProviders, type SocialProvider } from './social-providers';\nimport { Separator } from '../../components/separator';\n\nexport interface SignInBlockProps {\n onSubmit: (data: { email: string; password: string }) => void | Promise<void>;\n onForgotPassword?: () => void;\n onSocialLogin?: (provider: SocialProvider) => void;\n socialProviders?: SocialProvider[];\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n signUpHref?: string;\n onSignUp?: () => void;\n className?: string;\n /** When provided, replaces the built-in form content. The Card wrapper, header, and footer links are preserved. */\n children?: React.ReactNode;\n /** Callback to request a one-time code. When provided, enables the tabbed Password / OTP layout. */\n onOtpRequest?: (email: string) => Promise<{ session: string }>;\n /** Callback to verify a one-time code and complete login. */\n onOtpVerify?: (data: {\n email: string;\n code: string;\n session: string;\n }) => Promise<void>;\n /** Label for the OTP tab trigger. @default \"Email me a code\" */\n otpLabel?: string;\n /** Fires when the user switches between the password and OTP tabs. Useful for clearing parent-owned error state so stale errors do not persist across tabs. */\n onTabChange?: (tab: 'password' | 'otp') => void;\n}\n\ntype OtpStep = 'email' | 'code';\n\nconst AUTH_TABS = { PASSWORD: 'password', OTP: 'otp' } as const;\ntype AuthTab = (typeof AUTH_TABS)[keyof typeof AUTH_TABS];\n\nfunction PillTabs({\n activeTab,\n onTabChange,\n otpLabel,\n}: {\n activeTab: AuthTab;\n onTabChange: (tab: AuthTab) => void;\n otpLabel: string;\n}) {\n const tabs = [\n { value: AUTH_TABS.PASSWORD, label: 'Password' },\n { value: AUTH_TABS.OTP, label: otpLabel },\n ];\n\n return (\n <div className=\"relative flex rounded-md bg-muted p-1\">\n {tabs.map((tab) => (\n <button\n key={tab.value}\n type=\"button\"\n onClick={() => onTabChange(tab.value)}\n className={cn(\n 'relative z-10 flex-1 rounded-sm px-3 py-1.5 text-sm font-medium transition-colors',\n activeTab === tab.value\n ? 'text-primary-foreground'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {activeTab === tab.value && (\n <motion.div\n layoutId=\"sign-in-tab-pill\"\n className=\"absolute inset-0 rounded-sm bg-primary shadow-sm\"\n transition={{ type: 'spring', bounce: 0.15, duration: 0.4 }}\n />\n )}\n <span className=\"relative z-10\">{tab.label}</span>\n </button>\n ))}\n </div>\n );\n}\n\nfunction OtpForm({\n onOtpRequest,\n onOtpVerify,\n loading = false,\n disabled = false,\n}: {\n onOtpRequest: (email: string) => Promise<{ session: string }>;\n onOtpVerify: (data: {\n email: string;\n code: string;\n session: string;\n }) => Promise<void>;\n loading?: boolean;\n disabled?: boolean;\n}) {\n const [step, setStep] = React.useState<OtpStep>('email');\n const [email, setEmail] = React.useState('');\n const [session, setSession] = React.useState('');\n const [otpLoading, setOtpLoading] = React.useState(false);\n const [otpError, setOtpError] = React.useState<string | undefined>();\n\n const isLoading = loading || otpLoading;\n const displayError = otpError;\n\n const handleEmailSubmit = async (\n e: React.SyntheticEvent<HTMLFormElement>,\n ) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n const emailValue = formData.get('otp-email') as string;\n setOtpError(undefined);\n setOtpLoading(true);\n\n try {\n const result = await onOtpRequest(emailValue);\n setEmail(emailValue);\n setSession(result.session);\n setStep('code');\n } catch (err) {\n setOtpError(\n err instanceof Error\n ? err.message\n : 'Failed to send code. Please try again.',\n );\n } finally {\n setOtpLoading(false);\n }\n };\n\n if (step === 'code') {\n return (\n <>\n <FormError message={displayError} />\n <div className=\"space-y-4\">\n <div className=\"text-center text-sm text-muted-foreground\">\n We sent a 6-digit code to <strong>{email}</strong>\n </div>\n <CodeInput\n length={6}\n loading={isLoading}\n disabled={disabled}\n onComplete={(fullCode) => {\n setOtpLoading(true);\n setOtpError(undefined);\n onOtpVerify({ email, code: fullCode, session })\n .catch((err) =>\n setOtpError(\n err instanceof Error\n ? err.message\n : 'Invalid or expired code. Please try again.',\n ),\n )\n .finally(() => setOtpLoading(false));\n }}\n />\n {isLoading && (\n <div className=\"flex justify-center\">\n <Spinner size=\"sm\" />\n </div>\n )}\n <button\n type=\"button\"\n className=\"w-full text-center text-sm text-muted-foreground hover:text-foreground\"\n onClick={() => {\n setStep('email');\n setOtpError(undefined);\n }}\n >\n Use a different email\n </button>\n </div>\n </>\n );\n }\n\n return (\n <>\n <FormError message={displayError} />\n <form onSubmit={handleEmailSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"otp-email\">\n <Input\n id=\"otp-email\"\n name=\"otp-email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={isLoading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n variant=\"default\"\n className=\"w-full\"\n loading={isLoading}\n disabled={disabled}\n >\n Send Login Code\n </Button>\n </form>\n </>\n );\n}\n\nexport function SignInBlock({\n onSubmit,\n onForgotPassword,\n onSocialLogin,\n socialProviders = [],\n loading = false,\n error,\n disabled = false,\n title = 'Sign in',\n description = 'Enter your credentials to access your account',\n signUpHref,\n onSignUp,\n className,\n children,\n onOtpRequest,\n onOtpVerify,\n otpLabel = 'Email me a code',\n onTabChange,\n}: SignInBlockProps) {\n const [activeTab, setActiveTab] = React.useState<AuthTab>(AUTH_TABS.PASSWORD);\n const otpEnabled = Boolean(onOtpRequest && onOtpVerify);\n\n const handleTabChange = React.useCallback(\n (tab: AuthTab) => {\n setActiveTab(tab);\n onTabChange?.(tab);\n },\n [onTabChange],\n );\n\n // Stale parent-owned errors should not bleed across tab switches\n // (for example, a failed password attempt's \"Invalid email or password\"\n // alert must not appear under the OTP tab). We track which tab the\n // current `error` was set on and only render it when that tab is active.\n const [errorTab, setErrorTab] = React.useState<AuthTab | null>(\n error ? AUTH_TABS.PASSWORD : null,\n );\n const previousErrorRef = React.useRef<string | undefined>(error);\n React.useEffect(() => {\n if (error !== previousErrorRef.current) {\n previousErrorRef.current = error;\n setErrorTab(error ? activeTab : null);\n }\n }, [error, activeTab]);\n const visibleError = errorTab === activeTab ? error : undefined;\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n email: formData.get('email') as string,\n password: formData.get('password') as string,\n });\n };\n\n const passwordForm = (\n <>\n <FormError message={visibleError} />\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <InputGroup label=\"Password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"current-password\"\n />\n {onForgotPassword && (\n <div className=\"flex justify-end\">\n <button\n type=\"button\"\n onClick={onForgotPassword}\n className=\"text-sm text-primary hover:underline\"\n tabIndex={-1}\n >\n Forgot password?\n </button>\n </div>\n )}\n </InputGroup>\n\n <Button\n type=\"submit\"\n variant=\"default\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Sign in\n </Button>\n </form>\n </>\n );\n\n const socialSection = socialProviders.length > 0 && onSocialLogin && (\n <>\n <div className=\"relative\">\n <div className=\"absolute inset-0 flex items-center\">\n <Separator className=\"w-full\" />\n </div>\n <div className=\"relative flex justify-center text-xs uppercase\">\n <span className=\"bg-card px-2 text-muted-foreground\">or</span>\n </div>\n </div>\n <SocialProviders\n providers={socialProviders}\n onSocialLogin={onSocialLogin}\n loading={loading}\n disabled={disabled}\n />\n </>\n );\n\n const footerLinks = (\n <>\n {(signUpHref || onSignUp) && (\n <p className=\"text-center text-sm text-muted-foreground\">\n Don't have an account?{' '}\n {onSignUp ? (\n <button\n type=\"button\"\n onClick={onSignUp}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign up\n </button>\n ) : (\n <a\n href={signUpHref}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign up\n </a>\n )}\n </p>\n )}\n </>\n );\n\n return (\n <Card className={cn('w-full max-w-md mx-auto', className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {children ? (\n children\n ) : otpEnabled ? (\n <>\n <PillTabs\n activeTab={activeTab}\n onTabChange={handleTabChange}\n otpLabel={otpLabel}\n />\n <motion.div\n layout\n transition={{ type: 'spring', bounce: 0, duration: 0.4 }}\n className=\"\"\n >\n <AnimatePresence mode=\"wait\" initial={false}>\n {activeTab === AUTH_TABS.PASSWORD ? (\n <motion.div\n key=\"password\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"space-y-4\"\n >\n {passwordForm}\n </motion.div>\n ) : (\n <motion.div\n key=\"otp\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"space-y-4\"\n >\n <OtpForm\n onOtpRequest={onOtpRequest!}\n onOtpVerify={onOtpVerify!}\n loading={loading}\n disabled={disabled}\n />\n </motion.div>\n )}\n </AnimatePresence>\n </motion.div>\n </>\n ) : (\n passwordForm\n )}\n\n {socialSection}\n {footerLinks}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { InputGroup } from \"../../components/input-group\";\nimport { PasswordInput } from \"../../components/password-input\";\nimport { Checkbox } from \"../../components/checkbox\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\nimport { SocialProviders, type SocialProvider } from \"./social-providers\";\nimport { Separator } from \"../../components/separator\";\n\nexport interface SignUpBlockProps {\n onSubmit: (data: {\n firstName: string;\n lastName: string;\n email: string;\n password: string;\n confirmPassword: string;\n termsAccepted: boolean;\n }) => void | Promise<void>;\n onSocialLogin?: (provider: SocialProvider) => void;\n socialProviders?: SocialProvider[];\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n signInHref?: string;\n onSignIn?: () => void;\n termsHref?: string;\n privacyHref?: string;\n className?: string;\n}\n\nexport function SignUpBlock({\n onSubmit,\n onSocialLogin,\n socialProviders = [],\n loading = false,\n error,\n disabled = false,\n title = \"Create an account\",\n description = \"Enter your details to get started\",\n signInHref,\n onSignIn,\n termsHref = \"#\",\n privacyHref = \"#\",\n className,\n}: SignUpBlockProps) {\n const [termsAccepted, setTermsAccepted] = React.useState(false);\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n firstName: (formData.get(\"firstName\") as string) ?? \"\",\n lastName: (formData.get(\"lastName\") as string) ?? \"\",\n email: formData.get(\"email\") as string,\n password: formData.get(\"password\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n termsAccepted,\n });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {socialProviders.length > 0 && onSocialLogin && (\n <>\n <SocialProviders\n providers={socialProviders}\n onSocialLogin={onSocialLogin}\n loading={loading}\n disabled={disabled}\n />\n <div className=\"relative\">\n <div className=\"absolute inset-0 flex items-center\">\n <Separator className=\"w-full\" />\n </div>\n <div className=\"relative flex justify-center text-xs uppercase\">\n <span className=\"bg-card px-2 text-muted-foreground\">\n Or continue with\n </span>\n </div>\n </div>\n </>\n )}\n\n <FormError message={error} />\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"First name\" htmlFor=\"firstName\">\n <Input\n id=\"firstName\"\n name=\"firstName\"\n placeholder=\"Jane\"\n required\n disabled={loading || disabled}\n autoComplete=\"given-name\"\n />\n </InputGroup>\n <InputGroup label=\"Last name\" htmlFor=\"lastName\">\n <Input\n id=\"lastName\"\n name=\"lastName\"\n placeholder=\"Doe\"\n required\n disabled={loading || disabled}\n autoComplete=\"family-name\"\n />\n </InputGroup>\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <InputGroup label=\"Password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <InputGroup label=\"Confirm password\" htmlFor=\"confirmPassword\">\n <PasswordInput\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n\n <div className=\"flex items-start space-x-2\">\n <Checkbox\n id=\"terms\"\n checked={termsAccepted}\n onCheckedChange={(checked) =>\n setTermsAccepted(checked === true)\n }\n disabled={loading || disabled}\n className=\"mt-0.5\"\n />\n <label\n htmlFor=\"terms\"\n className=\"text-sm text-muted-foreground cursor-pointer\"\n >\n I agree to the{\" \"}\n <a href={termsHref} className=\"text-primary hover:underline\">\n terms of service\n </a>{\" \"}\n and{\" \"}\n <a href={privacyHref} className=\"text-primary hover:underline\">\n privacy policy\n </a>\n </label>\n </div>\n\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled || !termsAccepted}\n >\n Create account\n </Button>\n </form>\n\n {(signInHref || onSignIn) && (\n <p className=\"text-center text-sm text-muted-foreground\">\n Already have an account?{\" \"}\n {onSignIn ? (\n <button\n type=\"button\"\n onClick={onSignIn}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign in\n </button>\n ) : (\n <a\n href={signInHref}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign in\n </a>\n )}\n </p>\n )}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowLeft, Mail } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { InputGroup } from \"../../components/input-group\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ForgotPasswordBlockProps {\n onSubmit: (data: { email: string }) => void | Promise<void>;\n onBack?: () => void;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n success?: boolean;\n title?: string;\n description?: string;\n className?: string;\n}\n\nexport function ForgotPasswordBlock({\n onSubmit,\n onBack,\n loading = false,\n error,\n disabled = false,\n success = false,\n title = \"Forgot password\",\n description = \"Enter your email and we'll send you a reset link\",\n className,\n}: ForgotPasswordBlockProps) {\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({ email: formData.get(\"email\") as string });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n {success ? (\n <>\n <div className=\"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10\">\n <Mail className=\"h-6 w-6 text-primary\" />\n </div>\n <CardTitle>Check your email</CardTitle>\n <CardDescription>\n We've sent a password reset link to your email address.\n </CardDescription>\n </>\n ) : (\n <>\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </>\n )}\n </CardHeader>\n {!success && (\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Send reset link\n </Button>\n </form>\n {onBack && (\n <button\n type=\"button\"\n onClick={onBack}\n className=\"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Back to sign in\n </button>\n )}\n </div>\n </CardContent>\n )}\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { InputGroup } from \"../../components/input-group\";\nimport { PasswordInput } from \"../../components/password-input\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ResetPasswordBlockProps {\n onSubmit: (data: {\n password: string;\n confirmPassword: string;\n }) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n className?: string;\n}\n\nexport function ResetPasswordBlock({\n onSubmit,\n loading = false,\n error,\n disabled = false,\n title = \"Reset password\",\n description = \"Enter your new password below\",\n className,\n}: ResetPasswordBlockProps) {\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n password: formData.get(\"password\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"New password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <InputGroup label=\"Confirm new password\" htmlFor=\"confirmPassword\">\n <PasswordInput\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Reset password\n </Button>\n </form>\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { Spinner } from \"../../components/spinner\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface VerifyBlockProps {\n onVerify: (code: string) => void | Promise<void>;\n onResend?: () => void | Promise<void>;\n codeLength?: number;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n resendCooldown?: number;\n className?: string;\n}\n\nexport function VerifyBlock({\n onVerify,\n onResend,\n codeLength = 6,\n loading = false,\n error,\n disabled = false,\n title = \"Verify your account\",\n description = \"Enter the verification code sent to your email\",\n resendCooldown = 60,\n className,\n}: VerifyBlockProps) {\n const [code, setCode] = React.useState<string[]>(Array(codeLength).fill(\"\"));\n const [countdown, setCountdown] = React.useState(0);\n const inputRefs = React.useRef<(HTMLInputElement | null)[]>([]);\n\n React.useEffect(() => {\n if (countdown > 0) {\n const timer = setTimeout(() => setCountdown(countdown - 1), 1000);\n return () => clearTimeout(timer);\n }\n }, [countdown]);\n\n const handleChange = (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n const newCode = [...code];\n newCode[index] = value.slice(-1);\n setCode(newCode);\n\n if (value && index < codeLength - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n\n const fullCode = newCode.join(\"\");\n if (fullCode.length === codeLength && newCode.every(Boolean)) {\n onVerify(fullCode);\n }\n };\n\n const handleKeyDown = (index: number, e: React.KeyboardEvent) => {\n if (e.key === \"Backspace\" && !code[index] && index > 0) {\n inputRefs.current[index - 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pasted = e.clipboardData.getData(\"text\").replace(/\\D/g, \"\").slice(0, codeLength);\n const newCode = [...code];\n for (let i = 0; i < pasted.length; i++) {\n newCode[i] = pasted[i];\n }\n setCode(newCode);\n if (pasted.length === codeLength) {\n onVerify(pasted);\n } else {\n inputRefs.current[pasted.length]?.focus();\n }\n };\n\n const handleResend = async () => {\n setCountdown(resendCooldown);\n await onResend?.();\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <div className=\"flex justify-center gap-2\" onPaste={handlePaste}>\n {code.map((digit, index) => (\n <Input\n key={index}\n ref={(el) => { inputRefs.current[index] = el; }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onChange={(e) => handleChange(index, e.target.value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n disabled={loading || disabled}\n className=\"h-12 w-12 text-center text-lg font-semibold\"\n autoFocus={index === 0}\n />\n ))}\n </div>\n\n {loading && (\n <div className=\"flex justify-center\">\n <Spinner size=\"sm\" />\n </div>\n )}\n\n {onResend && (\n <div className=\"text-center\">\n {countdown > 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n Resend code in {countdown}s\n </p>\n ) : (\n <Button variant=\"ghost\" size=\"sm\" onClick={handleResend} disabled={loading || disabled}>\n Resend code\n </Button>\n )}\n </div>\n )}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { FileQuestion } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface NotFoundBlockProps {\n title?: string;\n message?: string;\n homeHref?: string;\n onGoHome?: () => void;\n className?: string;\n}\n\nexport function NotFoundBlock({\n title = \"Page not found\",\n message = \"Sorry, we couldn't find the page you're looking for. It may have been moved or deleted.\",\n homeHref = \"/\",\n onGoHome,\n className,\n}: NotFoundBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-muted\">\n <FileQuestion className=\"h-12 w-12 text-muted-foreground\" />\n </div>\n <h1 className=\"text-4xl font-bold tracking-tight mb-2\">404</h1>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-8\">{message}</p>\n {onGoHome ? (\n <Button onClick={onGoHome}>Go back home</Button>\n ) : (\n <Button asChild>\n <a href={homeHref}>Go back home</a>\n </Button>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Server } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface ServerErrorBlockProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n homeHref?: string;\n onGoHome?: () => void;\n className?: string;\n}\n\nexport function ServerErrorBlock({\n title = \"Something went wrong\",\n message = \"An unexpected error occurred. Our team has been notified and is working on a fix.\",\n onRetry,\n homeHref = \"/\",\n onGoHome,\n className,\n}: ServerErrorBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-destructive/10\">\n <Server className=\"h-12 w-12 text-destructive\" />\n </div>\n <h1 className=\"text-4xl font-bold tracking-tight mb-2\">500</h1>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-8\">{message}</p>\n <div className=\"flex gap-3\">\n {onRetry && (\n <Button onClick={onRetry}>Try again</Button>\n )}\n {onGoHome ? (\n <Button variant=\"outline\" onClick={onGoHome}>Go home</Button>\n ) : (\n <Button variant=\"outline\" asChild>\n <a href={homeHref}>Go home</a>\n </Button>\n )}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Wrench } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface MaintenanceBlockProps {\n title?: string;\n message?: string;\n estimatedReturn?: string;\n className?: string;\n}\n\nexport function MaintenanceBlock({\n title = \"Under maintenance\",\n message = \"We're performing scheduled maintenance to improve your experience. We'll be back shortly.\",\n estimatedReturn,\n className,\n}: MaintenanceBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-muted\">\n <Wrench className=\"h-12 w-12 text-muted-foreground\" />\n </div>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-4\">{message}</p>\n {estimatedReturn && (\n <p className=\"text-sm text-muted-foreground\">\n Estimated return: <span className=\"font-medium text-foreground\">{estimatedReturn}</span>\n </p>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Inbox } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface EmptyStateBlockProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Icon to render inside the centered circle. Pass any React node\n * (`<FontAwesomeIcon … />`, a Lucide icon, an inline SVG, etc.). Defaults to\n * a Lucide `Inbox` glyph.\n */\n icon?: React.ReactNode;\n title?: string;\n description?: string;\n actionLabel?: string;\n onAction?: () => void;\n}\n\nconst EmptyStateBlock = React.forwardRef<HTMLDivElement, EmptyStateBlockProps>(\n (\n {\n icon,\n title = \"No results found\",\n description = \"There's nothing here yet. Get started by creating your first item.\",\n actionLabel,\n onAction,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div ref={ref} className={cn(\"flex flex-col items-center justify-center text-center py-16 px-4\", className)} {...props}>\n <div className=\"mb-6 flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground [&_svg]:h-8 [&_svg]:w-8\">\n {icon ?? <Inbox />}\n </div>\n <h3 className=\"text-lg font-semibold mb-1\">{title}</h3>\n <p className=\"text-sm text-muted-foreground max-w-sm mb-6\">{description}</p>\n {actionLabel && onAction && (\n <Button onClick={onAction}>{actionLabel}</Button>\n )}\n </div>\n );\n }\n);\nEmptyStateBlock.displayName = \"EmptyStateBlock\";\n\nexport { EmptyStateBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface PageShellProps {\n children: React.ReactNode;\n sidebar?: React.ReactNode;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n sidebarWidth?: string;\n sidebarCollapsed?: boolean;\n className?: string;\n}\n\nexport function PageShell({\n children,\n sidebar,\n header,\n footer,\n sidebarWidth = \"16rem\",\n sidebarCollapsed = false,\n className,\n}: PageShellProps) {\n return (\n <div className={cn(\"flex min-h-screen flex-col\", className)}>\n {header}\n <div className=\"flex flex-1\">\n {sidebar && (\n <aside\n className={cn(\n \"hidden border-r bg-card transition-all duration-normal ease-default md:block\",\n sidebarCollapsed && \"w-16\"\n )}\n style={sidebarCollapsed ? undefined : { width: sidebarWidth }}\n >\n {sidebar}\n </aside>\n )}\n <main className=\"flex-1 overflow-auto\">{children}</main>\n </div>\n {footer}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Menu } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface HeaderBlockProps {\n logo?: React.ReactNode;\n nav?: React.ReactNode;\n actions?: React.ReactNode;\n onMenuToggle?: () => void;\n sticky?: boolean;\n className?: string;\n}\n\nexport function HeaderBlock({\n logo,\n nav,\n actions,\n onMenuToggle,\n sticky = true,\n className,\n}: HeaderBlockProps) {\n return (\n <header\n className={cn(\n \"flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6\",\n sticky && \"sticky top-0 z-[var(--z-sticky)]\",\n className\n )}\n >\n {onMenuToggle && (\n <Button variant=\"ghost\" size=\"icon\" className=\"md:hidden\" onClick={onMenuToggle}>\n <Menu className=\"h-5 w-5\" />\n <span className=\"sr-only\">Toggle menu</span>\n </Button>\n )}\n {logo && <div className=\"flex items-center gap-2 font-semibold\">{logo}</div>}\n {nav && <nav className=\"hidden md:flex items-center gap-6 text-sm font-medium flex-1\">{nav}</nav>}\n {actions && <div className=\"ml-auto flex items-center gap-2\">{actions}</div>}\n </header>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface SidebarItem {\n label: string;\n href?: string;\n icon?: React.ReactNode;\n active?: boolean;\n onClick?: () => void;\n children?: SidebarItem[];\n}\n\nexport interface SidebarSection {\n title?: string;\n items: SidebarItem[];\n}\n\nexport interface SidebarBlockProps {\n sections: SidebarSection[];\n header?: React.ReactNode;\n footer?: React.ReactNode;\n collapsed?: boolean;\n className?: string;\n}\n\nfunction SidebarItemComponent({ item, collapsed }: { item: SidebarItem; collapsed?: boolean }) {\n const Comp = item.href ? \"a\" : \"button\";\n return (\n <Comp\n href={item.href}\n onClick={item.onClick}\n className={cn(\n \"flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\",\n item.active && \"bg-accent text-accent-foreground\",\n collapsed && \"justify-center px-2\"\n )}\n >\n {item.icon && <span className=\"flex h-5 w-5 shrink-0 items-center justify-center\">{item.icon}</span>}\n {!collapsed && <span>{item.label}</span>}\n </Comp>\n );\n}\n\nexport function SidebarBlock({\n sections,\n header,\n footer,\n collapsed = false,\n className,\n}: SidebarBlockProps) {\n return (\n <div className={cn(\"flex h-full flex-col\", className)}>\n {header && (\n <div className={cn(\"border-b p-4\", collapsed && \"p-2\")}>{header}</div>\n )}\n <nav className=\"flex-1 space-y-4 overflow-y-auto p-4\">\n {sections.map((section, sIdx) => (\n <div key={sIdx} className=\"space-y-1\">\n {section.title && !collapsed && (\n <p className=\"px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {section.title}\n </p>\n )}\n {section.items.map((item, iIdx) => (\n <SidebarItemComponent key={iIdx} item={item} collapsed={collapsed} />\n ))}\n </div>\n ))}\n </nav>\n {footer && (\n <div className={cn(\"border-t p-4\", collapsed && \"p-2\")}>{footer}</div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface FooterLink {\n label: string;\n href: string;\n}\n\nexport interface FooterBlockProps {\n copyright?: string;\n links?: FooterLink[];\n logo?: React.ReactNode;\n className?: string;\n}\n\nexport function FooterBlock({\n copyright,\n links = [],\n logo,\n className,\n}: FooterBlockProps) {\n return (\n <footer className={cn(\"border-t bg-background\", className)}>\n <div className=\"flex flex-col items-center gap-4 px-4 py-6 md:flex-row md:justify-between md:px-6\">\n <div className=\"flex items-center gap-2\">\n {logo}\n {copyright && (\n <p className=\"text-sm text-muted-foreground\">{copyright}</p>\n )}\n </div>\n {links.length > 0 && (\n <nav className=\"flex gap-4\">\n {links.map((link) => (\n <a\n key={link.href}\n href={link.href}\n className=\"text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n {link.label}\n </a>\n ))}\n </nav>\n )}\n </div>\n </footer>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronsUpDown, Plus } from \"lucide-react\";\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuTrigger,\n} from \"../../../components/dropdown-menu\";\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"../../../components/sidebar\";\nimport type { SidebarTeam } from \"./types\";\n\nexport interface TeamSwitcherProps {\n teams: SidebarTeam[];\n activeTeam?: SidebarTeam;\n onTeamChange?: (team: SidebarTeam) => void;\n onAddTeam?: () => void;\n}\n\nexport function TeamSwitcher({\n teams,\n activeTeam: activeTeamProp,\n onTeamChange,\n onAddTeam,\n}: TeamSwitcherProps) {\n const { isMobile } = useSidebar();\n const [internalActive, setInternalActive] = React.useState(teams[0]);\n const activeTeam = activeTeamProp ?? internalActive;\n\n if (!activeTeam) {\n return null;\n }\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n size=\"lg\"\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n <activeTeam.logo className=\"size-4\" />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">\n {activeTeam.name}\n </span>\n <span className=\"truncate text-xs\">{activeTeam.plan}</span>\n </div>\n <ChevronsUpDown className=\"ml-auto\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n align=\"start\"\n side={isMobile ? \"bottom\" : \"right\"}\n sideOffset={4}\n >\n <DropdownMenuLabel className=\"text-xs text-muted-foreground\">\n Teams\n </DropdownMenuLabel>\n {teams.map((team, index) => (\n <DropdownMenuItem\n key={team.name}\n onClick={() => {\n setInternalActive(team);\n onTeamChange?.(team);\n }}\n className=\"gap-2 p-2\"\n >\n <div className=\"flex size-6 items-center justify-center rounded-md border\">\n <team.logo className=\"size-3.5 shrink-0\" />\n </div>\n {team.name}\n <DropdownMenuShortcut>\n {\"⌘\"}\n {index + 1}\n </DropdownMenuShortcut>\n </DropdownMenuItem>\n ))}\n {onAddTeam && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem className=\"gap-2 p-2\" onClick={onAddTeam}>\n <div className=\"flex size-6 items-center justify-center rounded-md border bg-transparent\">\n <Plus className=\"size-4\" />\n </div>\n <div className=\"font-medium text-muted-foreground\">\n Add team\n </div>\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n}\n","\"use client\";\n\nimport { ChevronRight } from \"lucide-react\";\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../../components/collapsible\";\nimport {\n SidebarGroup,\n SidebarGroupLabel,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n} from \"../../../components/sidebar\";\nimport type { SidebarNavGroup } from \"./types\";\n\nexport interface SidebarNavProps {\n groups: SidebarNavGroup[];\n}\n\nexport function SidebarNav({ groups }: SidebarNavProps) {\n return (\n <>\n {groups.map((group, groupIdx) => (\n <SidebarGroup key={group.label ?? groupIdx}>\n {group.label && <SidebarGroupLabel>{group.label}</SidebarGroupLabel>}\n <SidebarMenu>\n {group.items.map((item) => {\n if (item.items && item.items.length > 0) {\n return (\n <Collapsible\n key={item.title}\n asChild\n defaultOpen={item.isActive}\n className=\"group/collapsible\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton tooltip={item.title}>\n {item.icon}\n <span>{item.title}</span>\n <ChevronRight className=\"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90\" />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n {item.items.map((subItem) => (\n <SidebarMenuSubItem key={subItem.title}>\n <SidebarMenuSubButton\n asChild\n isActive={subItem.isActive}\n >\n <a\n href={subItem.url}\n onClick={(e) => {\n if (subItem.onClick) {\n e.preventDefault();\n subItem.onClick();\n }\n }}\n >\n <span>{subItem.title}</span>\n </a>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </CollapsibleContent>\n </SidebarMenuItem>\n </Collapsible>\n );\n }\n\n return (\n <SidebarMenuItem key={item.title}>\n <SidebarMenuButton\n asChild\n tooltip={item.title}\n isActive={item.isActive}\n >\n <a\n href={item.url}\n onClick={(e) => {\n if (item.onClick) {\n e.preventDefault();\n item.onClick();\n }\n }}\n >\n {item.icon}\n <span>{item.title}</span>\n </a>\n </SidebarMenuButton>\n </SidebarMenuItem>\n );\n })}\n </SidebarMenu>\n </SidebarGroup>\n ))}\n </>\n );\n}\n","\"use client\";\n\nimport { ChevronsUpDown, LogOut } from \"lucide-react\";\n\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"../../../components/avatar\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../../../components/dropdown-menu\";\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"../../../components/sidebar\";\nimport type { SidebarUser, SidebarUserMenuItem } from \"./types\";\n\nexport interface SidebarUserNavProps {\n user: SidebarUser;\n menuGroups?: SidebarUserMenuItem[][];\n onLogout: () => void;\n}\n\nfunction getInitials(name: string): string {\n return name\n .split(\" \")\n .map((part) => part[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2);\n}\n\nexport function SidebarUserNav({\n user,\n menuGroups,\n onLogout,\n}: SidebarUserNavProps) {\n const { isMobile } = useSidebar();\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n size=\"lg\"\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <Avatar className=\"h-8 w-8 rounded-lg\">\n {user.avatar && (\n <AvatarImage src={user.avatar} alt={user.name} />\n )}\n <AvatarFallback className=\"rounded-lg\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n <ChevronsUpDown className=\"ml-auto size-4\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n side={isMobile ? \"bottom\" : \"right\"}\n align=\"end\"\n sideOffset={4}\n >\n <DropdownMenuLabel className=\"p-0 font-normal\">\n <div className=\"flex items-center gap-2 px-1 py-1.5 text-left text-sm\">\n <Avatar className=\"h-8 w-8 rounded-lg\">\n {user.avatar && (\n <AvatarImage src={user.avatar} alt={user.name} />\n )}\n <AvatarFallback className=\"rounded-lg\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n </div>\n </DropdownMenuLabel>\n {menuGroups?.map((group, groupIdx) => (\n <span key={groupIdx}>\n <DropdownMenuSeparator />\n <DropdownMenuGroup>\n {group.map((item) => (\n <DropdownMenuItem key={item.label} onClick={item.onClick}>\n {item.icon}\n {item.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </span>\n ))}\n <DropdownMenuSeparator />\n <DropdownMenuItem onClick={onLogout}>\n <LogOut />\n Log out\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarRail,\n} from \"../../../components/sidebar\";\nimport { TeamSwitcher } from \"./team-switcher\";\nimport { SidebarNav } from \"./sidebar-nav\";\nimport { SidebarUserNav } from \"./sidebar-user\";\nimport type {\n SidebarTeam,\n SidebarNavGroup,\n SidebarUser,\n SidebarUserMenuItem,\n} from \"./types\";\n\nexport interface AppSidebarBlockProps\n extends React.ComponentProps<typeof Sidebar> {\n /** One or more teams displayed in the header switcher */\n teams: SidebarTeam[];\n /** Currently active team (defaults to first team) */\n activeTeam?: SidebarTeam;\n /** Called when user switches teams */\n onTeamChange?: (team: SidebarTeam) => void;\n /** Called when \"Add team\" is clicked — omit to hide the button */\n onAddTeam?: () => void;\n\n /** Flexible navigation groups rendered in the sidebar body */\n navGroups?: SidebarNavGroup[];\n\n /** User info displayed in the footer */\n user: SidebarUser;\n /** Optional grouped menu items in the user dropdown (e.g. Account, Billing) */\n userMenuGroups?: SidebarUserMenuItem[][];\n /** Called on logout — always rendered */\n onLogout: () => void;\n}\n\nexport function AppSidebarBlock({\n teams,\n activeTeam,\n onTeamChange,\n onAddTeam,\n navGroups,\n user,\n userMenuGroups,\n onLogout,\n ...sidebarProps\n}: AppSidebarBlockProps) {\n return (\n <Sidebar collapsible=\"icon\" {...sidebarProps}>\n <SidebarHeader>\n <TeamSwitcher\n teams={teams}\n activeTeam={activeTeam}\n onTeamChange={onTeamChange}\n onAddTeam={onAddTeam}\n />\n </SidebarHeader>\n <SidebarContent>\n {navGroups && navGroups.length > 0 && (\n <SidebarNav groups={navGroups} />\n )}\n </SidebarContent>\n <SidebarFooter>\n <SidebarUserNav\n user={user}\n menuGroups={userMenuGroups}\n onLogout={onLogout}\n />\n </SidebarFooter>\n <SidebarRail />\n </Sidebar>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowRight, Image as ImageIcon } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n CardDescription,\n} from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { Button } from \"../../components/button\";\nimport { AspectRatio } from \"../../components/aspect-ratio\";\n\nexport interface MediaCardMeta {\n /**\n * Optional icon for the meta row. Pass any React node (`<FontAwesomeIcon … />`,\n * a Lucide icon, an inline SVG, etc.).\n */\n icon?: React.ReactNode;\n label: string;\n}\n\nexport interface MediaCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Cover image source and alt text */\n image?: { src: string; alt: string };\n /**\n * Icon displayed when no image is provided. Pass any React node. Defaults to\n * a Lucide `Image` glyph.\n */\n fallbackIcon?: React.ReactNode;\n /** Optional badge shown over the image area */\n badge?: string;\n /** Card title */\n title: string;\n /** Card description */\n description?: string;\n /** Metadata items rendered below the description */\n meta?: MediaCardMeta[];\n /** Footer text rendered as a CTA link/button */\n footer?: string;\n /** URL for the card link / CTA */\n href?: string;\n /** Click handler for the CTA (used when no href is provided) */\n onAction?: () => void;\n /** Loading state */\n loading?: boolean;\n /** Disabled state */\n disabled?: boolean;\n}\n\nconst MediaCard = React.forwardRef<HTMLDivElement, MediaCardProps>(\n (\n {\n image,\n fallbackIcon,\n badge,\n title,\n description,\n meta,\n footer,\n href,\n onAction,\n loading,\n disabled,\n className,\n ...props\n },\n ref,\n ) => {\n const Wrapper = href ? \"a\" : \"div\";\n const wrapperProps = href\n ? {\n href,\n className:\n \"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 rounded-lg\",\n }\n : {};\n\n return (\n <Wrapper {...wrapperProps}>\n <Card\n ref={ref}\n className={cn(\n \"overflow-hidden transition-shadow duration-normal ease-default\",\n href && \"hover:shadow-md\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n {...props}\n >\n {/* Image / Fallback area */}\n <div className=\"relative\">\n <AspectRatio ratio={16 / 9}>\n {image ? (\n <img\n src={image.src}\n alt={image.alt}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-muted text-muted-foreground [&_svg]:h-10 [&_svg]:w-10\">\n {fallbackIcon ?? <ImageIcon />}\n </div>\n )}\n </AspectRatio>\n {badge && (\n <div className=\"absolute top-2 right-2\">\n <Badge variant=\"secondary\">{badge}</Badge>\n </div>\n )}\n </div>\n\n {/* Content */}\n <CardHeader>\n <CardTitle className=\"text-lg\">{title}</CardTitle>\n {description && <CardDescription>{description}</CardDescription>}\n </CardHeader>\n\n {/* Meta items */}\n {meta && meta.length > 0 && (\n <CardContent>\n <div className=\"flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground\">\n {meta.map((item, i) => (\n <span\n key={i}\n className=\"inline-flex items-center gap-1.5 [&_svg]:h-3.5 [&_svg]:w-3.5\"\n >\n {item.icon}\n {item.label}\n </span>\n ))}\n </div>\n </CardContent>\n )}\n\n {/* Footer CTA */}\n {footer && (\n <CardFooter>\n {href ? (\n <span className=\"inline-flex items-center gap-1.5 text-sm font-medium text-primary\">\n {footer}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </span>\n ) : (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onAction}\n disabled={disabled || loading}\n className=\"gap-1.5 px-0 text-primary hover:text-primary/80\"\n >\n {footer}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Button>\n )}\n </CardFooter>\n )}\n </Card>\n </Wrapper>\n );\n },\n);\nMediaCard.displayName = \"MediaCard\";\n\nexport { MediaCard };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Card, CardContent } from \"../../components/card\";\nimport {\n Avatar,\n AvatarImage,\n AvatarFallback,\n} from \"../../components/avatar\";\nimport { Badge, type BadgeProps } from \"../../components/badge\";\nimport { Progress } from \"../../components/progress\";\nimport { Rating } from \"../../components/rating\";\nimport { Skeleton } from \"../../components/skeleton\";\n\nexport interface ReviewItem {\n /** Stable key for the review. */\n id: string;\n /** Star rating for this review, 0–5. */\n rating: number;\n /** Review body text. */\n content: string;\n author: {\n name: string;\n /** Optional avatar image URL; falls back to initials. */\n avatarUrl?: string;\n };\n /** Preformatted, human-readable date, e.g. \"2 weeks ago\" or \"Dec 10, 2024\". */\n date: string;\n /** Optional badge shown beside the author name, e.g. \"Google\". */\n badgeLabel?: string;\n}\n\n/** A single `{ star, count }` bucket of the rating distribution. */\nexport interface RatingDistributionItem {\n /** Star level, 1–5. */\n star: number;\n /** Number of reviews at this star level. */\n count: number;\n}\n\nexport interface ReviewsBlockProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Reviews to display as cards. */\n reviews: ReviewItem[];\n /** Aggregate average rating shown in the summary. */\n averageRating: number;\n /** Total number of reviews behind the aggregate. */\n totalReviews: number;\n /** Section heading. Defaults to \"Customer Reviews\". */\n title?: string;\n /**\n * Optional per-star distribution. When provided, the summary renders the\n * bar chart; when omitted, only the average + total are shown. Omit it when\n * the data source (e.g. Google Places) does not expose a full histogram.\n */\n distribution?: RatingDistributionItem[];\n /**\n * Brand variant for the per-review badge (`badgeLabel`). Defaults to\n * `secondary`. Use it to align the badge with the surrounding brand color.\n */\n badgeVariant?: BadgeProps[\"variant\"];\n /**\n * Text-color utility applied to the star ratings, e.g. `text-primary`.\n * Defaults to the `Rating` component's own default (`text-highlight`).\n */\n ratingClassName?: string;\n /** Render skeleton placeholders instead of content. */\n loading?: boolean;\n /** Render an error message instead of content. */\n error?: string;\n}\n\nfunction initials(name: string): string {\n return name\n .split(\" \")\n .map((n) => n[0])\n .filter(Boolean)\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n\nconst SKELETON_CARDS = 4;\n\nconst ReviewsBlock = React.forwardRef<HTMLElement, ReviewsBlockProps>(\n (\n {\n reviews,\n averageRating,\n totalReviews,\n title = \"Customer Reviews\",\n distribution,\n badgeVariant = \"secondary\",\n ratingClassName,\n loading,\n error,\n className,\n ...props\n },\n ref,\n ) => {\n // Round once so the numeric label and the star fill never disagree (e.g.\n // 4.95 must not read \"5.0\" beside a partially filled fifth star).\n const displayRating = Math.round(averageRating * 10) / 10;\n\n return (\n <section\n ref={ref}\n className={cn(\"py-16 md:py-24\", className)}\n {...props}\n >\n <div className=\"mx-auto max-w-5xl px-4 sm:px-6\">\n <h2 className=\"mb-8 text-2xl font-semibold tracking-tight md:text-3xl\">\n {title}\n </h2>\n\n {error ? (\n <p className=\"text-sm text-muted-foreground\">{error}</p>\n ) : (\n <div className=\"grid gap-8 lg:grid-cols-[280px_1fr] lg:gap-12\">\n {/* Summary */}\n <div className=\"space-y-6\">\n <div className=\"text-center lg:text-left\">\n {loading ? (\n <>\n <Skeleton className=\"mx-auto h-12 w-20 lg:mx-0\" />\n <Skeleton className=\"mx-auto mt-2 h-5 w-28 lg:mx-0\" />\n <Skeleton className=\"mx-auto mt-1 h-4 w-36 lg:mx-0\" />\n </>\n ) : (\n <>\n <div className=\"text-5xl font-bold\">\n {displayRating.toFixed(1)}\n </div>\n <Rating\n rate={displayRating}\n size=\"lg\"\n className={cn(\n \"mt-2 justify-center lg:justify-start\",\n ratingClassName,\n )}\n />\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Based on {totalReviews.toLocaleString()} reviews\n </p>\n </>\n )}\n </div>\n\n {/* Distribution bars — only when the data source provides them */}\n {!loading && distribution && distribution.length > 0 && (\n <div className=\"space-y-2\">\n {[...distribution]\n .sort((a, b) => b.star - a.star)\n .map(({ star, count }) => (\n <div key={star} className=\"flex items-center gap-3\">\n <span className=\"w-8 text-sm text-muted-foreground\">\n {star} ★\n </span>\n <Progress\n value={\n totalReviews > 0\n ? (count / totalReviews) * 100\n : 0\n }\n className=\"h-2 flex-1\"\n />\n <span className=\"w-8 text-right text-sm text-muted-foreground\">\n {count}\n </span>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Reviews grid */}\n <div className=\"grid gap-4 sm:grid-cols-2\">\n {loading\n ? Array.from({ length: SKELETON_CARDS }).map((_, i) => (\n <Card key={i} className=\"gap-0 p-0 shadow-none\">\n <CardContent className=\"space-y-3 p-5\">\n <div className=\"flex items-center gap-2.5\">\n <Skeleton className=\"size-9 rounded-full\" />\n <div className=\"space-y-1.5\">\n <Skeleton className=\"h-4 w-24\" />\n <Skeleton className=\"h-3 w-16\" />\n </div>\n </div>\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-4/5\" />\n </CardContent>\n </Card>\n ))\n : reviews.map((review) => (\n <Card\n key={review.id}\n className=\"gap-0 p-0 shadow-none\"\n >\n <CardContent className=\"space-y-3 p-5\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex items-center gap-2.5\">\n <Avatar className=\"size-9\">\n {review.author.avatarUrl && (\n <AvatarImage\n src={review.author.avatarUrl}\n alt={review.author.name}\n />\n )}\n <AvatarFallback className=\"text-xs\">\n {initials(review.author.name)}\n </AvatarFallback>\n </Avatar>\n <div>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-medium\">\n {review.author.name}\n </span>\n {review.badgeLabel && (\n <Badge\n variant={badgeVariant}\n className=\"h-5 px-1.5 text-[0.625rem]\"\n >\n {review.badgeLabel}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {review.date}\n </p>\n </div>\n </div>\n <Rating\n rate={review.rating}\n size=\"sm\"\n className={ratingClassName}\n />\n </div>\n\n <p className=\"line-clamp-4 text-sm leading-relaxed text-muted-foreground\">\n {review.content}\n </p>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n )}\n </div>\n </section>\n );\n },\n);\nReviewsBlock.displayName = \"ReviewsBlock\";\n\nexport { ReviewsBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Camera } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Label } from \"../../components/label\";\nimport { Textarea } from \"../../components/textarea\";\nimport { Avatar, AvatarImage, AvatarFallback } from \"../../components/avatar\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ProfileSettingsData {\n name: string;\n email: string;\n bio?: string;\n avatarUrl?: string;\n}\n\nexport interface ProfileSettingsBlockProps {\n initialData: ProfileSettingsData;\n onSave: (data: ProfileSettingsData) => void | Promise<void>;\n onAvatarChange?: (file: File) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function ProfileSettingsBlock({\n initialData,\n onSave,\n onAvatarChange,\n loading = false,\n error,\n disabled = false,\n className,\n}: ProfileSettingsBlockProps) {\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSave({\n name: formData.get(\"name\") as string,\n email: formData.get(\"email\") as string,\n bio: formData.get(\"bio\") as string,\n avatarUrl: initialData.avatarUrl,\n });\n };\n\n const handleAvatarClick = () => {\n fileInputRef.current?.click();\n };\n\n const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const file = e.target.files?.[0];\n if (file && onAvatarChange) {\n onAvatarChange(file);\n }\n };\n\n const initials = initialData.name\n .split(\" \")\n .map((n) => n[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2);\n\n return (\n <Card className={cn(\"w-full max-w-2xl\", className)}>\n <CardHeader>\n <CardTitle>Profile</CardTitle>\n <CardDescription>Manage your personal information</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-6\">\n <FormError message={error} />\n\n <div className=\"flex items-center gap-4\">\n <div className=\"relative group\">\n <Avatar className=\"h-20 w-20\">\n {initialData.avatarUrl && <AvatarImage src={initialData.avatarUrl} alt={initialData.name} />}\n <AvatarFallback className=\"text-lg\">{initials}</AvatarFallback>\n </Avatar>\n {onAvatarChange && (\n <button\n type=\"button\"\n onClick={handleAvatarClick}\n disabled={loading || disabled}\n className=\"absolute inset-0 flex items-center justify-center rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity\"\n >\n <Camera className=\"h-5 w-5 text-white\" />\n </button>\n )}\n <input ref={fileInputRef} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={handleFileChange} />\n </div>\n <div>\n <p className=\"font-medium\">{initialData.name}</p>\n <p className=\"text-sm text-muted-foreground\">{initialData.email}</p>\n </div>\n </div>\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"name\">Name</Label>\n <Input id=\"name\" name=\"name\" defaultValue={initialData.name} required disabled={loading || disabled} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" name=\"email\" type=\"email\" defaultValue={initialData.email} required disabled={loading || disabled} />\n </div>\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"bio\">Bio</Label>\n <Textarea id=\"bio\" name=\"bio\" defaultValue={initialData.bio} placeholder=\"Tell us about yourself...\" disabled={loading || disabled} rows={3} />\n </div>\n <div className=\"flex justify-end\">\n <Button type=\"submit\" loading={loading} disabled={disabled}>\n Save changes\n </Button>\n </div>\n </form>\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Label } from \"../../components/label\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { Separator } from \"../../components/separator\";\nimport { FormError } from \"../../form/form-error\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"../../components/alert-dialog\";\n\nexport interface AccountSettingsBlockProps {\n onChangePassword: (data: { currentPassword: string; newPassword: string; confirmPassword: string }) => void | Promise<void>;\n onDeleteAccount?: () => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function AccountSettingsBlock({\n onChangePassword,\n onDeleteAccount,\n loading = false,\n error,\n disabled = false,\n className,\n}: AccountSettingsBlockProps) {\n const handlePasswordSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onChangePassword({\n currentPassword: formData.get(\"currentPassword\") as string,\n newPassword: formData.get(\"newPassword\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n });\n e.currentTarget.reset();\n };\n\n return (\n <div className={cn(\"w-full max-w-2xl space-y-6\", className)}>\n <Card>\n <CardHeader>\n <CardTitle>Change password</CardTitle>\n <CardDescription>Update your password to keep your account secure</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handlePasswordSubmit} className=\"space-y-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"currentPassword\">Current password</Label>\n <Input id=\"currentPassword\" name=\"currentPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"current-password\" />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"newPassword\">New password</Label>\n <Input id=\"newPassword\" name=\"newPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"new-password\" />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"confirmPassword\">Confirm new password</Label>\n <Input id=\"confirmPassword\" name=\"confirmPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"new-password\" />\n </div>\n <div className=\"flex justify-end\">\n <Button type=\"submit\" loading={loading} disabled={disabled}>\n Update password\n </Button>\n </div>\n </form>\n </div>\n </CardContent>\n </Card>\n\n {onDeleteAccount && (\n <Card className=\"border-destructive/50\">\n <CardHeader>\n <CardTitle className=\"text-destructive\">Danger zone</CardTitle>\n <CardDescription>Permanently delete your account and all associated data</CardDescription>\n </CardHeader>\n <CardContent>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"destructive\" disabled={loading || disabled}>\n Delete account\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. This will permanently delete your account and remove all your data from our servers.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction onClick={onDeleteAccount} className=\"bg-destructive text-destructive-foreground hover:bg-destructive/90\">\n Delete account\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </CardContent>\n </Card>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Switch } from \"../../components/switch\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface NotificationSetting {\n id: string;\n label: string;\n description: string;\n enabled: boolean;\n}\n\nexport interface NotificationGroup {\n title: string;\n description?: string;\n settings: NotificationSetting[];\n}\n\nexport interface NotificationSettingsBlockProps {\n groups: NotificationGroup[];\n onSave: (settings: Record<string, boolean>) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function NotificationSettingsBlock({\n groups,\n onSave,\n loading = false,\n error,\n disabled = false,\n className,\n}: NotificationSettingsBlockProps) {\n const [values, setValues] = React.useState<Record<string, boolean>>(() => {\n const initial: Record<string, boolean> = {};\n for (const group of groups) {\n for (const setting of group.settings) {\n initial[setting.id] = setting.enabled;\n }\n }\n return initial;\n });\n\n const handleToggle = (id: string, checked: boolean) => {\n setValues((prev) => ({ ...prev, [id]: checked }));\n };\n\n const handleSave = async () => {\n await onSave(values);\n };\n\n return (\n <div className={cn(\"w-full max-w-2xl space-y-6\", className)}>\n <FormError message={error} />\n\n {groups.map((group, gIdx) => (\n <Card key={gIdx}>\n <CardHeader>\n <CardTitle className=\"text-lg\">{group.title}</CardTitle>\n {group.description && <CardDescription>{group.description}</CardDescription>}\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {group.settings.map((setting) => (\n <div key={setting.id} className=\"flex items-center justify-between gap-4\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-medium\">{setting.label}</p>\n <p className=\"text-sm text-muted-foreground\">{setting.description}</p>\n </div>\n <Switch\n checked={values[setting.id]}\n onCheckedChange={(checked) => handleToggle(setting.id, checked)}\n disabled={loading || disabled}\n />\n </div>\n ))}\n </div>\n </CardContent>\n </Card>\n ))}\n\n <div className=\"flex justify-end\">\n <Button onClick={handleSave} loading={loading} disabled={disabled}>\n Save preferences\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAa,2BACX;AAEF,MAAa,4BACX;AAEF,MAAa,4BACX;;AAGF,MAAa,iCAAiC;;;;;;;;;;;;;ACO9C,SAAgB,gBACd,UAAkC,EAAE,EACmB;CACvD,MAAM,EAAE,OAAO,MAAM,SAAS,SAAS,YAAY,MAAM;CACzD,MAAM,MAAM,MAAM,OAAiB,KAAK;CACxC,MAAM,CAAC,UAAU,eAAe,MAAM,SAAS,MAAM;AAErD,OAAM,gBAAgB;EACpB,MAAM,KAAK,IAAI;AACf,MAAI,CAAC,GAAI;EAET,MAAM,WAAW,IAAI,sBAClB,CAAC,WAAW;AACX,OAAI,MAAM,gBAAgB;AACxB,gBAAY,KAAK;AACjB,QAAI,KAAM,UAAS,UAAU,GAAG;cACvB,CAAC,KACV,aAAY,MAAM;KAGtB;GAAE,YAAY;GAAQ;GAAW,CAClC;AAED,WAAS,QAAQ,GAAG;AACpB,eAAa,SAAS,YAAY;IACjC;EAAC;EAAM;EAAQ;EAAU,CAAC;AAE7B,QAAO;EAAE;EAAK;EAAU;;;;AC9C1B,MAAM,oBAAoB;AAE1B,SAAgB,cAAc;CAC5B,MAAM,CAAC,UAAU,eAA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CACE,oBAAC,WAAD;IAAW,WAAU;cAAW,MAAM;IAAkB,CAAA,EACvD,MAAM,eAAe,oBAAC,iBAAD,EAAA,UAAkB,MAAM,aAA8B,CAAA,CACjE,EAAA,CAAA,EACb,oBAAC,aAAD,EAAA,UACE,oBAAC,OAAD;IAAK,WAAU;cACZ,MAAM,SAAS,KAAK,YACnB,qBAAC,OAAD;KAAsB,WAAU;eAAhC,CACE,qBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,oBAAC,KAAD;OAAG,WAAU;iBAAuB,QAAQ;OAAU,CAAA,EACtD,oBAAC,KAAD;OAAG,WAAU;iBAAiC,QAAQ;OAAgB,CAAA,CAClE;SACN,oBAAC,QAAD;MACE,SAAS,OAAO,QAAQ;MACxB,kBAAkB,YAAY,aAAa,QAAQ,IAAI,QAAQ;MAC/D,UAAU,WAAW;MACrB,CAAA,CACE;OAVI,QAAQ,GAUZ,CACN;IACE,CAAA,EACM,CAAA,CACT,EAAA,EAtBI,KAsBJ,CACP;GAEF,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,QAAD;KAAQ,SAAS;KAAqB;KAAmB;eAAU;KAE1D,CAAA;IACL,CAAA;GACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["SlotPrimitive","PasswordToggleField","LabelPrimitive","SelectPrimitive","PopoverPrimitive","CalendarIcon","useIsomorphicLayoutEffect","CalendarIcon","SeparatorPrimitive","TooltipPrimitive","UnderlineIcon","LinkIcon","Underline","Link","CheckboxPrimitive","RadioGroupPrimitive","SwitchPrimitives","SliderPrimitive","AvatarPrimitive","DialogPrimitive","AlertDialogPrimitive","SheetPrimitive","DropdownMenuPrimitive","SonnerToaster","TabsPrimitive","AccordionPrimitive","ProgressPrimitive","ScrollAreaPrimitive","ContextMenuPrimitive","NavigationMenuPrimitive","SlotPrimitive","CommandPrimitive","AspectRatioPrimitive","CollapsiblePrimitive","SlotPrimitive","ImageIcon"],"sources":["../src/lib/semantic-action-tones.ts","../src/hooks/use-scroll-reveal.ts","../src/hooks/use-mobile.ts","../src/providers/theme-provider.tsx","../src/providers/density-provider.tsx","../src/providers/bison-provider.tsx","../src/providers/theme-scope.tsx","../src/form/form.tsx","../src/form/field-context.tsx","../src/components/outlined-field.tsx","../src/form/form-field.tsx","../src/form/form-error.tsx","../src/components/button.tsx","../src/lib/surface-classes.ts","../src/components/input.tsx","../src/components/password-input.tsx","../src/components/code-input.tsx","../src/components/currency-input.tsx","../src/lib/us-phone.ts","../src/components/phone-input.tsx","../src/components/label.tsx","../src/components/input-group.tsx","../src/components/textarea.tsx","../src/components/select.tsx","../src/components/calendar.tsx","../src/components/popover.tsx","../src/components/date-picker.tsx","../src/components/time-picker.tsx","../src/components/date-range-picker.tsx","../src/components/separator.tsx","../src/components/tooltip.tsx","../src/components/text-editor.tsx","../src/components/text-content.tsx","../src/components/checkbox.tsx","../src/components/radio-group.tsx","../src/components/switch.tsx","../src/components/slider.tsx","../src/components/card.tsx","../src/components/alert.tsx","../src/lib/semantic-tint-tones.ts","../src/components/badge.tsx","../src/components/avatar.tsx","../src/components/dialog.tsx","../src/components/alert-dialog.tsx","../src/components/sheet.tsx","../src/components/dropdown-menu.tsx","../src/components/toast.tsx","../src/components/tabs.tsx","../src/components/stepper.tsx","../src/components/accordion.tsx","../src/components/table.tsx","../src/components/data-table.tsx","../src/components/progress.tsx","../src/components/progress-bar.tsx","../src/components/scroll-area.tsx","../src/components/skeleton.tsx","../src/components/rating.tsx","../src/components/spinner.tsx","../src/components/saved-ping.tsx","../src/components/context-menu.tsx","../src/components/navigation-menu.tsx","../src/components/breadcrumb.tsx","../src/components/pagination.tsx","../src/components/command.tsx","../src/components/editable-title.tsx","../src/components/aspect-ratio.tsx","../src/components/collapsible.tsx","../src/components/sidebar.tsx","../src/blocks/auth/social-providers.tsx","../src/blocks/auth/sign-in-block.tsx","../src/blocks/auth/sign-up-block.tsx","../src/blocks/auth/forgot-password-block.tsx","../src/blocks/auth/reset-password-block.tsx","../src/blocks/auth/verify-block.tsx","../src/blocks/error/not-found-block.tsx","../src/blocks/error/server-error-block.tsx","../src/blocks/error/maintenance-block.tsx","../src/blocks/error/empty-state-block.tsx","../src/blocks/layout/page-shell.tsx","../src/blocks/layout/header-block.tsx","../src/blocks/layout/sidebar-block.tsx","../src/blocks/layout/footer-block.tsx","../src/blocks/layout/app-sidebar/team-switcher.tsx","../src/blocks/layout/app-sidebar/sidebar-nav.tsx","../src/blocks/layout/app-sidebar/sidebar-user.tsx","../src/blocks/layout/app-sidebar/app-sidebar-block.tsx","../src/blocks/data-display/media-card.tsx","../src/blocks/data-display/reviews-block.tsx","../src/blocks/settings/profile-settings-block.tsx","../src/blocks/settings/account-settings-block.tsx","../src/blocks/settings/notification-settings-block.tsx"],"sourcesContent":["/**\n * Reusable “soft” icon tiles: same border + shadow language, hue from semantic scales.\n * Pair with `Button` variants `actionNeutral` | `actionPositive` | `actionNegative` and `size=\"icon\"`.\n *\n * Requires `--success-*` and `--destructive-*` scales from BisonProvider / tailwind preset.\n */\nexport const actionNeutralToneClasses =\n 'border border-border bg-muted/80 text-muted-foreground shadow-sm hover:border-border-strong hover:bg-muted hover:text-foreground dark:border-border dark:bg-muted/50 dark:hover:bg-muted/80 dark:hover:text-foreground';\n\nexport const actionPositiveToneClasses =\n 'border border-success-200/90 bg-success-100 text-success-600 shadow-sm hover:border-success-300 hover:bg-success-200 hover:text-success-700 focus-visible:ring-success-500/40 dark:border-success-800/55 dark:bg-success-950/40 dark:text-success-400 dark:hover:border-success-700 dark:hover:bg-success-950/60 dark:hover:text-success-300';\n\nexport const actionNegativeToneClasses =\n 'border border-destructive-200/90 bg-destructive-100 text-destructive-600 shadow-sm hover:border-destructive-300 hover:bg-destructive-200 hover:text-destructive-700 focus-visible:ring-destructive-500/40 dark:border-destructive-800/55 dark:bg-destructive-950/45 dark:text-destructive-400 dark:hover:border-destructive-700 dark:hover:bg-destructive-950/65 dark:hover:text-destructive-300';\n\n/** @deprecated Use `actionNeutralToneClasses` + `variant=\"actionNeutral\"` on Button. */\nexport const actionNeutralIconChromeClasses = actionNeutralToneClasses;\n","\"use client\";\n\nimport * as React from \"react\";\n\nexport interface UseScrollRevealOptions {\n /** Trigger only once (default: true) */\n once?: boolean;\n /** Root margin for IntersectionObserver (default: \"-50px\") */\n margin?: string;\n /** Visibility threshold 0–1 (default: 0) */\n threshold?: number;\n}\n\n/**\n * Returns a ref and a boolean indicating whether the element is in view.\n * Uses IntersectionObserver internally — no Framer Motion dependency required.\n *\n * @example\n * ```tsx\n * const { ref, isInView } = useScrollReveal();\n * <div ref={ref} style={{ opacity: isInView ? 1 : 0 }}>Content</div>\n * ```\n */\nexport function useScrollReveal<T extends HTMLElement = HTMLDivElement>(\n options: UseScrollRevealOptions = {}\n): { ref: React.RefObject<T | null>; isInView: boolean } {\n const { once = true, margin = \"-50px\", threshold = 0 } = options;\n const ref = React.useRef<T | null>(null);\n const [isInView, setIsInView] = React.useState(false);\n\n React.useEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry.isIntersecting) {\n setIsInView(true);\n if (once) observer.unobserve(el);\n } else if (!once) {\n setIsInView(false);\n }\n },\n { rootMargin: margin, threshold }\n );\n\n observer.observe(el);\n return () => observer.disconnect();\n }, [once, margin, threshold]);\n\n return { ref, isInView };\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n mql.addEventListener(\"change\", onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n}\n","'use client';\n\nimport * as React from 'react';\n\ntype Theme = 'light' | 'dark' | 'system';\ntype ResolvedTheme = 'light' | 'dark';\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n defaultTheme?: Theme;\n storageKey?: string;\n attribute?: string;\n}\n\ninterface ThemeProviderState {\n /** The user's selected theme — can be `\"system\"`. Use `resolvedTheme` for the value actually applied to the DOM. */\n theme: Theme;\n /** The theme actually applied to the DOM (`\"light\"` or `\"dark\"`). `undefined` until the client mounts (avoids SSR/hydration mismatches). */\n resolvedTheme: ResolvedTheme | undefined;\n /** The user's OS-level color scheme preference. `undefined` until the client mounts. */\n systemTheme: ResolvedTheme | undefined;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeProviderContext = React.createContext<\n ThemeProviderState | undefined\n>(undefined);\n\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n storageKey = 'bison-theme',\n attribute = 'data-theme',\n ...props\n}: ThemeProviderProps) {\n const [theme, setTheme] = React.useState<Theme>(defaultTheme);\n const [systemTheme, setSystemTheme] = React.useState<\n ResolvedTheme | undefined\n >(undefined);\n\n React.useEffect(() => {\n const stored = localStorage.getItem(storageKey) as Theme | null;\n if (stored) setTheme(stored);\n }, [storageKey]);\n\n React.useEffect(() => {\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n setSystemTheme(media.matches ? 'dark' : 'light');\n\n const handleChange = (event: MediaQueryListEvent) => {\n setSystemTheme(event.matches ? 'dark' : 'light');\n };\n media.addEventListener('change', handleChange);\n return () => media.removeEventListener('change', handleChange);\n }, []);\n\n const resolvedTheme: ResolvedTheme | undefined =\n theme === 'light' || theme === 'dark' ? theme : systemTheme;\n\n React.useEffect(() => {\n if (!resolvedTheme) return;\n const root = window.document.documentElement;\n\n if (attribute === 'class') {\n root.classList.remove('light', 'dark');\n root.classList.add(resolvedTheme);\n } else {\n root.setAttribute(attribute, resolvedTheme);\n }\n }, [resolvedTheme, attribute]);\n\n const value = React.useMemo(\n () => ({\n theme,\n resolvedTheme,\n systemTheme,\n setTheme: (newTheme: Theme) => {\n localStorage.setItem(storageKey, newTheme);\n setTheme(newTheme);\n },\n }),\n [theme, resolvedTheme, systemTheme, storageKey],\n );\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n );\n}\n\nexport function useTheme() {\n const context = React.useContext(ThemeProviderContext);\n if (!context) throw new Error('useTheme must be used within a ThemeProvider');\n return context;\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\ntype Density = \"compact\" | \"default\" | \"spacious\";\n\ninterface DensityProviderProps {\n children: React.ReactNode;\n density?: Density;\n}\n\nconst DensityContext = React.createContext<Density>(\"default\");\n\nconst densityClasses: Record<Density, string> = {\n compact: \"bison-density-compact\",\n default: \"bison-density-default\",\n spacious: \"bison-density-spacious\",\n};\n\nexport function DensityProvider({ children, density = \"default\" }: DensityProviderProps) {\n return (\n <DensityContext.Provider value={density}>\n <div className={densityClasses[density]}>{children}</div>\n </DensityContext.Provider>\n );\n}\n\nexport function useDensity() {\n return React.useContext(DensityContext);\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n deriveLightPalette,\n deriveDarkPalette,\n generateBrandScales,\n generateScaleCSS,\n generateDestructiveScaleCSS,\n radiusPresets,\n shadowPresets,\n motionPresets,\n densityPresets,\n defaultFontWeights,\n zIndexTokens,\n} from \"@bison-lab/tokens\";\nimport type {\n BrandColors,\n RadiusPreset,\n ShadowPreset,\n MotionPreset,\n DensityPreset,\n FontWeightMap,\n} from \"@bison-lab/tokens\";\nimport { ThemeProvider } from \"./theme-provider\";\nimport { DensityProvider } from \"./density-provider\";\n\ntype Theme = \"light\" | \"dark\" | \"system\";\n\ninterface GoogleFontConfig {\n /** Google Font family name, e.g. \"Inter\", \"Roboto\", \"Playfair Display\" */\n family: string;\n /** Font weights to load. Defaults to [400, 500, 600, 700] */\n weights?: number[];\n /** Whether to load italic variants. Defaults to false */\n italic?: boolean;\n}\n\nexport interface BisonProviderProps {\n children: React.ReactNode;\n\n /** Brand colors used to derive the full semantic palette */\n brandColors: BrandColors;\n\n /** Border radius preset. Defaults to \"rounded\" */\n radius?: RadiusPreset;\n /** Shadow preset. Defaults to \"subtle\" */\n shadow?: ShadowPreset;\n /** Motion preset. Defaults to \"smooth\" */\n motion?: MotionPreset;\n /** Density preset. Defaults to \"default\" */\n density?: DensityPreset;\n\n /**\n * HTML attribute used to toggle dark mode on the root element.\n * Use \"class\" for the common `.dark` class convention (Tailwind default),\n * or \"data-theme\" for `[data-theme=\"dark\"]` attribute convention.\n * Defaults to \"class\".\n */\n attribute?: \"class\" | \"data-theme\";\n\n /** Default theme mode. Defaults to \"system\" */\n defaultTheme?: Theme;\n /** localStorage key for theme persistence. Defaults to \"bison-theme\" */\n storageKey?: string;\n\n /** Google Font for body/UI text. Defaults to Inter */\n bodyFont?: GoogleFontConfig;\n /** Google Font for headings. Falls back to bodyFont if not provided */\n headingFont?: GoogleFontConfig;\n /** Google Font for monospace/code. Defaults to JetBrains Mono */\n monoFont?: GoogleFontConfig;\n\n /** Custom font weight map. Defaults to 400/500/600/700 */\n fontWeights?: FontWeightMap;\n}\n\nfunction buildGoogleFontsUrl(fonts: GoogleFontConfig[]): string {\n const families = fonts.map((font) => {\n const weights = font.weights ?? [400, 500, 600, 700];\n const sortedWeights = [...weights].sort((a, b) => a - b);\n\n if (font.italic) {\n const ital = sortedWeights\n .flatMap((w) => [`0,${w}`, `1,${w}`])\n .join(\";\");\n return `family=${font.family.replace(/ /g, \"+\")}:ital,wght@${ital}`;\n }\n\n return `family=${font.family.replace(/ /g, \"+\")}:wght@${sortedWeights.join(\";\")}`;\n });\n\n return `https://fonts.googleapis.com/css2?${families.join(\"&\")}&display=swap`;\n}\n\nfunction fontFamilyValue(font: GoogleFontConfig, fallback: string): string {\n return `\"${font.family}\", ${fallback}`;\n}\n\nexport function BisonProvider({\n children,\n brandColors,\n radius = \"rounded\",\n shadow = \"subtle\",\n motion = \"smooth\",\n density = \"default\",\n attribute = \"class\",\n defaultTheme = \"system\",\n storageKey = \"bison-theme\",\n bodyFont = { family: \"Inter\", weights: [400, 500, 600, 700] },\n headingFont,\n monoFont = { family: \"JetBrains Mono\", weights: [400, 500, 600, 700] },\n fontWeights = defaultFontWeights,\n}: BisonProviderProps) {\n const resolvedHeadingFont = headingFont ?? bodyFont;\n\n // Derive color palettes + brand scales\n const lightPalette = React.useMemo(() => deriveLightPalette(brandColors), [brandColors]);\n const darkPalette = React.useMemo(() => deriveDarkPalette(brandColors), [brandColors]);\n const scaleCSS = React.useMemo(() => {\n const scales = generateBrandScales(brandColors);\n return `${generateScaleCSS(scales)}\\n${generateDestructiveScaleCSS()}`;\n }, [brandColors]);\n\n // Build Google Fonts URL\n const fontsUrl = React.useMemo(() => {\n const fonts: GoogleFontConfig[] = [bodyFont];\n if (headingFont && headingFont.family !== bodyFont.family) {\n fonts.push(headingFont);\n }\n if (monoFont.family !== bodyFont.family) {\n fonts.push(monoFont);\n }\n return buildGoogleFontsUrl(fonts);\n }, [bodyFont, headingFont, monoFont]);\n\n // Build CSS custom properties style string\n const styleContent = React.useMemo(() => {\n const radiusVars = radiusPresets[radius];\n const shadowVars = shadowPresets[shadow];\n const motionVars = motionPresets[motion];\n const densityVars = densityPresets[density];\n\n const fontVars = {\n \"--font-body\": fontFamilyValue(bodyFont, \"ui-sans-serif, system-ui, sans-serif\"),\n \"--font-heading\": fontFamilyValue(resolvedHeadingFont, \"ui-sans-serif, system-ui, sans-serif\"),\n \"--font-mono\": fontFamilyValue(monoFont, \"ui-monospace, monospace\"),\n \"--font-weight-normal\": String(fontWeights.normal),\n \"--font-weight-medium\": String(fontWeights.medium),\n \"--font-weight-semibold\": String(fontWeights.semibold),\n \"--font-weight-bold\": String(fontWeights.bold),\n ...(fontWeights.extrabold != null && {\n \"--font-weight-extrabold\": String(fontWeights.extrabold),\n }),\n };\n\n const lightColorVars = Object.entries(lightPalette)\n .map(([key, value]) => ` --${key}: ${value};`)\n .join(\"\\n\");\n\n const darkColorVars = Object.entries(darkPalette)\n .map(([key, value]) => ` --${key}: ${value};`)\n .join(\"\\n\");\n\n const zIndexVars = Object.entries(zIndexTokens)\n .map(([key, value]) => ` ${key}: ${value};`)\n .join(\"\\n\");\n\n const presetVars = [\n ...Object.entries(radiusVars),\n ...Object.entries(shadowVars),\n ...Object.entries(motionVars),\n ...Object.entries(densityVars),\n ...Object.entries(fontVars),\n ]\n .map(([key, value]) => ` ${key}: ${value};`)\n .join(\"\\n\");\n\n const darkSelector = attribute === \"class\" ? \".dark\" : '[data-theme=\"dark\"]';\n\n return `:root {\\n${lightColorVars}\\n\\n${scaleCSS}\\n${presetVars}\\n${zIndexVars}\\n font-family: var(--font-body);\\n}\\n\\n${darkSelector} {\\n${darkColorVars}\\n}`;\n }, [\n radius,\n shadow,\n motion,\n density,\n attribute,\n bodyFont,\n resolvedHeadingFont,\n monoFont,\n fontWeights,\n lightPalette,\n darkPalette,\n scaleCSS,\n ]);\n\n return (\n <>\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossOrigin=\"anonymous\" />\n <link rel=\"stylesheet\" href={fontsUrl} />\n <style dangerouslySetInnerHTML={{ __html: styleContent }} />\n <ThemeProvider defaultTheme={defaultTheme} storageKey={storageKey} attribute={attribute}>\n <DensityProvider density={density}>\n {children}\n </DensityProvider>\n </ThemeProvider>\n </>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface ThemeScopeProps extends React.HTMLAttributes<HTMLDivElement> {\n /** CSS custom property overrides applied to the scoped subtree */\n overrides: Record<string, string>;\n}\n\nconst ThemeScope = React.forwardRef<HTMLDivElement, ThemeScopeProps>(\n ({ overrides, className, style, children, ...props }, ref) => {\n const scopeStyle = React.useMemo(\n () => ({ ...overrides, ...style }),\n [overrides, style]\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"contents\", className)}\n style={scopeStyle}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nThemeScope.displayName = \"ThemeScope\";\n\nexport { ThemeScope };\n","'use client';\n\nimport * as React from 'react';\nimport type { ZodSchema, ZodError } from 'zod';\n\nexport type FormMode = 'native' | 'rhf';\n\n/**\n * The payload handed to `onSubmit`.\n *\n * A name that appears once yields a scalar; a name that repeats — a checkbox\n * group, a multi-select — yields an array. It used to always be a scalar,\n * because the payload was built with `Object.fromEntries(formData.entries())`,\n * which keeps only the LAST entry under a repeated key. Three checked boxes\n * submitted as one, silently, with nothing in the DOM to suggest the other two\n * had been dropped.\n */\nexport type FormData_ = Record<string, FormDataEntryValue | FormDataEntryValue[]>;\n\ninterface FormContextValue {\n errors: Record<string, string>;\n touched: Record<string, boolean>;\n setFieldError: (name: string, error: string) => void;\n clearFieldError: (name: string) => void;\n setFieldTouched: (name: string) => void;\n isSubmitting: boolean;\n formMode: FormMode;\n /**\n * Bumped on every submit that yields validation errors. Fields read this to\n * replay the error shake on each failed submit — error strings alone don't\n * change between identical resubmits, so the animation wouldn't otherwise\n * re-trigger.\n */\n errorVersion: number;\n}\n\nconst FormContext = React.createContext<FormContextValue | undefined>(undefined);\n\nexport function useFormContext() {\n return React.useContext(FormContext);\n}\n\n/**\n * Anything that can take focus. Hidden and disabled controls are excluded —\n * focusing either is a no-op that would strand the user mid-form.\n */\nconst FOCUSABLE_SELECTOR = [\n 'input:not([type=\"hidden\"]):not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ');\n\n/**\n * Move focus to the first control the schema rejected (WCAG technique G139).\n *\n * Dives inside the invalid element when the element itself cannot hold focus:\n * a checkbox group marks the `<fieldset>` invalid, and a fieldset is not\n * focusable, so the first checkbox inside it is the right landing point.\n */\nfunction focusFirstInvalid(form: HTMLFormElement): void {\n const invalids = form.querySelectorAll<HTMLElement>('[aria-invalid=\"true\"]');\n for (const el of Array.from(invalids)) {\n const target = el.matches(FOCUSABLE_SELECTOR)\n ? el\n : el.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n if (target) {\n target.focus();\n return;\n }\n }\n}\n\nexport interface FormProps\n extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {\n onSubmit?: (data: FormData_) => void | Promise<void>;\n schema?: ZodSchema;\n formMode?: FormMode;\n /**\n * Field errors supplied from outside — typically what a Server Action just\n * returned, keyed by field name.\n *\n * Needed because errors produced on the server have to appear during RENDER,\n * not from an effect: with JavaScript disabled the action runs, the page\n * re-renders on the server, and an effect that would have pushed the errors\n * into context never executes. Passing them here is what lets `FormField`\n * wire them to `aria-describedby` on that path too, instead of degrading to\n * an unassociated summary.\n *\n * Merged with the schema's own results, which win — the most recent\n * validation is the client one.\n */\n errors?: Record<string, string>;\n /**\n * Move focus to the first invalid control after a failed submit.\n * @default true\n */\n focusOnError?: boolean;\n /**\n * Wording for the screen-reader announcement made after a failed submit.\n * Override for i18n or for a more specific summary.\n */\n errorSummary?: (count: number) => string;\n children: React.ReactNode;\n}\n\nfunction defaultErrorSummary(count: number) {\n return count === 1\n ? '1 field needs attention.'\n : `${count} fields need attention.`;\n}\n\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n (\n {\n onSubmit,\n schema,\n formMode = 'native',\n errors: externalErrors,\n focusOnError = true,\n errorSummary = defaultErrorSummary,\n children,\n className,\n noValidate,\n ...props\n },\n ref,\n ) => {\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [touched, setTouched] = React.useState<Record<string, boolean>>({});\n const [isSubmitting, setIsSubmitting] = React.useState(false);\n const [errorVersion, setErrorVersion] = React.useState(0);\n const [announcement, setAnnouncement] = React.useState('');\n\n const innerRef = React.useRef<HTMLFormElement>(null);\n React.useImperativeHandle(ref, () => innerRef.current as HTMLFormElement);\n\n const setFieldError = React.useCallback((name: string, error: string) => {\n setErrors((prev) => ({ ...prev, [name]: error }));\n }, []);\n\n const clearFieldError = React.useCallback((name: string) => {\n setErrors((prev) => {\n const next = { ...prev };\n delete next[name];\n return next;\n });\n }, []);\n\n const setFieldTouched = React.useCallback((name: string) => {\n setTouched((prev) => ({ ...prev, [name]: true }));\n }, []);\n\n const handleSubmit = React.useCallback(\n async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n setIsSubmitting(true);\n setErrors({});\n\n const formData = new FormData(e.currentTarget);\n\n // Repeated names collapse into an array rather than overwriting each\n // other. See {@link FormData_}.\n const data: FormData_ = {};\n for (const key of Array.from(new Set(formData.keys()))) {\n const values = formData.getAll(key);\n data[key] = values.length > 1 ? values : values[0];\n }\n\n if (schema) {\n try {\n schema.parse(data);\n } catch (err) {\n const zodError = err as ZodError;\n const fieldErrors: Record<string, string> = {};\n for (const issue of zodError.issues) {\n const path = issue.path.join('.');\n if (!fieldErrors[path]) {\n fieldErrors[path] = issue.message;\n }\n }\n setErrors(fieldErrors);\n setErrorVersion((v) => v + 1);\n setAnnouncement(errorSummary(Object.keys(fieldErrors).length));\n setIsSubmitting(false);\n return;\n }\n }\n\n setAnnouncement('');\n\n try {\n await onSubmit?.(data);\n } finally {\n setIsSubmitting(false);\n }\n },\n [onSubmit, schema, errorSummary],\n );\n\n // Runs after the errors have been committed to the DOM, which is what makes\n // the `[aria-invalid=\"true\"]` query find anything.\n React.useEffect(() => {\n if (!focusOnError || errorVersion === 0) return;\n const form = innerRef.current;\n if (form) focusFirstInvalid(form);\n }, [errorVersion, focusOnError]);\n\n const mergedErrors = React.useMemo(\n () => ({ ...externalErrors, ...errors }),\n [externalErrors, errors],\n );\n\n const contextValue = React.useMemo(\n () => ({\n errors: mergedErrors,\n touched,\n setFieldError,\n clearFieldError,\n setFieldTouched,\n isSubmitting,\n formMode,\n errorVersion,\n }),\n [\n mergedErrors,\n touched,\n setFieldError,\n clearFieldError,\n setFieldTouched,\n isSubmitting,\n formMode,\n errorVersion,\n ],\n );\n\n return (\n <FormContext.Provider value={contextValue}>\n <form\n ref={innerRef}\n onSubmit={handleSubmit}\n className={className}\n // With a schema in play the browser's own bubbles would fire first and\n // pre-empt it, giving two validation systems with different wording and\n // only one of them wired to the field's `aria-describedby`.\n noValidate={noValidate ?? Boolean(schema)}\n {...props}\n >\n {children}\n {/*\n The live region is mounted unconditionally and stays mounted —\n a region inserted at the same moment as its content is routinely\n missed. Only the inner node is replaced, keyed on errorVersion so\n an identical resubmit still reads out.\n\n Polite rather than assertive: focus is already moving to the first\n invalid control, and an assertive region would talk over the field\n announcement that focus triggers.\n */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"sr-only\"\n data-slot=\"form-status\"\n >\n {announcement ? <span key={errorVersion}>{announcement}</span> : null}\n </div>\n </form>\n </FormContext.Provider>\n );\n },\n);\nForm.displayName = 'Form';\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * The channel between a field wrapper and the control nested inside it.\n *\n * `FormField`, `InputGroup` and `OutlinedField` all render a label, an optional\n * hint and an optional error around an arbitrary child. Before this context\n * they had no way to reach that child, so the error text was rendered as a bare\n * `<p>` that nothing pointed at: no `aria-describedby`, no `aria-invalid`, no\n * `aria-required`. The label leaned on `htmlFor={name}` and simply hoped the\n * consumer had set a matching `id` — when they hadn't, the label resolved to\n * nothing at all (WCAG 1.3.1 and 4.1.2, and axe's `label` rule fires).\n *\n * A wrapper now publishes this context and every control calls\n * {@link useFieldControl} to wire itself. The important property is that the\n * context is OPTIONAL: outside a wrapper the hook returns the control's own\n * props untouched, so a bare `<Input />` behaves exactly as it always has.\n */\nexport interface FieldContextValue {\n /**\n * `id` the control should adopt. Derived from the wrapper's `name` /\n * `htmlFor` rather than `useId()` so it stays the value the wrapper's own\n * `htmlFor` already points at, and so consumers who set `id={name}` by hand\n * land on the same string instead of fighting it.\n */\n controlId: string;\n /** `id` of the hint paragraph, when one is rendered. */\n descriptionId?: string;\n /** `id` of the error paragraph, when one is rendered. */\n errorId?: string;\n /**\n * `id` of the label element. Composite controls need it: a `<label for>`\n * cannot name a `<div>`, so `TimePicker` and `CodeInput` point at it with\n * `aria-labelledby` instead. See {@link useFieldGroup}.\n */\n labelId?: string;\n /** Whether the field is currently in an error state. */\n invalid: boolean;\n /** Whether the field is required. */\n required: boolean;\n /**\n * True when the wrapper labels a SET of controls (a checkbox or radio group)\n * rather than a single one. Controls must not adopt the field's ids in this\n * mode — five checkboxes sharing one `id` is worse than none — so\n * {@link useFieldControl} becomes a no-op and the group element itself\n * carries the labelling.\n */\n group: boolean;\n}\n\nconst FieldContext = React.createContext<FieldContextValue | undefined>(\n undefined,\n);\n\nexport const FieldProvider = FieldContext.Provider;\n\n/** Read the surrounding field, if there is one. */\nexport function useField(): FieldContextValue | undefined {\n return React.useContext(FieldContext);\n}\n\n/** The ARIA surface a control exposes to its field wrapper. */\nexport interface FieldControlProps {\n id?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n 'aria-required'?: React.AriaAttributes['aria-required'];\n}\n\n/**\n * Merge the surrounding field's ARIA wiring into a control's own props.\n *\n * Call it in every control that accepts user input and spread the result onto\n * the DOM node.\n *\n * Inside a field the wrapper OWNS the control's `id`, and a consumer-supplied\n * one is deliberately overridden. The wrapper has already rendered its\n * `<label for>` pointing at the id it published, and it cannot see the child's\n * props to follow it anywhere else — so honouring an override here would leave\n * the label resolving to nothing, which is precisely the defect this context\n * exists to remove. Set the id through the wrapper's `name` / `htmlFor`\n * instead. `aria-invalid` and `aria-required` do defer to an explicit prop,\n * and the field's description ids are APPENDED to any `aria-describedby` the\n * consumer set rather than replacing it.\n *\n * Returns `props` unchanged when there is no field, or when the field is a\n * group.\n */\nexport function useFieldControl<T extends FieldControlProps>(props: T): T {\n const field = useField();\n\n if (!field || field.group) return props;\n\n const describedBy = [\n field.descriptionId,\n field.errorId,\n props['aria-describedby'],\n ]\n .filter(Boolean)\n .join(' ');\n\n return {\n ...props,\n id: field.controlId,\n // Omitted rather than set to \"false\" when the field is valid: an explicit\n // `aria-invalid=\"false\"` is noise on every untouched control on the page.\n 'aria-invalid': props['aria-invalid'] ?? (field.invalid || undefined),\n 'aria-required': props['aria-required'] ?? (field.required || undefined),\n 'aria-describedby': describedBy || undefined,\n };\n}\n\n/** The ARIA surface a COMPOSITE control exposes to its field wrapper. */\nexport interface FieldGroupProps {\n role?: 'group';\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n 'aria-required'?: React.AriaAttributes['aria-required'];\n}\n\n/**\n * The composite-control counterpart to {@link useFieldControl}.\n *\n * `TimePicker` is three selects and `CodeInput` is six inputs; neither has a\n * single element for the field's label to point at, and a `<label for>` naming\n * a `<div>` names nothing at all. These wrap their children in a labelled\n * `role=\"group\"` instead, so the whole composite is announced once with its\n * error and hint attached.\n *\n * Returns `{}` outside a field wrapper, leaving standalone usage untouched.\n */\nexport function useFieldGroup(): FieldGroupProps {\n const field = useField();\n if (!field) return {};\n\n const describedBy = [field.descriptionId, field.errorId]\n .filter(Boolean)\n .join(' ');\n\n return {\n role: 'group',\n 'aria-labelledby': field.labelId,\n 'aria-describedby': describedBy || undefined,\n 'aria-invalid': field.invalid || undefined,\n 'aria-required': field.required || undefined,\n };\n}\n\n/**\n * Seals a composite control against the field it sits in.\n *\n * `CodeInput` renders six `<Input>`s and `TimePicker` renders three\n * `<SelectTrigger>`s. Each of those calls {@link useFieldControl}, so without\n * this they would every one of them adopt the SAME field id — six elements\n * sharing `id=\"code\"`, which is worse than the missing wiring this whole\n * mechanism set out to fix. Re-providing the field in group mode turns the\n * hook into a no-op for everything below, leaving the composite's own wrapper\n * ({@link useFieldGroup}) as the single labelled thing.\n */\nexport function FieldGroupScope({ children }: { children: React.ReactNode }) {\n const field = useField();\n const scoped = React.useMemo(\n () => (field ? { ...field, group: true } : undefined),\n [field],\n );\n return <FieldProvider value={scoped}>{children}</FieldProvider>;\n}\n\n/**\n * Build the ids a wrapper publishes.\n *\n * `useId()` supplies the hint/error ids because nothing outside the wrapper\n * references them, so uniqueness costs nothing. The control id stays\n * caller-derived — see {@link FieldContextValue.controlId}.\n */\nexport function useFieldIds({\n controlId,\n hasDescription,\n hasError,\n}: {\n controlId: string;\n hasDescription: boolean;\n hasError: boolean;\n}) {\n const reactId = React.useId();\n return {\n controlId,\n descriptionId: hasDescription ? `${reactId}-description` : undefined,\n errorId: hasError ? `${reactId}-error` : undefined,\n labelId: `${reactId}-label`,\n };\n}\n","'use client';\n\nimport { motion } from 'motion/react';\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { FieldProvider, useFieldIds } from '../form/field-context';\n\n/**\n * Strips border / ring from nested form controls so the outer outlined shell\n * owns the chrome. Targets inputs, textareas, and select triggers (buttons).\n */\nexport const outlinedFieldNestResetClasses = cn(\n '[&_input]:!h-full [&_input]:min-h-0 [&_input]:border-0 [&_input]:bg-transparent [&_input]:shadow-none',\n '[&_input]:focus-visible:ring-0 [&_input]:focus-visible:ring-offset-0',\n '[&_textarea]:box-border [&_textarea]:min-h-[72px] [&_textarea]:h-auto [&_textarea]:!h-auto [&_textarea]:flex-1 [&_textarea]:resize-y',\n '[&_textarea]:border-0 [&_textarea]:bg-transparent [&_textarea]:shadow-none',\n '[&_textarea]:focus-visible:ring-0 [&_textarea]:focus-visible:ring-offset-0',\n '[&_button]:h-full [&_button]:min-h-0 [&_button]:border-0 [&_button]:bg-transparent [&_button]:shadow-none',\n '[&_button]:focus-visible:ring-0 [&_button]:focus-visible:ring-offset-0',\n);\n\nexport interface OutlinedFieldProps {\n /** Field label; shown on the top border (Material-style notch). */\n label: React.ReactNode;\n /** Associates the label with the control (`htmlFor` on the notch label). */\n htmlFor?: string;\n /** Validation error shown below the field. */\n error?: string;\n /**\n * Bumped by the parent `Form` on each failed submit so the error shake\n * replays even when the error text is unchanged. Optional for standalone use.\n */\n errorVersion?: number;\n /** Helper text below the field (hidden when `error` is set). */\n hint?: string;\n /** Renders a required indicator next to the label. */\n required?: boolean;\n className?: string;\n /** The control (Input, PhoneInput, Textarea, SelectTrigger, PasswordInput, etc.). */\n children: React.ReactNode;\n}\n\ntype ControlKind = 'input' | 'textarea' | 'other';\n\nfunction readValueFromShell(shell: HTMLElement): boolean {\n const input = shell.querySelector('input');\n const textarea = shell.querySelector('textarea');\n const el = textarea ?? input;\n if (el) return Boolean((el as HTMLInputElement).value);\n return true;\n}\n\nfunction detectControlKind(shell: HTMLElement): ControlKind {\n if (shell.querySelector('textarea')) return 'textarea';\n if (shell.querySelector('input')) return 'input';\n return 'other';\n}\n\nconst OutlinedField = React.forwardRef<HTMLDivElement, OutlinedFieldProps>(\n ({ label, htmlFor, error, errorVersion = 0, hint, required, className, children }, ref) => {\n const fallbackId = React.useId();\n const controlId = htmlFor ?? `${fallbackId}-control`;\n\n const { descriptionId, errorId, labelId } = useFieldIds({\n controlId,\n hasDescription: Boolean(hint) && !error,\n hasError: Boolean(error),\n });\n\n const field = React.useMemo(\n () => ({\n controlId,\n descriptionId,\n errorId,\n labelId,\n invalid: Boolean(error),\n required: Boolean(required),\n group: false,\n }),\n [controlId, descriptionId, errorId, labelId, error, required],\n );\n\n const shellRef = React.useRef<HTMLDivElement>(null);\n const [focused, setFocused] = React.useState(false);\n const [hasValue, setHasValue] = React.useState(false);\n const [controlKind, setControlKind] = React.useState<ControlKind>('input');\n\n const syncFromDom = React.useCallback(() => {\n const shell = shellRef.current;\n if (!shell) return;\n setControlKind(detectControlKind(shell));\n setHasValue(readValueFromShell(shell));\n }, []);\n\n React.useLayoutEffect(() => {\n syncFromDom();\n }, [children, syncFromDom]);\n\n React.useEffect(() => {\n const shell = shellRef.current;\n if (!shell) return;\n\n const onFocusIn = () => setFocused(true);\n const onFocusOut = (ev: FocusEvent) => {\n if (!shell.contains(ev.relatedTarget as Node)) {\n setFocused(false);\n syncFromDom();\n }\n };\n\n shell.addEventListener('focusin', onFocusIn);\n shell.addEventListener('focusout', onFocusOut);\n return () => {\n shell.removeEventListener('focusin', onFocusIn);\n shell.removeEventListener('focusout', onFocusOut);\n };\n }, [syncFromDom]);\n\n // Replay the error shake on each failed submit (errorVersion bumps even\n // when the error text is unchanged).\n React.useEffect(() => {\n const el = shellRef.current;\n if (!el || !error) return;\n el.style.animation = 'none';\n void el.offsetWidth;\n el.style.animation = '';\n }, [errorVersion, error]);\n\n const isFloated = controlKind === 'other' ? true : focused || hasValue;\n\n const handleInputCapture = React.useCallback(\n (e: React.FormEvent<HTMLDivElement>) => {\n const t = e.target;\n if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {\n setHasValue(Boolean(t.value));\n }\n },\n [],\n );\n\n const isTextarea = controlKind === 'textarea';\n\n const labelAnimate =\n isTextarea && !isFloated\n ? { top: 20, left: 12, x: 0, y: 0 }\n : isFloated\n ? { top: 0, left: 10, x: 0, y: '-50%' }\n : { top: '50%', left: 12, x: 0, y: '-50%' };\n\n return (\n <FieldProvider value={field}>\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n <div\n ref={shellRef}\n className={cn(\n 'group/outlined relative w-full min-w-0 rounded-md border border-input bg-background',\n 'ring-offset-background',\n 'focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 focus-within:ring-offset-0',\n error && 'border-destructive bison-shake',\n outlinedFieldNestResetClasses,\n isTextarea\n ? 'flex min-h-[80px] flex-col py-2'\n : 'flex h-[var(--density-height-md)] items-stretch pointer-coarse:min-h-11',\n !isFloated &&\n !focused &&\n '[&_input]:placeholder:text-transparent [&_textarea]:placeholder:text-transparent',\n )}\n onInputCapture={handleInputCapture}\n >\n <motion.label\n id={labelId}\n htmlFor={controlId}\n className={cn(\n 'pointer-events-none absolute z-10 bg-background px-1 font-medium leading-none text-muted-foreground',\n isFloated ? 'text-xs' : 'text-base',\n focused && 'text-primary',\n )}\n style={{ transformOrigin: 'left center' }}\n initial={false}\n animate={labelAnimate}\n transition={{ type: 'spring', stiffness: 520, damping: 34 }}\n >\n {label}\n {/* Decoration only — `aria-required` on the control carries the\n meaning. See FormField for the reasoning. */}\n {required ? (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-destructive\">\n *\n </span>\n ) : null}\n </motion.label>\n <div\n className={cn(\n 'box-border flex min-h-0 min-w-0 flex-1',\n isTextarea\n ? 'items-stretch pt-4 [&>*]:flex [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:flex-1'\n : 'items-stretch [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:flex-1',\n )}\n >\n {children}\n </div>\n </div>\n {error ? (\n <p id={errorId} className=\"text-sm leading-none text-destructive\">\n {error}\n </p>\n ) : null}\n {!error && hint ? (\n <p id={descriptionId} className=\"text-sm leading-none text-muted-foreground\">\n {hint}\n </p>\n ) : null}\n </div>\n </FieldProvider>\n );\n },\n);\nOutlinedField.displayName = 'OutlinedField';\n\nexport { OutlinedField };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { OutlinedField } from '../components/outlined-field';\nimport { useFormContext } from './form';\nimport { FieldProvider, useFieldIds } from './field-context';\n\nexport interface FormFieldProps {\n name: string;\n label?: string;\n description?: string;\n required?: boolean;\n /**\n * `stack`: label above the control (default).\n * `outlined`: Material-style label on the top border (requires `label`).\n */\n labelLayout?: 'stack' | 'outlined';\n /**\n * `field`: the wrapper labels ONE control (default).\n * `group`: it labels a SET of them — a checkbox or radio group.\n *\n * A `<label for>` can only point at a single form control, so a stack of\n * checkboxes under a plain label has no programmatic name at all\n * (WCAG 1.3.1). Group mode renders a real `<fieldset>` / `<legend>` instead\n * and moves the ARIA wiring onto it, leaving the individual controls to keep\n * their own ids and labels.\n *\n * Group mode always renders stacked; `labelLayout=\"outlined\"` is ignored,\n * because a floating notch label over a set of checkboxes describes nothing.\n */\n as?: 'field' | 'group';\n className?: string;\n children: React.ReactNode;\n}\n\nexport function FormField({\n name,\n label,\n description,\n required,\n labelLayout = 'stack',\n as = 'field',\n className,\n children,\n}: FormFieldProps) {\n const formCtx = useFormContext();\n const errorMessage = formCtx?.errors[name];\n const errorVersion = formCtx?.errorVersion ?? 0;\n const wrapRef = React.useRef<HTMLDivElement>(null);\n\n const { controlId, descriptionId, errorId, labelId } = useFieldIds({\n controlId: name,\n hasDescription: Boolean(description) && !errorMessage,\n hasError: Boolean(errorMessage),\n });\n\n const isGroup = as === 'group';\n\n const field = React.useMemo(\n () => ({\n controlId,\n descriptionId,\n errorId,\n labelId: label ? labelId : undefined,\n invalid: Boolean(errorMessage),\n required: Boolean(required),\n group: isGroup,\n }),\n [\n controlId,\n descriptionId,\n errorId,\n labelId,\n label,\n errorMessage,\n required,\n isGroup,\n ],\n );\n\n // Replay the error shake on every failed submit. Error strings don't change\n // between identical resubmits, so toggling the CSS class alone wouldn't\n // re-trigger the animation — restart it imperatively when errorVersion bumps.\n React.useEffect(() => {\n const el = wrapRef.current;\n if (!el || !errorMessage) return;\n el.style.animation = 'none';\n void el.offsetWidth;\n el.style.animation = '';\n }, [errorVersion, errorMessage]);\n\n if (!isGroup && label && labelLayout === 'outlined') {\n return (\n <OutlinedField\n label={label}\n htmlFor={name}\n required={required}\n error={errorMessage}\n errorVersion={errorVersion}\n hint={description}\n className={className}\n >\n {children}\n </OutlinedField>\n );\n }\n\n const describedBy =\n [descriptionId, errorId].filter(Boolean).join(' ') || undefined;\n\n const messages = (\n <>\n {description && !errorMessage && (\n <p\n id={descriptionId}\n className=\"mt-1.5 text-sm leading-none text-muted-foreground\"\n >\n {description}\n </p>\n )}\n {errorMessage && (\n <p id={errorId} className=\"mt-1.5 text-sm leading-none text-destructive\">\n {errorMessage}\n </p>\n )}\n </>\n );\n\n // The asterisk is decoration. `aria-required` on the control (or the group)\n // is what actually conveys the requirement — before this, a screen reader\n // either read \"star\" or skipped it entirely (WCAG 3.3.2).\n const requiredMark = required ? (\n <span aria-hidden=\"true\" className=\"text-destructive ml-1\">\n *\n </span>\n ) : null;\n\n if (isGroup) {\n return (\n <FieldProvider value={field}>\n <fieldset\n ref={wrapRef as unknown as React.Ref<HTMLFieldSetElement>}\n className={cn(\n 'flex flex-col',\n errorMessage && 'bison-shake',\n className,\n )}\n aria-describedby={describedBy}\n aria-invalid={errorMessage ? true : undefined}\n aria-required={required || undefined}\n >\n {label && (\n <legend id={labelId} className=\"mb-1.5 text-sm font-medium leading-none\">\n {label}\n {requiredMark}\n </legend>\n )}\n {children}\n {messages}\n </fieldset>\n </FieldProvider>\n );\n }\n\n return (\n <FieldProvider value={field}>\n <div\n ref={wrapRef}\n className={cn('flex flex-col', errorMessage && 'bison-shake', className)}\n >\n {label && (\n <label\n id={labelId}\n htmlFor={controlId}\n className=\"mb-1.5 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {requiredMark}\n </label>\n )}\n {children}\n {messages}\n </div>\n </FieldProvider>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface FormErrorProps {\n message?: string;\n className?: string;\n}\n\nexport function FormError({ message, className }: FormErrorProps) {\n if (!message) return null;\n\n return (\n <div\n className={cn(\n \"rounded-md border border-destructive/50 bg-destructive/10 px-4 py-3 text-sm text-destructive\",\n className\n )}\n role=\"alert\"\n >\n {message}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { LoaderCircle } from \"lucide-react\";\nimport {\n actionNegativeToneClasses,\n actionNeutralToneClasses,\n actionPositiveToneClasses,\n} from \"../lib/semantic-action-tones\";\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n // pointer-coarse:min-h-11/min-w-11 enforce a 44px minimum tap target on touch\n // devices (WCAG 2.5.5) without altering the visual density-driven height on\n // fine (mouse) pointers, so desktop sizing and form-control alignment are\n // unchanged. Applies across every size and the icon button.\n \"relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-[color,background-color,border-color,box-shadow] duration-fast ease-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer pointer-coarse:min-h-11 pointer-coarse:min-w-11\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-700 hover:shadow-md\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary-700 hover:shadow-md\",\n accent:\n \"bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600 hover:shadow-md\",\n highlight:\n \"bg-highlight text-highlight-foreground hover:bg-highlight-600 hover:shadow-md\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-700 hover:shadow-md\",\n outline:\n \"border border-border-strong bg-background text-foreground hover:bg-accent hover:text-accent-foreground hover:shadow-sm\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n /** Soft neutral tile (edit / secondary icon actions). */\n actionNeutral: actionNeutralToneClasses,\n /** Soft success tint + strong success icon (inline confirm, row actions). */\n actionPositive: actionPositiveToneClasses,\n /** Soft danger tint + strong destructive icon (inline cancel, row delete). */\n actionNegative: actionNegativeToneClasses,\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n sm: \"h-[var(--density-height-sm)] px-3 text-xs\",\n md: \"h-[var(--density-height-md)] px-4 py-2\",\n lg: \"h-[var(--density-height-lg)] px-8 text-base rounded-lg\",\n icon: \"h-[var(--density-height-md)] w-[var(--density-height-md)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n fullWidth: false,\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * When true, replaces the button's content with a centered spinner while\n * preserving the button's original width. The button is also disabled and\n * marked `aria-busy` for assistive tech. Ignored when `asChild` is set,\n * since Slot requires a single child.\n */\n loading?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n fullWidth,\n asChild = false,\n loading = false,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n if (asChild) {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, fullWidth, className }),\n )}\n ref={ref}\n aria-busy={loading || undefined}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n const spinnerSizeClass =\n size === \"sm\" ? \"h-3 w-3\" : size === \"lg\" ? \"h-5 w-5\" : \"h-4 w-4\";\n\n return (\n <button\n className={cn(buttonVariants({ variant, size, fullWidth, className }))}\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n data-loading={loading || undefined}\n {...props}\n >\n {loading ? (\n <>\n <span className=\"invisible inline-flex items-center justify-center\">\n {children}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 flex items-center justify-center\"\n >\n <LoaderCircle\n className={cn(\"animate-spin\", spinnerSizeClass)}\n />\n </span>\n </>\n ) : (\n children\n )}\n </button>\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","/**\n * Shared surface class strings extracted to a single source of truth.\n *\n * These patterns appear in multiple components that must stay in lockstep\n * visually (same border, same focus ring, same scrim, etc.). When any of\n * these visuals change, update here once — every consumer tracks.\n *\n * See components: input, textarea, password-input, currency-input,\n * select, dropdown-menu, context-menu, command, dialog, alert-dialog,\n * sheet, popover, tooltip.\n */\n\n// ─── Input family ──────────────────────────────────────────────────────────\n\n/**\n * Common chrome for form input surfaces: border, background, ring-offset,\n * placeholder color, disabled state. Does NOT include sizing or focus —\n * consumers add `inputSizingClasses` (or their own) + `inputFocusClasses`.\n *\n * Used by: Input, Textarea, PasswordInput, CurrencyInput, Select Trigger,\n * DatePicker trigger, DateRangePicker trigger.\n */\nexport const inputSurfaceClasses =\n 'flex w-full rounded-md border border-input bg-background text-base sm:text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50';\n\n/**\n * Focus-visible ring for input surfaces. Keyboard focus only (`focus-visible`)\n * so mouse clicks don't show the ring — matches WAI-ARIA expectations.\n */\nexport const inputFocusClasses =\n 'focus-visible:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-0';\n\nexport type InputSize = 'sm' | 'md' | 'lg';\n\n/**\n * Standard single-line input sizing per size: density height + horizontal\n * padding + vertical padding, scaled per size. Textarea uses `min-h-[80px]`\n * instead of any of these.\n *\n * `pointer-coarse:min-h-11` floors the height at 44px on touch pointers on\n * every size, matching the Button primitive (and Button-based DatePicker /\n * DateRangePicker triggers) so inputs, selects, and buttons stay the same\n * height when combined in a form. Fine (mouse) pointers keep the exact\n * density height for the chosen size.\n *\n * `'md'` (the default) is byte-identical to the original fixed sizing this\n * function replaced — every existing caller passes `'md'` explicitly and\n * renders unchanged.\n */\nconst inputSizingClassesBySize: Record<InputSize, string> = {\n sm: 'h-[var(--density-height-sm)] px-3 py-1 text-sm pointer-coarse:min-h-11',\n md: 'h-[var(--density-height-md)] px-3 py-2 pointer-coarse:min-h-11',\n lg: 'h-[var(--density-height-lg)] px-3 py-2.5 text-base pointer-coarse:min-h-11',\n};\n\nexport function inputSizingClasses(size: InputSize = 'md'): string {\n return inputSizingClassesBySize[size];\n}\n\n// ─── Touch targets ─────────────────────────────────────────────────────────\n\n/**\n * Minimum 44px tap target on touch (coarse) pointers, applied to the element\n * itself. For standalone icon buttons that can safely grow their box on touch\n * without crowding neighbors (e.g. Dialog / Sheet close). Pair with\n * `inline-flex items-center justify-center` to keep the glyph centered. Fine\n * (mouse) pointers are unchanged, so desktop chrome is pixel-identical. Mirrors\n * the Button primitive's own coarse-pointer floor (WCAG 2.5.5).\n *\n * Used by: Dialog Close, Sheet Close.\n */\nexport const touchTargetClasses = 'pointer-coarse:min-h-11 pointer-coarse:min-w-11';\n\n/**\n * Expanded 44px tap target for small controls whose *visual* size must stay\n * fixed (a 44px checkbox would look broken). Renders a centered, transparent\n * 44px pseudo-element that captures pointer events on touch (coarse) pointers\n * only, so the drawn control is unchanged on every pointer and desktop layouts\n * (dense tables, tight forms) stay pixel-identical. Includes `relative`; the\n * host element must not be `overflow-hidden` or the pseudo is clipped.\n *\n * Used by: Checkbox, Radio, Switch, Slider thumb.\n */\nexport const coarseHitAreaClasses =\n \"relative before:absolute before:left-1/2 before:top-1/2 before:hidden before:size-11 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] pointer-coarse:before:block\";\n\n// ─── Menu / popover surfaces ───────────────────────────────────────────────\n\n/**\n * Menu surface chrome shared by floating menus and popovers:\n * Select Content, DropdownMenu Content, ContextMenu Content, Command.\n *\n * Uses `--z-dropdown` (500 after z-index refactor) so menus open *above*\n * modals they're triggered from — critical for Select inside a Dialog, etc.\n */\nexport const menuSurfaceClasses =\n 'z-[var(--z-dropdown)] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md';\n\n/**\n * Base menu item: focus styling, disabled state, selection-ready.\n * Used by: Select Item, DropdownMenu Item, ContextMenu Item, Command Item.\n */\nexport const menuItemClasses =\n 'relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-default';\n\n/**\n * Menu item variant with indicator gutter on the left (for checkbox/radio\n * indicators on Select, DropdownMenu, ContextMenu).\n */\nexport const menuItemWithIndicatorClasses =\n 'relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-default';\n\n/**\n * Menu separator: horizontal rule sitting between menu groups.\n */\nexport const menuSeparatorClasses = '-mx-1 my-1 h-px bg-muted';\n\n// ─── Floating animations ───────────────────────────────────────────────────\n\n/**\n * transitions.dev \"menu dropdown\" (05): scale-pop + fade from the Radix\n * popper transform-origin, with distinct open/close timing. Driven by the\n * --dropdown-* tokens. Used by Select Content, DropdownMenu Content,\n * ContextMenu Content, Popover Content, Command popovers. Tooltip has its\n * own faster, subtler timing — see `tooltipAnimationClasses`.\n */\nexport const floatingAnimationClasses =\n 'origin-[var(--radix-popper-transform-origin)] data-[state=open]:bison-pop-in data-[state=closed]:bison-pop-out';\n\n/**\n * transitions.dev \"tooltip\" (17): faster scale-pop driven by the --tt-*\n * tokens. Used by Tooltip Content. NB: Radix Tooltip's open state is\n * `delayed-open` / `instant-open` (not `open` like other overlays), so the\n * enter animation keys off both.\n */\nexport const tooltipAnimationClasses =\n 'origin-[var(--radix-popper-transform-origin)] data-[state=delayed-open]:bison-tooltip-in data-[state=instant-open]:bison-tooltip-in data-[state=closed]:bison-tooltip-out';\n\n// ─── Modal / overlay ───────────────────────────────────────────────────────\n\n/**\n * Scrim (backdrop) shared by Dialog, AlertDialog, Sheet.\n */\nexport const overlayScrimClasses =\n 'fixed inset-0 z-[var(--z-modal-backdrop)] bg-black/80 data-[state=open]:bison-scrim-in data-[state=closed]:bison-scrim-out';\n\n/**\n * Centered modal content positioning + chrome (Dialog, AlertDialog).\n * Sheet has its own side-anchored variants in `sheet.tsx`.\n */\nexport const centeredModalContentClasses =\n 'fixed left-[50%] top-[50%] z-[var(--z-modal)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg rounded-lg data-[state=open]:bison-modal-in data-[state=closed]:bison-modal-out';\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n // PhoneInput and CurrencyInput inherit this by rendering through Input.\n const fieldProps = useFieldControl(props);\n\n return (\n <input\n type={type}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm',\n className,\n )}\n ref={ref}\n {...fieldProps}\n />\n );\n },\n);\nInput.displayName = 'Input';\n\nexport { Input };\n","'use client';\n\nimport * as React from 'react';\nimport { unstable_PasswordToggleField as PasswordToggleField } from 'radix-ui';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface PasswordInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof PasswordToggleField.Input>,\n 'type'\n > {\n /**\n * Accessible name for the show/hide control.\n *\n * The toggle is icon-only, and Radix supplies no name of its own, so without\n * this it reaches a screen reader as an unlabelled button (WCAG 4.1.2). The\n * wording covers both states deliberately: the button's own pressed state is\n * what conveys which way it is currently set.\n */\n toggleLabel?: string;\n}\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n ({ className, toggleLabel = 'Show or hide password', ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <PasswordToggleField.Root>\n <div className=\"relative\">\n <PasswordToggleField.Input\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'pr-10 file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm',\n className,\n )}\n ref={ref}\n {...fieldProps}\n />\n <PasswordToggleField.Toggle\n className=\"absolute right-0 top-0 flex h-full w-10 items-center justify-center text-muted-foreground hover:text-foreground transition-colors disabled:pointer-events-none disabled:opacity-50\"\n disabled={props.disabled}\n aria-label={toggleLabel}\n >\n <PasswordToggleField.Icon\n visible={<EyeOff className=\"h-4 w-4\" />}\n hidden={<Eye className=\"h-4 w-4\" />}\n />\n </PasswordToggleField.Toggle>\n </div>\n </PasswordToggleField.Root>\n );\n },\n);\nPasswordInput.displayName = 'PasswordInput';\n\nexport { PasswordInput };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Input } from \"./input\";\nimport { FieldGroupScope, useFieldGroup } from \"../form/field-context\";\n\nexport interface CodeInputProps {\n /** Number of digits. @default 6 */\n length?: number;\n /**\n * Accessible name for each box, given its 1-based position and the total.\n *\n * The boxes are unlabelled digits — without a name each one reaches a screen\n * reader as a bare \"edit text\" and there is no way to tell which of the six\n * you are in (WCAG 4.1.2, and 2.4.6 once you are lost in the middle).\n */\n digitLabel?: (position: number, total: number) => string;\n /** Called with the full code string when all digits are filled. */\n onComplete?: (code: string) => void;\n /** Called on every change with the current partial/full code string. */\n onChange?: (code: string) => void;\n loading?: boolean;\n disabled?: boolean;\n className?: string;\n}\n\nconst CodeInput = React.forwardRef<HTMLDivElement, CodeInputProps>(\n (\n {\n length = 6,\n onComplete,\n onChange,\n loading = false,\n disabled = false,\n className,\n digitLabel = (position, total) => `Digit ${position} of ${total}`,\n },\n ref,\n ) => {\n const groupProps = useFieldGroup();\n const [code, setCode] = React.useState<string[]>(Array(length).fill(\"\"));\n const inputRefs = React.useRef<(HTMLInputElement | null)[]>([]);\n\n const updateCode = React.useCallback(\n (newCode: string[]) => {\n setCode(newCode);\n const joined = newCode.join(\"\");\n onChange?.(joined);\n if (joined.length === length && newCode.every(Boolean)) {\n onComplete?.(joined);\n }\n },\n [length, onChange, onComplete],\n );\n\n const handleChange = React.useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n const newCode = [...code];\n newCode[index] = value.slice(-1);\n updateCode(newCode);\n\n if (value && index < length - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n },\n [code, length, updateCode],\n );\n\n const handleKeyDown = React.useCallback(\n (index: number, e: React.KeyboardEvent) => {\n if (e.key === \"Backspace\" && !code[index] && index > 0) {\n inputRefs.current[index - 1]?.focus();\n }\n },\n [code],\n );\n\n const handlePaste = React.useCallback(\n (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pasted = e.clipboardData\n .getData(\"text\")\n .replace(/\\D/g, \"\")\n .slice(0, length);\n const newCode = Array(length).fill(\"\") as string[];\n for (let i = 0; i < pasted.length; i++) {\n newCode[i] = pasted[i];\n }\n updateCode(newCode);\n if (pasted.length < length) {\n inputRefs.current[pasted.length]?.focus();\n }\n },\n [length, updateCode],\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"flex justify-center gap-2\", className)}\n onPaste={handlePaste}\n {...groupProps}\n >\n <FieldGroupScope>\n {code.map((digit, index) => (\n <Input\n key={index}\n ref={(el) => {\n inputRefs.current[index] = el;\n }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onChange={(e) => handleChange(index, e.target.value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n disabled={loading || disabled}\n className=\"h-12 w-12 text-center text-lg font-semibold\"\n autoFocus={index === 0}\n aria-label={digitLabel(index + 1, length)}\n />\n ))}\n </FieldGroupScope>\n </div>\n );\n },\n);\nCodeInput.displayName = \"CodeInput\";\n\nexport { CodeInput };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface CurrencyInputProps\n extends Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'type' | 'inputMode' | 'onChange' | 'value'\n > {\n /** Current value in cents (integer). */\n value: number;\n /** Called with the new value in cents */\n onChange: (cents: number) => void;\n /** Currency symbol displayed as a prefix. Defaults to \"$\" */\n symbol?: string;\n}\n\n/** Strips everything except digits and a single decimal point, limits to 2 decimal places. */\nfunction sanitize(raw: string): string {\n let cleaned = raw.replace(/[^\\d.]/g, '');\n const parts = cleaned.split('.');\n if (parts.length > 2) {\n cleaned = parts[0] + '.' + parts.slice(1).join('');\n }\n if (parts.length === 2 && parts[1].length > 2) {\n cleaned = parts[0] + '.' + parts[1].slice(0, 2);\n }\n return cleaned;\n}\n\n/** Converts a dollar string to cents: \"25\" → 2500, \"25.50\" → 2550 */\nfunction toCents(raw: string): number {\n if (!raw) return 0;\n const num = parseFloat(raw);\n if (isNaN(num) || num <= 0) return 0;\n return Math.round(num * 100);\n}\n\n/** Formats cents to a display string: 2500 → \"25.00\", 0 → \"\" */\nfunction fromCents(cents: number): string {\n if (cents <= 0) return '';\n return (cents / 100).toFixed(2);\n}\n\nconst CurrencyInput = React.forwardRef<HTMLInputElement, CurrencyInputProps>(\n ({ className, value, onChange, symbol = '$', ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n const [display, setDisplay] = React.useState(() => fromCents(value));\n\n // Sync display when value changes externally (e.g. reset to 0)\n const prevValue = React.useRef(value);\n if (value !== prevValue.current) {\n prevValue.current = value;\n const expected = fromCents(value);\n // Only overwrite display if the external value actually changed meaning\n // (avoids fighting with the user's in-progress typing)\n if (toCents(display) !== value) {\n setDisplay(expected);\n }\n }\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n const cleaned = sanitize(e.target.value);\n setDisplay(cleaned);\n onChange(toCents(cleaned));\n }\n\n function handleBlur() {\n // Format to XX.00 on blur\n const cents = toCents(display);\n setDisplay(fromCents(cents));\n }\n\n return (\n <div className=\"relative\">\n <span\n className=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 select-none text-muted-foreground\"\n aria-hidden=\"true\"\n >\n {symbol}\n </span>\n <input\n ref={ref}\n type=\"text\"\n inputMode=\"decimal\"\n autoComplete=\"off\"\n value={display}\n onChange={handleChange}\n onBlur={handleBlur}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'pl-7 pr-3 text-sm',\n className,\n )}\n {...fieldProps}\n />\n </div>\n );\n },\n);\nCurrencyInput.displayName = 'CurrencyInput';\n\nexport { CurrencyInput };\n","const PHONE_MAX_DIGITS = 10;\n\n/** Strips non-digits and caps at 10 (US NANP). */\nexport function parseUsPhoneDigits(value: string): string {\n return value.replace(/\\D/g, '').slice(0, PHONE_MAX_DIGITS);\n}\n\n/** Formats a phone value (digits, E.164, or any mixed string) as `(XXX) XXX-XXXX`. */\nexport function formatUsPhone(value: string): string {\n const d = parseUsPhoneDigits(value);\n if (d.length <= 3) return d;\n if (d.length <= 6) return `(${d.slice(0, 3)}) ${d.slice(3)}`;\n return `(${d.slice(0, 3)}) ${d.slice(3, 6)}-${d.slice(6)}`;\n}\n\n/**\n * Deliberately NOT a `'use client'` module, and deliberately not living in\n * `phone-input.tsx` any more.\n *\n * `validators.ts` needs `parseUsPhoneDigits`, and it is consumed from Server\n * Actions. Importing it from the component file dragged the whole client\n * component in behind it, and every output of the main entry carries a\n * `\"use client\"` banner — so calling the validator on the server failed with\n * \"Attempted to call … from the server but … is on the client\".\n *\n * Keep this file free of React, and free of imports from anything holding a\n * `'use client'` directive.\n */\n","'use client';\n\nimport * as React from 'react';\n\nimport { Input } from './input';\nimport { formatUsPhone, parseUsPhoneDigits } from '../lib/us-phone';\n\nconst PHONE_MAX_LENGTH = 14;\n\n// Re-exported so the public API is unchanged. The implementations moved to a\n// module with no `'use client'` directive so `validators.ts` can use them from\n// a Server Action — see lib/us-phone.ts.\nexport { formatUsPhone, parseUsPhoneDigits };\n\n/**\n * US phone field: shows `(555) 123-4567` while `value` / `onChange` use digits\n * only (`5551234567`), matching {@link CurrencyInput} (display vs semantic value).\n */\nexport interface PhoneInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Input>,\n 'type' | 'inputMode' | 'maxLength' | 'value' | 'defaultValue' | 'onChange'\n > {\n /** Digits only, up to 10 characters. Use with `onChange` for controlled usage. */\n value?: string;\n /** Initial digits when uncontrolled. */\n defaultValue?: string;\n /** Called with digits-only value on each edit (empty string when cleared). */\n onChange?: (digits: string) => void;\n}\n\nconst PhoneInput = React.forwardRef<HTMLInputElement, PhoneInputProps>(\n function PhoneInput(\n {\n value: valueProp,\n defaultValue = '',\n onChange,\n autoComplete = 'tel',\n ...props\n },\n ref,\n ) {\n const isControlled = valueProp !== undefined;\n const [uncontrolledDigits, setUncontrolledDigits] = React.useState(() =>\n parseUsPhoneDigits(defaultValue),\n );\n\n const digits = isControlled\n ? parseUsPhoneDigits(valueProp ?? '')\n : uncontrolledDigits;\n\n const display = formatUsPhone(digits);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const next = parseUsPhoneDigits(event.target.value);\n if (!isControlled) {\n setUncontrolledDigits(next);\n }\n onChange?.(next);\n }\n\n return (\n <Input\n ref={ref}\n {...props}\n type=\"text\"\n inputMode=\"tel\"\n autoComplete={autoComplete}\n maxLength={PHONE_MAX_LENGTH}\n value={display}\n onChange={handleChange}\n />\n );\n },\n);\n\nPhoneInput.displayName = 'PhoneInput';\n\nexport { PhoneInput };\n","'use client';\n\nimport * as React from 'react';\nimport { Label as LabelPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst labelVariants = cva(\n 'inline-block text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n {\n variants: {\n /** `stack`: label above a field (default). `inline`: beside checkbox, radio, switch. */\n layout: {\n stack: 'mb-2 leading-none',\n inline: 'mb-0 leading-snug',\n },\n },\n defaultVariants: {\n layout: 'stack',\n },\n },\n);\n\nconst Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, layout, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants({ layout }), className)}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\nimport { OutlinedField } from './outlined-field';\nimport { FieldProvider, useFieldIds } from '../form/field-context';\n\nexport interface InputGroupProps {\n /** Field label text. */\n label: string;\n /**\n * Associates the label with the input via `htmlFor`.\n *\n * Optional now: when omitted, the group generates an id and the control\n * adopts it through the field context. It used to be the only way the label\n * could reach the control, and a caller who forgot it shipped a label\n * pointing at nothing.\n */\n htmlFor?: string;\n /** Validation error message displayed below the input. */\n error?: string;\n /** Helper text displayed below the input (hidden when error is present). */\n hint?: string;\n /** Marks the field as required with a visual indicator. */\n required?: boolean;\n /**\n * `stack`: label above the control (default).\n * `outlined`: Material-style label notch on the top border; nested controls lose their own border.\n */\n labelLayout?: 'stack' | 'outlined';\n className?: string;\n children: React.ReactNode;\n}\n\nconst InputGroup = React.forwardRef<HTMLDivElement, InputGroupProps>(\n (\n {\n label,\n htmlFor,\n error,\n hint,\n required,\n labelLayout = 'stack',\n className,\n children,\n },\n ref,\n ) => {\n const fallbackId = React.useId();\n const controlId = htmlFor ?? `${fallbackId}-control`;\n\n const { descriptionId, errorId, labelId } = useFieldIds({\n controlId,\n hasDescription: Boolean(hint) && !error,\n hasError: Boolean(error),\n });\n\n const field = React.useMemo(\n () => ({\n controlId,\n descriptionId,\n errorId,\n labelId,\n invalid: Boolean(error),\n required: Boolean(required),\n group: false,\n }),\n [controlId, descriptionId, errorId, labelId, error, required],\n );\n\n if (labelLayout === 'outlined') {\n return (\n <OutlinedField\n ref={ref}\n label={label}\n htmlFor={controlId}\n error={error}\n hint={hint}\n required={required}\n className={className}\n >\n {children}\n </OutlinedField>\n );\n }\n\n return (\n <FieldProvider value={field}>\n <div ref={ref} className={cn('flex flex-col gap-2', className)}>\n <Label id={labelId} htmlFor={controlId}>\n {label}\n {/* Decoration only — `aria-required` on the control carries the\n meaning. See FormField for the reasoning. */}\n {required && (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-destructive\">\n *\n </span>\n )}\n </Label>\n {children}\n {error && (\n <p id={errorId} className=\"text-sm text-destructive\">\n {error}\n </p>\n )}\n {!error && hint && (\n <p id={descriptionId} className=\"text-sm text-muted-foreground\">\n {hint}\n </p>\n )}\n </div>\n </FieldProvider>\n );\n },\n);\nInputGroup.displayName = 'InputGroup';\n\nexport { InputGroup };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { inputFocusClasses, inputSurfaceClasses } from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <textarea\n className={cn(\n inputSurfaceClasses,\n 'min-h-[80px] px-3 py-2',\n inputFocusClasses,\n className,\n )}\n ref={ref}\n {...fieldProps}\n />\n );\n },\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","'use client';\n\nimport * as React from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nconst Select = SelectPrimitive.Root;\nconst SelectGroup = SelectPrimitive.Group;\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'items-center justify-between [&>span]:line-clamp-1',\n className,\n )}\n {...fieldProps}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n});\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n menuSurfaceClasses,\n floatingAnimationClasses,\n 'relative max-h-96 p-0',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, 'w-full', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nconst Calendar = ({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) => {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row gap-2\",\n month: \"flex flex-col gap-4\",\n month_caption: \"flex justify-center pt-1 relative items-center w-full\",\n caption_label: \"text-sm font-medium\",\n nav: \"flex items-center gap-1\",\n button_previous:\n \"absolute left-1 inline-flex items-center justify-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md z-10\",\n button_next:\n \"absolute right-1 inline-flex items-center justify-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md z-10\",\n month_grid: \"w-full border-collapse space-x-1\",\n weekdays: \"flex\",\n weekday:\n \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n week: \"flex w-full mt-2\",\n day: cn(\n \"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50\",\n props.mode === \"range\"\n ? \"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n : \"[&:has([aria-selected])]:rounded-md\",\n ),\n day_button: cn(\n \"inline-flex items-center justify-center h-9 w-9 p-0 font-normal aria-selected:opacity-100 rounded-md\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\",\n ),\n range_start: \"day-range-start rounded-l-md\",\n range_end: \"day-range-end rounded-r-md\",\n selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n today: \"bg-accent text-accent-foreground\",\n outside:\n \"day-outside text-muted-foreground aria-selected:text-muted-foreground opacity-50 aria-selected:opacity-30\",\n disabled: \"text-muted-foreground opacity-50\",\n range_middle:\n \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) =>\n orientation === \"left\" ? (\n <ChevronLeft className=\"h-4 w-4\" />\n ) : (\n <ChevronRight className=\"h-4 w-4\" />\n ),\n }}\n {...props}\n />\n );\n};\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n","'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport { floatingAnimationClasses } from '../lib/surface-classes';\n\nconst Popover = PopoverPrimitive.Root;\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\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-md border bg-popover p-4 text-popover-foreground shadow-md outline-none',\n floatingAnimationClasses,\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { format } from \"date-fns\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { useFieldControl } from \"../form/field-context\";\n\nexport interface DatePickerProps {\n /** The selected date */\n value?: Date;\n /** Callback when the date changes */\n onChange?: (date: Date | undefined) => void;\n /** Placeholder text when no date is selected */\n placeholder?: string;\n /** Date format string (date-fns format) */\n dateFormat?: string;\n /** Disable the date picker */\n disabled?: boolean;\n /** Additional class names for the trigger button */\n className?: string;\n /** Minimum selectable date */\n fromDate?: Date;\n /** Maximum selectable date */\n toDate?: Date;\n /** Dates that should be disabled */\n disabledDates?: Date[];\n}\n\nconst DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Pick a date\",\n dateFormat = \"PPP\",\n disabled = false,\n className,\n fromDate,\n toDate,\n disabledDates,\n },\n ref\n ) => {\n // The popover trigger is the only focusable element the field can attach\n // to, so it carries the id and the error description.\n const fieldProps = useFieldControl({});\n const [open, setOpen] = React.useState(false);\n\n const handleSelect = (date: Date | undefined) => {\n onChange?.(date);\n setOpen(false);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n className\n )}\n {...fieldProps}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? format(value, dateFormat) : <span>{placeholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={value}\n onSelect={handleSelect}\n disabled={disabledDates ? disabledDates : undefined}\n startMonth={fromDate}\n endMonth={toDate}\n autoFocus\n />\n </PopoverContent>\n </Popover>\n );\n }\n);\nDatePicker.displayName = \"DatePicker\";\n\nexport { DatePicker };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { inputSizingClasses, type InputSize } from '../lib/surface-classes';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from './select';\nimport { FieldGroupScope, useFieldGroup } from '../form/field-context';\n\n// useLayoutEffect warns on the server; this library targets Next.js\n// consumers, so fall back to useEffect there. Matches tabs.tsx's helper.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nexport type TimePeriod = 'AM' | 'PM';\n\n/** Curated minute-increment presets, matching this library's finite-preset philosophy. */\nexport type MinuteStep = 1 | 5 | 10 | 15 | 30;\n\nexport interface TimeParts {\n /** 1-12 */\n hour12: number;\n /** 0-59 */\n minute: number;\n period: TimePeriod;\n}\n\n/** Zero-pads a number to a 2-digit string (\"5\" → \"05\"). */\nfunction pad2(n: number): string {\n return String(n).padStart(2, '0');\n}\n\n/**\n * A segment's controlled Select value: zero-padded, or `''` when unset.\n *\n * Radix's Select.Root treats `''` as \"clear the selection and show the\n * placeholder\" (see @radix-ui/react-select's own SelectItem invariant: a\n * SelectItem's value may never be `''` for exactly this reason) while still\n * remaining fully controlled by us. Passing `undefined` instead would leave\n * Select.Root uncontrolled whenever a segment is unset, and Radix's internal\n * uncontrolled fallback state -- populated only by the user's own picks via\n * onValueChange -- does not reset just because our `value` prop returns to\n * `undefined`, so a cleared, previously-picked trigger would keep showing\n * its last value. Always passing a defined string avoids that entirely.\n */\nfunction toSegmentValue(n: number | undefined): string {\n return n === undefined ? '' : pad2(n);\n}\n\nconst HOUR_OPTIONS = Array.from({ length: 12 }, (_, i) => pad2(i + 1));\n\n/** Generates zero-padded minute option strings (\"00\", \"05\", ...) stepped by `step`. */\nexport function getMinuteOptions(step: MinuteStep): string[] {\n const options: string[] = [];\n for (let minute = 0; minute < 60; minute += step) {\n options.push(pad2(minute));\n }\n return options;\n}\n\n/** Parses a 24-hour \"HH:mm\" string into 12-hour parts. Returns {} for undefined/malformed input. */\nexport function parseTimeValue(value: string | undefined): Partial<TimeParts> {\n if (!value) return {};\n const match = /^([01]\\d|2[0-3]):([0-5]\\d)$/.exec(value);\n if (!match) return {};\n const hour24 = Number(match[1]);\n const minute = Number(match[2]);\n const period: TimePeriod = hour24 >= 12 ? 'PM' : 'AM';\n const hour12 = hour24 % 12 === 0 ? 12 : hour24 % 12;\n return { hour12, minute, period };\n}\n\n/** Formats 12-hour parts back into a 24-hour \"HH:mm\" string. */\nexport function formatTimeValue(parts: TimeParts): string {\n let hour24 = parts.hour12 % 12;\n if (parts.period === 'PM') hour24 += 12;\n return `${pad2(hour24)}:${pad2(parts.minute)}`;\n}\n\nexport interface TimePickerProps {\n /** Current time, 24-hour \"HH:mm\" format, e.g. \"14:30\" */\n value?: string;\n /** Fires only once hour, minute, and period are all selected */\n onChange?: (value: string) => void;\n /** Minute increment, restricted to a curated preset. Default: 5 */\n minuteStep?: MinuteStep;\n /** Field size. Default: \"md\" */\n size?: InputSize;\n disabled?: boolean;\n /** Placeholder text per segment. Defaults: \"HH\" / \"MM\" / \"AM\" */\n placeholder?: { hour?: string; minute?: string; period?: string };\n /** Applied to the wrapping row element */\n className?: string;\n}\n\nconst TimePicker = React.forwardRef<HTMLDivElement, TimePickerProps>(\n (\n {\n value,\n onChange,\n minuteStep = 5,\n size = 'md',\n disabled = false,\n placeholder,\n className,\n },\n ref,\n ) => {\n const groupProps = useFieldGroup();\n const [partial, setPartial] = React.useState<Partial<TimeParts>>({});\n // A `value` only counts as \"controlled\" once it fully parses — an\n // unparseable non-empty string (or \"\") is treated the same as\n // `undefined`, so segment picks still accumulate in local state instead\n // of being silently discarded just because `value` happened to be\n // truthy. `parseTimeValue` never returns a partial result (its regex\n // match sets all three fields together or none), so checking `hour12`\n // alone is a reliable proxy for \"did this value actually parse.\"\n const parsedValue = parseTimeValue(value);\n const isControlled = parsedValue.hour12 !== undefined;\n const parts = isControlled ? parsedValue : partial;\n\n // If a controlled value is cleared (or becomes unparseable) after having\n // been set, drop any stale local selection so the picker falls back to\n // placeholders instead of showing the last value it had before it\n // became controlled. useIsomorphicLayoutEffect (not useEffect) so this\n // correction lands before paint -- the transition render below already\n // computes `parts` from the stale `partial`, and running the reset after\n // paint would let that stale value flash on screen for a frame first.\n const wasControlledRef = React.useRef(isControlled);\n useIsomorphicLayoutEffect(() => {\n if (wasControlledRef.current && !isControlled) {\n setPartial({});\n }\n wasControlledRef.current = isControlled;\n }, [isControlled]);\n\n const minuteOptions = React.useMemo(() => {\n const options = getMinuteOptions(minuteStep);\n // A `value` supplied directly (not picked via this UI) may carry a\n // minute that isn't a multiple of `minuteStep` — include it so the\n // trigger reflects the true value instead of falling back to the\n // placeholder as if nothing were selected.\n if (parts.minute !== undefined) {\n const minuteStr = pad2(parts.minute);\n if (!options.includes(minuteStr)) {\n return [...options, minuteStr].sort();\n }\n }\n return options;\n }, [minuteStep, parts.minute]);\n\n function commit(next: Partial<TimeParts>) {\n if (!isControlled) {\n setPartial(next);\n }\n if (\n next.hour12 !== undefined &&\n next.minute !== undefined &&\n next.period !== undefined\n ) {\n onChange?.(\n formatTimeValue({\n hour12: next.hour12,\n minute: next.minute,\n period: next.period,\n }),\n );\n }\n }\n\n const triggerClassName = cn(inputSizingClasses(size), 'w-auto min-w-0');\n\n return (\n <div ref={ref} className={cn('flex gap-2', className)} {...groupProps}>\n {/* Three selects, each already self-labelled. FieldGroupScope stops all\n three adopting the surrounding field's single id. */}\n <FieldGroupScope>\n <Select\n disabled={disabled}\n value={toSegmentValue(parts.hour12)}\n onValueChange={(hour) => commit({ ...parts, hour12: Number(hour) })}\n >\n <SelectTrigger aria-label=\"Hour\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.hour ?? 'HH'} />\n </SelectTrigger>\n <SelectContent>\n {HOUR_OPTIONS.map((hour) => (\n <SelectItem key={hour} value={hour}>\n {hour}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Select\n disabled={disabled}\n value={toSegmentValue(parts.minute)}\n onValueChange={(minute) =>\n commit({ ...parts, minute: Number(minute) })\n }\n >\n <SelectTrigger aria-label=\"Minute\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.minute ?? 'MM'} />\n </SelectTrigger>\n <SelectContent>\n {minuteOptions.map((minute) => (\n <SelectItem key={minute} value={minute}>\n {minute}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Select\n disabled={disabled}\n value={parts.period ?? ''}\n onValueChange={(period) =>\n commit({ ...parts, period: period as TimePeriod })\n }\n >\n <SelectTrigger aria-label=\"AM or PM\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.period ?? 'AM'} />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"AM\">AM</SelectItem>\n <SelectItem value=\"PM\">PM</SelectItem>\n </SelectContent>\n </Select>\n </FieldGroupScope>\n </div>\n );\n },\n);\nTimePicker.displayName = 'TimePicker';\n\nexport { TimePicker };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n format,\n subDays,\n startOfWeek,\n startOfMonth,\n startOfYear,\n endOfWeek,\n endOfMonth,\n subMonths,\n subYears,\n} from \"date-fns\";\nimport { Calendar as CalendarIcon, CircleX } from \"lucide-react\";\nimport type { DateRange } from \"react-day-picker\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { useFieldControl } from \"../form/field-context\";\n\nexport interface DateRangePreset {\n /** Display label for the preset */\n label: string;\n /** Function that returns the date range for this preset */\n range: () => DateRange;\n}\n\n/** Built-in preset range generators */\nexport const dateRangePresets = {\n today: (): DateRangePreset => ({\n label: \"Today\",\n range: () => {\n const today = new Date();\n return { from: today, to: today };\n },\n }),\n yesterday: (): DateRangePreset => ({\n label: \"Yesterday\",\n range: () => {\n const yesterday = subDays(new Date(), 1);\n return { from: yesterday, to: yesterday };\n },\n }),\n last7Days: (): DateRangePreset => ({\n label: \"Last 7 days\",\n range: () => ({ from: subDays(new Date(), 6), to: new Date() }),\n }),\n last14Days: (): DateRangePreset => ({\n label: \"Last 14 days\",\n range: () => ({ from: subDays(new Date(), 13), to: new Date() }),\n }),\n last30Days: (): DateRangePreset => ({\n label: \"Last 30 days\",\n range: () => ({ from: subDays(new Date(), 29), to: new Date() }),\n }),\n last90Days: (): DateRangePreset => ({\n label: \"Last 90 days\",\n range: () => ({ from: subDays(new Date(), 89), to: new Date() }),\n }),\n thisWeek: (): DateRangePreset => ({\n label: \"This week\",\n range: () => ({ from: startOfWeek(new Date()), to: endOfWeek(new Date()) }),\n }),\n lastWeek: (): DateRangePreset => ({\n label: \"Last week\",\n range: () => {\n const lastWeek = subDays(new Date(), 7);\n return { from: startOfWeek(lastWeek), to: endOfWeek(lastWeek) };\n },\n }),\n thisMonth: (): DateRangePreset => ({\n label: \"This month\",\n range: () => ({\n from: startOfMonth(new Date()),\n to: endOfMonth(new Date()),\n }),\n }),\n lastMonth: (): DateRangePreset => ({\n label: \"Last month\",\n range: () => {\n const lastMonth = subMonths(new Date(), 1);\n return { from: startOfMonth(lastMonth), to: endOfMonth(lastMonth) };\n },\n }),\n thisYear: (): DateRangePreset => ({\n label: \"This year\",\n range: () => ({ from: startOfYear(new Date()), to: new Date() }),\n }),\n lastYear: (): DateRangePreset => ({\n label: \"Last year\",\n range: () => {\n const lastYear = subYears(new Date(), 1);\n return { from: startOfYear(lastYear), to: new Date() };\n },\n }),\n} as const;\n\nexport interface DateRangePickerProps {\n /** The selected date range */\n value?: DateRange;\n /** Callback when the date range changes */\n onChange?: (range: DateRange | undefined) => void;\n /** Placeholder text when no range is selected */\n placeholder?: string;\n /** Date format string (date-fns format) */\n dateFormat?: string;\n /** Disable the date range picker */\n disabled?: boolean;\n /** Additional class names for the trigger button */\n className?: string;\n /** Preset ranges to display in the sidebar */\n presets?: DateRangePreset[];\n /** Number of months to display */\n numberOfMonths?: number;\n /** Minimum selectable date */\n fromDate?: Date;\n /** Maximum selectable date */\n toDate?: Date;\n /** When true, shows an X-in-circle clear button on the right when a value is selected. Defaults to true. */\n clearable?: boolean;\n /** Accessible label for the clear button. Defaults to \"Clear date range\". */\n clearLabel?: string;\n}\n\nconst DateRangePicker = React.forwardRef<\n HTMLButtonElement,\n DateRangePickerProps\n>(\n (\n {\n value,\n onChange,\n placeholder = \"Pick a date range\",\n dateFormat = \"LLL dd, y\",\n disabled = false,\n className,\n presets,\n numberOfMonths = 2,\n fromDate,\n toDate,\n clearable = true,\n clearLabel = \"Clear date range\",\n },\n ref,\n ) => {\n // The popover trigger is the only focusable element the field can attach\n // to, so it carries the id and the error description. The clear button\n // beside it keeps its own label.\n const fieldProps = useFieldControl({});\n const [open, setOpen] = React.useState(false);\n\n const handlePresetClick = (preset: DateRangePreset) => {\n const range = preset.range();\n onChange?.(range);\n };\n\n const showClear = clearable && !disabled && Boolean(value?.from);\n\n const handleClear = (e: React.MouseEvent | React.KeyboardEvent) => {\n e.stopPropagation();\n e.preventDefault();\n onChange?.(undefined);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <div className=\"relative w-full\">\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n showClear && \"pr-9\",\n className,\n )}\n {...fieldProps}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value?.from ? (\n value.to ? (\n <>\n {format(value.from, dateFormat)} –{\" \"}\n {format(value.to, dateFormat)}\n </>\n ) : (\n format(value.from, dateFormat)\n )\n ) : (\n <span>{placeholder}</span>\n )}\n </Button>\n </PopoverTrigger>\n {showClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onClick={handleClear}\n onPointerDown={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n handleClear(e);\n }\n }}\n className=\"absolute right-2 top-1/2 -translate-y-1/2 rounded-full text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1\"\n >\n <CircleX className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <div\n className={cn(\"flex\", presets && presets.length > 0 && \"flex-row\")}\n >\n {presets && presets.length > 0 && (\n <div className=\"flex flex-col gap-1 border-r p-3 min-w-[160px]\">\n <p className=\"mb-1 text-xs font-medium text-muted-foreground\">\n Quick select\n </p>\n {presets.map((preset) => (\n <Button\n key={preset.label}\n variant=\"ghost\"\n size=\"sm\"\n className=\"justify-start text-left text-sm font-normal\"\n onClick={() => handlePresetClick(preset)}\n >\n {preset.label}\n </Button>\n ))}\n </div>\n )}\n <div>\n <Calendar\n mode=\"range\"\n defaultMonth={value?.from}\n selected={value}\n onSelect={onChange}\n numberOfMonths={numberOfMonths}\n startMonth={fromDate}\n endMonth={toDate}\n autoFocus\n />\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n },\n);\nDateRangePicker.displayName = \"DateRangePicker\";\n\nexport { DateRangePicker };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Separator as SeparatorPrimitive } from \"radix-ui\";\nimport { cn } from \"../lib/utils\";\n\nconst Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport { tooltipAnimationClasses } from '../lib/surface-classes';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\nconst Tooltip = TooltipPrimitive.Root;\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md',\n tooltipAnimationClasses,\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useEditor, EditorContent, type Editor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Link from \"@tiptap/extension-link\";\nimport Underline from \"@tiptap/extension-underline\";\nimport TextAlign from \"@tiptap/extension-text-align\";\nimport {\n AlignCenter,\n AlignLeft,\n AlignRight,\n Bold,\n Code,\n Heading1,\n Heading2,\n Heading3,\n Italic,\n Link as LinkIcon,\n List,\n ListOrdered,\n Minus,\n Quote,\n Redo,\n Strikethrough,\n Underline as UnderlineIcon,\n Undo,\n Unlink,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Separator } from \"./separator\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"./tooltip\";\n\nexport interface TextEditorProps {\n /** The HTML content of the editor */\n value?: string;\n /** Callback when content changes (returns HTML) */\n onChange?: (html: string) => void;\n /** Placeholder text */\n placeholder?: string;\n /** Disable the editor */\n disabled?: boolean;\n /** Additional class names for the outer wrapper */\n className?: string;\n /** Additional class names for the editor content area */\n contentClassName?: string;\n /** Minimum height of the editor content area */\n minHeight?: string;\n /** Hide the toolbar */\n hideToolbar?: boolean;\n /** Toolbar features to show. Defaults to all. */\n toolbar?: Array<\n | \"bold\"\n | \"italic\"\n | \"underline\"\n | \"strike\"\n | \"code\"\n | \"heading\"\n | \"bulletList\"\n | \"orderedList\"\n | \"blockquote\"\n | \"horizontalRule\"\n | \"link\"\n | \"align\"\n | \"undo\"\n | \"redo\"\n >;\n /** Called when the editor is created */\n onEditorReady?: (editor: Editor) => void;\n}\n\ninterface ToolbarButtonProps {\n onClick: () => void;\n isActive?: boolean;\n disabled?: boolean;\n tooltip: string;\n children: React.ReactNode;\n}\n\nconst ToolbarButton = ({\n onClick,\n isActive,\n disabled,\n tooltip,\n children,\n}: ToolbarButtonProps) => (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={disabled}\n className={cn(\n \"h-8 w-8 p-0\",\n isActive && \"bg-accent text-accent-foreground\",\n )}\n onClick={onClick}\n >\n {children}\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\">\n <p className=\"text-xs\">{tooltip}</p>\n </TooltipContent>\n </Tooltip>\n);\n\nconst defaultToolbar: TextEditorProps[\"toolbar\"] = [\n \"bold\",\n \"italic\",\n \"underline\",\n \"strike\",\n \"code\",\n \"heading\",\n \"bulletList\",\n \"orderedList\",\n \"blockquote\",\n \"horizontalRule\",\n \"link\",\n \"align\",\n \"undo\",\n \"redo\",\n];\n\nconst EditorToolbar = ({\n editor,\n toolbar = defaultToolbar,\n}: {\n editor: Editor;\n toolbar?: TextEditorProps[\"toolbar\"];\n}) => {\n const has = (feature: string) => toolbar?.includes(feature as never) ?? false;\n\n const handleLink = () => {\n if (editor.isActive(\"link\")) {\n editor.chain().focus().unsetLink().run();\n return;\n }\n const url = window.prompt(\"Enter URL:\");\n if (url) {\n editor\n .chain()\n .focus()\n .extendMarkRange(\"link\")\n .setLink({ href: url })\n .run();\n }\n };\n\n return (\n <TooltipProvider delayDuration={300}>\n <div className=\"flex flex-wrap items-center gap-0.5 border-b px-2 py-1\">\n {has(\"bold\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBold().run()}\n isActive={editor.isActive(\"bold\")}\n tooltip=\"Bold\"\n >\n <Bold className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"italic\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleItalic().run()}\n isActive={editor.isActive(\"italic\")}\n tooltip=\"Italic\"\n >\n <Italic className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"underline\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n isActive={editor.isActive(\"underline\")}\n tooltip=\"Underline\"\n >\n <UnderlineIcon className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"strike\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleStrike().run()}\n isActive={editor.isActive(\"strike\")}\n tooltip=\"Strikethrough\"\n >\n <Strikethrough className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"code\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleCode().run()}\n isActive={editor.isActive(\"code\")}\n tooltip=\"Code\"\n >\n <Code className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n\n {(has(\"bold\") ||\n has(\"italic\") ||\n has(\"underline\") ||\n has(\"strike\") ||\n has(\"code\")) &&\n (has(\"heading\") ||\n has(\"bulletList\") ||\n has(\"orderedList\") ||\n has(\"blockquote\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"heading\") && (\n <>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 1 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 1 })}\n tooltip=\"Heading 1\"\n >\n <Heading1 className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 2 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 2 })}\n tooltip=\"Heading 2\"\n >\n <Heading2 className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 3 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 3 })}\n tooltip=\"Heading 3\"\n >\n <Heading3 className=\"h-4 w-4\" />\n </ToolbarButton>\n </>\n )}\n\n {has(\"bulletList\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBulletList().run()}\n isActive={editor.isActive(\"bulletList\")}\n tooltip=\"Bullet list\"\n >\n <List className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"orderedList\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleOrderedList().run()}\n isActive={editor.isActive(\"orderedList\")}\n tooltip=\"Ordered list\"\n >\n <ListOrdered className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"blockquote\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBlockquote().run()}\n isActive={editor.isActive(\"blockquote\")}\n tooltip=\"Blockquote\"\n >\n <Quote className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"horizontalRule\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().setHorizontalRule().run()}\n tooltip=\"Horizontal rule\"\n >\n <Minus className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n\n {(has(\"heading\") ||\n has(\"bulletList\") ||\n has(\"orderedList\") ||\n has(\"blockquote\")) &&\n (has(\"link\") || has(\"align\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"link\") && (\n <ToolbarButton\n onClick={handleLink}\n isActive={editor.isActive(\"link\")}\n tooltip={editor.isActive(\"link\") ? \"Remove link\" : \"Add link\"}\n >\n {editor.isActive(\"link\") ? (\n <Unlink className=\"h-4 w-4\" />\n ) : (\n <LinkIcon className=\"h-4 w-4\" />\n )}\n </ToolbarButton>\n )}\n\n {has(\"align\") && (\n <>\n <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign(\"left\").run()}\n isActive={editor.isActive({ textAlign: \"left\" })}\n tooltip=\"Align left\"\n >\n <AlignLeft className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().setTextAlign(\"center\").run()\n }\n isActive={editor.isActive({ textAlign: \"center\" })}\n tooltip=\"Align center\"\n >\n <AlignCenter className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign(\"right\").run()}\n isActive={editor.isActive({ textAlign: \"right\" })}\n tooltip=\"Align right\"\n >\n <AlignRight className=\"h-4 w-4\" />\n </ToolbarButton>\n </>\n )}\n\n {(has(\"link\") || has(\"align\")) && (has(\"undo\") || has(\"redo\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"undo\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().undo().run()}\n disabled={!editor.can().undo()}\n tooltip=\"Undo\"\n >\n <Undo className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"redo\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().redo().run()}\n disabled={!editor.can().redo()}\n tooltip=\"Redo\"\n >\n <Redo className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n </div>\n </TooltipProvider>\n );\n};\n\nconst TextEditor = React.forwardRef<HTMLDivElement, TextEditorProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Start writing...\",\n disabled = false,\n className,\n contentClassName,\n minHeight = \"150px\",\n hideToolbar = false,\n toolbar = defaultToolbar,\n onEditorReady,\n },\n ref,\n ) => {\n const editor = useEditor({\n immediatelyRender: false,\n extensions: [\n StarterKit.configure({\n heading: { levels: [1, 2, 3] },\n }),\n Placeholder.configure({ placeholder }),\n Underline,\n Link.configure({\n openOnClick: false,\n HTMLAttributes: {\n class: \"text-primary underline underline-offset-4 cursor-pointer\",\n },\n }),\n TextAlign.configure({\n types: [\"heading\", \"paragraph\"],\n }),\n ],\n content: value,\n editable: !disabled,\n onUpdate: ({ editor: e }) => {\n onChange?.(e.getHTML());\n },\n onCreate: ({ editor: e }) => {\n onEditorReady?.(e);\n },\n });\n\n React.useEffect(() => {\n if (editor && disabled !== undefined) {\n editor.setEditable(!disabled);\n }\n }, [editor, disabled]);\n\n React.useEffect(() => {\n if (editor && value !== undefined && editor.getHTML() !== value) {\n editor.commands.setContent(value);\n }\n }, [editor, value]);\n\n if (!editor) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n \"rounded-md border border-input bg-background ring-offset-background focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 focus-within:ring-offset-0\",\n disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n >\n {!hideToolbar && <EditorToolbar editor={editor} toolbar={toolbar} />}\n <EditorContent\n editor={editor}\n className={cn(\n \"prose prose-base sm:prose-sm dark:prose-invert max-w-none px-3 py-2 focus:outline-none [&_.tiptap]:outline-none [&_.tiptap.ProseMirror]:outline-none\",\n `[&_.tiptap]:min-h-[${minHeight}]`,\n \"[&_.tiptap_p.is-editor-empty:first-child::before]:text-muted-foreground [&_.tiptap_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.tiptap_p.is-editor-empty:first-child::before]:float-left [&_.tiptap_p.is-editor-empty:first-child::before]:h-0 [&_.tiptap_p.is-editor-empty:first-child::before]:pointer-events-none\",\n contentClassName,\n )}\n style={{ minHeight }}\n />\n </div>\n );\n },\n);\nTextEditor.displayName = \"TextEditor\";\n\nexport { TextEditor };\nexport type { Editor };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface TextContentProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The HTML content to render (from TextEditor output) */\n content: string;\n}\n\nconst TextContent = React.forwardRef<HTMLDivElement, TextContentProps>(\n ({ content, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"prose prose-sm dark:prose-invert max-w-none\",\n \"prose-headings:font-heading prose-headings:tracking-tight\",\n \"prose-a:text-primary prose-a:underline prose-a:underline-offset-4\",\n \"prose-blockquote:border-l-primary\",\n \"prose-code:rounded prose-code:bg-muted prose-code:px-1.5 prose-code:py-0.5 prose-code:text-sm prose-code:font-mono\",\n \"prose-pre:bg-muted prose-pre:rounded-md\",\n \"prose-hr:border-border\",\n className\n )}\n dangerouslySetInnerHTML={{ __html: content }}\n {...props}\n />\n );\n }\n);\nTextContent.displayName = \"TextContent\";\n\nexport { TextContent };\n","'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport { coarseHitAreaClasses } from '../lib/surface-classes';\nimport { cn } from '../lib/utils';\nimport { useFieldControl } from '../form/field-context';\n\nfunction CheckIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn('shrink-0', className)}\n aria-hidden\n >\n <path\n d=\"M2.5 6.25 5 8.75 9.5 3.25\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction IndeterminateIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn('shrink-0', className)}\n aria-hidden\n >\n <path\n d=\"M2.5 6h7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, checked, ...props }, ref) => {\n // Adopts the surrounding field's wiring when it labels this ONE checkbox.\n // Inside `FormField as=\"group\"` it returns props untouched, so five boxes in\n // a set keep their own ids and the fieldset does the labelling.\n const fieldProps = useFieldControl(props);\n\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n checked={checked}\n className={cn(\n 'peer h-4 w-4 shrink-0 cursor-pointer rounded-[2px] border border-primary bg-background ring-offset-background transition-[color,background-color,border-color] duration-fast ease-default focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/35 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground',\n coarseHitAreaClasses,\n className,\n )}\n {...fieldProps}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n 'flex h-full w-full items-center justify-center text-current',\n )}\n >\n {checked === 'indeterminate' ? (\n <IndeterminateIcon className=\"h-[10px] w-[10px]\" />\n ) : (\n <CheckIcon className=\"h-[10px] w-[10px]\" />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n});\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","'use client';\n\nimport * as React from 'react';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\nimport { coarseHitAreaClasses } from '../lib/surface-classes';\nimport { cn } from '../lib/utils';\nimport { useFieldControl } from '../form/field-context';\n\nconst RadioGroup = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n // The Root already carries role=\"radiogroup\", so a plain `FormField` can\n // describe it directly. Wrapping it in `FormField as=\"group\"` instead gives a\n // real fieldset/legend and makes this a no-op — both are correct, and which\n // one to reach for is a labelling question, not an ARIA one.\n const fieldProps = useFieldControl(props);\n\n return (\n <RadioGroupPrimitive.Root\n className={cn('grid gap-2', className)}\n {...fieldProps}\n ref={ref}\n />\n );\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-primary bg-background text-primary ring-offset-background focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/35 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary',\n coarseHitAreaClasses,\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex h-full w-full items-center justify-center\">\n <span\n aria-hidden\n className=\"block h-2 w-2 rounded-full bg-current\"\n />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Switch as SwitchPrimitives } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { coarseHitAreaClasses } from \"../lib/surface-classes\";\nimport { cn } from \"../lib/utils\";\nimport { useFieldControl } from \"../form/field-context\";\n\nconst switchVariants = cva(\n \"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast ease-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n {\n variants: {\n size: {\n sm: \"h-5 w-9\",\n md: \"h-6 w-11\",\n lg: \"h-7 w-14\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\n// Thumb size + checked translate are paired to each track so the thumb slides\n// exactly to the far edge (translate = track inner width − thumb width).\nconst switchThumbVariants = cva(\n \"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform duration-fast ease-default data-[state=unchecked]:translate-x-0\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 data-[state=checked]:translate-x-4\",\n md: \"h-5 w-5 data-[state=checked]:translate-x-5\",\n lg: \"h-6 w-6 data-[state=checked]:translate-x-7\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\nexport interface SwitchProps\n extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,\n VariantProps<typeof switchVariants> {}\n\nconst Switch = React.forwardRef<React.ComponentRef<typeof SwitchPrimitives.Root>, SwitchProps>(\n ({ className, size, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <SwitchPrimitives.Root\n className={cn(switchVariants({ size }), coarseHitAreaClasses, className)}\n {...fieldProps}\n ref={ref}\n >\n <SwitchPrimitives.Thumb className={cn(switchThumbVariants({ size }))} />\n </SwitchPrimitives.Root>\n );\n },\n);\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch, switchVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slider as SliderPrimitive } from \"radix-ui\";\nimport { coarseHitAreaClasses } from \"../lib/surface-classes\";\nimport { cn } from \"../lib/utils\";\nimport { useFieldControl } from \"../form/field-context\";\n\nconst Slider = React.forwardRef<\n React.ComponentRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({ className, ...props }, ref) => {\n // The Thumb is the element carrying role=\"slider\" and taking focus, so the\n // field's id and description belong on it — on the Root they would name a\n // wrapper the user can never land on.\n const {\n id,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": invalid,\n \"aria-required\": ariaRequired,\n ...rootProps\n } = useFieldControl(props);\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex w-full touch-none select-none items-center\",\n className,\n )}\n {...rootProps}\n >\n <SliderPrimitive.Track className=\"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary\">\n <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb\n id={id}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n aria-required={ariaRequired}\n className={cn(\n \"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n coarseHitAreaClasses,\n )}\n />\n </SliderPrimitive.Root>\n );\n});\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-lg border bg-card text-card-foreground shadow-sm\", className)}\n {...props}\n />\n )\n);\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-[var(--density-padding-xl)]\", className)}\n {...props}\n />\n )\n);\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-2xl font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n )\n);\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n )\n);\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-[var(--density-padding-xl)] pt-0\", className)} {...props} />\n )\n);\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-[var(--density-padding-xl)] pt-0\", className)}\n {...props}\n />\n )\n);\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\n","'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n CircleAlert,\n CircleCheck,\n Info,\n ShieldAlert,\n TriangleAlert,\n X,\n} from 'lucide-react';\nimport { cn } from '../lib/utils';\n\nconst alertVariants = cva(\n 'flex w-full items-start gap-3 rounded-[var(--radius-md)] border p-4 text-sm',\n {\n variants: {\n variant: {\n default:\n 'bg-muted/50 text-foreground border-border [&_[data-alert-icon]]:text-muted-foreground dark:bg-muted/30 dark:border-border-strong',\n destructive:\n 'border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300',\n success:\n 'border-success-300 bg-success-50 text-success-900 [&_[data-alert-icon]]:text-success-600 dark:border-success-700 dark:bg-success-900/60 dark:text-success-100 dark:[&_[data-alert-icon]]:text-success-300',\n warning:\n 'border-warning-300 bg-warning-50 text-warning-900 [&_[data-alert-icon]]:text-warning-600 dark:border-warning-700 dark:bg-warning-900/60 dark:text-warning-100 dark:[&_[data-alert-icon]]:text-warning-300',\n /**\n * @deprecated Use `variant=\"destructive\"` instead — `danger` is a\n * visual duplicate and will be removed in a future major release.\n */\n danger:\n 'border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300',\n info: 'border-primary-300 bg-primary-50 text-primary-900 [&_[data-alert-icon]]:text-primary-600 dark:border-primary-700 dark:bg-primary-900/60 dark:text-primary-100 dark:[&_[data-alert-icon]]:text-primary-300',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nconst defaultIcons: Record<string, React.ReactNode> = {\n default: <Info className=\"size-4\" />,\n destructive: <ShieldAlert className=\"size-4\" />,\n success: <CircleCheck className=\"size-4\" />,\n warning: <TriangleAlert className=\"size-4\" />,\n danger: <CircleAlert className=\"size-4\" />,\n info: <Info className=\"size-4\" />,\n};\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof alertVariants> {\n /**\n * Whether to render a leading icon. When `true` and no `icon` is provided,\n * the variant's built-in default icon is rendered. Defaults to `false`.\n */\n showIcon?: boolean;\n /**\n * Renders any React node as the leading icon (e.g. `<FontAwesomeIcon … />`,\n * a Lucide icon, or an inline SVG). When set, this takes precedence over\n * `showIcon` and replaces the default icon entirely.\n */\n icon?: React.ReactNode;\n /** Whether the alert can be dismissed. Defaults to `false`. */\n dismissable?: boolean;\n /** Callback fired when the dismiss button is clicked. */\n onDismiss?: () => void;\n}\n\nconst Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = 'default',\n showIcon = false,\n icon,\n dismissable = false,\n onDismiss,\n children,\n ...props\n },\n ref,\n ) => {\n const [dismissed, setDismissed] = React.useState(false);\n\n if (dismissed) return null;\n\n const resolvedIcon =\n icon ?? (showIcon ? defaultIcons[variant ?? 'default'] : null);\n\n const leading = resolvedIcon ? (\n <span\n className=\"mt-0.5 inline-flex shrink-0 [&_svg]:shrink-0\"\n data-alert-icon=\"\"\n aria-hidden\n >\n {resolvedIcon}\n </span>\n ) : null;\n\n const handleDismiss = () => {\n setDismissed(true);\n onDismiss?.();\n };\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), 'min-w-0', className)}\n {...props}\n >\n {leading}\n <div className=\"min-w-0 flex-1\">{children}</div>\n {dismissable ? (\n <button\n type=\"button\"\n onClick={handleDismiss}\n className=\"shrink-0 self-start rounded-[var(--radius-sm)] p-1.5 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2\"\n aria-label=\"Dismiss\"\n >\n <X className=\"size-4\" />\n </button>\n ) : null}\n </div>\n );\n },\n);\nAlert.displayName = 'Alert';\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn('mb-1 font-medium leading-none tracking-tight', className)}\n {...props}\n />\n));\nAlertTitle.displayName = 'AlertTitle';\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm [&_p]:leading-relaxed', className)}\n {...props}\n />\n));\nAlertDescription.displayName = 'AlertDescription';\n\nexport { Alert, AlertTitle, AlertDescription, alertVariants };\n","/**\n * Soft semantic tints — used for status indicators (badges, callouts) where\n * the element is informational/passive (not an interactive tile or button).\n *\n * Pattern: `border-{color}-500/30 bg-{color}-500/10 text-{color}-700`\n * with dark-mode shifts to `*-400` shades. Yields a subtle, non-clickable\n * \"I am a {success|warning|error|info} indicator\" look.\n *\n * Distinct from `semantic-action-tones.ts`:\n * - Action tones (positive/negative): brighter, clickable tile look\n * (`bg-X-100 + border-X-200/0.9 + text-X-600 + shadow-sm`). Used by Button.\n * - Tint tones (here): subtler, indicator look. Used by Badge.\n *\n * If you find yourself reaching for \"soft semantic background\" — interactive\n * → use action tones; passive → use these.\n */\n\nexport const tintToneSuccess =\n 'border-success-500/30 bg-success-500/10 text-success-700 dark:border-success-400/30 dark:bg-success-400/10 dark:text-success-400';\n\nexport const tintToneWarning =\n 'border-warning-500/30 bg-warning-500/10 text-warning-700 dark:border-warning-400/30 dark:bg-warning-400/10 dark:text-warning-400';\n\nexport const tintToneDestructive =\n 'border-destructive-500/30 bg-destructive-500/10 text-destructive-700 dark:border-destructive-400/30 dark:bg-destructive-400/10 dark:text-destructive-400';\n\nexport const tintToneInfo =\n 'border-primary-500/30 bg-primary-500/10 text-primary-700 dark:border-primary-400/30 dark:bg-primary-400/10 dark:text-primary-400';\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\nimport {\n tintToneDestructive,\n tintToneInfo,\n tintToneSuccess,\n tintToneWarning,\n} from \"../lib/semantic-tint-tones\";\n\nconst badgeVariants = cva(\n \"inline-flex h-6 items-center justify-center rounded-md border px-2.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-border bg-muted text-muted-foreground hover:bg-muted/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary-700\",\n accent:\n \"border-transparent bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600\",\n highlight:\n \"border-transparent bg-highlight text-highlight-foreground hover:bg-highlight-600\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive-700\",\n outline: \"text-foreground\",\n success: tintToneSuccess,\n warning: tintToneWarning,\n error: tintToneDestructive,\n info: tintToneInfo,\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport interface BadgeProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n <div className={cn(badgeVariants({ variant }), className)} {...props} />\n );\n}\n\nexport { Badge, badgeVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst avatarVariants = cva(\n \"relative flex h-10 w-10 shrink-0\",\n {\n variants: {\n shape: {\n circle: \"rounded-full\",\n rounded: \"rounded-2xl\",\n square: \"rounded-lg\",\n },\n },\n defaultVariants: {\n shape: \"circle\",\n },\n }\n);\n\ninterface AvatarProps\n extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {\n /**\n * Clip content to the avatar shape. Defaults to `true`. Set `false` to let an\n * overlay that a source bakes into the image extend past the shape — e.g. a\n * Google \"Local Guide\" star badge composited into the corner of a profile\n * photo, which a circular clip would otherwise cut off.\n */\n clip?: boolean;\n}\n\nconst Avatar = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Root>,\n AvatarProps\n>(({ className, shape, clip = true, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n avatarVariants({ shape }),\n clip ? \"overflow-hidden\" : \"overflow-visible\",\n className,\n )}\n {...props}\n />\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nconst AvatarImage = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image ref={ref} className={cn(\"aspect-square h-full w-full\", className)} {...props} />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\"flex h-full w-full items-center justify-center rounded-full bg-muted\", className)}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\nexport { Avatar, AvatarImage, AvatarFallback, avatarVariants };\nexport type { AvatarProps };\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { X } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n centeredModalContentClasses,\n overlayScrimClasses,\n touchTargetClasses,\n} from '../lib/surface-classes';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(overlayScrimClasses, className)}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(centeredModalContentClasses, className)}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className={cn(\n 'absolute right-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',\n touchTargetClasses,\n )}\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-1.5 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport {\n centeredModalContentClasses,\n overlayScrimClasses,\n} from '../lib/surface-classes';\nimport { buttonVariants } from './button';\n\nconst AlertDialog = AlertDialogPrimitive.Root;\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(overlayScrimClasses, className)}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(centeredModalContentClasses, className)}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-2 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\n\nconst AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold', className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: 'outline' }),\n 'mt-2 sm:mt-0',\n className,\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as SheetPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport { overlayScrimClasses, touchTargetClasses } from '../lib/surface-classes';\n\nconst Sheet = SheetPrimitive.Root;\nconst SheetTrigger = SheetPrimitive.Trigger;\nconst SheetClose = SheetPrimitive.Close;\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(overlayScrimClasses, className)}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariants = cva(\n 'fixed z-[var(--z-modal)] gap-4 bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:[animation-duration:var(--panel-open-dur)] data-[state=closed]:[animation-duration:var(--panel-close-dur)] data-[state=open]:[animation-timing-function:var(--panel-ease)] data-[state=closed]:[animation-timing-function:var(--panel-ease)]',\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left',\n right:\n 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right',\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n xl: '',\n full: '',\n },\n },\n defaultVariants: {\n side: 'right',\n size: 'sm',\n },\n compoundVariants: [\n { side: 'left', size: 'sm', className: 'sm:max-w-sm' },\n { side: 'left', size: 'md', className: 'sm:max-w-md' },\n { side: 'left', size: 'lg', className: 'sm:max-w-lg' },\n { side: 'left', size: 'xl', className: 'sm:max-w-xl' },\n { side: 'left', size: 'full', className: 'sm:max-w-full' },\n { side: 'right', size: 'sm', className: 'sm:max-w-sm' },\n { side: 'right', size: 'md', className: 'sm:max-w-md' },\n { side: 'right', size: 'lg', className: 'sm:max-w-lg' },\n { side: 'right', size: 'xl', className: 'sm:max-w-xl' },\n { side: 'right', size: 'full', className: 'sm:max-w-full' },\n ],\n },\n);\n\ninterface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = 'right', size = 'sm', className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n ref={ref}\n className={cn(sheetVariants({ side, size }), className)}\n {...props}\n >\n {children}\n <SheetPrimitive.Close\n className={cn(\n 'absolute right-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary',\n touchTargetClasses,\n )}\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-2 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\n\nconst SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n","'use client';\n\n/**\n * DropdownMenu — visually mirrored by `context-menu.tsx`. Both pull chrome\n * from `lib/surface-classes.ts` (menuSurfaceClasses, menuItemClasses, etc.)\n * so they stay in lockstep. Edit the shared classes file, not this one or\n * context-menu.tsx, when tweaking menu visuals.\n */\n\nimport * as React from 'react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n menuItemClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[state=open]:bg-accent',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n menuSurfaceClasses,\n floatingAnimationClasses,\n 'shadow-lg',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(menuItemClasses, inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n);\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n","\"use client\";\n\nimport { Toaster as SonnerToaster, toast } from \"sonner\";\n\nexport interface ToasterProps {\n position?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\" | \"top-center\" | \"bottom-center\";\n richColors?: boolean;\n closeButton?: boolean;\n className?: string;\n}\n\nfunction Toaster({ position = \"bottom-right\", richColors = true, closeButton = true, ...props }: ToasterProps) {\n return (\n <SonnerToaster\n position={position}\n richColors={richColors}\n closeButton={closeButton}\n toastOptions={{\n classNames: {\n toast: \"group border-border bg-background text-foreground shadow-lg\",\n description: \"text-muted-foreground\",\n actionButton: \"bg-primary text-primary-foreground\",\n cancelButton: \"bg-muted text-muted-foreground\",\n },\n }}\n {...props}\n />\n );\n}\n\nexport { Toaster, toast };\n","'use client';\n\nimport * as React from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\n\nconst Tabs = TabsPrimitive.Root;\n\n// useLayoutEffect warns on the server; fall back to useEffect there.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nconst TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, children, ...props }, forwardedRef) => {\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n const pillRef = React.useRef<HTMLSpanElement | null>(null);\n\n // Merge the forwarded ref with our internal one.\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n innerRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n // Slide the pill behind whichever trigger Radix has marked active. The pill\n // shares the list as its offset parent, so a trigger's offsetLeft/offsetWidth\n // map directly to the pill's translateX/width.\n const move = React.useCallback((animate: boolean) => {\n const list = innerRef.current;\n const pill = pillRef.current;\n if (!list || !pill) return;\n\n const active = list.querySelector<HTMLElement>(\n '[role=\"tab\"][data-state=\"active\"]',\n );\n if (!active) {\n pill.style.opacity = '0';\n return;\n }\n\n // Suspend via transition-property (not the `transition` shorthand) so the\n // inline duration/easing from the --tabs-* tokens survive the snap.\n if (!animate) pill.style.transitionProperty = 'none';\n pill.style.opacity = '1';\n pill.style.transform = `translateX(${active.offsetLeft}px)`;\n pill.style.width = `${active.offsetWidth}px`;\n if (!animate) {\n // Force a reflow so the snap applies before transitions are restored.\n void pill.offsetWidth;\n pill.style.transitionProperty = '';\n }\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n move(false);\n\n const list = innerRef.current;\n if (!list) return;\n\n // Radix flips data-state on triggers for both pointer and keyboard nav.\n const observer = new MutationObserver(() => move(true));\n observer.observe(list, {\n subtree: true,\n attributes: true,\n attributeFilter: ['data-state'],\n childList: true,\n });\n\n const resize = new ResizeObserver(() => move(false));\n resize.observe(list);\n\n return () => {\n observer.disconnect();\n resize.disconnect();\n };\n }, [move]);\n\n return (\n <TabsPrimitive.List\n ref={setRef}\n className={cn(\n 'relative isolate inline-flex h-[var(--density-height-md)] items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',\n className,\n )}\n {...props}\n >\n <span\n ref={pillRef}\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute bottom-1 left-0 top-1 z-0 rounded-sm opacity-0 shadow-sm',\n 'bg-[var(--bison-tab-active-bg,hsl(var(--primary)))]',\n 'transition-[transform,width] motion-reduce:transition-none',\n )}\n style={{\n transitionDuration: 'var(--tabs-dur)',\n transitionTimingFunction: 'var(--tabs-ease)',\n }}\n />\n {children}\n </TabsPrimitive.List>\n );\n});\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'relative z-[1] inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-[var(--bison-tab-active-fg,hsl(var(--primary-foreground)))]',\n className,\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Check, FastForward } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { tintToneSuccess, tintToneWarning } from \"../lib/semantic-tint-tones\";\n\nexport type StepperState = \"completed\" | \"active\" | \"skipped\" | \"upcoming\";\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\n// Indicator size — kept as a constant so connector positioning math is exact.\nconst INDICATOR_SIZE_PX = 36; // matches h-9/w-9\nconst INDICATOR_CENTER_PX = INDICATOR_SIZE_PX / 2; // 18\nconst CONNECTOR_THICKNESS_PX = 2; // h-0.5 / w-0.5\n// Minimum connector length when there's no surrounding content to push items\n// apart. Keeps the visual rhythm consistent.\nconst MIN_CONNECTOR_LENGTH_PX = 24;\n\ntype StepperContextValue = {\n orientation: StepperOrientation;\n interactive: boolean;\n allowSkipAhead: boolean;\n onStepClick?: (index: number) => void;\n};\n\nconst StepperContext = React.createContext<StepperContextValue | null>(null);\n\nfunction useStepperContext(component: string) {\n const ctx = React.useContext(StepperContext);\n if (!ctx) {\n throw new Error(`<${component}> must be used inside <Stepper>`);\n }\n return ctx;\n}\n\ntype StepperItemContextValue = {\n state: StepperState;\n index: number;\n isLast: boolean;\n disabled: boolean;\n};\n\nconst StepperItemContext = React.createContext<StepperItemContextValue | null>(\n null,\n);\n\nfunction useStepperItemContext(component: string) {\n const ctx = React.useContext(StepperItemContext);\n if (!ctx) {\n throw new Error(`<${component}> must be used inside <StepperItem>`);\n }\n return ctx;\n}\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: StepperOrientation;\n interactive?: boolean;\n allowSkipAhead?: boolean;\n onStepClick?: (index: number) => void;\n}\n\nconst Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n (\n {\n className,\n orientation = \"horizontal\",\n interactive = false,\n allowSkipAhead = false,\n onStepClick,\n children,\n ...props\n },\n ref,\n ) => {\n const value = React.useMemo<StepperContextValue>(\n () => ({\n orientation,\n interactive,\n allowSkipAhead,\n onStepClick,\n }),\n [orientation, interactive, allowSkipAhead, onStepClick],\n );\n\n // Derive each item's index and `isLast` flag from its JSX position rather\n // than from a shared mutable counter. The counter approach was unsound:\n // it relied on every `<StepperItem>` re-rendering exactly once per\n // `<Stepper>` render, in order. React 19 strict-mode double renders,\n // concurrent renders, and out-of-band item re-renders can all break that\n // contract, causing indices (and therefore `isLast`) to drift — which\n // shows up as wrong step numbers and a stray trailing connector.\n //\n // Instead we walk the children once here, count `<StepperItem>` matches\n // up-front, then `cloneElement` each item with `_index` and `_isLast`\n // injected as internal props. Non-item children pass through untouched.\n const childArray = React.Children.toArray(children);\n const totalItems = childArray.reduce<number>(\n (acc, child) =>\n React.isValidElement(child) &&\n (child.type as { displayName?: string })?.displayName === \"StepperItem\"\n ? acc + 1\n : acc,\n 0,\n );\n\n let itemIndex = 0;\n const decoratedChildren = childArray.map((child) => {\n if (\n !React.isValidElement(child) ||\n (child.type as { displayName?: string })?.displayName !== \"StepperItem\"\n ) {\n return child;\n }\n const index = itemIndex;\n itemIndex += 1;\n return React.cloneElement(child as React.ReactElement<StepperItemProps>, {\n _index: index,\n _isLast: index === totalItems - 1,\n });\n });\n\n return (\n <StepperContext.Provider value={value}>\n <div\n ref={ref}\n role={interactive ? \"tablist\" : undefined}\n aria-orientation={orientation}\n className={cn(\n \"flex w-full\",\n orientation === \"horizontal\"\n ? \"flex-row items-start\"\n : \"flex-col items-stretch\",\n className,\n )}\n {...props}\n >\n {decoratedChildren}\n </div>\n </StepperContext.Provider>\n );\n },\n);\nStepper.displayName = \"Stepper\";\n\nconst stepperItemVariants = cva(\n \"group/stepper-item relative flex transition-colors\",\n {\n variants: {\n orientation: {\n // Horizontal items grow to share the row equally. Indicator at top,\n // label/description block below. Trailing connector is absolutely\n // positioned at the indicator's vertical center.\n horizontal: \"min-w-0 flex-1 flex-col items-center text-center\",\n // Vertical items have indicator on the left, label/description block\n // on the right. Trailing connector is absolutely positioned at the\n // indicator's horizontal center.\n vertical: \"flex-row items-start gap-3 text-left\",\n },\n interactive: {\n true: \"cursor-pointer rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60\",\n false: \"\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n interactive: false,\n },\n },\n);\n\nexport interface StepperItemProps extends Omit<\n React.HTMLAttributes<HTMLDivElement | HTMLButtonElement>,\n \"onClick\"\n> {\n state?: StepperState;\n /**\n * Color of the connector that follows this item. Defaults to the item's own\n * `state`, which yields a \"fills in\" effect as the user progresses.\n */\n connectorState?: StepperState;\n /**\n * Hide the trailing connector for this item. Useful if you need a custom\n * separator. The last item never renders a connector regardless of this prop.\n */\n hideConnector?: boolean;\n disabled?: boolean;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /**\n * @internal Injected by the parent `<Stepper>` based on JSX position. Do\n * not pass directly — `<Stepper>` clones each `<StepperItem>` to set this.\n */\n _index?: number;\n /**\n * @internal Injected by the parent `<Stepper>` based on JSX position. Do\n * not pass directly — `<Stepper>` clones each `<StepperItem>` to set this.\n */\n _isLast?: boolean;\n}\n\nconst StepperItem = React.forwardRef<HTMLElement, StepperItemProps>(\n (\n {\n state = \"upcoming\",\n connectorState,\n hideConnector = false,\n disabled: disabledProp,\n className,\n onClick,\n children,\n _index,\n _isLast,\n ...props\n },\n ref,\n ) => {\n const { orientation, interactive, allowSkipAhead, onStepClick } =\n useStepperContext(\"StepperItem\");\n\n // `_index` and `_isLast` are injected by the parent `<Stepper>` based on\n // JSX position. We default them defensively so a `<StepperItem>` rendered\n // in isolation (e.g. a snapshot test) still produces sensible output —\n // it's treated as the only/last step.\n const index = _index ?? 0;\n const isLast = _isLast ?? true;\n\n const disabled =\n disabledProp ?? (interactive && state === \"upcoming\" && !allowSkipAhead);\n\n const itemValue = React.useMemo<StepperItemContextValue>(\n () => ({ state, index, isLast, disabled }),\n [state, index, isLast, disabled],\n );\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) return;\n onClick?.(event);\n onStepClick?.(index);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!interactive) return;\n const target = event.currentTarget;\n const items = Array.from(\n target.parentElement?.querySelectorAll<HTMLElement>(\n '[data-stepper-item=\"true\"]:not([disabled])',\n ) ?? [],\n );\n const currentIdx = items.indexOf(target);\n if (currentIdx < 0) return;\n\n const nextKey = orientation === \"horizontal\" ? \"ArrowRight\" : \"ArrowDown\";\n const prevKey = orientation === \"horizontal\" ? \"ArrowLeft\" : \"ArrowUp\";\n\n if (event.key === nextKey) {\n event.preventDefault();\n items[(currentIdx + 1) % items.length]?.focus();\n } else if (event.key === prevKey) {\n event.preventDefault();\n items[(currentIdx - 1 + items.length) % items.length]?.focus();\n } else if (event.key === \"Home\") {\n event.preventDefault();\n items[0]?.focus();\n } else if (event.key === \"End\") {\n event.preventDefault();\n items[items.length - 1]?.focus();\n }\n };\n\n const showConnector = !isLast && !hideConnector;\n const resolvedConnectorState = connectorState ?? state;\n\n // Ensure each item has enough length for the connector to be visible even\n // when the content is short. Padding stays inside the item so the next\n // item's indicator sits flush against the end of the connector.\n const itemSpacing = !showConnector\n ? \"\"\n : orientation === \"vertical\"\n ? \"pb-8\"\n : \"\";\n\n const sharedProps = {\n \"data-stepper-item\": \"true\" as const,\n \"data-state\": state,\n \"aria-current\": state === \"active\" ? (\"step\" as const) : undefined,\n className: cn(\n stepperItemVariants({ orientation, interactive }),\n itemSpacing,\n className,\n ),\n };\n\n // Split children into the indicator and everything else, then wrap the\n // \"rest\" in a labelled content block. This lets users write:\n //\n // <StepperItem>\n // <StepperIndicator />\n // <StepperLabel>...</StepperLabel>\n // <StepperDescription>...</StepperDescription>\n // </StepperItem>\n //\n // …without manually grouping label + description in a wrapper div.\n const { indicator, rest } = splitIndicator(children);\n\n const content = (\n <StepperItemContext.Provider value={itemValue}>\n {indicator}\n {rest.length > 0 ? (\n <div\n className={cn(\n \"relative z-10 flex min-w-0 flex-col gap-1\",\n orientation === \"horizontal\"\n ? \"mt-2 items-center\"\n : \"flex-1 items-start\",\n )}\n >\n {rest}\n </div>\n ) : null}\n {showConnector ? (\n <Connector orientation={orientation} state={resolvedConnectorState} />\n ) : null}\n </StepperItemContext.Provider>\n );\n\n if (interactive) {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n role=\"tab\"\n aria-selected={state === \"active\"}\n disabled={disabled}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n {...sharedProps}\n {...(props as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div\n ref={ref as React.Ref<HTMLDivElement>}\n {...sharedProps}\n {...(props as React.HTMLAttributes<HTMLDivElement>)}\n >\n {content}\n </div>\n );\n },\n);\nStepperItem.displayName = \"StepperItem\";\n\n/**\n * Trailing connector line, absolutely positioned along the indicator's\n * center axis. By anchoring to the item box (not to a flex sibling) the\n * line is guaranteed to align with the indicator regardless of how much\n * content sits below or beside it.\n *\n * - Horizontal: line runs from the right edge of this item's indicator to\n * the left edge of the next item's indicator. Top = indicator center.\n * - Vertical: line runs from the bottom edge of this item's indicator to\n * the top edge of the next item's indicator. Left = indicator center.\n */\nfunction Connector({\n orientation,\n state,\n}: {\n orientation: StepperOrientation;\n state: StepperState;\n}) {\n if (orientation === \"horizontal\") {\n return (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute z-0 h-0.5 transition-colors\",\n connectorColor(state),\n )}\n style={{\n top: INDICATOR_CENTER_PX - CONNECTOR_THICKNESS_PX / 2,\n left: `calc(50% + ${INDICATOR_CENTER_PX}px)`,\n right: `calc(-50% + ${INDICATOR_CENTER_PX}px)`,\n }}\n />\n );\n }\n\n return (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute z-0 w-0.5 transition-colors\",\n connectorColor(state),\n )}\n style={{\n left: INDICATOR_CENTER_PX - CONNECTOR_THICKNESS_PX / 2,\n top: INDICATOR_SIZE_PX,\n bottom: 0,\n }}\n />\n );\n}\n\n/**\n * Pulls the first <StepperIndicator> out of a children list. Returns the\n * indicator (or null) and the remaining children. Identity-checked so it\n * works with forwardRef wrappers regardless of displayName quirks.\n */\nfunction splitIndicator(children: React.ReactNode): {\n indicator: React.ReactNode | null;\n rest: React.ReactNode[];\n} {\n let indicator: React.ReactNode | null = null;\n const rest: React.ReactNode[] = [];\n\n React.Children.forEach(children, (child) => {\n if (\n indicator === null &&\n React.isValidElement(child) &&\n child.type === StepperIndicator\n ) {\n indicator = child;\n } else {\n rest.push(child);\n }\n });\n\n return { indicator, rest };\n}\n\nfunction connectorColor(state: StepperState): string {\n switch (state) {\n case \"completed\":\n return \"bg-success-500 dark:bg-success-400\";\n case \"active\":\n return \"bg-primary\";\n case \"skipped\":\n return \"bg-warning-500 dark:bg-warning-400\";\n case \"upcoming\":\n default:\n return \"bg-border\";\n }\n}\n\nconst stepperIndicatorVariants = cva(\n \"relative z-10 inline-flex shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors\",\n {\n variants: {\n state: {\n completed: tintToneSuccess,\n active:\n \"border-primary bg-primary text-primary-foreground ring-2 ring-primary/30 ring-offset-2 ring-offset-background\",\n skipped: tintToneWarning,\n upcoming: \"border-border bg-muted text-muted-foreground\",\n },\n },\n defaultVariants: { state: \"upcoming\" },\n },\n);\n\nexport interface StepperIndicatorProps\n extends\n Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\">,\n VariantProps<typeof stepperIndicatorVariants> {\n /**\n * Optional icon to render when the step is `active` or `upcoming`. Pass any\n * React node (`<FontAwesomeIcon … />`, a Lucide icon, an inline SVG, etc.).\n * Ignored for `completed` (always check) and `skipped` (always forward) states.\n */\n icon?: React.ReactNode;\n /**\n * Override the auto-generated step number. Pass a string/number to display\n * custom content for `active` / `upcoming` states.\n */\n children?: React.ReactNode;\n}\n\nconst StepperIndicator = React.forwardRef<\n HTMLSpanElement,\n StepperIndicatorProps\n>(({ className, icon, children, style, ...props }, ref) => {\n const { state, index } = useStepperItemContext(\"StepperIndicator\");\n\n let inner: React.ReactNode;\n if (state === \"completed\") {\n inner = <Check className=\"h-4 w-4\" aria-hidden=\"true\" />;\n } else if (state === \"skipped\") {\n inner = <FastForward className=\"h-4 w-4\" aria-hidden=\"true\" />;\n } else if (icon !== undefined && icon !== null) {\n inner = (\n <span className=\"inline-flex h-4 w-4 items-center justify-center [&_svg]:h-4 [&_svg]:w-4\">\n {icon}\n </span>\n );\n } else if (children !== undefined) {\n inner = children;\n } else {\n inner = index + 1;\n }\n\n return (\n <span\n ref={ref}\n aria-hidden={state !== \"active\"}\n className={cn(stepperIndicatorVariants({ state }), className)}\n style={{\n height: INDICATOR_SIZE_PX,\n width: INDICATOR_SIZE_PX,\n ...style,\n }}\n {...props}\n >\n {inner}\n </span>\n );\n});\nStepperIndicator.displayName = \"StepperIndicator\";\n\nconst stepperLabelVariants = cva(\"text-sm font-medium transition-colors\", {\n variants: {\n state: {\n completed: \"text-foreground\",\n active: \"text-foreground\",\n skipped: \"text-muted-foreground line-through\",\n upcoming: \"text-muted-foreground\",\n },\n },\n defaultVariants: { state: \"upcoming\" },\n});\n\nconst StepperLabel = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => {\n const { state } = useStepperItemContext(\"StepperLabel\");\n return (\n <span\n ref={ref}\n className={cn(stepperLabelVariants({ state }), className)}\n {...props}\n />\n );\n});\nStepperLabel.displayName = \"StepperLabel\";\n\nconst StepperDescription = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n className={cn(\"text-xs text-muted-foreground\", className)}\n {...props}\n />\n));\nStepperDescription.displayName = \"StepperDescription\";\n\n/**\n * Backwards-compatible no-op separator.\n *\n * The connector line between steps is now rendered automatically by each\n * `<StepperItem>`. Continue using `<StepperSeparator>` between items if you\n * prefer the explicit syntax — it renders nothing and the auto-connector\n * handles the visual.\n *\n * @deprecated Connectors are rendered automatically by `<StepperItem>`.\n * This component is now a no-op kept for source compatibility.\n */\nconst StepperSeparator: React.FC<{\n state?: StepperState;\n className?: string;\n}> = () => null;\nStepperSeparator.displayName = \"StepperSeparator\";\n\nexport {\n Stepper,\n StepperItem,\n StepperIndicator,\n StepperLabel,\n StepperDescription,\n StepperSeparator,\n stepperItemVariants,\n stepperIndicatorVariants,\n stepperLabelVariants,\n};\n\nexport { INDICATOR_SIZE_PX, INDICATOR_CENTER_PX };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Accordion as AccordionPrimitive } from \"radix-ui\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 transition-transform duration-normal\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n","import * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(\n ({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table ref={ref} className={cn(\"w-full caption-bottom text-sm\", className)} {...props} />\n </div>\n )\n);\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <thead ref={ref} className={cn(\"[&_tr]:border-b\", className)} {...props} />\n);\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tbody ref={ref} className={cn(\"[&_tr:last-child]:border-0\", className)} {...props} />\n);\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tfoot ref={ref} className={cn(\"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0\", className)} {...props} />\n);\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr ref={ref} className={cn(\"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\", className)} {...props} />\n )\n);\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <th ref={ref} className={cn(\"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\", className)} {...props} />\n )\n);\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <td ref={ref} className={cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className)} {...props} />\n )\n);\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(\n ({ className, ...props }, ref) => <caption ref={ref} className={cn(\"mt-4 text-sm text-muted-foreground\", className)} {...props} />\n);\nTableCaption.displayName = \"TableCaption\";\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n flexRender,\n type ColumnDef,\n type SortingState,\n type ColumnFiltersState,\n type VisibilityState,\n type RowSelectionState,\n type PaginationState,\n type Table as TanstackTable,\n type OnChangeFn,\n} from \"@tanstack/react-table\";\nimport {\n ArrowDown,\n ArrowUp,\n ArrowUpDown,\n ChevronLeft,\n ChevronRight,\n ChevronsLeft,\n ChevronsRight,\n Settings2,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Table, TableHeader, TableBody, TableHead, TableRow, TableCell } from \"./table\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Checkbox } from \"./checkbox\";\nimport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n} from \"./select\";\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuCheckboxItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n} from \"./dropdown-menu\";\n\n// ---------------------------------------------------------------------------\n// Re-exports\n// ---------------------------------------------------------------------------\n\nexport type { ColumnDef } from \"@tanstack/react-table\";\n\n// ---------------------------------------------------------------------------\n// Size / Density\n// ---------------------------------------------------------------------------\n\ntype DataTableSize = \"sm\" | \"md\" | \"lg\";\n\nconst sizeClasses: Record<DataTableSize, { cell: string; header: string }> = {\n sm: { cell: \"px-3 py-1.5 text-xs\", header: \"h-9 px-3 text-xs\" },\n md: { cell: \"px-4 py-2 text-sm\", header: \"h-10 px-4 text-sm\" },\n lg: { cell: \"px-4 py-3 text-sm\", header: \"h-12 px-4 text-sm\" },\n};\n\nconst densitySizeMap: Record<string, DataTableSize> = {\n compact: \"sm\",\n default: \"md\",\n spacious: \"lg\",\n};\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface DataTableProps<TData> {\n /** Column definitions (TanStack Table ColumnDef). */\n columns: ColumnDef<TData, unknown>[];\n /** Data array to render. */\n data: TData[];\n\n // --- Filtering ---\n /** Column id used for the filter input. Omit to disable the built-in filter. */\n filterColumn?: string;\n /** Placeholder text for the filter input. @default \"Filter...\" */\n filterPlaceholder?: string;\n\n // --- Pagination ---\n /** Enable pagination. @default true */\n pagination?: boolean;\n /** Number of rows per page. @default 10 */\n pageSize?: number;\n /** Page size options in the dropdown. @default [10, 20, 30, 50] */\n pageSizeOptions?: number[];\n\n // --- Row selection ---\n /** Show a checkbox column for row selection. @default false */\n enableRowSelection?: boolean;\n /** Callback when selection changes. Receives a record of row-id to boolean. */\n onRowSelectionChange?: (selection: RowSelectionState) => void;\n\n // --- Server-side / manual mode ---\n /** Total row count for server-side pagination. Enables manual mode when set. */\n totalRows?: number;\n /** Controlled pagination state for server-side mode. */\n paginationState?: PaginationState;\n /** Callback when pagination changes (server-side). */\n onPaginationChange?: OnChangeFn<PaginationState>;\n /** Controlled sorting state for server-side mode. */\n sortingState?: SortingState;\n /** Callback when sorting changes (server-side). */\n onSortingChange?: OnChangeFn<SortingState>;\n /** Controlled column filter state for server-side mode. */\n filterState?: ColumnFiltersState;\n /** Callback when column filters change (server-side). */\n onFilterChange?: OnChangeFn<ColumnFiltersState>;\n\n // --- Toolbar ---\n /** Show the column visibility toggle in the toolbar. @default true */\n showColumnToggle?: boolean;\n /** Additional actions rendered at the end of the toolbar. */\n toolbarActions?: React.ReactNode;\n\n // --- Sizing ---\n /** Override density-derived size. When omitted, reads from the nearest DensityProvider. */\n size?: DataTableSize;\n\n // --- Display ---\n /** Message shown when there are no rows. @default \"No results.\" */\n emptyMessage?: string;\n /** Additional class name on the root wrapper. */\n className?: string;\n}\n\n// ---------------------------------------------------------------------------\n// DataTableColumnHeader\n// ---------------------------------------------------------------------------\n\nexport interface DataTableColumnHeaderProps {\n column: {\n getCanSort: () => boolean;\n getIsSorted: () => false | \"asc\" | \"desc\";\n toggleSorting: (desc?: boolean, multi?: boolean) => void;\n };\n title: string;\n className?: string;\n}\n\nfunction DataTableColumnHeader({ column, title, className }: DataTableColumnHeaderProps) {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n const sorted = column.getIsSorted();\n\n return (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\"-ml-3 h-8 data-[state=open]:bg-accent\", className)}\n onClick={() => column.toggleSorting(sorted === \"asc\")}\n >\n {title}\n {sorted === \"asc\" ? (\n <ArrowUp className=\"ml-2 h-3.5 w-3.5\" />\n ) : sorted === \"desc\" ? (\n <ArrowDown className=\"ml-2 h-3.5 w-3.5\" />\n ) : (\n <ArrowUpDown className=\"ml-2 h-3.5 w-3.5 text-muted-foreground/50\" />\n )}\n </Button>\n );\n}\nDataTableColumnHeader.displayName = \"DataTableColumnHeader\";\n\n// ---------------------------------------------------------------------------\n// Internal: selection column factory\n// ---------------------------------------------------------------------------\n\nfunction createSelectionColumn<TData>(): ColumnDef<TData, unknown> {\n return {\n id: \"_select\",\n header: ({ table }) => (\n <Checkbox\n checked={table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && \"indeterminate\")}\n onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n aria-label=\"Select all\"\n className=\"translate-y-[2px]\"\n />\n ),\n cell: ({ row }) => (\n <Checkbox\n checked={row.getIsSelected()}\n onCheckedChange={(value) => row.toggleSelected(!!value)}\n aria-label=\"Select row\"\n className=\"translate-y-[2px]\"\n />\n ),\n enableSorting: false,\n enableHiding: false,\n size: 40,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Internal: detect density from DOM\n// ---------------------------------------------------------------------------\n\nfunction useDensitySize(): DataTableSize {\n const ref = React.useRef<HTMLDivElement>(null);\n const [size, setSize] = React.useState<DataTableSize>(\"md\");\n\n React.useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const container = el.closest(\".bison-density-compact, .bison-density-default, .bison-density-spacious\");\n if (!container) return;\n for (const [cls, sz] of Object.entries(densitySizeMap)) {\n if (container.classList.contains(`bison-density-${cls}`)) {\n setSize(sz);\n return;\n }\n }\n }, []);\n\n return size;\n}\n\n// ---------------------------------------------------------------------------\n// DataTable\n// ---------------------------------------------------------------------------\n\nfunction DataTableInner<TData>(\n {\n columns,\n data,\n filterColumn,\n filterPlaceholder = \"Filter...\",\n pagination = true,\n pageSize = 10,\n pageSizeOptions = [10, 20, 30, 50],\n enableRowSelection = false,\n onRowSelectionChange,\n totalRows,\n paginationState: controlledPagination,\n onPaginationChange,\n sortingState: controlledSorting,\n onSortingChange: onSortingChangeProp,\n filterState: controlledFilters,\n onFilterChange,\n showColumnToggle = true,\n toolbarActions,\n size: sizeProp,\n emptyMessage = \"No results.\",\n className,\n }: DataTableProps<TData>,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const isServerSide = totalRows !== undefined;\n\n // --- Internal state (client-side) ---\n const [internalSorting, setInternalSorting] = React.useState<SortingState>([]);\n const [internalFilters, setInternalFilters] = React.useState<ColumnFiltersState>([]);\n const [internalPagination, setInternalPagination] = React.useState<PaginationState>({\n pageIndex: 0,\n pageSize,\n });\n const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>({});\n const [rowSelection, setRowSelection] = React.useState<RowSelectionState>({});\n\n // Resolve controlled vs uncontrolled state\n const sorting = controlledSorting ?? internalSorting;\n const setSorting = onSortingChangeProp ?? setInternalSorting;\n const columnFilters = controlledFilters ?? internalFilters;\n const setColumnFilters = onFilterChange ?? setInternalFilters;\n const paginationVal = controlledPagination ?? internalPagination;\n const setPaginationVal = onPaginationChange ?? setInternalPagination;\n\n // Notify consumer of selection changes\n const handleRowSelectionChange: OnChangeFn<RowSelectionState> = React.useCallback(\n (updater) => {\n setRowSelection((prev) => {\n const next = typeof updater === \"function\" ? updater(prev) : updater;\n onRowSelectionChange?.(next);\n return next;\n });\n },\n [onRowSelectionChange]\n );\n\n // Prepend selection column\n const finalColumns = React.useMemo(() => {\n if (!enableRowSelection) return columns;\n return [createSelectionColumn<TData>(), ...columns];\n }, [columns, enableRowSelection]);\n\n const table = useReactTable({\n data,\n columns: finalColumns,\n state: {\n sorting,\n columnFilters,\n columnVisibility,\n rowSelection,\n pagination: paginationVal,\n },\n onSortingChange: setSorting,\n onColumnFiltersChange: setColumnFilters,\n onColumnVisibilityChange: setColumnVisibility,\n onRowSelectionChange: handleRowSelectionChange,\n onPaginationChange: setPaginationVal,\n getCoreRowModel: getCoreRowModel(),\n ...(isServerSide\n ? {\n manualPagination: true,\n manualSorting: true,\n manualFiltering: true,\n pageCount: Math.ceil(totalRows / paginationVal.pageSize),\n }\n : {\n getSortedRowModel: getSortedRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n ...(pagination && { getPaginationRowModel: getPaginationRowModel() }),\n }),\n enableRowSelection,\n });\n\n // --- Density / size ---\n const densitySize = useDensitySize();\n const resolvedSize = sizeProp ?? densitySize;\n const sc = sizeClasses[resolvedSize];\n\n // --- Toolbar visibility ---\n const hasToolbar = filterColumn || showColumnToggle || toolbarActions;\n\n const selectedCount = Object.keys(rowSelection).length;\n const totalFilteredRows = isServerSide ? totalRows : table.getFilteredRowModel().rows.length;\n\n return (\n <div ref={ref} className={cn(\"space-y-4\", className)}>\n {/* Toolbar */}\n {hasToolbar && (\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex flex-1 items-center gap-2\">\n {filterColumn && (\n <Input\n placeholder={filterPlaceholder}\n value={(table.getColumn(filterColumn)?.getFilterValue() as string) ?? \"\"}\n onChange={(event) => table.getColumn(filterColumn)?.setFilterValue(event.target.value)}\n className=\"max-w-sm\"\n />\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {toolbarActions}\n {showColumnToggle && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto h-8\">\n <Settings2 className=\"mr-2 h-4 w-4\" />\n Columns\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-40\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((col) => col.getCanHide())\n .map((col) => (\n <DropdownMenuCheckboxItem\n key={col.id}\n className=\"capitalize\"\n checked={col.getIsVisible()}\n onCheckedChange={(value) => col.toggleVisibility(!!value)}\n >\n {col.id}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n )}\n\n {/* Table */}\n <div className=\"rounded-md border\">\n <Table>\n <TableHeader>\n {table.getHeaderGroups().map((headerGroup) => (\n <TableRow key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <TableHead\n key={header.id}\n className={sc.header}\n style={{ width: header.column.id === \"_select\" ? 40 : (header.getSize() !== 150 ? header.getSize() : undefined) }}\n >\n {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody>\n {table.getRowModel().rows?.length ? (\n table.getRowModel().rows.map((row) => (\n <TableRow key={row.id} data-state={row.getIsSelected() && \"selected\"}>\n {row.getVisibleCells().map((cell) => (\n <TableCell key={cell.id} className={sc.cell}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell colSpan={finalColumns.length} className=\"h-24 text-center\">\n {emptyMessage}\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n\n {/* Footer: selection info + pagination */}\n {(pagination || enableRowSelection) && (\n <div className=\"flex items-center justify-between px-2\">\n <div className=\"flex-1 text-sm text-muted-foreground\">\n {enableRowSelection\n ? `${selectedCount} of ${totalFilteredRows} row(s) selected`\n : `${totalFilteredRows} row(s) total`}\n </div>\n {pagination && (\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={`${paginationVal.pageSize}`}\n onValueChange={(value) => {\n setPaginationVal((old: PaginationState) => ({\n ...old,\n pageIndex: 0,\n pageSize: Number(value),\n }));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={`${paginationVal.pageSize}`} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {pageSizeOptions.map((s) => (\n <SelectItem key={s} value={`${s}`}>\n {s}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {paginationVal.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(0)}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <ChevronsLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <ChevronsRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nconst DataTable = React.forwardRef(DataTableInner) as <TData>(\n props: DataTableProps<TData> & { ref?: React.ForwardedRef<HTMLDivElement> }\n) => React.ReactElement;\n\n(DataTable as { displayName?: string }).displayName = \"DataTable\";\n\nexport { DataTable, DataTableColumnHeader };\n","'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\n\nconst Progress = React.forwardRef<\n React.ComponentRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\n 'relative h-4 w-full overflow-hidden rounded-full bg-muted',\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-primary transition-all duration-normal ease-default\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n","'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst progressBarVariants = cva(\n 'h-full rounded-full transition-all duration-normal ease-default',\n {\n variants: {\n color: {\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n highlight: 'bg-highlight',\n destructive: 'bg-destructive',\n brand: 'bg-brand-accent',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n },\n);\n\nconst progressBarTrackVariants = cva(\n 'relative w-full overflow-hidden rounded-full bg-muted',\n {\n variants: {\n size: {\n sm: 'h-1.5',\n md: 'h-2.5',\n lg: 'h-4',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nexport type ProgressBarFormat = 'percent' | 'currency';\n\nexport interface ProgressBarProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n VariantProps<typeof progressBarVariants>,\n VariantProps<typeof progressBarTrackVariants> {\n /** Current value. When format is \"percent\", this is 0–100. When format is \"currency\", this is the raw amount (e.g. cents). */\n value?: number;\n /** Maximum value. Default: 100. When format is \"currency\", this is the goal amount in the same unit as value. */\n max?: number;\n /** Label rendered above the bar */\n label?: React.ReactNode;\n /** Whether to show the formatted value text */\n showValue?: boolean;\n /**\n * Display format for the value text.\n * - \"percent\" (default): shows percentage (e.g. \"65%\")\n * - \"currency\": formats value and max as currency (e.g. \"$2,500 of $5,000\")\n */\n format?: ProgressBarFormat;\n /** Intl.NumberFormat locale for currency formatting. Defaults to \"en-US\". */\n locale?: string;\n /** ISO 4217 currency code. Defaults to \"USD\". */\n currency?: string;\n /** Divisor to convert raw value to display value (e.g. 100 for cents → dollars). Defaults to 1. */\n currencyDivisor?: number;\n}\n\nfunction formatCurrency(\n amount: number,\n divisor: number,\n locale: string,\n currency: string,\n): string {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }).format(amount / divisor);\n}\n\nconst ProgressBar = React.forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n className,\n value = 0,\n max = 100,\n color,\n size,\n label,\n showValue,\n format = 'percent',\n locale = 'en-US',\n currency = 'USD',\n currencyDivisor = 1,\n ...props\n },\n ref,\n ) => {\n const pct = Math.min(100, Math.max(0, (value / max) * 100));\n\n const formattedValue = React.useMemo(() => {\n if (format === 'currency') {\n const current = formatCurrency(\n value,\n currencyDivisor,\n locale,\n currency,\n );\n const goal = formatCurrency(max, currencyDivisor, locale, currency);\n return `${current} of ${goal}`;\n }\n return `${Math.round(pct)}%`;\n }, [format, value, max, pct, currencyDivisor, locale, currency]);\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {(label || showValue) && (\n <div className=\"mb-1.5 flex items-center justify-between text-sm\">\n {label && (\n <span className=\"font-medium text-foreground\">{label}</span>\n )}\n {showValue && (\n <span className=\"text-content-secondary tabular-nums\">\n {formattedValue}\n </span>\n )}\n </div>\n )}\n <div\n className={cn(progressBarTrackVariants({ size }))}\n role=\"progressbar\"\n aria-valuenow={value}\n aria-valuemin={0}\n aria-valuemax={max}\n >\n <div\n className={cn(progressBarVariants({ color }))}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n },\n);\nProgressBar.displayName = 'ProgressBar';\n\nexport { ProgressBar, progressBarVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ScrollArea as ScrollAreaPrimitive } from \"radix-ui\";\nimport { cn } from \"../lib/utils\";\n\nconst ScrollArea = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root ref={ref} className={cn(\"relative overflow-hidden\", className)} {...props}>\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n","import { cn } from \"../lib/utils\";\n\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"animate-pulse rounded-md bg-muted\", className)} {...props} />;\n}\n\nexport { Skeleton };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Star } from \"lucide-react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\n// Filled stars use `fill-current`/`stroke-current`, so the star color follows\n// the element's text color. The default `text-highlight` keeps ratings on brand,\n// and consumers can override per-use with any text-color utility (e.g.\n// `text-primary`) via `className` — tailwind-merge lets the override win.\nconst ratingVariants = cva(\"inline-flex items-center text-highlight\", {\n variants: {\n size: {\n sm: \"gap-0.5 [&_svg]:size-3.5\",\n md: \"gap-0.5 [&_svg]:size-4\",\n lg: \"gap-1 [&_svg]:size-5\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\ninterface RatingProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"role\" | \"aria-label\">,\n VariantProps<typeof ratingVariants> {\n /** The rating to display, e.g. 4.3. Clamped to the range [0, count]. */\n rate: number;\n /** Number of stars to render. Defaults to 5. */\n count?: number;\n /** Accessible label. Defaults to \"Rated {rate} out of {count}\". */\n label?: string;\n}\n\n/**\n * Read-only star rating display with fractional fill. A single filled-star layer\n * is clipped to the fractional width over an empty-star track, so a rating like\n * 4.3 shows four full stars and a partial fifth. Presentation only — for input,\n * compose a separate control.\n */\nconst Rating = React.forwardRef<HTMLDivElement, RatingProps>(\n ({ rate, count = 5, size, label, className, ...props }, ref) => {\n const clamped = Math.max(0, Math.min(rate, count));\n const stars = Array.from({ length: count });\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={label ?? `Rated ${clamped} out of ${count}`}\n className={cn(ratingVariants({ size }), className)}\n {...props}\n >\n {stars.map((_, i) => {\n // Fraction of THIS star that should be filled: 1 fully below the rating,\n // 0 fully above, fractional for the single straddling star.\n const fill = Math.max(0, Math.min(1, clamped - i));\n return (\n <span key={i} className=\"relative inline-flex shrink-0\">\n <Star className=\"fill-muted stroke-muted-foreground/40\" />\n {fill > 0 && (\n <span\n className=\"absolute inset-0 overflow-hidden\"\n style={{ width: `${fill * 100}%` }}\n >\n <Star className=\"fill-current stroke-current\" />\n </span>\n )}\n </span>\n );\n })}\n </div>\n );\n },\n);\nRating.displayName = \"Rating\";\n\nexport { Rating, ratingVariants };\nexport type { RatingProps };\n","import * as React from \"react\";\nimport { LoaderCircle } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst spinnerVariants = cva(\"text-muted-foreground\", {\n variants: {\n size: {\n sm: \"h-4 w-4\",\n md: \"h-6 w-6\",\n lg: \"h-8 w-8\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\nexport interface SpinnerProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof spinnerVariants> {}\n\nfunction Spinner({ className, size, ...props }: SpinnerProps) {\n return (\n <span className={cn(spinnerVariants({ size }), className)} {...props}>\n <LoaderCircle className=\"h-full w-full animate-spin\" />\n </span>\n );\n}\n\nexport { Spinner, spinnerVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface SavedPingProps {\n /**\n * Increments on every successful save. Parents should key this component on\n * `pingCount` (e.g. `<SavedPing key={pingCount} pingCount={pingCount} />`)\n * so each increment remounts the component and replays the animation.\n * Renders nothing while `pingCount === 0`.\n */\n pingCount: number;\n /** Label shown next to the checkmark. Defaults to `\"Saved\"`. */\n label?: string;\n /** Extra classes appended to the pill container. */\n className?: string;\n /** Passed through to the container for test queries. */\n \"data-testid\"?: string;\n}\n\n/**\n * A bespoke \"saved!\" confirmation pill — quieter than a standard toast.\n * Intended for background autosave flows where success needs acknowledgment\n * without interrupting the user. Uses the `success-*` semantic color scale so\n * it inherits the theme's success hue.\n *\n * Visual: small circle with light success fill, darker success border, and an\n * animated SVG checkmark that draws in. The whole pill fades in, drifts up,\n * holds briefly, then fades out.\n */\nconst SavedPing = React.forwardRef<HTMLDivElement, SavedPingProps>(\n (\n { pingCount, label = \"Saved\", className, \"data-testid\": dataTestId },\n ref,\n ) => {\n if (pingCount === 0) return null;\n\n return (\n <motion.div\n ref={ref}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={label}\n data-testid={dataTestId}\n initial={{ opacity: 0, y: 14, scale: 0.92 }}\n animate={{\n opacity: [0, 1, 1, 0],\n y: [14, 0, -6, -16],\n scale: [0.92, 1, 1, 0.96],\n }}\n transition={{\n duration: 1.4,\n times: [0, 0.15, 0.75, 1],\n ease: [0.22, 1, 0.36, 1],\n }}\n className={cn(\n \"pointer-events-none flex h-9 items-center gap-2 rounded-full border border-success-500 bg-success-50 pr-3.5 pl-2 text-sm font-medium text-success-700 shadow-sm shadow-success-500/10 dark:border-success-400 dark:bg-success-950/60 dark:text-success-200 dark:shadow-success-500/20\",\n className,\n )}\n >\n <span\n aria-hidden\n className=\"flex h-6 w-6 items-center justify-center rounded-full border border-success-500 bg-success-100/80 dark:border-success-400 dark:bg-success-900/60\"\n >\n <svg\n viewBox=\"0 0 20 20\"\n className=\"h-3.5 w-3.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <motion.path\n d=\"M4 10.5 L8.5 15 L16 6\"\n initial={{ pathLength: 0, opacity: 0 }}\n animate={{ pathLength: 1, opacity: 1 }}\n transition={{\n pathLength: { delay: 0.18, duration: 0.32, ease: \"easeOut\" },\n opacity: { delay: 0.18, duration: 0.05 },\n }}\n />\n </svg>\n </span>\n <span>{label}</span>\n </motion.div>\n );\n },\n);\nSavedPing.displayName = \"SavedPing\";\n\nexport { SavedPing };\n","'use client';\n\n/**\n * ContextMenu mirrors `dropdown-menu.tsx` visually — Radix UI ships them as\n * separate primitives because the trigger semantics differ (right-click vs\n * click), but the rendered chrome is identical. Both import from\n * `lib/surface-classes.ts` so any visual tweak updates both automatically.\n *\n * If you need to change the look of menus, edit `surface-classes.ts`\n * (the `menuSurfaceClasses` / `menuItemClasses` exports). Do NOT edit one\n * of these files without the other.\n */\n\nimport * as React from 'react';\nimport { ContextMenu as ContextMenuPrimitive } from 'radix-ui';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n menuItemClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\n\nconst ContextMenu = ContextMenuPrimitive.Root;\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(menuItemClasses, inset && 'pl-8', className)}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold text-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { NavigationMenu as NavigationMenuPrimitive } from \"radix-ui\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cva } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root> & {\n /**\n * When `true` (default) all panels render into a single shared, animated\n * viewport centered under the menu. When `false`, each panel renders in\n * place and anchors directly under its own trigger — the right choice for\n * hover mega-menu headers where panels should drop beneath their item.\n */\n viewport?: boolean;\n }\n>(({ className, children, viewport = true, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n data-viewport={viewport}\n className={cn(\n \"group/navigation-menu relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className,\n )}\n {...props}\n >\n {children}\n {viewport ? <NavigationMenuViewport /> : null}\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\n// `relative` so that, in `viewport={false}` mode, each `NavigationMenuContent`\n// anchors to its own item instead of the menu root.\nconst NavigationMenuItem = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Item ref={ref} className={cn(\"relative\", className)} {...props} />\n));\nNavigationMenuItem.displayName = NavigationMenuPrimitive.Item.displayName;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-[var(--density-height-md)] w-max items-center justify-center rounded-md bg-transparent px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\"\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto\",\n // viewport={false}: become a standalone popover surface anchored under the trigger\n \"group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow-lg group-data-[viewport=false]/navigation-menu:duration-200 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & { separator?: React.ReactNode }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />);\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<\"ol\">>(\n ({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n )\n);\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"inline-flex items-center gap-1.5\", className)} {...props} />\n )\n);\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & { asChild?: boolean }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? SlotPrimitive.Slot : \"a\";\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<\"span\">>(\n ({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n )\n);\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<\"li\">) => (\n <li role=\"presentation\" aria-hidden=\"true\" className={cn(\"[&>svg]:h-3.5 [&>svg]:w-3.5\", className)} {...props}>\n {children ?? <ChevronRight />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbEllipsis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { type ButtonProps, buttonVariants } from \"./button\";\n\nconst Pagination = ({ className, ...props }: React.ComponentProps<\"nav\">) => (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n);\nPagination.displayName = \"Pagination\";\n\nconst PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentPropsWithoutRef<\"ul\">>(\n ({ className, ...props }, ref) => (\n <ul ref={ref} className={cn(\"flex flex-row items-center gap-1\", className)} {...props} />\n )\n);\nPaginationContent.displayName = \"PaginationContent\";\n\nconst PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => <li ref={ref} className={cn(\"\", className)} {...props} />\n);\nPaginationItem.displayName = \"PaginationItem\";\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<ButtonProps, \"size\"> &\n React.ComponentProps<\"a\">;\n\nconst PaginationLink = ({ className, isActive, size = \"icon\", ...props }: PaginationLinkProps) => (\n <a\n aria-current={isActive ? \"page\" : undefined}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n);\nPaginationLink.displayName = \"PaginationLink\";\n\nconst PaginationPrevious = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink aria-label=\"Go to previous page\" size=\"md\" className={cn(\"gap-1 pl-2.5\", className)} {...props}>\n <ChevronLeft className=\"h-4 w-4\" />\n <span>Previous</span>\n </PaginationLink>\n);\nPaginationPrevious.displayName = \"PaginationPrevious\";\n\nconst PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink aria-label=\"Go to next page\" size=\"md\" className={cn(\"gap-1 pr-2.5\", className)} {...props}>\n <span>Next</span>\n <ChevronRight className=\"h-4 w-4\" />\n </PaginationLink>\n);\nPaginationNext.displayName = \"PaginationNext\";\n\nconst PaginationEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span aria-hidden className={cn(\"flex h-9 w-9 items-center justify-center\", className)} {...props}>\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n);\nPaginationEllipsis.displayName = \"PaginationEllipsis\";\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport { menuItemClasses } from '../lib/surface-classes';\nimport { Dialog, DialogContent } from './dialog';\n\nconst Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n 'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ninterface CommandDialogProps\n extends React.ComponentPropsWithoutRef<typeof Dialog> {}\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n);\n\nconst CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full rounded-md bg-transparent py-3 text-base sm:text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 h-px bg-border', className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Check, Pencil, X } from 'lucide-react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\nconst editableTitleVariants = cva(\n 'inline-flex items-center gap-2 font-semibold text-foreground',\n {\n variants: {\n size: {\n sm: 'text-lg',\n md: 'text-2xl',\n lg: 'text-4xl',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst editableTitleInputVariants = cva(\n 'bg-transparent border-b-2 border-primary outline-none font-semibold text-foreground w-full min-w-0',\n {\n variants: {\n size: {\n sm: 'text-lg pb-0.5',\n md: 'text-2xl pb-1',\n lg: 'text-4xl pb-1.5',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\n/**\n * Fixed square chrome for edit / confirm / cancel: outer box is identical regardless of glyph.\n * Overrides `Button` `size=\"icon\"` density vars so all three match exactly.\n */\nfunction titleActionButtonClass(size: 'sm' | 'md' | 'lg' | null | undefined) {\n switch (size) {\n case 'sm':\n return 'box-border aspect-square size-6 min-h-6 min-w-6 max-h-6 max-w-6 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-3 [&_svg]:shrink-0';\n case 'lg':\n return 'box-border aspect-square size-10 min-h-10 min-w-10 max-h-10 max-w-10 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-5 [&_svg]:shrink-0';\n default:\n return 'box-border aspect-square size-8 min-h-8 min-w-8 max-h-8 max-w-8 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-4 [&_svg]:shrink-0';\n }\n}\n\n/** Loading affordance: same outer square as action buttons. */\nfunction loadingSpinnerWrapClass(size: 'sm' | 'md' | 'lg' | null | undefined) {\n switch (size) {\n case 'sm':\n return 'box-border size-6 min-h-6 min-w-6 max-h-6 max-w-6 [&_svg]:size-3';\n case 'lg':\n return 'box-border size-10 min-h-10 min-w-10 max-h-10 max-w-10 [&_svg]:size-5';\n default:\n return 'box-border size-8 min-h-8 min-w-8 max-h-8 max-w-8 [&_svg]:size-4';\n }\n}\n\nexport interface EditableTitleProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof editableTitleVariants> {\n /** The current title value */\n value: string;\n /** Callback when the title is saved */\n onSave?: (value: string) => void;\n /** Callback on every keystroke while editing */\n onChange?: (value: string) => void;\n /** Placeholder text when the title is empty */\n placeholder?: string;\n /** Whether the title is editable */\n disabled?: boolean;\n /** Whether a save operation is in progress */\n loading?: boolean;\n /** Maximum character length */\n maxLength?: number;\n}\n\nconst EditableTitle = React.forwardRef<HTMLDivElement, EditableTitleProps>(\n (\n {\n className,\n size,\n value,\n onSave,\n onChange,\n placeholder = 'Untitled',\n disabled = false,\n loading = false,\n maxLength,\n ...props\n },\n ref,\n ) => {\n const [isEditing, setIsEditing] = React.useState(false);\n const [draft, setDraft] = React.useState(value);\n /** Avoids a flash: after save/cancel the pointer often sits where the pen mounts, so hover would show it immediately. */\n const [suppressPenReveal, setSuppressPenReveal] = React.useState(false);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n React.useEffect(() => {\n if (!suppressPenReveal) return;\n const t = window.setTimeout(() => setSuppressPenReveal(false), 200);\n return () => clearTimeout(t);\n }, [suppressPenReveal]);\n\n React.useEffect(() => {\n if (!isEditing) {\n setDraft(value);\n }\n }, [value, isEditing]);\n\n React.useEffect(() => {\n if (isEditing && inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n }, [isEditing]);\n\n const startEditing = () => {\n if (disabled || loading) return;\n setSuppressPenReveal(false);\n setDraft(value);\n setIsEditing(true);\n };\n\n const endEditing = () => {\n setSuppressPenReveal(true);\n setIsEditing(false);\n };\n\n const save = () => {\n const trimmed = draft.trim();\n if (trimmed && trimmed !== value) {\n onSave?.(trimmed);\n }\n endEditing();\n };\n\n const cancel = () => {\n setDraft(value);\n endEditing();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n save();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n cancel();\n }\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n if (maxLength && newValue.length > maxLength) return;\n setDraft(newValue);\n onChange?.(newValue);\n };\n\n if (isEditing) {\n return (\n <div\n ref={ref}\n className={cn(editableTitleVariants({ size }), className)}\n {...props}\n >\n <input\n ref={inputRef}\n type=\"text\"\n value={draft}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onBlur={save}\n placeholder={placeholder}\n maxLength={maxLength}\n className={cn(\n editableTitleInputVariants({ size }),\n 'min-w-0 flex-1',\n )}\n aria-label=\"Edit title\"\n />\n <Button\n type=\"button\"\n variant=\"actionPositive\"\n size=\"icon\"\n className={titleActionButtonClass(size)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={save}\n aria-label=\"Save title\"\n >\n <Check />\n </Button>\n <Button\n type=\"button\"\n variant=\"actionNegative\"\n size=\"icon\"\n className={titleActionButtonClass(size)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={cancel}\n aria-label=\"Cancel editing\"\n >\n <X />\n </Button>\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n className={cn(editableTitleVariants({ size }), 'group', className)}\n {...props}\n >\n <span\n className={cn(\n 'cursor-pointer hover:text-primary transition-colors duration-fast ease-default',\n disabled && 'cursor-default hover:text-foreground',\n loading && 'cursor-wait hover:text-foreground opacity-70',\n )}\n onClick={startEditing}\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n startEditing();\n }\n }}\n aria-label={disabled ? value : `Edit title: ${value}`}\n >\n {value || placeholder}\n </span>\n {!disabled && !loading && (\n <Button\n type=\"button\"\n variant=\"actionNeutral\"\n size=\"icon\"\n className={cn(\n 'transition-opacity duration-fast ease-default',\n titleActionButtonClass(size),\n suppressPenReveal\n ? 'pointer-events-none opacity-0'\n : 'opacity-0 group-hover:opacity-100 group-focus-within:opacity-100',\n )}\n onClick={startEditing}\n tabIndex={-1}\n aria-hidden=\"true\"\n >\n <Pencil />\n </Button>\n )}\n {loading && (\n <span\n className={cn(\n 'inline-flex items-center justify-center shrink-0 rounded-md text-muted-foreground',\n loadingSpinnerWrapClass(size),\n 'animate-spin pointer-events-none',\n )}\n aria-label=\"Saving\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n </span>\n )}\n </div>\n );\n },\n);\nEditableTitle.displayName = 'EditableTitle';\n\nexport { EditableTitle, editableTitleVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { AspectRatio as AspectRatioPrimitive } from \"radix-ui\";\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n","\"use client\";\n\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\n\nfunction Collapsible({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n {...props}\n />\n );\n}\n\nfunction CollapsibleContent({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n {...props}\n />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { PanelLeft } from \"lucide-react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\n\nimport { useIsMobile } from \"../hooks/use-mobile\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Separator } from \"./separator\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"./sheet\";\nimport { Skeleton } from \"./skeleton\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"./tooltip\";\n\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\";\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\nconst SIDEBAR_WIDTH = \"16rem\";\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\";\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\n }\n return context;\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}) {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n const [_open, _setOpen] = React.useState(defaultOpen);\n const open = openProp ?? _open;\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\n },\n [setOpenProp, open]\n );\n\n const toggleSidebar = React.useCallback(() => {\n return isMobile\n ? setOpenMobile((open) => !open)\n : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [toggleSidebar]);\n\n const state = open ? \"expanded\" : \"collapsed\";\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n data-slot=\"sidebar-wrapper\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n}\n\nfunction Sidebar({\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\";\n variant?: \"sidebar\" | \"floating\" | \"inset\";\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === \"none\") {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn(\n \"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n className=\"group peer hidden text-sidebar-foreground md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n \"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\"\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n className={cn(\n \"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className=\"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n}\n\nfunction SidebarTrigger({\n className,\n onClick,\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"size-7\", className)}\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeft />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<\"button\">) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<\"main\">) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex w-full flex-1 flex-col bg-background\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInput({\n className,\n ...props\n}: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn(\"h-8 w-full bg-background shadow-none\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn(\"mx-2 w-auto bg-sidebar-border\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupLabel({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & { asChild?: boolean }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"div\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n data-sidebar=\"group-label\"\n className={cn(\n \"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupAction({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> & { asChild?: boolean }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-action\"\n data-sidebar=\"group-action\"\n className={cn(\n \"absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupContent({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n );\n}\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:p-0!\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nfunction SidebarMenuButton({\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\n} & VariantProps<typeof sidebarMenuButtonVariants>) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n data-slot=\"sidebar-menu-button\"\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n };\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n );\n}\n\nfunction SidebarMenuAction({\n className,\n asChild = false,\n showOnHover = false,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n showOnHover?: boolean;\n}) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-action\"\n data-sidebar=\"menu-action\"\n className={cn(\n \"absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuBadge({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n \"pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSkeleton({\n className,\n showIcon = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showIcon?: boolean;\n}) {\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n );\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n \"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubItem({\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubButton({\n asChild = false,\n size = \"md\",\n isActive = false,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & {\n asChild?: boolean;\n size?: \"sm\" | \"md\";\n isActive?: boolean;\n}) {\n const Comp = asChild ? SlotPrimitive.Slot : \"a\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport type SocialProvider = \"google\" | \"facebook\" | \"github\" | \"apple\";\n\ninterface SocialProvidersProps {\n providers: SocialProvider[];\n onSocialLogin: (provider: SocialProvider) => void;\n loading?: boolean;\n disabled?: boolean;\n className?: string;\n}\n\nconst providerConfig: Record<\n SocialProvider,\n { label: string; icon: React.ReactNode }\n> = {\n google: {\n label: \"Google\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z\"\n fill=\"#4285F4\"\n />\n <path\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n fill=\"#34A853\"\n />\n <path\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n fill=\"#FBBC05\"\n />\n <path\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n fill=\"#EA4335\"\n />\n </svg>\n ),\n },\n facebook: {\n label: \"Facebook\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"#1877F2\">\n <path d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\" />\n </svg>\n ),\n },\n github: {\n label: \"GitHub\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z\" />\n </svg>\n ),\n },\n apple: {\n label: \"Apple\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z\" />\n </svg>\n ),\n },\n};\n\nexport function SocialProviders({\n providers,\n onSocialLogin,\n loading,\n disabled,\n className,\n}: SocialProvidersProps) {\n return (\n <div className={cn(\"grid gap-2\", className)}>\n {providers.map((provider) => {\n const config = providerConfig[provider];\n return (\n <Button\n key={provider}\n variant=\"outline\"\n type=\"button\"\n disabled={loading || disabled}\n onClick={() => onSocialLogin(provider)}\n className=\"w-full\"\n >\n {config.icon}\n <span className=\"ml-2\">Continue with {config.label}</span>\n </Button>\n );\n })}\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport { motion, AnimatePresence } from 'motion/react';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../../components/button';\nimport { CodeInput } from '../../components/code-input';\nimport { Input } from '../../components/input';\nimport { InputGroup } from '../../components/input-group';\nimport { PasswordInput } from '../../components/password-input';\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../../components/card';\nimport { Spinner } from '../../components/spinner';\nimport { FormError } from '../../form/form-error';\nimport { SocialProviders, type SocialProvider } from './social-providers';\nimport { Separator } from '../../components/separator';\n\nexport interface SignInBlockProps {\n onSubmit: (data: { email: string; password: string }) => void | Promise<void>;\n onForgotPassword?: () => void;\n onSocialLogin?: (provider: SocialProvider) => void;\n socialProviders?: SocialProvider[];\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n signUpHref?: string;\n onSignUp?: () => void;\n className?: string;\n /** When provided, replaces the built-in form content. The Card wrapper, header, and footer links are preserved. */\n children?: React.ReactNode;\n /** Callback to request a one-time code. When provided, enables the tabbed Password / OTP layout. */\n onOtpRequest?: (email: string) => Promise<{ session: string }>;\n /** Callback to verify a one-time code and complete login. */\n onOtpVerify?: (data: {\n email: string;\n code: string;\n session: string;\n }) => Promise<void>;\n /** Label for the OTP tab trigger. @default \"Email me a code\" */\n otpLabel?: string;\n /** Fires when the user switches between the password and OTP tabs. Useful for clearing parent-owned error state so stale errors do not persist across tabs. */\n onTabChange?: (tab: 'password' | 'otp') => void;\n}\n\ntype OtpStep = 'email' | 'code';\n\nconst AUTH_TABS = { PASSWORD: 'password', OTP: 'otp' } as const;\ntype AuthTab = (typeof AUTH_TABS)[keyof typeof AUTH_TABS];\n\nfunction PillTabs({\n activeTab,\n onTabChange,\n otpLabel,\n}: {\n activeTab: AuthTab;\n onTabChange: (tab: AuthTab) => void;\n otpLabel: string;\n}) {\n const tabs = [\n { value: AUTH_TABS.PASSWORD, label: 'Password' },\n { value: AUTH_TABS.OTP, label: otpLabel },\n ];\n\n return (\n <div className=\"relative flex rounded-md bg-muted p-1\">\n {tabs.map((tab) => (\n <button\n key={tab.value}\n type=\"button\"\n onClick={() => onTabChange(tab.value)}\n className={cn(\n 'relative z-10 flex-1 rounded-sm px-3 py-1.5 text-sm font-medium transition-colors',\n activeTab === tab.value\n ? 'text-primary-foreground'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {activeTab === tab.value && (\n <motion.div\n layoutId=\"sign-in-tab-pill\"\n className=\"absolute inset-0 rounded-sm bg-primary shadow-sm\"\n transition={{ type: 'spring', bounce: 0.15, duration: 0.4 }}\n />\n )}\n <span className=\"relative z-10\">{tab.label}</span>\n </button>\n ))}\n </div>\n );\n}\n\nfunction OtpForm({\n onOtpRequest,\n onOtpVerify,\n loading = false,\n disabled = false,\n}: {\n onOtpRequest: (email: string) => Promise<{ session: string }>;\n onOtpVerify: (data: {\n email: string;\n code: string;\n session: string;\n }) => Promise<void>;\n loading?: boolean;\n disabled?: boolean;\n}) {\n const [step, setStep] = React.useState<OtpStep>('email');\n const [email, setEmail] = React.useState('');\n const [session, setSession] = React.useState('');\n const [otpLoading, setOtpLoading] = React.useState(false);\n const [otpError, setOtpError] = React.useState<string | undefined>();\n\n const isLoading = loading || otpLoading;\n const displayError = otpError;\n\n const handleEmailSubmit = async (\n e: React.SyntheticEvent<HTMLFormElement>,\n ) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n const emailValue = formData.get('otp-email') as string;\n setOtpError(undefined);\n setOtpLoading(true);\n\n try {\n const result = await onOtpRequest(emailValue);\n setEmail(emailValue);\n setSession(result.session);\n setStep('code');\n } catch (err) {\n setOtpError(\n err instanceof Error\n ? err.message\n : 'Failed to send code. Please try again.',\n );\n } finally {\n setOtpLoading(false);\n }\n };\n\n if (step === 'code') {\n return (\n <>\n <FormError message={displayError} />\n <div className=\"space-y-4\">\n <div className=\"text-center text-sm text-muted-foreground\">\n We sent a 6-digit code to <strong>{email}</strong>\n </div>\n <CodeInput\n length={6}\n loading={isLoading}\n disabled={disabled}\n onComplete={(fullCode) => {\n setOtpLoading(true);\n setOtpError(undefined);\n onOtpVerify({ email, code: fullCode, session })\n .catch((err) =>\n setOtpError(\n err instanceof Error\n ? err.message\n : 'Invalid or expired code. Please try again.',\n ),\n )\n .finally(() => setOtpLoading(false));\n }}\n />\n {isLoading && (\n <div className=\"flex justify-center\">\n <Spinner size=\"sm\" />\n </div>\n )}\n <button\n type=\"button\"\n className=\"w-full text-center text-sm text-muted-foreground hover:text-foreground\"\n onClick={() => {\n setStep('email');\n setOtpError(undefined);\n }}\n >\n Use a different email\n </button>\n </div>\n </>\n );\n }\n\n return (\n <>\n <FormError message={displayError} />\n <form onSubmit={handleEmailSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"otp-email\">\n <Input\n id=\"otp-email\"\n name=\"otp-email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={isLoading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n variant=\"default\"\n className=\"w-full\"\n loading={isLoading}\n disabled={disabled}\n >\n Send Login Code\n </Button>\n </form>\n </>\n );\n}\n\nexport function SignInBlock({\n onSubmit,\n onForgotPassword,\n onSocialLogin,\n socialProviders = [],\n loading = false,\n error,\n disabled = false,\n title = 'Sign in',\n description = 'Enter your credentials to access your account',\n signUpHref,\n onSignUp,\n className,\n children,\n onOtpRequest,\n onOtpVerify,\n otpLabel = 'Email me a code',\n onTabChange,\n}: SignInBlockProps) {\n const [activeTab, setActiveTab] = React.useState<AuthTab>(AUTH_TABS.PASSWORD);\n const otpEnabled = Boolean(onOtpRequest && onOtpVerify);\n\n const handleTabChange = React.useCallback(\n (tab: AuthTab) => {\n setActiveTab(tab);\n onTabChange?.(tab);\n },\n [onTabChange],\n );\n\n // Stale parent-owned errors should not bleed across tab switches\n // (for example, a failed password attempt's \"Invalid email or password\"\n // alert must not appear under the OTP tab). We track which tab the\n // current `error` was set on and only render it when that tab is active.\n const [errorTab, setErrorTab] = React.useState<AuthTab | null>(\n error ? AUTH_TABS.PASSWORD : null,\n );\n const previousErrorRef = React.useRef<string | undefined>(error);\n React.useEffect(() => {\n if (error !== previousErrorRef.current) {\n previousErrorRef.current = error;\n setErrorTab(error ? activeTab : null);\n }\n }, [error, activeTab]);\n const visibleError = errorTab === activeTab ? error : undefined;\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n email: formData.get('email') as string,\n password: formData.get('password') as string,\n });\n };\n\n const passwordForm = (\n <>\n <FormError message={visibleError} />\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <InputGroup label=\"Password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"current-password\"\n />\n {onForgotPassword && (\n <div className=\"flex justify-end\">\n <button\n type=\"button\"\n onClick={onForgotPassword}\n className=\"text-sm text-primary hover:underline\"\n tabIndex={-1}\n >\n Forgot password?\n </button>\n </div>\n )}\n </InputGroup>\n\n <Button\n type=\"submit\"\n variant=\"default\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Sign in\n </Button>\n </form>\n </>\n );\n\n const socialSection = socialProviders.length > 0 && onSocialLogin && (\n <>\n <div className=\"relative\">\n <div className=\"absolute inset-0 flex items-center\">\n <Separator className=\"w-full\" />\n </div>\n <div className=\"relative flex justify-center text-xs uppercase\">\n <span className=\"bg-card px-2 text-muted-foreground\">or</span>\n </div>\n </div>\n <SocialProviders\n providers={socialProviders}\n onSocialLogin={onSocialLogin}\n loading={loading}\n disabled={disabled}\n />\n </>\n );\n\n const footerLinks = (\n <>\n {(signUpHref || onSignUp) && (\n <p className=\"text-center text-sm text-muted-foreground\">\n Don't have an account?{' '}\n {onSignUp ? (\n <button\n type=\"button\"\n onClick={onSignUp}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign up\n </button>\n ) : (\n <a\n href={signUpHref}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign up\n </a>\n )}\n </p>\n )}\n </>\n );\n\n return (\n <Card className={cn('w-full max-w-md mx-auto', className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {children ? (\n children\n ) : otpEnabled ? (\n <>\n <PillTabs\n activeTab={activeTab}\n onTabChange={handleTabChange}\n otpLabel={otpLabel}\n />\n <motion.div\n layout\n transition={{ type: 'spring', bounce: 0, duration: 0.4 }}\n className=\"\"\n >\n <AnimatePresence mode=\"wait\" initial={false}>\n {activeTab === AUTH_TABS.PASSWORD ? (\n <motion.div\n key=\"password\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"space-y-4\"\n >\n {passwordForm}\n </motion.div>\n ) : (\n <motion.div\n key=\"otp\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"space-y-4\"\n >\n <OtpForm\n onOtpRequest={onOtpRequest!}\n onOtpVerify={onOtpVerify!}\n loading={loading}\n disabled={disabled}\n />\n </motion.div>\n )}\n </AnimatePresence>\n </motion.div>\n </>\n ) : (\n passwordForm\n )}\n\n {socialSection}\n {footerLinks}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { InputGroup } from \"../../components/input-group\";\nimport { PasswordInput } from \"../../components/password-input\";\nimport { Checkbox } from \"../../components/checkbox\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\nimport { SocialProviders, type SocialProvider } from \"./social-providers\";\nimport { Separator } from \"../../components/separator\";\n\nexport interface SignUpBlockProps {\n onSubmit: (data: {\n firstName: string;\n lastName: string;\n email: string;\n password: string;\n confirmPassword: string;\n termsAccepted: boolean;\n }) => void | Promise<void>;\n onSocialLogin?: (provider: SocialProvider) => void;\n socialProviders?: SocialProvider[];\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n signInHref?: string;\n onSignIn?: () => void;\n termsHref?: string;\n privacyHref?: string;\n className?: string;\n}\n\nexport function SignUpBlock({\n onSubmit,\n onSocialLogin,\n socialProviders = [],\n loading = false,\n error,\n disabled = false,\n title = \"Create an account\",\n description = \"Enter your details to get started\",\n signInHref,\n onSignIn,\n termsHref = \"#\",\n privacyHref = \"#\",\n className,\n}: SignUpBlockProps) {\n const [termsAccepted, setTermsAccepted] = React.useState(false);\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n firstName: (formData.get(\"firstName\") as string) ?? \"\",\n lastName: (formData.get(\"lastName\") as string) ?? \"\",\n email: formData.get(\"email\") as string,\n password: formData.get(\"password\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n termsAccepted,\n });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {socialProviders.length > 0 && onSocialLogin && (\n <>\n <SocialProviders\n providers={socialProviders}\n onSocialLogin={onSocialLogin}\n loading={loading}\n disabled={disabled}\n />\n <div className=\"relative\">\n <div className=\"absolute inset-0 flex items-center\">\n <Separator className=\"w-full\" />\n </div>\n <div className=\"relative flex justify-center text-xs uppercase\">\n <span className=\"bg-card px-2 text-muted-foreground\">\n Or continue with\n </span>\n </div>\n </div>\n </>\n )}\n\n <FormError message={error} />\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"First name\" htmlFor=\"firstName\">\n <Input\n id=\"firstName\"\n name=\"firstName\"\n placeholder=\"Jane\"\n required\n disabled={loading || disabled}\n autoComplete=\"given-name\"\n />\n </InputGroup>\n <InputGroup label=\"Last name\" htmlFor=\"lastName\">\n <Input\n id=\"lastName\"\n name=\"lastName\"\n placeholder=\"Doe\"\n required\n disabled={loading || disabled}\n autoComplete=\"family-name\"\n />\n </InputGroup>\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <InputGroup label=\"Password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <InputGroup label=\"Confirm password\" htmlFor=\"confirmPassword\">\n <PasswordInput\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n\n <div className=\"flex items-start space-x-2\">\n <Checkbox\n id=\"terms\"\n checked={termsAccepted}\n onCheckedChange={(checked) =>\n setTermsAccepted(checked === true)\n }\n disabled={loading || disabled}\n className=\"mt-0.5\"\n />\n <label\n htmlFor=\"terms\"\n className=\"text-sm text-muted-foreground cursor-pointer\"\n >\n I agree to the{\" \"}\n <a href={termsHref} className=\"text-primary hover:underline\">\n terms of service\n </a>{\" \"}\n and{\" \"}\n <a href={privacyHref} className=\"text-primary hover:underline\">\n privacy policy\n </a>\n </label>\n </div>\n\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled || !termsAccepted}\n >\n Create account\n </Button>\n </form>\n\n {(signInHref || onSignIn) && (\n <p className=\"text-center text-sm text-muted-foreground\">\n Already have an account?{\" \"}\n {onSignIn ? (\n <button\n type=\"button\"\n onClick={onSignIn}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign in\n </button>\n ) : (\n <a\n href={signInHref}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign in\n </a>\n )}\n </p>\n )}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowLeft, Mail } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { InputGroup } from \"../../components/input-group\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ForgotPasswordBlockProps {\n onSubmit: (data: { email: string }) => void | Promise<void>;\n onBack?: () => void;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n success?: boolean;\n title?: string;\n description?: string;\n className?: string;\n}\n\nexport function ForgotPasswordBlock({\n onSubmit,\n onBack,\n loading = false,\n error,\n disabled = false,\n success = false,\n title = \"Forgot password\",\n description = \"Enter your email and we'll send you a reset link\",\n className,\n}: ForgotPasswordBlockProps) {\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({ email: formData.get(\"email\") as string });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n {success ? (\n <>\n <div className=\"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10\">\n <Mail className=\"h-6 w-6 text-primary\" />\n </div>\n <CardTitle>Check your email</CardTitle>\n <CardDescription>\n We've sent a password reset link to your email address.\n </CardDescription>\n </>\n ) : (\n <>\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </>\n )}\n </CardHeader>\n {!success && (\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Send reset link\n </Button>\n </form>\n {onBack && (\n <button\n type=\"button\"\n onClick={onBack}\n className=\"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Back to sign in\n </button>\n )}\n </div>\n </CardContent>\n )}\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { InputGroup } from \"../../components/input-group\";\nimport { PasswordInput } from \"../../components/password-input\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ResetPasswordBlockProps {\n onSubmit: (data: {\n password: string;\n confirmPassword: string;\n }) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n className?: string;\n}\n\nexport function ResetPasswordBlock({\n onSubmit,\n loading = false,\n error,\n disabled = false,\n title = \"Reset password\",\n description = \"Enter your new password below\",\n className,\n}: ResetPasswordBlockProps) {\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n password: formData.get(\"password\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"New password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <InputGroup label=\"Confirm new password\" htmlFor=\"confirmPassword\">\n <PasswordInput\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Reset password\n </Button>\n </form>\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { Spinner } from \"../../components/spinner\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface VerifyBlockProps {\n onVerify: (code: string) => void | Promise<void>;\n onResend?: () => void | Promise<void>;\n codeLength?: number;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n resendCooldown?: number;\n className?: string;\n}\n\nexport function VerifyBlock({\n onVerify,\n onResend,\n codeLength = 6,\n loading = false,\n error,\n disabled = false,\n title = \"Verify your account\",\n description = \"Enter the verification code sent to your email\",\n resendCooldown = 60,\n className,\n}: VerifyBlockProps) {\n const [code, setCode] = React.useState<string[]>(Array(codeLength).fill(\"\"));\n const [countdown, setCountdown] = React.useState(0);\n const inputRefs = React.useRef<(HTMLInputElement | null)[]>([]);\n\n React.useEffect(() => {\n if (countdown > 0) {\n const timer = setTimeout(() => setCountdown(countdown - 1), 1000);\n return () => clearTimeout(timer);\n }\n }, [countdown]);\n\n const handleChange = (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n const newCode = [...code];\n newCode[index] = value.slice(-1);\n setCode(newCode);\n\n if (value && index < codeLength - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n\n const fullCode = newCode.join(\"\");\n if (fullCode.length === codeLength && newCode.every(Boolean)) {\n onVerify(fullCode);\n }\n };\n\n const handleKeyDown = (index: number, e: React.KeyboardEvent) => {\n if (e.key === \"Backspace\" && !code[index] && index > 0) {\n inputRefs.current[index - 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pasted = e.clipboardData.getData(\"text\").replace(/\\D/g, \"\").slice(0, codeLength);\n const newCode = [...code];\n for (let i = 0; i < pasted.length; i++) {\n newCode[i] = pasted[i];\n }\n setCode(newCode);\n if (pasted.length === codeLength) {\n onVerify(pasted);\n } else {\n inputRefs.current[pasted.length]?.focus();\n }\n };\n\n const handleResend = async () => {\n setCountdown(resendCooldown);\n await onResend?.();\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <div className=\"flex justify-center gap-2\" onPaste={handlePaste}>\n {code.map((digit, index) => (\n <Input\n key={index}\n ref={(el) => { inputRefs.current[index] = el; }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onChange={(e) => handleChange(index, e.target.value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n disabled={loading || disabled}\n className=\"h-12 w-12 text-center text-lg font-semibold\"\n autoFocus={index === 0}\n />\n ))}\n </div>\n\n {loading && (\n <div className=\"flex justify-center\">\n <Spinner size=\"sm\" />\n </div>\n )}\n\n {onResend && (\n <div className=\"text-center\">\n {countdown > 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n Resend code in {countdown}s\n </p>\n ) : (\n <Button variant=\"ghost\" size=\"sm\" onClick={handleResend} disabled={loading || disabled}>\n Resend code\n </Button>\n )}\n </div>\n )}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { FileQuestion } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface NotFoundBlockProps {\n title?: string;\n message?: string;\n homeHref?: string;\n onGoHome?: () => void;\n className?: string;\n}\n\nexport function NotFoundBlock({\n title = \"Page not found\",\n message = \"Sorry, we couldn't find the page you're looking for. It may have been moved or deleted.\",\n homeHref = \"/\",\n onGoHome,\n className,\n}: NotFoundBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-muted\">\n <FileQuestion className=\"h-12 w-12 text-muted-foreground\" />\n </div>\n <h1 className=\"text-4xl font-bold tracking-tight mb-2\">404</h1>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-8\">{message}</p>\n {onGoHome ? (\n <Button onClick={onGoHome}>Go back home</Button>\n ) : (\n <Button asChild>\n <a href={homeHref}>Go back home</a>\n </Button>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Server } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface ServerErrorBlockProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n homeHref?: string;\n onGoHome?: () => void;\n className?: string;\n}\n\nexport function ServerErrorBlock({\n title = \"Something went wrong\",\n message = \"An unexpected error occurred. Our team has been notified and is working on a fix.\",\n onRetry,\n homeHref = \"/\",\n onGoHome,\n className,\n}: ServerErrorBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-destructive/10\">\n <Server className=\"h-12 w-12 text-destructive\" />\n </div>\n <h1 className=\"text-4xl font-bold tracking-tight mb-2\">500</h1>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-8\">{message}</p>\n <div className=\"flex gap-3\">\n {onRetry && (\n <Button onClick={onRetry}>Try again</Button>\n )}\n {onGoHome ? (\n <Button variant=\"outline\" onClick={onGoHome}>Go home</Button>\n ) : (\n <Button variant=\"outline\" asChild>\n <a href={homeHref}>Go home</a>\n </Button>\n )}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Wrench } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface MaintenanceBlockProps {\n title?: string;\n message?: string;\n estimatedReturn?: string;\n className?: string;\n}\n\nexport function MaintenanceBlock({\n title = \"Under maintenance\",\n message = \"We're performing scheduled maintenance to improve your experience. We'll be back shortly.\",\n estimatedReturn,\n className,\n}: MaintenanceBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-muted\">\n <Wrench className=\"h-12 w-12 text-muted-foreground\" />\n </div>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-4\">{message}</p>\n {estimatedReturn && (\n <p className=\"text-sm text-muted-foreground\">\n Estimated return: <span className=\"font-medium text-foreground\">{estimatedReturn}</span>\n </p>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Inbox } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface EmptyStateBlockProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Icon to render inside the centered circle. Pass any React node\n * (`<FontAwesomeIcon … />`, a Lucide icon, an inline SVG, etc.). Defaults to\n * a Lucide `Inbox` glyph.\n */\n icon?: React.ReactNode;\n title?: string;\n description?: string;\n actionLabel?: string;\n onAction?: () => void;\n}\n\nconst EmptyStateBlock = React.forwardRef<HTMLDivElement, EmptyStateBlockProps>(\n (\n {\n icon,\n title = \"No results found\",\n description = \"There's nothing here yet. Get started by creating your first item.\",\n actionLabel,\n onAction,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div ref={ref} className={cn(\"flex flex-col items-center justify-center text-center py-16 px-4\", className)} {...props}>\n <div className=\"mb-6 flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground [&_svg]:h-8 [&_svg]:w-8\">\n {icon ?? <Inbox />}\n </div>\n <h3 className=\"text-lg font-semibold mb-1\">{title}</h3>\n <p className=\"text-sm text-muted-foreground max-w-sm mb-6\">{description}</p>\n {actionLabel && onAction && (\n <Button onClick={onAction}>{actionLabel}</Button>\n )}\n </div>\n );\n }\n);\nEmptyStateBlock.displayName = \"EmptyStateBlock\";\n\nexport { EmptyStateBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface PageShellProps {\n children: React.ReactNode;\n sidebar?: React.ReactNode;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n sidebarWidth?: string;\n sidebarCollapsed?: boolean;\n className?: string;\n}\n\nexport function PageShell({\n children,\n sidebar,\n header,\n footer,\n sidebarWidth = \"16rem\",\n sidebarCollapsed = false,\n className,\n}: PageShellProps) {\n return (\n <div className={cn(\"flex min-h-screen flex-col\", className)}>\n {header}\n <div className=\"flex flex-1\">\n {sidebar && (\n <aside\n className={cn(\n \"hidden border-r bg-card transition-all duration-normal ease-default md:block\",\n sidebarCollapsed && \"w-16\"\n )}\n style={sidebarCollapsed ? undefined : { width: sidebarWidth }}\n >\n {sidebar}\n </aside>\n )}\n <main className=\"flex-1 overflow-auto\">{children}</main>\n </div>\n {footer}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Menu } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface HeaderBlockProps {\n logo?: React.ReactNode;\n nav?: React.ReactNode;\n actions?: React.ReactNode;\n onMenuToggle?: () => void;\n sticky?: boolean;\n className?: string;\n}\n\nexport function HeaderBlock({\n logo,\n nav,\n actions,\n onMenuToggle,\n sticky = true,\n className,\n}: HeaderBlockProps) {\n return (\n <header\n className={cn(\n \"flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6\",\n sticky && \"sticky top-0 z-[var(--z-sticky)]\",\n className\n )}\n >\n {onMenuToggle && (\n <Button variant=\"ghost\" size=\"icon\" className=\"md:hidden\" onClick={onMenuToggle}>\n <Menu className=\"h-5 w-5\" />\n <span className=\"sr-only\">Toggle menu</span>\n </Button>\n )}\n {logo && <div className=\"flex items-center gap-2 font-semibold\">{logo}</div>}\n {nav && <nav className=\"hidden md:flex items-center gap-6 text-sm font-medium flex-1\">{nav}</nav>}\n {actions && <div className=\"ml-auto flex items-center gap-2\">{actions}</div>}\n </header>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface SidebarItem {\n label: string;\n href?: string;\n icon?: React.ReactNode;\n active?: boolean;\n onClick?: () => void;\n children?: SidebarItem[];\n}\n\nexport interface SidebarSection {\n title?: string;\n items: SidebarItem[];\n}\n\nexport interface SidebarBlockProps {\n sections: SidebarSection[];\n header?: React.ReactNode;\n footer?: React.ReactNode;\n collapsed?: boolean;\n className?: string;\n}\n\nfunction SidebarItemComponent({ item, collapsed }: { item: SidebarItem; collapsed?: boolean }) {\n const Comp = item.href ? \"a\" : \"button\";\n return (\n <Comp\n href={item.href}\n onClick={item.onClick}\n className={cn(\n \"flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\",\n item.active && \"bg-accent text-accent-foreground\",\n collapsed && \"justify-center px-2\"\n )}\n >\n {item.icon && <span className=\"flex h-5 w-5 shrink-0 items-center justify-center\">{item.icon}</span>}\n {!collapsed && <span>{item.label}</span>}\n </Comp>\n );\n}\n\nexport function SidebarBlock({\n sections,\n header,\n footer,\n collapsed = false,\n className,\n}: SidebarBlockProps) {\n return (\n <div className={cn(\"flex h-full flex-col\", className)}>\n {header && (\n <div className={cn(\"border-b p-4\", collapsed && \"p-2\")}>{header}</div>\n )}\n <nav className=\"flex-1 space-y-4 overflow-y-auto p-4\">\n {sections.map((section, sIdx) => (\n <div key={sIdx} className=\"space-y-1\">\n {section.title && !collapsed && (\n <p className=\"px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {section.title}\n </p>\n )}\n {section.items.map((item, iIdx) => (\n <SidebarItemComponent key={iIdx} item={item} collapsed={collapsed} />\n ))}\n </div>\n ))}\n </nav>\n {footer && (\n <div className={cn(\"border-t p-4\", collapsed && \"p-2\")}>{footer}</div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface FooterLink {\n label: string;\n href: string;\n}\n\nexport interface FooterBlockProps {\n copyright?: string;\n links?: FooterLink[];\n logo?: React.ReactNode;\n className?: string;\n}\n\nexport function FooterBlock({\n copyright,\n links = [],\n logo,\n className,\n}: FooterBlockProps) {\n return (\n <footer className={cn(\"border-t bg-background\", className)}>\n <div className=\"flex flex-col items-center gap-4 px-4 py-6 md:flex-row md:justify-between md:px-6\">\n <div className=\"flex items-center gap-2\">\n {logo}\n {copyright && (\n <p className=\"text-sm text-muted-foreground\">{copyright}</p>\n )}\n </div>\n {links.length > 0 && (\n <nav className=\"flex gap-4\">\n {links.map((link) => (\n <a\n key={link.href}\n href={link.href}\n className=\"text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n {link.label}\n </a>\n ))}\n </nav>\n )}\n </div>\n </footer>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronsUpDown, Plus } from \"lucide-react\";\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuTrigger,\n} from \"../../../components/dropdown-menu\";\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"../../../components/sidebar\";\nimport type { SidebarTeam } from \"./types\";\n\nexport interface TeamSwitcherProps {\n teams: SidebarTeam[];\n activeTeam?: SidebarTeam;\n onTeamChange?: (team: SidebarTeam) => void;\n onAddTeam?: () => void;\n}\n\nexport function TeamSwitcher({\n teams,\n activeTeam: activeTeamProp,\n onTeamChange,\n onAddTeam,\n}: TeamSwitcherProps) {\n const { isMobile } = useSidebar();\n const [internalActive, setInternalActive] = React.useState(teams[0]);\n const activeTeam = activeTeamProp ?? internalActive;\n\n if (!activeTeam) {\n return null;\n }\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n size=\"lg\"\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n <activeTeam.logo className=\"size-4\" />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">\n {activeTeam.name}\n </span>\n <span className=\"truncate text-xs\">{activeTeam.plan}</span>\n </div>\n <ChevronsUpDown className=\"ml-auto\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n align=\"start\"\n side={isMobile ? \"bottom\" : \"right\"}\n sideOffset={4}\n >\n <DropdownMenuLabel className=\"text-xs text-muted-foreground\">\n Teams\n </DropdownMenuLabel>\n {teams.map((team, index) => (\n <DropdownMenuItem\n key={team.name}\n onClick={() => {\n setInternalActive(team);\n onTeamChange?.(team);\n }}\n className=\"gap-2 p-2\"\n >\n <div className=\"flex size-6 items-center justify-center rounded-md border\">\n <team.logo className=\"size-3.5 shrink-0\" />\n </div>\n {team.name}\n <DropdownMenuShortcut>\n {\"⌘\"}\n {index + 1}\n </DropdownMenuShortcut>\n </DropdownMenuItem>\n ))}\n {onAddTeam && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem className=\"gap-2 p-2\" onClick={onAddTeam}>\n <div className=\"flex size-6 items-center justify-center rounded-md border bg-transparent\">\n <Plus className=\"size-4\" />\n </div>\n <div className=\"font-medium text-muted-foreground\">\n Add team\n </div>\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n}\n","\"use client\";\n\nimport { ChevronRight } from \"lucide-react\";\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../../components/collapsible\";\nimport {\n SidebarGroup,\n SidebarGroupLabel,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n} from \"../../../components/sidebar\";\nimport type { SidebarNavGroup } from \"./types\";\n\nexport interface SidebarNavProps {\n groups: SidebarNavGroup[];\n}\n\nexport function SidebarNav({ groups }: SidebarNavProps) {\n return (\n <>\n {groups.map((group, groupIdx) => (\n <SidebarGroup key={group.label ?? groupIdx}>\n {group.label && <SidebarGroupLabel>{group.label}</SidebarGroupLabel>}\n <SidebarMenu>\n {group.items.map((item) => {\n if (item.items && item.items.length > 0) {\n return (\n <Collapsible\n key={item.title}\n asChild\n defaultOpen={item.isActive}\n className=\"group/collapsible\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton tooltip={item.title}>\n {item.icon}\n <span>{item.title}</span>\n <ChevronRight className=\"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90\" />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n {item.items.map((subItem) => (\n <SidebarMenuSubItem key={subItem.title}>\n <SidebarMenuSubButton\n asChild\n isActive={subItem.isActive}\n >\n <a\n href={subItem.url}\n onClick={(e) => {\n if (subItem.onClick) {\n e.preventDefault();\n subItem.onClick();\n }\n }}\n >\n <span>{subItem.title}</span>\n </a>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </CollapsibleContent>\n </SidebarMenuItem>\n </Collapsible>\n );\n }\n\n return (\n <SidebarMenuItem key={item.title}>\n <SidebarMenuButton\n asChild\n tooltip={item.title}\n isActive={item.isActive}\n >\n <a\n href={item.url}\n onClick={(e) => {\n if (item.onClick) {\n e.preventDefault();\n item.onClick();\n }\n }}\n >\n {item.icon}\n <span>{item.title}</span>\n </a>\n </SidebarMenuButton>\n </SidebarMenuItem>\n );\n })}\n </SidebarMenu>\n </SidebarGroup>\n ))}\n </>\n );\n}\n","\"use client\";\n\nimport { ChevronsUpDown, LogOut } from \"lucide-react\";\n\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"../../../components/avatar\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../../../components/dropdown-menu\";\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"../../../components/sidebar\";\nimport type { SidebarUser, SidebarUserMenuItem } from \"./types\";\n\nexport interface SidebarUserNavProps {\n user: SidebarUser;\n menuGroups?: SidebarUserMenuItem[][];\n onLogout: () => void;\n}\n\nfunction getInitials(name: string): string {\n return name\n .split(\" \")\n .map((part) => part[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2);\n}\n\nexport function SidebarUserNav({\n user,\n menuGroups,\n onLogout,\n}: SidebarUserNavProps) {\n const { isMobile } = useSidebar();\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n size=\"lg\"\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <Avatar className=\"h-8 w-8 rounded-lg\">\n {user.avatar && (\n <AvatarImage src={user.avatar} alt={user.name} />\n )}\n <AvatarFallback className=\"rounded-lg\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n <ChevronsUpDown className=\"ml-auto size-4\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n side={isMobile ? \"bottom\" : \"right\"}\n align=\"end\"\n sideOffset={4}\n >\n <DropdownMenuLabel className=\"p-0 font-normal\">\n <div className=\"flex items-center gap-2 px-1 py-1.5 text-left text-sm\">\n <Avatar className=\"h-8 w-8 rounded-lg\">\n {user.avatar && (\n <AvatarImage src={user.avatar} alt={user.name} />\n )}\n <AvatarFallback className=\"rounded-lg\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n </div>\n </DropdownMenuLabel>\n {menuGroups?.map((group, groupIdx) => (\n <span key={groupIdx}>\n <DropdownMenuSeparator />\n <DropdownMenuGroup>\n {group.map((item) => (\n <DropdownMenuItem key={item.label} onClick={item.onClick}>\n {item.icon}\n {item.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </span>\n ))}\n <DropdownMenuSeparator />\n <DropdownMenuItem onClick={onLogout}>\n <LogOut />\n Log out\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarRail,\n} from \"../../../components/sidebar\";\nimport { TeamSwitcher } from \"./team-switcher\";\nimport { SidebarNav } from \"./sidebar-nav\";\nimport { SidebarUserNav } from \"./sidebar-user\";\nimport type {\n SidebarTeam,\n SidebarNavGroup,\n SidebarUser,\n SidebarUserMenuItem,\n} from \"./types\";\n\nexport interface AppSidebarBlockProps\n extends React.ComponentProps<typeof Sidebar> {\n /** One or more teams displayed in the header switcher */\n teams: SidebarTeam[];\n /** Currently active team (defaults to first team) */\n activeTeam?: SidebarTeam;\n /** Called when user switches teams */\n onTeamChange?: (team: SidebarTeam) => void;\n /** Called when \"Add team\" is clicked — omit to hide the button */\n onAddTeam?: () => void;\n\n /** Flexible navigation groups rendered in the sidebar body */\n navGroups?: SidebarNavGroup[];\n\n /** User info displayed in the footer */\n user: SidebarUser;\n /** Optional grouped menu items in the user dropdown (e.g. Account, Billing) */\n userMenuGroups?: SidebarUserMenuItem[][];\n /** Called on logout — always rendered */\n onLogout: () => void;\n}\n\nexport function AppSidebarBlock({\n teams,\n activeTeam,\n onTeamChange,\n onAddTeam,\n navGroups,\n user,\n userMenuGroups,\n onLogout,\n ...sidebarProps\n}: AppSidebarBlockProps) {\n return (\n <Sidebar collapsible=\"icon\" {...sidebarProps}>\n <SidebarHeader>\n <TeamSwitcher\n teams={teams}\n activeTeam={activeTeam}\n onTeamChange={onTeamChange}\n onAddTeam={onAddTeam}\n />\n </SidebarHeader>\n <SidebarContent>\n {navGroups && navGroups.length > 0 && (\n <SidebarNav groups={navGroups} />\n )}\n </SidebarContent>\n <SidebarFooter>\n <SidebarUserNav\n user={user}\n menuGroups={userMenuGroups}\n onLogout={onLogout}\n />\n </SidebarFooter>\n <SidebarRail />\n </Sidebar>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowRight, Image as ImageIcon } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n CardDescription,\n} from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { Button } from \"../../components/button\";\nimport { AspectRatio } from \"../../components/aspect-ratio\";\n\nexport interface MediaCardMeta {\n /**\n * Optional icon for the meta row. Pass any React node (`<FontAwesomeIcon … />`,\n * a Lucide icon, an inline SVG, etc.).\n */\n icon?: React.ReactNode;\n label: string;\n}\n\nexport interface MediaCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Cover image source and alt text */\n image?: { src: string; alt: string };\n /**\n * Icon displayed when no image is provided. Pass any React node. Defaults to\n * a Lucide `Image` glyph.\n */\n fallbackIcon?: React.ReactNode;\n /** Optional badge shown over the image area */\n badge?: string;\n /** Card title */\n title: string;\n /** Card description */\n description?: string;\n /** Metadata items rendered below the description */\n meta?: MediaCardMeta[];\n /** Footer text rendered as a CTA link/button */\n footer?: string;\n /** URL for the card link / CTA */\n href?: string;\n /** Click handler for the CTA (used when no href is provided) */\n onAction?: () => void;\n /** Loading state */\n loading?: boolean;\n /** Disabled state */\n disabled?: boolean;\n}\n\nconst MediaCard = React.forwardRef<HTMLDivElement, MediaCardProps>(\n (\n {\n image,\n fallbackIcon,\n badge,\n title,\n description,\n meta,\n footer,\n href,\n onAction,\n loading,\n disabled,\n className,\n ...props\n },\n ref,\n ) => {\n const Wrapper = href ? \"a\" : \"div\";\n const wrapperProps = href\n ? {\n href,\n className:\n \"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 rounded-lg\",\n }\n : {};\n\n return (\n <Wrapper {...wrapperProps}>\n <Card\n ref={ref}\n className={cn(\n \"overflow-hidden transition-shadow duration-normal ease-default\",\n href && \"hover:shadow-md\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n {...props}\n >\n {/* Image / Fallback area */}\n <div className=\"relative\">\n <AspectRatio ratio={16 / 9}>\n {image ? (\n <img\n src={image.src}\n alt={image.alt}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-muted text-muted-foreground [&_svg]:h-10 [&_svg]:w-10\">\n {fallbackIcon ?? <ImageIcon />}\n </div>\n )}\n </AspectRatio>\n {badge && (\n <div className=\"absolute top-2 right-2\">\n <Badge variant=\"secondary\">{badge}</Badge>\n </div>\n )}\n </div>\n\n {/* Content */}\n <CardHeader>\n <CardTitle className=\"text-lg\">{title}</CardTitle>\n {description && <CardDescription>{description}</CardDescription>}\n </CardHeader>\n\n {/* Meta items */}\n {meta && meta.length > 0 && (\n <CardContent>\n <div className=\"flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground\">\n {meta.map((item, i) => (\n <span\n key={i}\n className=\"inline-flex items-center gap-1.5 [&_svg]:h-3.5 [&_svg]:w-3.5\"\n >\n {item.icon}\n {item.label}\n </span>\n ))}\n </div>\n </CardContent>\n )}\n\n {/* Footer CTA */}\n {footer && (\n <CardFooter>\n {href ? (\n <span className=\"inline-flex items-center gap-1.5 text-sm font-medium text-primary\">\n {footer}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </span>\n ) : (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onAction}\n disabled={disabled || loading}\n className=\"gap-1.5 px-0 text-primary hover:text-primary/80\"\n >\n {footer}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Button>\n )}\n </CardFooter>\n )}\n </Card>\n </Wrapper>\n );\n },\n);\nMediaCard.displayName = \"MediaCard\";\n\nexport { MediaCard };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Card, CardContent } from \"../../components/card\";\nimport {\n Avatar,\n AvatarImage,\n AvatarFallback,\n} from \"../../components/avatar\";\nimport { Badge, type BadgeProps } from \"../../components/badge\";\nimport { Progress } from \"../../components/progress\";\nimport { Rating } from \"../../components/rating\";\nimport { Skeleton } from \"../../components/skeleton\";\n\nexport interface ReviewItem {\n /** Stable key for the review. */\n id: string;\n /** Star rating for this review, 0–5. */\n rating: number;\n /** Review body text. */\n content: string;\n author: {\n name: string;\n /** Optional avatar image URL; falls back to initials. */\n avatarUrl?: string;\n };\n /** Preformatted, human-readable date, e.g. \"2 weeks ago\" or \"Dec 10, 2024\". */\n date: string;\n /** Optional badge shown beside the author name, e.g. \"Google\". */\n badgeLabel?: string;\n}\n\n/** A single `{ star, count }` bucket of the rating distribution. */\nexport interface RatingDistributionItem {\n /** Star level, 1–5. */\n star: number;\n /** Number of reviews at this star level. */\n count: number;\n}\n\nexport interface ReviewsBlockProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Reviews to display as cards. */\n reviews: ReviewItem[];\n /** Aggregate average rating shown in the summary. */\n averageRating: number;\n /** Total number of reviews behind the aggregate. */\n totalReviews: number;\n /** Section heading. Defaults to \"Customer Reviews\". */\n title?: string;\n /**\n * Optional per-star distribution. When provided, the summary renders the\n * bar chart; when omitted, only the average + total are shown. Omit it when\n * the data source (e.g. Google Places) does not expose a full histogram.\n */\n distribution?: RatingDistributionItem[];\n /**\n * Brand variant for the per-review badge (`badgeLabel`). Defaults to\n * `secondary`. Use it to align the badge with the surrounding brand color.\n */\n badgeVariant?: BadgeProps[\"variant\"];\n /**\n * Text-color utility applied to the star ratings, e.g. `text-primary`.\n * Defaults to the `Rating` component's own default (`text-highlight`).\n */\n ratingClassName?: string;\n /** Render skeleton placeholders instead of content. */\n loading?: boolean;\n /** Render an error message instead of content. */\n error?: string;\n}\n\nfunction initials(name: string): string {\n return name\n .split(\" \")\n .map((n) => n[0])\n .filter(Boolean)\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n\nconst SKELETON_CARDS = 4;\n\nconst ReviewsBlock = React.forwardRef<HTMLElement, ReviewsBlockProps>(\n (\n {\n reviews,\n averageRating,\n totalReviews,\n title = \"Customer Reviews\",\n distribution,\n badgeVariant = \"secondary\",\n ratingClassName,\n loading,\n error,\n className,\n ...props\n },\n ref,\n ) => {\n // Round once so the numeric label and the star fill never disagree (e.g.\n // 4.95 must not read \"5.0\" beside a partially filled fifth star).\n const displayRating = Math.round(averageRating * 10) / 10;\n\n return (\n <section\n ref={ref}\n className={cn(\"py-16 md:py-24\", className)}\n {...props}\n >\n <div className=\"mx-auto max-w-5xl px-4 sm:px-6\">\n <h2 className=\"mb-8 text-2xl font-semibold tracking-tight md:text-3xl\">\n {title}\n </h2>\n\n {error ? (\n <p className=\"text-sm text-muted-foreground\">{error}</p>\n ) : (\n <div className=\"grid gap-8 lg:grid-cols-[280px_1fr] lg:gap-12\">\n {/* Summary */}\n <div className=\"space-y-6\">\n <div className=\"text-center lg:text-left\">\n {loading ? (\n <>\n <Skeleton className=\"mx-auto h-12 w-20 lg:mx-0\" />\n <Skeleton className=\"mx-auto mt-2 h-5 w-28 lg:mx-0\" />\n <Skeleton className=\"mx-auto mt-1 h-4 w-36 lg:mx-0\" />\n </>\n ) : (\n <>\n <div className=\"text-5xl font-bold\">\n {displayRating.toFixed(1)}\n </div>\n <Rating\n rate={displayRating}\n size=\"lg\"\n className={cn(\n \"mt-2 justify-center lg:justify-start\",\n ratingClassName,\n )}\n />\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Based on {totalReviews.toLocaleString()} reviews\n </p>\n </>\n )}\n </div>\n\n {/* Distribution bars — only when the data source provides them */}\n {!loading && distribution && distribution.length > 0 && (\n <div className=\"space-y-2\">\n {[...distribution]\n .sort((a, b) => b.star - a.star)\n .map(({ star, count }) => (\n <div key={star} className=\"flex items-center gap-3\">\n <span className=\"w-8 text-sm text-muted-foreground\">\n {star} ★\n </span>\n <Progress\n value={\n totalReviews > 0\n ? (count / totalReviews) * 100\n : 0\n }\n className=\"h-2 flex-1\"\n />\n <span className=\"w-8 text-right text-sm text-muted-foreground\">\n {count}\n </span>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Reviews grid */}\n <div className=\"grid gap-4 sm:grid-cols-2\">\n {loading\n ? Array.from({ length: SKELETON_CARDS }).map((_, i) => (\n <Card key={i} className=\"gap-0 p-0 shadow-none\">\n <CardContent className=\"space-y-3 p-5\">\n <div className=\"flex items-center gap-2.5\">\n <Skeleton className=\"size-9 rounded-full\" />\n <div className=\"space-y-1.5\">\n <Skeleton className=\"h-4 w-24\" />\n <Skeleton className=\"h-3 w-16\" />\n </div>\n </div>\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-4/5\" />\n </CardContent>\n </Card>\n ))\n : reviews.map((review) => (\n <Card\n key={review.id}\n className=\"gap-0 p-0 shadow-none\"\n >\n <CardContent className=\"space-y-3 p-5\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex items-center gap-2.5\">\n <Avatar className=\"size-9\">\n {review.author.avatarUrl && (\n <AvatarImage\n src={review.author.avatarUrl}\n alt={review.author.name}\n />\n )}\n <AvatarFallback className=\"text-xs\">\n {initials(review.author.name)}\n </AvatarFallback>\n </Avatar>\n <div>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-medium\">\n {review.author.name}\n </span>\n {review.badgeLabel && (\n <Badge\n variant={badgeVariant}\n className=\"h-5 px-1.5 text-[0.625rem]\"\n >\n {review.badgeLabel}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {review.date}\n </p>\n </div>\n </div>\n <Rating\n rate={review.rating}\n size=\"sm\"\n className={ratingClassName}\n />\n </div>\n\n <p className=\"line-clamp-4 text-sm leading-relaxed text-muted-foreground\">\n {review.content}\n </p>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n )}\n </div>\n </section>\n );\n },\n);\nReviewsBlock.displayName = \"ReviewsBlock\";\n\nexport { ReviewsBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Camera } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Label } from \"../../components/label\";\nimport { Textarea } from \"../../components/textarea\";\nimport { Avatar, AvatarImage, AvatarFallback } from \"../../components/avatar\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ProfileSettingsData {\n name: string;\n email: string;\n bio?: string;\n avatarUrl?: string;\n}\n\nexport interface ProfileSettingsBlockProps {\n initialData: ProfileSettingsData;\n onSave: (data: ProfileSettingsData) => void | Promise<void>;\n onAvatarChange?: (file: File) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function ProfileSettingsBlock({\n initialData,\n onSave,\n onAvatarChange,\n loading = false,\n error,\n disabled = false,\n className,\n}: ProfileSettingsBlockProps) {\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSave({\n name: formData.get(\"name\") as string,\n email: formData.get(\"email\") as string,\n bio: formData.get(\"bio\") as string,\n avatarUrl: initialData.avatarUrl,\n });\n };\n\n const handleAvatarClick = () => {\n fileInputRef.current?.click();\n };\n\n const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const file = e.target.files?.[0];\n if (file && onAvatarChange) {\n onAvatarChange(file);\n }\n };\n\n const initials = initialData.name\n .split(\" \")\n .map((n) => n[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2);\n\n return (\n <Card className={cn(\"w-full max-w-2xl\", className)}>\n <CardHeader>\n <CardTitle>Profile</CardTitle>\n <CardDescription>Manage your personal information</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-6\">\n <FormError message={error} />\n\n <div className=\"flex items-center gap-4\">\n <div className=\"relative group\">\n <Avatar className=\"h-20 w-20\">\n {initialData.avatarUrl && <AvatarImage src={initialData.avatarUrl} alt={initialData.name} />}\n <AvatarFallback className=\"text-lg\">{initials}</AvatarFallback>\n </Avatar>\n {onAvatarChange && (\n <button\n type=\"button\"\n onClick={handleAvatarClick}\n disabled={loading || disabled}\n className=\"absolute inset-0 flex items-center justify-center rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity\"\n >\n <Camera className=\"h-5 w-5 text-white\" />\n </button>\n )}\n <input ref={fileInputRef} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={handleFileChange} />\n </div>\n <div>\n <p className=\"font-medium\">{initialData.name}</p>\n <p className=\"text-sm text-muted-foreground\">{initialData.email}</p>\n </div>\n </div>\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"name\">Name</Label>\n <Input id=\"name\" name=\"name\" defaultValue={initialData.name} required disabled={loading || disabled} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" name=\"email\" type=\"email\" defaultValue={initialData.email} required disabled={loading || disabled} />\n </div>\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"bio\">Bio</Label>\n <Textarea id=\"bio\" name=\"bio\" defaultValue={initialData.bio} placeholder=\"Tell us about yourself...\" disabled={loading || disabled} rows={3} />\n </div>\n <div className=\"flex justify-end\">\n <Button type=\"submit\" loading={loading} disabled={disabled}>\n Save changes\n </Button>\n </div>\n </form>\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Label } from \"../../components/label\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { Separator } from \"../../components/separator\";\nimport { FormError } from \"../../form/form-error\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"../../components/alert-dialog\";\n\nexport interface AccountSettingsBlockProps {\n onChangePassword: (data: { currentPassword: string; newPassword: string; confirmPassword: string }) => void | Promise<void>;\n onDeleteAccount?: () => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function AccountSettingsBlock({\n onChangePassword,\n onDeleteAccount,\n loading = false,\n error,\n disabled = false,\n className,\n}: AccountSettingsBlockProps) {\n const handlePasswordSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onChangePassword({\n currentPassword: formData.get(\"currentPassword\") as string,\n newPassword: formData.get(\"newPassword\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n });\n e.currentTarget.reset();\n };\n\n return (\n <div className={cn(\"w-full max-w-2xl space-y-6\", className)}>\n <Card>\n <CardHeader>\n <CardTitle>Change password</CardTitle>\n <CardDescription>Update your password to keep your account secure</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handlePasswordSubmit} className=\"space-y-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"currentPassword\">Current password</Label>\n <Input id=\"currentPassword\" name=\"currentPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"current-password\" />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"newPassword\">New password</Label>\n <Input id=\"newPassword\" name=\"newPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"new-password\" />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"confirmPassword\">Confirm new password</Label>\n <Input id=\"confirmPassword\" name=\"confirmPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"new-password\" />\n </div>\n <div className=\"flex justify-end\">\n <Button type=\"submit\" loading={loading} disabled={disabled}>\n Update password\n </Button>\n </div>\n </form>\n </div>\n </CardContent>\n </Card>\n\n {onDeleteAccount && (\n <Card className=\"border-destructive/50\">\n <CardHeader>\n <CardTitle className=\"text-destructive\">Danger zone</CardTitle>\n <CardDescription>Permanently delete your account and all associated data</CardDescription>\n </CardHeader>\n <CardContent>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"destructive\" disabled={loading || disabled}>\n Delete account\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. This will permanently delete your account and remove all your data from our servers.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction onClick={onDeleteAccount} className=\"bg-destructive text-destructive-foreground hover:bg-destructive/90\">\n Delete account\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </CardContent>\n </Card>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Switch } from \"../../components/switch\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface NotificationSetting {\n id: string;\n label: string;\n description: string;\n enabled: boolean;\n}\n\nexport interface NotificationGroup {\n title: string;\n description?: string;\n settings: NotificationSetting[];\n}\n\nexport interface NotificationSettingsBlockProps {\n groups: NotificationGroup[];\n onSave: (settings: Record<string, boolean>) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function NotificationSettingsBlock({\n groups,\n onSave,\n loading = false,\n error,\n disabled = false,\n className,\n}: NotificationSettingsBlockProps) {\n const [values, setValues] = React.useState<Record<string, boolean>>(() => {\n const initial: Record<string, boolean> = {};\n for (const group of groups) {\n for (const setting of group.settings) {\n initial[setting.id] = setting.enabled;\n }\n }\n return initial;\n });\n\n const handleToggle = (id: string, checked: boolean) => {\n setValues((prev) => ({ ...prev, [id]: checked }));\n };\n\n const handleSave = async () => {\n await onSave(values);\n };\n\n return (\n <div className={cn(\"w-full max-w-2xl space-y-6\", className)}>\n <FormError message={error} />\n\n {groups.map((group, gIdx) => (\n <Card key={gIdx}>\n <CardHeader>\n <CardTitle className=\"text-lg\">{group.title}</CardTitle>\n {group.description && <CardDescription>{group.description}</CardDescription>}\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {group.settings.map((setting) => (\n <div key={setting.id} className=\"flex items-center justify-between gap-4\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-medium\">{setting.label}</p>\n <p className=\"text-sm text-muted-foreground\">{setting.description}</p>\n </div>\n <Switch\n checked={values[setting.id]}\n onCheckedChange={(checked) => handleToggle(setting.id, checked)}\n disabled={loading || disabled}\n />\n </div>\n ))}\n </div>\n </CardContent>\n </Card>\n ))}\n\n <div className=\"flex justify-end\">\n <Button onClick={handleSave} loading={loading} disabled={disabled}>\n Save preferences\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAa,2BACX;AAEF,MAAa,4BACX;AAEF,MAAa,4BACX;;AAGF,MAAa,iCAAiC;;;;;;;;;;;;;ACO9C,SAAgB,gBACd,UAAkC,EAAE,EACmB;CACvD,MAAM,EAAE,OAAO,MAAM,SAAS,SAAS,YAAY,MAAM;CACzD,MAAM,MAAM,MAAM,OAAiB,KAAK;CACxC,MAAM,CAAC,UAAU,eAAe,MAAM,SAAS,MAAM;AAErD,OAAM,gBAAgB;EACpB,MAAM,KAAK,IAAI;AACf,MAAI,CAAC,GAAI;EAET,MAAM,WAAW,IAAI,sBAClB,CAAC,WAAW;AACX,OAAI,MAAM,gBAAgB;AACxB,gBAAY,KAAK;AACjB,QAAI,KAAM,UAAS,UAAU,GAAG;cACvB,CAAC,KACV,aAAY,MAAM;KAGtB;GAAE,YAAY;GAAQ;GAAW,CAClC;AAED,WAAS,QAAQ,GAAG;AACpB,eAAa,SAAS,YAAY;IACjC;EAAC;EAAM;EAAQ;EAAU,CAAC;AAE7B,QAAO;EAAE;EAAK;EAAU;;;;AC9C1B,MAAM,oBAAoB;AAE1B,SAAgB,cAAc;CAC5B,MAAM,CAAC,UAAU,eAAe,MAAM,SACpC,KAAA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