@discuss-ds/ui 0.38.0 → 0.39.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/components/Buttons & Actions/Button.tsx","../src/lib/utils.ts","../src/components/Buttons & Actions/Switch.tsx","../src/components/Buttons & Actions/Toggle.tsx","../src/components/Conversation & AI Chat/AIMiniAvatar.tsx","../src/components/Conversation & AI Chat/aiGlyphPaths.ts","../src/components/Conversation & AI Chat/AIResponseContainer.tsx","../src/components/Conversation & AI Chat/AskAiToggle.tsx","../src/components/Conversation & AI Chat/ChatChoices.tsx","../src/components/Forms & Data Entry/Checkbox.tsx","../src/components/Forms & Data Entry/Label.tsx","../src/components/Forms & Data Entry/RadioGroup.tsx","../src/components/Conversation & AI Chat/ChatInput.tsx","../src/components/Conversation & AI Chat/FileAttachment.tsx","../src/components/Conversation & AI Chat/ProjectSelector.tsx","../src/components/Overlays & Feedback/DropdownMenu.tsx","../src/components/Conversation & AI Chat/Timestamp.tsx","../src/components/Conversation & AI Chat/TopicCard.tsx","../src/components/Conversation & AI Chat/UserMessageBubble.tsx","../src/components/Forms & Data Entry/Calendar.tsx","../src/components/Forms & Data Entry/DateTimePicker.tsx","../src/components/Forms & Data Entry/Field.tsx","../src/components/Forms & Data Entry/formatDateTime.ts","../src/components/Forms & Data Entry/TimePicker.tsx","../src/components/Navigation/TabItem.tsx","../src/components/Navigation/TabNavigation.tsx","../src/components/Forms & Data Entry/Form.tsx","../src/components/Forms & Data Entry/InlineEdit.tsx","../src/components/Forms & Data Entry/MarkedText.tsx","../src/components/Forms & Data Entry/Input.tsx","../src/components/Forms & Data Entry/InputWithAction.tsx","../src/components/Forms & Data Entry/NumberInput.tsx","../src/components/Forms & Data Entry/SearchBar.tsx","../src/components/Forms & Data Entry/Select.tsx","../src/components/Forms & Data Entry/Slider.tsx","../src/components/Forms & Data Entry/Textarea.tsx","../src/components/Navigation/Stepper.tsx","../src/components/Overlays & Feedback/Dialog.tsx","../src/components/Overlays & Feedback/Toast.tsx","../src/components/Overlays & Feedback/Tooltip.tsx","../src/components/Question Types/FileUpload.tsx","../src/components/Tags & Badges/Tag.tsx","../src/components/Question Types/Media.tsx","../src/components/Question Types/OpenEndAnswer.tsx","../src/components/Question Types/QuestionCard.tsx","../src/components/Question Types/QuestionEditorCard.tsx","../src/lib/keepEditingFocus.ts","../src/components/Question Types/QuestionHeader.tsx","../src/components/Question Types/QuestionNumberTag.tsx","../src/components/Question Types/QuestionTypeIcon.tsx","../src/components/Question Types/QuestionNavItem.tsx","../src/components/Question Types/QuestionOption.tsx","../src/components/Question Types/RankList.tsx","../src/components/Question Types/RatingScale.tsx","../src/components/Question Types/StimulusCard.tsx","../src/components/Data Display/Progress.tsx","../src/components/Data Display/Table.tsx","../src/components/Data Display/DataTable.tsx","../src/components/Utility/Pagination.tsx","../src/components/Data Display/StatCard.tsx","../src/components/Research-Specific/ActivityStructure.tsx","../src/components/Tags & Badges/EditableTag.tsx","../src/components/Tags & Badges/Badge.tsx"],"sourcesContent":["// Public component exports.\n//\n// Each implemented component is re-exported here from its folder under\n// src/components/<Section>/<Component>. See ../../../.context/COMPONENT_STATUS.md\n// for the build queue and ../../../.context/COMPONENT_CONTRACTS.md for the\n// export-barrel convention components must follow once they land here.\nexport * from './components/Buttons & Actions';\nexport * from './components/Conversation & AI Chat';\nexport * from './components/Forms & Data Entry';\nexport * from './components/Navigation';\nexport * from './components/Overlays & Feedback';\nexport * from './components/Question Types';\nexport * from './components/Data Display';\nexport * from './components/Research-Specific';\nexport * from './components/Tags & Badges';\nexport * from './components/Utility';\n","import * as React from 'react';\nimport { Slot } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\nconst subtle =\n 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground hover:bg-accent-soft hover:bg-none hover:text-accent-soft-foreground disabled:bg-muted disabled:bg-none disabled:text-muted-foreground';\n\n// Figma: Buttons (13) + Button Small/Reaction (16). Disabled is a flat 50%\n// opacity for every type; the hover fill is `accent-soft` everywhere except\n// primary (`primary-hover`) and destructive (a 10% black overlay).\nconst buttonVariants = cva(\n 'inline-flex shrink-0 items-center justify-center whitespace-nowrap text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default: 'bg-primary text-label hover:bg-primary-hover',\n subtle,\n // Alias of `subtle`, kept so existing consumers don't break.\n secondary: subtle,\n destructive: 'bg-destructive text-label hover:bg-destructive-hover',\n outline:\n 'border border-border bg-surface text-surface-foreground hover:border-input-muted hover:bg-accent-soft hover:text-accent-soft-foreground disabled:bg-transparent disabled:border-input-muted disabled:text-muted-foreground',\n ghost:\n 'text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground disabled:text-muted-foreground',\n link: 'text-surface-foreground underline hover:text-accent-foreground',\n },\n size: {\n md: 'h-10 min-w-10 gap-2.5 rounded-md px-4 py-2',\n sm: 'h-8 min-w-8 gap-1 rounded-sm px-2.5 py-1.5',\n lg: 'h-12 gap-2.5 rounded-md px-6 py-3 text-ui-label-large',\n icon: 'size-10 rounded-md p-0',\n 'icon-sm': 'size-8 rounded-sm p-0',\n },\n },\n compoundVariants: [\n // Primary icon-only is a circle at 40px (and a rounded square at 32px).\n { variant: 'default', size: 'icon', className: 'rounded-full' },\n {\n variant: 'default',\n size: ['icon', 'icon-sm'],\n className: 'disabled:border disabled:border-border disabled:bg-transparent disabled:text-muted-foreground disabled:opacity-100',\n },\n // Destructive icon-only drops the fill and tints the glyph instead.\n {\n variant: 'destructive',\n size: ['icon', 'icon-sm'],\n className: 'bg-transparent text-destructive hover:bg-destructive-soft-hover',\n },\n { variant: 'outline', size: ['icon', 'icon-sm'], className: 'disabled:border-border' },\n // Links have no box of their own.\n { variant: 'link', className: 'rounded-md bg-transparent px-4' },\n ],\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /**\n * Render `props.children` into the child element instead of wrapping it in\n * a `<button>` (Radix `Slot`) — lets consumers compose e.g.\n * `<Button asChild><a href=\"...\">Label</a></Button>` without double-wrapping.\n * The ref then targets whatever element the child renders, not necessarily\n * an `HTMLButtonElement`.\n */\n asChild?: boolean;\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot.Root : 'button';\n return <Comp ref={ref} className={cn(buttonVariants({ variant, size }), className)} {...props} />;\n },\n);\nButton.displayName = 'Button';\n","import { type ClassValue, clsx } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\n// tailwind-merge only knows Tailwind's built-in class names. Without these\n// registrations it reads our composite type styles (`text-ui-label`) as a text\n// *colour* — so a later `text-surface-foreground` silently drops the type\n// style — and `bg-linear-to-r` (Tailwind v4) as a background colour, dropping\n// `bg-secondary`.\nconst twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n 'font-size': [\n {\n text: [\n 'heading-h1',\n 'heading-h2',\n 'heading-h3',\n 'heading-h4',\n 'body-section',\n 'body-base',\n 'body-small',\n 'body-xs',\n 'body-xxs',\n 'ui-label',\n 'ui-label-large',\n 'ui-badge',\n 'ui-caption',\n 'ui-overline',\n 'ui-code',\n 'ui-placeholder',\n 'ui-input-value',\n ],\n },\n ],\n 'bg-image': [{ 'bg-linear': ['to-t', 'to-tr', 'to-r', 'to-br', 'to-b', 'to-bl', 'to-l', 'to-tl'] }],\n },\n },\n});\n\n/**\n * Merge class lists, resolving Tailwind class conflicts so a consumer-supplied\n * `className` always wins over an internal default. See COMPONENT_CONTRACTS.md.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/** Whether a length is too short (under the minimum, ignoring surrounding spaces) or too long (over the maximum): the only time a character count is shown. */\nexport function lengthOutOfRange(text: string, min?: number, max?: number) {\n return (min !== undefined && text.trim().length < min) || (max !== undefined && text.length > max);\n}\n","import * as React from 'react';\nimport { Switch as SwitchPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>;\n\n// Figma: Toggle / Switch (17) — 44×24 track, 20px white thumb. Off is `muted`, on is the accent.\nexport const Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitive.Root>, SwitchProps>(\n ({ className, ...props }, ref) => (\n <SwitchPrimitive.Root\n ref={ref}\n className={cn(\n 'inline-flex h-6 w-11 shrink-0 items-center rounded-full p-0.5 transition-colors',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Brand override: selected controls use `ring`, not `primary`/`accent`.\n 'data-[state=checked]:bg-ring data-[state=unchecked]:bg-muted',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n 'block size-5 rounded-full bg-surface shadow-sm transition-transform',\n 'data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0',\n )}\n />\n </SwitchPrimitive.Root>\n ),\n);\nSwitch.displayName = 'Switch';\n","import * as React from 'react';\nimport { Toggle as TogglePrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport type ToggleProps = React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>;\n\n// Figma: Toggle / Switch (17) › Toggle menu — a 40px square icon button that fills with `secondary` when pressed.\nexport const Toggle = React.forwardRef<React.ElementRef<typeof TogglePrimitive.Root>, ToggleProps>(\n ({ className, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(\n 'inline-flex size-10 shrink-0 items-center justify-center rounded-md text-surface-foreground transition-colors',\n 'hover:bg-accent-soft hover:text-accent-soft-foreground',\n 'data-[state=on]:bg-secondary data-[state=on]:hover:bg-accent-soft',\n 'disabled:pointer-events-none disabled:opacity-50',\n className,\n )}\n {...props}\n />\n ),\n);\nToggle.displayName = 'Toggle';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { AI_GLYPH_THINKING, AI_GLYPH_WORKING } from './aiGlyphPaths';\n\nexport type AIStatus = 'idle' | 'thinking' | 'executing' | 'working';\n\nconst defaultLabel: Record<Exclude<AIStatus, 'idle'>, string> = {\n thinking: 'Thinking...',\n executing: 'Executing...',\n working: 'Working on it...',\n};\n\nexport interface AIMiniAvatarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** `idle` shows only the mark; the others add a status line next to it. */\n status?: AIStatus;\n /** Override the status text. */\n label?: React.ReactNode;\n /** Elapsed time shown after the label while `working` (e.g. \"45 s\"). */\n elapsed?: React.ReactNode;\n}\n\n// Figma: AI Mini Avatar (57) › AI feedback — the accent squiggle mark with an optional status line.\n// While busy the mark draws itself on along its own path, holds, clears the same way and repeats (still under prefers-reduced-motion).\nexport const AIMiniAvatar = React.forwardRef<HTMLDivElement, AIMiniAvatarProps>(\n ({ className, status = 'idle', label, elapsed, ...props }, ref) => {\n const glyph = status === 'working' ? AI_GLYPH_WORKING : AI_GLYPH_THINKING;\n const busy = status !== 'idle';\n // The busy mark is drawn on along its own path, so each instance needs its own mask.\n const maskId = React.useId();\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-live=\"polite\"\n className={cn('flex items-center gap-2.5', className)}\n {...props}\n >\n <svg\n aria-hidden=\"true\"\n viewBox={glyph.viewBox}\n fill=\"none\"\n className={cn(\n 'h-5.75 shrink-0 fill-accent',\n status === 'working' ? 'w-5' : 'w-5.25',\n )}\n >\n {busy && (\n <>\n <mask id={maskId} maskUnits=\"userSpaceOnUse\" style={{ maskType: 'alpha' }}>\n {/* A thick stroke along the mark's centre line. It is revealed gradually (see `animate-ai-draw-on`), uncovering the mark behind it. */}\n <path\n d={glyph.line}\n pathLength={1}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"motion-safe:animate-ai-draw-on\"\n />\n </mask>\n <path d={glyph.d} mask={`url(#${maskId})`} />\n </>\n )}\n {!busy && <path d={glyph.d} />}\n </svg>\n {busy && (\n <span\n className={cn(\n 'text-ui-caption whitespace-nowrap',\n status === 'executing'\n ? 'bg-linear-to-r from-secondary-muted-foreground to-secondary-muted-foreground/40 bg-clip-text text-transparent'\n : 'text-secondary-muted-foreground',\n )}\n >\n {label ?? defaultLabel[status]}\n </span>\n )}\n {status === 'working' && elapsed != null && (\n <>\n <span aria-hidden=\"true\" className=\"size-0.5 rounded-full bg-secondary-muted-foreground\" />\n <span className=\"text-ui-caption whitespace-nowrap text-secondary-muted-foreground\">{elapsed}</span>\n </>\n )}\n </div>\n );\n },\n);\nAIMiniAvatar.displayName = 'AIMiniAvatar';\n","// Hand-off from Figma (AI feedback › AI assistant): the squiggle mark shown while the assistant works.\n// The path data is the exported vector, unmodified. `line` is the stroke's centre line, traced by hand along the vector in the same\n// coordinates: AIMiniAvatar draws it on as a mask, so the mark appears as if it were being drawn from its first end to its last.\nexport const AI_GLYPH_THINKING = {\n viewBox: '0 0 23.5102 10.31',\n d: 'M20.7764 6.13895C20.8091 6.08935 20.9139 6.07477 20.9653 6.02535C21.1265 5.87047 21.227 5.79769 21.3523 5.6889L21.3349 5.70985C21.3757 5.67187 21.4194 5.629 21.4687 5.57648C21.7621 5.26894 22.4786 4.16096 22.8403 4.43013C22.8403 4.43014 22.8403 4.43014 22.8403 4.43015C22.8438 4.43279 22.8474 4.43556 22.8508 4.43847C22.9168 4.49352 22.9251 4.63928 22.993 4.71056C23.061 4.78185 23.5711 5.14655 23.5041 5.29532C23.4036 5.50831 22.9412 5.85678 22.8715 5.95956C22.8242 6.02999 22.8059 6.14803 22.7475 6.24057C22.6464 6.40032 22.5565 6.50906 22.4809 6.62923C22.4785 6.632 22.4718 6.64062 22.4693 6.64331C22.3989 6.74734 22.341 6.85851 22.2892 7.02244C22.1391 7.06575 21.9883 7.10631 21.8375 7.14262C21.7434 7.29292 21.476 7.39415 21.4003 7.4664C21.3382 7.52673 21.3404 7.6092 21.2705 7.66966C21.2189 7.71436 21.1282 7.74838 21.0302 7.79812C21.0228 7.80313 21.0008 7.8182 20.9928 7.8224C20.9494 7.83706 20.9028 7.85865 20.856 7.89199C20.6266 8.05556 20.6529 8.23489 20.4981 8.34362C20.4171 8.3997 20.2989 8.44071 20.1779 8.48367C20.0629 8.52373 19.9434 8.57023 19.8501 8.64564C19.8314 8.67452 19.8127 8.70339 19.7937 8.73228C19.83 8.76183 19.8664 8.79129 19.9028 8.82072C19.8037 8.88716 19.7221 8.82963 19.622 8.8719C19.5039 8.92146 19.4745 9.02208 19.3928 9.05557C19.3259 9.0829 19.2105 9.05922 19.1237 9.09701C18.9965 9.1516 19.0573 9.22895 18.9919 9.2717C18.9722 9.29205 18.4308 9.51795 18.3887 9.52197C18.1304 9.58812 18.0801 9.46546 17.8631 9.48595C17.8361 9.48814 17.8091 9.4903 17.782 9.49237C17.3207 9.52161 16.8743 9.67817 16.3789 9.7352C16.285 9.7455 16.1851 9.74966 16.0822 9.74684C15.9622 9.74345 15.8411 9.73294 15.7225 9.71759C16.0452 9.39607 15.3567 9.12062 15.6025 9.64387C15.3808 9.56394 15.2157 9.69807 14.9941 9.66267C14.8498 9.63874 14.7566 9.5627 14.5364 9.54137C14.3208 9.51495 14.0878 9.5587 13.7616 9.41848C13.6405 9.36165 13.5631 9.27393 13.5919 9.09969C13.4354 9.05602 13.2983 8.98697 13.1658 8.92556C13.0992 8.89457 13.0342 8.86595 12.9619 8.83793C12.8815 8.79834 12.8349 8.81997 12.6347 8.66553C12.5818 8.65788 12.5185 8.66138 12.4458 8.68578C12.3597 8.6238 12.3017 8.26898 12.2414 8.14791C12.1605 8.05685 11.7146 7.13701 11.7091 6.94414C11.7083 6.94093 11.7074 6.93768 11.7065 6.93438C11.6552 6.75979 11.6158 6.47257 11.5821 6.33303C11.5388 6.16728 11.1933 5.9876 11.6352 5.69928C11.6536 5.50058 11.6924 5.35814 11.7614 5.21539C11.7996 5.14267 11.8487 5.06108 11.9231 4.94138C11.9508 4.89665 12.0069 4.91427 12.0188 4.88607C12.0432 4.82851 12.0458 4.71199 12.0891 4.60378C12.1604 4.42562 12.3223 4.38132 12.1443 4.31661C12.1745 4.18591 12.2099 4.05361 12.2533 3.91918C12.3093 3.89617 12.3653 3.87434 12.4217 3.85356C12.4277 3.77084 12.4368 3.68676 12.4498 3.60124C12.6122 3.82914 12.8149 3.31965 12.5882 3.35167C12.6971 3.26408 12.8129 3.18134 12.936 3.10694C13.0432 3.05147 13.1502 2.9942 13.2575 2.93523C13.445 3.18433 13.6433 2.62036 13.4965 2.52782C13.5159 2.50978 13.5359 2.49118 13.5559 2.47273C13.6468 2.43151 13.7186 2.3762 13.8101 2.30215C13.9339 2.20399 14.0605 2.08848 14.2572 2.00205C14.5866 1.86654 14.5863 1.91818 14.7383 2.00328C14.8117 1.96386 14.8906 1.92778 14.9768 1.89808C15.2046 1.61986 15.3871 1.74917 15.5554 1.87821C15.6574 1.92057 15.8644 2.08723 15.9086 2.24717C15.9561 2.38086 15.9647 2.4401 16.0174 2.50589C16.0362 2.5325 16.059 2.56113 16.0862 2.59267C15.9089 2.83438 16.1252 3.33908 16.1251 3.71466C16.1272 3.75694 16.1742 3.7651 16.1787 3.82326C16.1923 3.96864 16.0396 4.27583 16.1879 4.30844C16.1104 4.40775 16.0302 4.50104 15.9487 4.58956C15.9485 4.59211 15.9483 4.59466 15.9481 4.59722C15.9434 4.68512 15.9381 4.77303 15.9326 4.86089C15.9773 4.87807 16.0219 4.89524 16.0666 4.91242C15.8514 5.01394 15.8076 5.2888 15.7201 5.39794C15.7026 5.41968 15.6395 5.39969 15.591 5.46924C15.5342 5.55031 15.482 5.72425 15.4171 5.82229C15.4664 5.89261 15.5154 5.96317 15.5642 6.03418C15.516 6.24242 15.3088 6.23112 15.2434 6.33666C15.2371 6.34685 15.1897 6.45661 15.1414 6.56252C15.1003 6.65319 15.0605 6.74017 15.0575 6.75026C14.9983 6.92736 15.1953 6.94548 14.8653 7.42471C14.8017 7.51174 14.7031 7.55363 14.6374 7.63359C14.5939 7.68676 14.5258 7.79471 14.4522 7.90588C14.359 8.0661 14.2337 8.27035 14.258 8.34435C13.9929 8.37671 13.5599 8.69876 13.4026 8.72273C13.3557 8.73114 13.3039 8.65181 13.1715 8.69189C13.1196 8.70739 13.0387 8.75964 12.9539 8.81245C12.8709 8.86549 12.783 8.9216 12.7186 8.94208C12.5852 8.98412 12.5082 8.92996 12.4483 8.94919C12.3923 8.9672 12.3668 9.04791 12.2925 9.07862C12.0591 9.1738 11.8082 9.16385 11.6213 9.23522C11.3502 9.33814 11.1776 9.60661 10.949 9.76888C10.9348 9.77067 10.9203 9.77115 10.9058 9.77095C10.8529 9.76975 10.7975 9.7598 10.7466 9.77439C9.99772 10.0005 9.00243 10.0857 8.1768 9.85282C8.13481 9.84174 8.09342 9.83033 8.0522 9.8185C7.65595 9.74342 6.84265 9.06031 6.88897 9.55865C6.80575 9.55556 6.53393 9.38444 6.29758 9.12608C6.231 9.02829 5.91504 8.73378 5.8576 8.6732C5.70806 8.5387 5.53716 8.47446 5.42743 8.35204C5.23871 8.13938 5.11803 7.9385 4.98784 7.72031C4.93094 7.62219 4.78289 7.41761 4.64906 7.18544C4.56629 7.04595 4.42492 6.92507 4.39704 6.84099C4.36359 6.73961 4.41467 6.60764 4.3839 6.48312C4.3266 6.25751 4.2228 5.90491 4.15903 5.6261C4.13709 5.5314 4.11932 5.43956 4.10919 5.36422C4.10191 5.30774 4.17499 5.27443 4.18647 5.19139C4.22915 4.86817 4.21424 4.52439 3.96715 4.59214C4.0923 4.18224 4.00781 3.80768 4.06914 3.4305C4.07049 3.42228 4.07191 3.41407 4.0734 3.40587C4.17848 2.77229 4.60265 1.62744 5.42728 1.02539C5.5388 0.936113 5.63885 0.851595 5.72033 0.774897C6.02466 0.499997 5.92843 0.404094 6.57046 0.168732C6.72019 0.118531 6.87745 0.0750992 7.10515 0.029663C7.44001 -0.0409616 8.00784 0.000885725 8.42487 0.305113C8.52342 0.370349 8.66824 0.438081 8.84918 0.507494C9.00601 0.701494 9.15341 0.965493 9.19962 1.24429C9.25461 1.59798 9.20706 1.9295 9.02072 2.15487C9.06272 2.2086 9.10331 2.26358 9.14209 2.32146C9.12853 2.38467 9.11273 2.44783 9.09564 2.50868C9.04342 2.51339 8.99124 2.51735 8.93911 2.52058C8.80099 2.92074 8.72119 3.45798 8.53257 3.73379C8.51917 3.75362 8.50452 3.77482 8.48864 3.79731C8.18299 4.22988 7.45145 5.14772 7.14208 5.47284C6.97081 5.65357 7.04778 5.72472 6.79141 5.71506C6.77155 5.76833 6.75129 5.82205 6.73113 5.87552C6.74881 5.93119 6.76688 5.98626 6.78446 6.04197C6.67655 6.19317 6.53517 6.34587 6.39918 6.49486C6.30179 6.60171 6.20676 6.7071 6.12771 6.80983C5.86753 7.16626 5.41116 7.79089 4.96904 8.10513C4.87549 8.1762 4.78037 8.24183 4.68809 8.2947C4.56491 8.36535 4.36563 8.39839 4.25536 8.48329C4.09377 8.60676 4.15002 8.76609 3.93397 8.92203C3.68203 9.10323 3.21465 9.30524 2.7946 9.44827C2.61334 9.50835 2.4488 9.5679 2.33086 9.62822C2.22328 9.68313 2.19724 9.76099 2.12265 9.80252C1.81329 9.9754 1.54922 10.089 1.27057 10.31C0.871376 10.3138 0.823743 10.1166 0.644008 9.97432C0.509878 9.86688 0.126525 9.63933 0.0856048 9.51058C0.0484623 9.42509 0.051783 9.29751 0 9.20711C0.311082 9.00323 0.527575 9.0048 0.893831 9.00304C1.355 8.7957 1.81246 8.57815 2.27037 8.35384C2.37271 8.30354 2.47492 8.24832 2.57658 8.1893C2.6503 8.2117 2.72528 8.23255 2.80124 8.252C2.8013 8.25211 2.80136 8.25221 2.80143 8.25232C3.03486 8.18581 3.03979 8.00743 3.12463 7.91046C3.36205 7.63959 3.68578 7.33424 4.07988 6.99574C4.53563 6.62516 4.89846 6.21727 5.32159 5.69439C5.74872 5.17021 6.15919 4.65793 6.46139 4.25093C6.64154 4.00919 7.13955 3.16034 7.33028 3.04133C7.34208 3.03408 7.35548 3.03074 7.36955 3.02924C7.41387 3.02544 7.46598 3.03904 7.49046 3.00739C7.70834 2.58993 7.86103 2.13779 7.83041 1.79989C7.8547 1.70941 7.86312 1.62307 7.85378 1.53151C7.87209 1.5287 7.84915 1.45435 7.69179 1.34775C7.77026 1.34362 7.49926 1.35778 7.23888 1.52474C6.97348 1.67631 6.69939 1.87603 6.42229 2.07271C6.36356 2.11454 6.30432 2.15719 6.24453 2.20056C5.85524 2.48354 5.60232 3.08823 5.49387 3.71498C5.39928 4.24892 5.42498 4.76811 5.56179 5.30683C5.73246 5.96207 5.84566 6.51339 6.19333 6.98921C6.31865 7.19227 6.46019 7.37337 6.62146 7.53296C6.79615 7.70852 6.92033 7.78019 7.25856 8.05634C7.33453 8.12545 7.42269 8.18946 7.52192 8.24799C7.75285 8.38685 8.10613 8.47857 8.4572 8.54593C8.61666 8.57713 8.77013 8.59963 8.91167 8.62268C9.08941 8.64956 9.17441 8.79085 9.4164 8.66989C9.42212 8.70681 9.42791 8.74373 9.43379 8.78063C9.65293 8.71479 9.77712 8.60908 10.021 8.54539C10.1203 8.51928 10.2997 8.46967 10.4831 8.41151C10.6699 8.35263 10.8737 8.27862 10.9746 8.24849C11.0761 8.21757 11.0641 8.29673 11.157 8.26042C11.3161 8.19806 11.6214 7.97025 11.8416 7.87728C12.0071 7.80802 12.2892 7.74718 12.4664 7.68389C12.5014 7.67152 12.5303 7.65958 12.5544 7.6466C12.9362 7.44059 13.2264 7.19551 13.4781 6.90736C13.5439 6.83289 13.5972 6.76236 13.6731 6.65907C13.7546 6.55024 13.9356 6.40299 13.9581 6.35458C14.0011 6.26124 13.9376 6.19233 13.9591 6.12514C13.9721 6.08459 13.9882 6.04256 14.0073 5.9983C14.1356 5.69579 14.4023 5.27933 14.5269 4.98849C14.6407 4.72311 14.7511 4.44958 14.8552 4.17601C14.9522 3.92097 15.0207 3.66979 15.0372 3.45937C15.0531 3.24138 15.027 3.11048 14.9379 2.78902C14.9187 2.70766 14.878 2.57482 14.9201 2.69356C14.9293 2.78057 15.2047 3.01121 15.3025 3.00426C15.3103 3.005 15.2823 2.99694 15.209 3.02009C15.1006 3.05115 14.8991 3.17087 14.6896 3.3475C14.4622 3.54526 14.1241 3.87681 13.8343 4.11513C13.7102 4.21459 13.5954 4.34064 13.4984 4.45314C13.4195 4.54661 13.3558 4.46837 13.2997 4.56139C13.2381 4.66643 13.2646 4.75718 13.2429 4.81048C13.1582 5.0115 13.0582 5.33059 12.8983 5.73083C12.8528 5.84656 12.829 6.11681 12.8105 6.25296C12.8013 6.311 12.7318 6.36264 12.7373 6.39885C12.74 6.41716 12.7967 6.44932 12.8133 6.49994C12.8239 6.53247 12.835 6.56327 12.8464 6.59222C13.0113 6.99361 13.2145 7.29577 13.6284 7.75962C13.6287 7.75995 13.629 7.76028 13.6292 7.7606C13.5327 7.66867 13.5735 7.71591 13.5864 7.71996C13.6067 7.73297 13.6364 7.74994 13.6682 7.76708C13.7325 7.8017 13.8061 7.838 13.8819 7.87409C14.0342 7.94645 14.1967 8.01873 14.3624 8.09149C14.4295 8.12341 14.8213 8.16242 15.1241 8.16799C15.4466 8.17777 15.7837 8.17904 16.12 8.1862C16.4042 8.19173 16.7364 8.16186 17.0675 8.14113C17.3555 8.12227 17.5732 8.24796 17.6136 8.24221C17.625 8.2406 17.6357 8.23751 17.6461 8.23323C17.7042 8.20464 17.7441 8.12089 17.8688 8.07355C18.3421 7.89885 19.1022 7.67963 19.5971 7.39003C19.6136 7.38042 19.6303 7.37015 19.6473 7.35931C19.8747 7.2155 20.0413 6.98443 20.2828 6.80153C20.3065 6.7842 20.3357 6.76481 20.3699 6.74391L20.298 6.79064C20.4619 6.66741 20.7621 6.44192 20.7839 6.34931C20.7993 6.28776 20.7412 6.19318 20.7764 6.13895ZM14.3029 9.42491C14.3405 9.34309 14.2314 9.3194 14.1139 9.3164C13.9993 9.31488 13.861 9.3268 13.9789 9.41542C14.0391 9.45982 14.2868 9.46988 14.3029 9.42491ZM9.59175 9.70184C9.60097 9.75063 9.61033 9.7994 9.61981 9.84815C9.67917 9.8212 9.73753 9.79318 9.79481 9.76425C9.75681 9.73961 9.71928 9.71456 9.68227 9.6891C9.65216 9.69362 9.62202 9.69787 9.59175 9.70184Z',\n line: 'M0.41 9.67C0.71 9.55 1.58 9.27 2.18 8.97C2.79 8.68 3.46 8.34 4.04 7.9C4.62 7.46 5.17 6.92 5.67 6.32C6.17 5.72 6.63 4.99 7.06 4.32C7.48 3.65 8.01 2.89 8.22 2.32C8.43 1.75 8.51 1.26 8.32 0.92C8.13 0.58 7.54 0.27 7.06 0.27C6.58 0.27 5.87 0.48 5.43 0.92C4.99 1.36 4.55 2.16 4.41 2.92C4.27 3.68 4.39 4.67 4.6 5.48C4.81 6.29 5.26 7.23 5.67 7.81C6.08 8.39 6.52 8.7 7.06 8.97C7.6 9.24 8.26 9.41 8.92 9.43C9.58 9.45 10.35 9.26 11.01 9.11C11.67 8.96 12.33 8.72 12.87 8.5C13.41 8.28 13.87 8.23 14.27 7.81C14.67 7.38 15.08 6.61 15.29 5.95C15.5 5.29 15.58 4.46 15.53 3.85C15.48 3.25 15.24 2.57 14.97 2.32C14.7 2.06 14.29 2.14 13.9 2.32C13.51 2.5 12.95 2.86 12.64 3.39C12.33 3.92 12 4.78 12.04 5.48C12.08 6.18 12.46 7.06 12.87 7.57C13.28 8.08 13.92 8.32 14.5 8.55C15.08 8.78 15.7 9.02 16.36 8.97C17.02 8.92 17.76 8.66 18.46 8.27C19.16 7.88 20.01 7.07 20.55 6.64C21.09 6.21 21.32 5.96 21.71 5.71C22.11 5.46 22.72 5.21 22.92 5.11',\n} as const;\n\nexport const AI_GLYPH_WORKING = {\n viewBox: '0 0 21.6653 7.31887',\n d: 'M21.5195 2.20094C21.5632 2.27281 21.5435 2.40302 21.5694 2.49163C21.6275 2.6923 21.6417 2.82523 21.6527 2.95596C21.6564 2.97027 21.6628 3.01397 21.6653 3.02853C21.6641 3.13693 21.6598 3.24436 21.6586 3.38773C21.6816 3.85362 21.6618 5.13496 21.204 5.07451C21.204 5.0745 21.204 5.0745 21.204 5.0745C21.1996 5.074 21.1952 5.07338 21.1907 5.07263C21.1061 5.05815 21.0241 4.94601 20.929 4.92104C20.8337 4.89639 20.2098 4.84129 20.1872 4.70468C20.162 4.5075 20.3424 4.05165 20.3322 3.94693C20.3275 3.87626 20.2696 3.79112 20.2564 3.70362C20.2253 3.50095 20.228 3.36832 20.1618 3.22753L20.1705 3.27725C20.1408 3.22743 20.1002 3.17862 20.0419 3.13125C20.0967 3.02469 20.1456 2.91373 20.1862 2.79711C20.1085 2.70121 20.1178 2.49436 20.0701 2.43438C20.0329 2.38632 19.9603 2.39539 19.9218 2.35006C19.8787 2.3002 19.8633 2.1732 19.7612 2.09203C19.7034 2.0461 19.6466 2.03107 19.595 2.02843L19.7627 2.11426C19.6671 2.14605 19.6042 2.2088 19.5173 2.20366C19.3811 2.19547 19.1788 2.06914 18.9898 2.10943C18.9652 2.12544 18.9407 2.1416 18.9163 2.1579C18.9287 2.20111 18.9406 2.24436 18.9521 2.28762C18.8618 2.29819 18.8311 2.20964 18.7478 2.20237C18.6497 2.19419 18.5963 2.27357 18.5308 2.27097C18.4776 2.26885 18.4048 2.20215 18.3342 2.20612C18.2309 2.21188 18.2544 2.30623 18.2002 2.32458C18.1776 2.32896 17.7784 2.40078 17.7565 2.40615C17.5856 2.42463 17.557 2.29863 17.4163 2.30438C17.0252 2.32264 16.6544 2.50901 16.341 2.64771C16.2001 2.7096 16.0505 2.75491 15.9061 2.79231C16.0092 2.39243 15.4001 2.37041 15.7957 2.76269C15.7449 2.76246 15.7042 2.7768 15.67 2.79808C15.5564 2.86487 15.4802 2.97434 15.3466 3.01614C15.2272 3.05323 15.1197 3.02273 14.9627 3.09457C14.6814 3.2228 14.4809 3.53873 14.2487 3.24296C13.9703 3.44596 13.6586 3.47244 13.7401 3.80561C13.6873 3.86035 13.4234 3.80763 13.3424 3.84086C13.2469 3.85834 12.8209 4.21338 12.8015 4.30503C12.7577 4.37886 12.704 4.52293 12.7165 4.60386C12.7165 4.60456 12.7165 4.60525 12.7166 4.60594C12.7245 4.73675 13.038 4.86932 12.6198 5.00545C12.6218 5.24087 12.6062 5.31289 12.5709 5.505C12.5653 5.5391 12.5078 5.54892 12.51 5.56912C12.5148 5.61101 12.5679 5.67144 12.5899 5.73138C12.625 5.82708 12.5422 5.92847 12.7068 5.83917C12.7265 5.85366 12.7463 5.86629 12.7663 5.87733C12.8032 5.90096 12.8414 5.92124 12.8766 5.93338C12.8592 5.96968 12.8434 6.00666 12.8291 6.04399C12.8751 6.0348 12.9151 6.01504 12.9349 5.9805C12.8531 6.08998 12.8602 6.12516 12.8542 6.09438C12.8536 6.06287 12.7741 5.97616 12.8523 5.90639C12.814 5.91011 12.7686 5.91968 12.7291 5.93658C12.8704 5.95935 13.0187 5.97102 13.1668 5.97103C13.2458 6.27758 13.5375 5.8631 13.4165 5.7269C13.4322 5.71942 13.4481 5.7116 13.4633 5.70383C13.6382 5.70301 13.7156 5.57219 13.8729 5.49571C14.0312 5.4108 14.0391 5.43683 14.1889 5.47644C14.2098 5.43405 14.2279 5.39151 14.2438 5.3483C14.0282 5.01309 14.4813 5.23839 14.467 4.9003C14.4628 4.86036 14.4497 4.81226 14.424 4.75824C14.6924 4.64645 14.5813 4.22813 14.4827 3.98518C14.4718 3.95634 14.4244 3.95942 14.4063 3.92204C14.3646 3.8314 14.3895 3.57996 14.2385 3.6136C14.269 3.52481 14.297 3.43419 14.3224 3.34163C14.2805 3.27925 14.2374 3.21883 14.1932 3.15937C14.147 3.17171 14.1008 3.18404 14.0545 3.19636C14.1795 3.02404 14.0534 2.83228 14.0536 2.72057C14.0538 2.69796 14.1146 2.67123 14.1077 2.60167C14.1053 2.5772 14.097 2.54816 14.0858 2.51695C14.0606 2.4458 14.0206 2.3664 14.0068 2.30319C13.9256 2.30215 13.845 2.30379 13.7653 2.30835C13.664 2.19886 13.8037 2.06102 13.7674 1.97878C13.7632 1.95836 13.5836 1.76062 13.569 1.76088C13.4625 1.71319 13.3938 1.83751 13.1876 1.69055C13.1768 1.68378 13.1679 1.67414 13.1594 1.66314C13.1251 1.62875 13.0976 1.58516 13.0563 1.56847C12.9543 1.52205 12.6158 1.57037 12.5754 1.68805C12.488 1.51352 12.1471 1.54577 12.0499 1.50822C12.0197 1.49536 12.0125 1.39933 11.915 1.38294C11.8348 1.36858 11.641 1.46343 11.5414 1.4673C11.4886 1.46852 11.4499 1.45238 11.417 1.43601C11.379 1.41974 11.3502 1.40253 11.3222 1.40479C11.2702 1.40908 11.2364 1.48093 11.1663 1.49376C10.9506 1.53213 10.7369 1.4686 10.5668 1.5019C10.3215 1.54967 10.1495 1.7839 9.97459 1.91406C9.92313 1.91395 9.86479 1.88637 9.81474 1.89889C9.18393 2.05373 8.52084 2.24974 8.06049 2.55947C7.97673 2.61393 7.82886 2.68357 7.70707 2.77585C7.47457 2.96164 7.29957 3.141 7.58115 3.23461C7.55145 3.37335 6.85892 3.81217 6.75779 3.91528C6.65223 4.01974 6.62886 4.1568 6.55292 4.24037C6.3287 4.49052 6.12192 4.63806 5.97447 4.97688C5.93734 5.06497 5.97217 5.18888 5.95013 5.22858C5.92305 5.27641 5.81725 5.29086 5.78729 5.35168C5.72348 5.47691 5.72292 5.63535 5.74247 5.70235C5.7392 5.69015 5.73474 5.68324 5.73057 5.6806C5.7259 5.67767 5.6564 5.71443 5.64159 5.73607C5.59977 5.79621 5.66356 5.86599 5.71545 5.8044C5.74124 5.7781 5.76378 5.72791 5.79373 5.65487C5.7797 5.76571 5.84646 5.7256 5.86464 5.68044C5.89311 5.65904 5.9217 5.63652 5.95175 5.6189C6.02236 5.57879 6.10324 5.51868 6.14438 5.46754C6.52517 4.99861 6.93077 4.48918 7.03916 4.16128C7.131 3.87843 7.03817 3.83671 7.2777 3.53191C7.3285 3.46368 7.38339 3.39761 7.43515 3.31198C7.55556 3.123 7.78512 2.91105 7.53243 2.74719C7.53788 2.72612 7.54202 2.70518 7.54516 2.6844C7.57114 2.34511 7.5461 2.13531 7.71559 1.91428C7.66205 1.8939 7.6084 1.87498 7.55468 1.85784C7.54899 1.82465 7.54284 1.79249 7.53625 1.76174C7.58249 1.7438 7.62858 1.72536 7.6745 1.70638C7.66025 1.58943 7.57775 1.48171 7.50533 1.44831C7.42954 1.40963 7.39741 1.46692 7.42084 1.47901C7.42785 1.48323 7.43783 1.48634 7.4422 1.48541C7.17989 1.34605 6.43947 1.33364 6.13402 1.38718C5.94822 1.40777 5.97834 1.51041 5.80067 1.34866C5.76607 1.37821 5.73267 1.40807 5.6993 1.43868C5.69344 1.49226 5.68877 1.54561 5.68469 1.59899C5.60346 1.6368 5.51247 1.67081 5.41947 1.70715C5.25719 1.77218 5.08842 1.83937 4.95565 1.92193C4.5607 2.16343 4.07316 2.6724 3.66471 2.90149C3.56135 2.95829 3.38743 2.97861 3.30147 3.05515C3.17694 3.16659 3.25374 3.3124 3.10481 3.45557C2.97543 3.58045 2.7598 3.72772 2.55869 3.88391C2.36237 4.0352 2.17431 4.20354 2.0791 4.34155C2.02181 4.42439 2.04245 4.49771 2.00764 4.55703C1.86276 4.80728 1.7279 5.00722 1.67572 5.28395C1.40472 5.45513 1.24398 5.34517 1.02204 5.34271C0.85587 5.34339 0.443166 5.39397 0.298309 5.53289C0.195382 5.59242 0.114988 5.33164 0 5.398C0.0672404 4.97998 0.13697 4.91763 0.231708 4.78102C0.32599 4.66409 0.441105 4.57777 0.588846 4.47063C0.890159 3.96002 1.2295 3.4868 1.62503 3.03919C1.6425 3.01952 1.66013 2.99985 1.67793 2.98018C1.75746 2.97633 1.83576 2.97461 1.91436 2.97328C1.91444 2.97336 1.91453 2.97345 1.91462 2.97353C2.12092 2.85218 2.0899 2.68327 2.15819 2.5722C2.597 1.85461 3.67978 1.04205 4.76963 0.519159C5.32989 0.243909 5.91307 0.0975681 6.38788 0.0444249C6.6555 -0.0118234 7.54053 -0.0488161 7.88667 0.153048C7.94618 0.17965 7.98958 0.207339 8.01918 0.232423C8.08533 0.290805 8.06243 0.37677 8.1281 0.424204C8.788 0.858895 8.84837 1.50779 8.95406 1.97915C8.94198 2.20167 8.92957 2.41449 8.93075 2.60529C8.95493 3.51671 8.63286 4.38247 8.20801 5.05868C7.91193 5.53227 7.58085 5.95424 7.27747 6.35851C7.01913 6.69107 6.69575 6.90231 6.33432 7.03688C5.96029 7.1761 5.5056 7.15874 5.13666 6.97761C4.77988 6.8026 4.46111 6.49764 4.34143 6.02344C4.13016 4.94119 4.72195 4.23827 5.12818 3.69949C5.57383 3.15323 6.05227 2.7034 6.49909 2.26167C6.60356 2.1588 6.70991 2.04377 6.81333 1.92552C7.11534 1.5805 7.51671 1.27415 7.87436 1.12238C8.09128 1.03067 8.22986 1.1177 8.46139 0.914443C8.47778 0.948059 8.49413 0.981695 8.51042 1.01535C8.72666 0.884509 8.85128 0.753639 9.11283 0.667108C9.33416 0.590984 9.91261 0.445577 10.1078 0.420265C10.2081 0.405908 10.1856 0.481938 10.2787 0.461915C10.4358 0.427279 10.7555 0.265817 10.9724 0.225515C11.0344 0.213886 11.1095 0.207961 11.1911 0.203672C11.3902 0.189668 11.6101 0.200757 11.7294 0.184671C12.3244 0.0941229 13.0686 0.0795288 13.6887 0.360932C13.7173 0.373361 13.7452 0.386407 13.7732 0.400348C13.9935 0.504733 14.1863 0.761282 14.2374 0.804733C14.3459 0.889986 14.4353 0.85695 14.5099 0.917486C14.8544 1.19506 15.0555 1.7393 15.1651 2.08618C15.1811 2.13408 15.1962 2.17883 15.2114 2.2209C15.5209 3.10883 15.7231 4.06037 15.5398 5.11604C15.4759 5.44103 15.3468 5.76469 15.156 6.04424C14.7344 6.73319 13.702 7.23955 12.966 7.30853C12.4728 7.37179 12.1947 7.12924 12.0524 6.99922C11.8908 6.83031 12.009 6.80775 11.9034 6.68162C11.8329 6.59062 11.7694 6.53954 11.7184 6.49409C11.6899 6.46762 11.6662 6.44349 11.6504 6.41689C11.2557 5.85657 11.3479 4.693 11.5144 4.34149C11.5151 4.33971 11.5158 4.33796 11.5166 4.33623C11.5524 4.24664 11.6398 4.2033 11.6561 4.14998C11.6648 4.12266 11.6353 4.04477 11.6651 3.9555C11.9475 3.16456 12.4817 2.80074 13.0494 2.47332C13.7152 2.10344 14.4121 1.81425 15.0508 1.49401C15.5692 1.23861 16.1097 1.07617 16.6335 0.991567C16.9162 0.946369 17.1285 1.06931 17.1663 1.06219C17.2508 1.04785 17.2925 0.940458 17.4657 0.897656C18.0451 0.752637 18.8417 0.865944 19.4146 0.908582C19.6055 0.920524 19.8557 0.905474 20.0965 0.923509C20.1598 0.938582 20.3128 1.02252 20.3653 1.06104C20.4783 1.12075 20.5849 1.18937 20.6707 1.26172C20.897 1.42686 21.21 2.00184 21.2965 2.08728C21.3583 2.13718 21.4717 2.12365 21.5195 2.20094ZM14.7616 3.09249C14.7223 2.91995 14.4452 3.20284 14.6094 3.23071C14.6457 3.23713 14.7714 3.13732 14.7616 3.09249ZM8.90352 1.8629C8.92394 1.90808 8.94428 1.9533 8.96454 1.99855C8.99986 1.96338 9.03568 1.92859 9.07244 1.894C9.0381 1.87445 9.00388 1.85503 8.96929 1.83592C8.94712 1.84485 8.92519 1.85385 8.90352 1.8629Z',\n line: 'M0.35 5.29C0.54 5.08 1.02 4.5 1.47 4C1.92 3.5 2.47 2.79 3.06 2.29C3.65 1.79 4.33 1.3 4.99 1C5.66 0.7 6.51 0.45 7.05 0.48C7.59 0.51 8.07 0.78 8.21 1.17C8.35 1.56 8.1 2.26 7.91 2.8C7.72 3.34 7.39 3.86 7.05 4.43C6.71 5 6.21 5.92 5.85 6.24C5.49 6.56 5.13 6.48 4.91 6.32C4.7 6.16 4.46 5.77 4.56 5.29C4.66 4.81 5.08 4.02 5.51 3.45C5.94 2.88 6.55 2.23 7.14 1.86C7.73 1.49 8.43 1.4 9.07 1.21C9.71 1.02 10.4 0.86 11.01 0.74C11.62 0.62 12.18 0.41 12.72 0.48C13.26 0.55 13.86 0.77 14.23 1.17C14.6 1.57 14.91 2.25 14.96 2.89C15.01 3.54 14.82 4.42 14.53 5.04C14.24 5.66 13.63 6.31 13.24 6.58C12.85 6.85 12.49 6.81 12.21 6.67C11.93 6.53 11.6 6.09 11.56 5.72C11.52 5.35 11.67 4.86 11.95 4.43C12.23 4 12.75 3.48 13.24 3.15C13.73 2.82 14.31 2.69 14.87 2.46C15.43 2.23 15.98 1.99 16.59 1.77C17.2 1.55 17.91 1.23 18.52 1.17C19.13 1.11 19.77 1.21 20.24 1.43C20.7 1.65 21.13 1.93 21.31 2.46C21.49 2.99 21.31 4.25 21.31 4.61',\n} as const;\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface AIResponseContainerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Display-font heading at the top of the reply (e.g. \"Confirm new project.\"). */\n title?: React.ReactNode;\n /** Message actions row — a `Timestamp` with copy / like / dislike / retry buttons. */\n actions?: React.ReactNode;\n /** Status line under the reply — an `AIMiniAvatar`. */\n feedback?: React.ReactNode;\n}\n\n// Figma: AI Response Container (55) › Chat reply — 16px-gapped column with an h4 title, rich content, actions and AI status.\nexport const AIResponseContainer = React.forwardRef<HTMLDivElement, AIResponseContainerProps>(\n ({ className, title, children, actions, feedback, ...props }, ref) => (\n <div ref={ref} className={cn('flex w-full max-w-188 flex-col items-start gap-4', className)} {...props}>\n {title && <h2 className=\"text-heading-h4 text-surface-foreground\">{title}</h2>}\n <div className=\"flex w-full flex-col gap-4 text-body-base text-surface-foreground [&>p]:opacity-90\">{children}</div>\n {actions}\n {feedback}\n </div>\n ),\n);\nAIResponseContainer.displayName = 'AIResponseContainer';\n","import * as React from 'react';\nimport { Sparkle } from '@phosphor-icons/react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Toggle as TogglePrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nconst askAiToggleVariants = cva(\n 'inline-flex shrink-0 items-center justify-center text-surface-foreground transition-colors disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n type: {\n // 40px, filled with the subtle fill until pressed.\n menu: 'size-10 rounded-md bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-soft-foreground',\n // 32px, bare until pressed.\n action: 'size-8 rounded-sm hover:bg-accent-soft data-[state=on]:bg-accent-soft data-[state=on]:text-accent-soft-foreground',\n },\n },\n defaultVariants: { type: 'menu' },\n },\n);\n\nexport interface AskAiToggleProps\n extends Omit<React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>, 'type'>,\n VariantProps<typeof askAiToggleVariants> {}\n\n// Figma: User Message Bubble (54) › Ask AI toggle — sparkle toggle in a 40px menu or a 32px action size.\nexport const AskAiToggle = React.forwardRef<React.ElementRef<typeof TogglePrimitive.Root>, AskAiToggleProps>(\n ({ className, type, 'aria-label': ariaLabel = 'Ask AI', pressed, defaultPressed, ...props }, ref) => {\n const [internal, setInternal] = React.useState(defaultPressed ?? false);\n const on = pressed ?? internal;\n return (\n <TogglePrimitive.Root\n ref={ref}\n aria-label={ariaLabel}\n pressed={pressed}\n defaultPressed={defaultPressed}\n onPressedChange={(next) => {\n setInternal(next);\n props.onPressedChange?.(next);\n }}\n className={cn(askAiToggleVariants({ type }), className)}\n {...props}\n >\n <Sparkle size={16} weight={on ? 'fill' : 'regular'} aria-hidden />\n </TogglePrimitive.Root>\n );\n },\n);\nAskAiToggle.displayName = 'AskAiToggle';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { Checkbox } from '../Forms & Data Entry/Checkbox';\nimport { RadioGroupItem } from '../Forms & Data Entry/RadioGroup';\n\nexport interface ChatChoicesProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** The question the assistant is asking. */\n title: React.ReactNode;\n}\n\n// Figma: Chat Input (56) › Choices — a question header over a list of options, shown above the input.\nexport const ChatChoices = React.forwardRef<HTMLDivElement, ChatChoicesProps>(\n ({ className, title, children, ...props }, ref) => (\n <div ref={ref} className={cn('flex flex-col', className)} {...props}>\n <div className=\"border-b border-border px-6 pt-5 pb-4\">\n <p className=\"text-body-section text-surface-foreground\">{title}</p>\n </div>\n {children}\n </div>\n ),\n);\nChatChoices.displayName = 'ChatChoices';\n\ninterface ChatOptionBaseProps {\n title: React.ReactNode;\n description?: React.ReactNode;\n className?: string;\n}\n\nexport interface ChatOptionActionProps\n extends ChatOptionBaseProps,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {\n kind?: 'action';\n}\n\nexport interface ChatOptionRadioProps extends ChatOptionBaseProps {\n kind: 'radio';\n /** Value in the surrounding `RadioGroup`. */\n value: string;\n disabled?: boolean;\n}\n\nexport interface ChatOptionCheckboxProps extends ChatOptionBaseProps {\n kind: 'checkbox';\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n disabled?: boolean;\n}\n\nexport type ChatOptionProps = ChatOptionActionProps | ChatOptionRadioProps | ChatOptionCheckboxProps;\n\nconst rowClasses = 'flex w-full flex-col gap-1 border-b border-border px-6 py-4 text-left text-body-small';\n\n// Figma: Chat Input (56) › AI option — a quick reply (action), or a radio / checkbox choice with a description.\nexport function ChatOption(props: ChatOptionProps) {\n const id = React.useId();\n const descriptionId = `${id}-description`;\n\n if (props.kind === 'radio' || props.kind === 'checkbox') {\n const { title, description, className } = props;\n const control =\n props.kind === 'radio' ? (\n <RadioGroupItem id={id} value={props.value} disabled={props.disabled} aria-describedby={description ? descriptionId : undefined} />\n ) : (\n <Checkbox\n id={id}\n checked={props.checked}\n defaultChecked={props.defaultChecked}\n onCheckedChange={(next) => props.onCheckedChange?.(next === true)}\n disabled={props.disabled}\n aria-describedby={description ? descriptionId : undefined}\n />\n );\n return (\n <div className={cn(rowClasses, 'cursor-default', className)}>\n <div className=\"flex items-center gap-2.5 py-1\">\n {control}\n <label htmlFor={id} className=\"text-ui-label text-surface-foreground\">\n {title}\n </label>\n </div>\n {description && (\n <p id={descriptionId} className=\"pl-7.75 text-sm leading-[1.4] text-secondary-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n );\n }\n\n const { title, description, className, kind: _kind, ...buttonProps } = props;\n return (\n <button\n type=\"button\"\n className={cn(rowClasses, 'transition-colors hover:bg-accent-soft', className)}\n {...buttonProps}\n >\n <span className=\"text-ui-label text-surface-foreground\">{title}</span>\n {description && <span className=\"text-body-small text-secondary-muted-foreground\">{description}</span>}\n </button>\n );\n}\n","import * as React from 'react';\nimport { Check, Minus } from '@phosphor-icons/react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Label } from './Label';\n\nexport type CheckboxProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>;\n\n// Figma: Checkbox (21) — 1.5px muted border at rest; accent fill when checked or indeterminate.\nexport const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n ({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'peer inline-flex size-4 shrink-0 items-center justify-center rounded-xxs border-2 border-input bg-surface transition-colors',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Brand override: selected controls use `ring`, not `primary`/`accent`.\n 'data-[state=checked]:border-ring data-[state=checked]:bg-ring data-[state=checked]:text-label',\n 'data-[state=indeterminate]:border-ring data-[state=indeterminate]:bg-ring data-[state=indeterminate]:text-label',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n {props.checked === 'indeterminate' ? <Minus size={12} weight=\"bold\" aria-hidden /> : <Check size={12} weight=\"bold\" aria-hidden />}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n ),\n);\nCheckbox.displayName = 'Checkbox';\n\nexport interface CheckboxFieldProps extends CheckboxProps {\n label: React.ReactNode;\n /** Secondary line under the label. */\n description?: React.ReactNode;\n}\n\n/** Checkbox with its label (and optional description) laid out per Figma. */\nexport const CheckboxField = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxFieldProps>(\n ({ label, description, id, className, disabled, ...props }, ref) => {\n const generatedId = React.useId();\n const controlId = id ?? generatedId;\n const descriptionId = `${controlId}-description`;\n return (\n <div\n className={cn('flex gap-2', description ? 'items-start pt-0.5' : 'items-center', disabled && 'opacity-50', className)}\n >\n <Checkbox\n ref={ref}\n id={controlId}\n disabled={disabled}\n aria-describedby={description ? descriptionId : undefined}\n className={description ? 'mt-0.5' : undefined}\n {...props}\n />\n <div className=\"flex flex-col gap-0.5\">\n <Label htmlFor={controlId} className={cn(!description && 'font-normal leading-5')}>\n {label}\n </Label>\n {description && (\n <p id={descriptionId} className=\"text-xs text-secondary-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n </div>\n );\n },\n);\nCheckboxField.displayName = 'CheckboxField';\n","import * as React from 'react';\nimport { Label as LabelPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nexport const Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n 'text-ui-label text-surface-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n ),\n);\nLabel.displayName = 'Label';\n","import * as React from 'react';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Label } from './Label';\n\nexport type RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;\n\nexport const RadioGroup = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Root>, RadioGroupProps>(\n ({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root ref={ref} className={cn('flex flex-col gap-2', className)} {...props} />\n ),\n);\nRadioGroup.displayName = 'RadioGroup';\n\nexport type RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;\n\n// Figma: Radio Group (24) — 16px ring in muted (same size as the checkbox), accent when selected with a solid centre dot.\nexport const RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioGroupItemProps\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'peer inline-flex size-4 shrink-0 items-center justify-center rounded-full border-2 border-input bg-surface transition-colors',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Brand override: selected controls use `ring`, not `primary`/`accent`.\n 'data-[state=checked]:border-ring',\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"size-2 rounded-full bg-ring\" />\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = 'RadioGroupItem';\n\nexport interface RadioGroupFieldItemProps extends RadioGroupItemProps {\n label: React.ReactNode;\n /** Secondary line under the label. */\n description?: React.ReactNode;\n}\n\n/** A radio with its label (and optional description) laid out per Figma. */\nexport const RadioGroupFieldItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioGroupFieldItemProps\n>(({ label, description, id, className, disabled, ...props }, ref) => {\n const generatedId = React.useId();\n const controlId = id ?? generatedId;\n const descriptionId = `${controlId}-description`;\n return (\n <div\n className={cn('flex gap-2', description ? 'items-start pt-0.5' : 'items-center', disabled && 'opacity-50', className)}\n >\n <RadioGroupItem\n ref={ref}\n id={controlId}\n disabled={disabled}\n aria-describedby={description ? descriptionId : undefined}\n {...props}\n />\n <div className=\"flex flex-col gap-0.5\">\n <Label htmlFor={controlId} className={cn(!description && 'font-normal leading-5')}>\n {label}\n </Label>\n {description && (\n <p id={descriptionId} className=\"text-xs text-secondary-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n </div>\n );\n});\nRadioGroupFieldItem.displayName = 'RadioGroupFieldItem';\n","import * as React from 'react';\nimport { ArrowUp, Plus } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport interface ChatInputProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSubmit' | 'defaultValue' | 'onChange'> {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Called with the text when the send button (or Enter) is pressed. */\n onSubmit?: (value: string) => void;\n placeholder?: string;\n /** Accessible name for the text area. */\n 'aria-label'?: string;\n /** Attached files (`FileAttachment`s) shown above the text. */\n attachments?: React.ReactNode;\n /** A `ChatChoices` block shown above the text area. */\n choices?: React.ReactNode;\n /** Slot before the send button — usually a `ProjectSelector`. */\n trailing?: React.ReactNode;\n /** Called when the add (+) button is pressed. Hides the button when omitted. */\n onAdd?: () => void;\n addLabel?: string;\n sendLabel?: string;\n disabled?: boolean;\n}\n\n// Figma: Chat Input (56) › Chat input — a rounded card: optional choices, attachments + text, then an actions row.\nexport const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(\n (\n {\n className,\n value,\n defaultValue = '',\n onValueChange,\n onSubmit,\n placeholder = 'Add context or ask for changes...',\n 'aria-label': ariaLabel = 'Message',\n attachments,\n choices,\n trailing,\n onAdd,\n addLabel = 'Add',\n sendLabel = 'Send',\n disabled,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState(defaultValue);\n const text = value ?? internal;\n const filled = text.trim() !== '' || attachments != null;\n\n const submit = () => {\n if (!text.trim() && attachments == null) return;\n onSubmit?.(text);\n };\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex w-full flex-col overflow-hidden rounded-2xl border border-border bg-surface shadow-xs',\n 'focus-within:border-input-accent',\n className,\n )}\n {...props}\n >\n {choices}\n <div className=\"flex flex-col gap-4 p-4\">\n {attachments && <div className=\"flex flex-wrap gap-4\">{attachments}</div>}\n <textarea\n rows={1}\n aria-label={ariaLabel}\n value={text}\n disabled={disabled}\n placeholder={placeholder}\n onChange={(event) => {\n setInternal(event.target.value);\n onValueChange?.(event.target.value);\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n submit();\n }\n }}\n className=\"field-sizing-content max-h-60 min-h-7 w-full resize-none bg-transparent text-body-base text-surface-foreground outline-none placeholder:text-muted-foreground\"\n />\n </div>\n <div className=\"flex items-center gap-1.5 px-2.5 pt-2 pb-2.5\">\n {onAdd && (\n <Button type=\"button\" variant=\"ghost\" size=\"icon\" aria-label={addLabel} disabled={disabled} onClick={onAdd}>\n <Plus size={16} aria-hidden />\n </Button>\n )}\n <div className=\"flex flex-1 items-center justify-end gap-1.5\">\n {trailing}\n <Button\n type=\"button\"\n variant={filled ? 'default' : 'outline'}\n size=\"icon\"\n aria-label={sendLabel}\n disabled={disabled || !filled}\n onClick={submit}\n className={cn('rounded-full', !filled && 'disabled:opacity-100 disabled:border-border disabled:text-muted-foreground')}\n >\n <ArrowUp size={16} aria-hidden />\n </Button>\n </div>\n </div>\n </div>\n );\n },\n);\nChatInput.displayName = 'ChatInput';\n\nexport interface AskAiInputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onSubmit'> {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onSubmit?: (value: string) => void;\n sendLabel?: string;\n}\n\n// Figma: Chat Input (56) › Ask AI — the compact one-line pill (\"Ask for changes\").\nexport const AskAiInput = React.forwardRef<HTMLInputElement, AskAiInputProps>(\n (\n { className, value, defaultValue = '', onValueChange, onSubmit, sendLabel = 'Send', placeholder = 'Ask for changes', disabled, ...props },\n ref,\n ) => {\n const [internal, setInternal] = React.useState(defaultValue);\n const text = value ?? internal;\n const filled = text.trim() !== '';\n return (\n <form\n className={cn(\n 'flex min-h-10 w-full items-center gap-2 rounded-full border border-border bg-surface py-1.5 pr-1.5 pl-2 shadow-sm',\n 'focus-within:border-input-accent',\n className,\n )}\n onSubmit={(event) => {\n event.preventDefault();\n if (filled) onSubmit?.(text);\n }}\n >\n <input\n ref={ref}\n value={text}\n disabled={disabled}\n placeholder={placeholder}\n onChange={(event) => {\n setInternal(event.target.value);\n onValueChange?.(event.target.value);\n }}\n className=\"min-w-0 flex-1 bg-transparent text-body-small text-surface-foreground outline-none placeholder:text-muted-foreground\"\n {...props}\n />\n <Button\n type=\"submit\"\n variant={filled ? 'default' : 'outline'}\n size=\"icon\"\n aria-label={sendLabel}\n disabled={disabled || !filled}\n className={cn(!filled && 'disabled:opacity-100 disabled:border-border disabled:text-muted-foreground')}\n >\n <ArrowUp size={16} aria-hidden />\n </Button>\n </form>\n );\n },\n);\nAskAiInput.displayName = 'AskAiInput';\n","import * as React from 'react';\nimport { X } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport interface FileAttachmentProps extends React.HTMLAttributes<HTMLDivElement> {\n name: string;\n /** File type badge text, e.g. \"PDF\". */\n type?: string;\n /** Shows the round remove button on hover or keyboard focus (Figma: Default). Omit for the sent-message card (Figma: Variant 3). */\n onRemove?: () => void;\n removeLabel?: string;\n}\n\n// Figma: User Message Bubble (54) › File attached — 128px card; the composer variant has a remove button.\nexport const FileAttachment = React.forwardRef<HTMLDivElement, FileAttachmentProps>(\n ({ className, name, type, onRemove, removeLabel, ...props }, ref) => (\n <div ref={ref} className={cn('group/file relative w-32 shrink-0', className)} {...props}>\n <div\n className={cn(\n 'flex flex-col gap-1.5 border border-border bg-surface px-2.5 pt-2.5 pb-3',\n onRemove ? 'rounded-xl' : 'rounded-lg',\n )}\n >\n <p className=\"line-clamp-2 min-h-8 break-all text-ui-caption text-surface-foreground\" title={name}>\n {name}\n </p>\n {type && (\n <span className=\"w-fit rounded-xs bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-1.5 py-px text-body-xxs font-semibold tracking-wider text-secondary-muted-foreground uppercase\">\n {type}\n </span>\n )}\n </div>\n {onRemove && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={removeLabel ?? `Remove ${name}`}\n onClick={onRemove}\n className=\"absolute right-0 bottom-0 rounded-full opacity-0 transition-opacity group-hover/file:opacity-100 group-focus-within/file:opacity-100\"\n >\n <X size={16} aria-hidden />\n </Button>\n )}\n </div>\n ),\n);\nFileAttachment.displayName = 'FileAttachment';\n","import * as React from 'react';\nimport { CaretDown, FolderOpen, FolderSimple } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '../Overlays & Feedback/DropdownMenu';\n\nconst NEW_PROJECT = '__new__';\n\nexport interface ProjectSelectorProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue'> {\n /** Name of the chosen project. Leave empty for \"New Project\". */\n project?: string;\n /**\n * Existing project names. When given, pressing the selector opens a menu with\n * \"New Project\" and these names; the current choice is checked.\n */\n projects?: string[];\n /** Called with the chosen project name, or `undefined` for \"New Project\". */\n onProjectChange?: (project: string | undefined) => void;\n /** Label of the \"new project\" menu item and of the pill when no project is chosen. */\n newProjectLabel?: string;\n /**\n * `selected` means the project is locked for this chat: the pill is read-only\n * (no caret, neutral border). Otherwise it is a trigger with a caret.\n */\n selected?: boolean;\n}\n\n// Figma: Chat Input (56) › Project selector — a pill showing the project folder, \"New Project\" until one is chosen.\nexport const ProjectSelector = React.forwardRef<HTMLButtonElement, ProjectSelectorProps>(\n ({ className, project, projects, onProjectChange, newProjectLabel = 'New Project', selected = false, children, ...props }, ref) => {\n const label = children ?? project ?? newProjectLabel;\n const classes = cn(\n 'inline-flex h-10 items-center gap-2 rounded-full border bg-surface px-3 py-2 text-ui-label whitespace-nowrap text-surface-foreground transition-colors',\n selected\n ? 'border-border'\n : 'border-input-muted hover:border-input-muted hover:bg-accent-soft hover:text-accent-soft-foreground data-[state=open]:bg-accent-soft data-[state=open]:text-accent-soft-foreground',\n className,\n );\n const content = (\n <>\n {project ? (\n <FolderOpen size={16} weight=\"fill\" aria-hidden className=\"shrink-0\" />\n ) : (\n <FolderSimple size={16} aria-hidden className=\"shrink-0\" />\n )}\n <span>{label}</span>\n {!selected && <CaretDown size={16} aria-hidden className=\"shrink-0\" />}\n </>\n );\n if (selected) {\n return (\n <span className={classes} title={typeof label === 'string' ? label : undefined}>\n {content}\n </span>\n );\n }\n const trigger = (\n <button ref={ref} type=\"button\" aria-haspopup=\"menu\" className={classes} {...props}>\n {content}\n </button>\n );\n if (!projects) return trigger;\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>{trigger}</DropdownMenuTrigger>\n <DropdownMenuContent side=\"top\" align=\"end\" className=\"min-w-60\">\n <DropdownMenuRadioGroup\n value={project ?? NEW_PROJECT}\n onValueChange={(next) => onProjectChange?.(next === NEW_PROJECT ? undefined : next)}\n >\n <DropdownMenuRadioItem value={NEW_PROJECT}>{newProjectLabel}</DropdownMenuRadioItem>\n {projects.map((name) => (\n <DropdownMenuRadioItem key={name} value={name}>\n {name}\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n },\n);\nProjectSelector.displayName = 'ProjectSelector';\n","import * as React from 'react';\nimport { CaretRight, Check, Trash } from '@phosphor-icons/react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport const DropdownMenu = DropdownMenuPrimitive.Root;\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nexport const DropdownMenuGroup = DropdownMenuPrimitive.Group;\nexport const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n// Figma: Dropdown Menu (50) — white card, 1px border, 8px radius, 4px padding and 2px between items.\nconst contentClasses =\n 'min-w-80 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md';\n\nexport type DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;\n\n/**\n * Radix moves DOM focus to the hovered item, so `:focus-visible` can't tell hover\n * from keyboard navigation. Track the last input modality instead: hover only\n * fills the item, and the ring is drawn only after a key press.\n */\nfunction useKeyboardModality<T extends HTMLElement>(\n onKeyDown?: React.KeyboardEventHandler<T>,\n onPointerMove?: React.PointerEventHandler<T>,\n) {\n const [keyboard, setKeyboard] = React.useState(false);\n return {\n 'data-keyboard': keyboard ? '' : undefined,\n onKeyDown: (event: React.KeyboardEvent<T>) => {\n setKeyboard(true);\n onKeyDown?.(event);\n },\n onPointerMove: (event: React.PointerEvent<T>) => {\n setKeyboard(false);\n onPointerMove?.(event);\n },\n };\n}\n\nexport const DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuContentProps\n>(({ className, sideOffset = 4, onKeyDown, onPointerMove, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n style={{ zIndex: 'var(--sys-z-30)' }}\n className={cn(contentClasses, 'group/menu flex flex-col gap-0.5', className)}\n {...useKeyboardModality(onKeyDown, onPointerMove)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\nconst itemBase =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-body-base text-surface-foreground outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50';\nconst itemHover =\n 'data-[highlighted]:bg-accent-soft group-data-[keyboard]/menu:data-[highlighted]:outline-solid group-data-[keyboard]/menu:data-[highlighted]:outline-2 group-data-[keyboard]/menu:data-[highlighted]:-outline-offset-2 group-data-[keyboard]/menu:data-[highlighted]:outline-ring';\nconst selectedItem = 'data-[state=checked]:text-ui-label-large data-[state=checked]:text-accent-foreground';\n\nexport interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n /** Secondary line under the label. */\n description?: React.ReactNode;\n /** `destructive` shows a trash icon and red text (Figma: State = Destructive). */\n variant?: 'default' | 'destructive';\n /** Leading icon. */\n icon?: React.ReactNode;\n}\n\nfunction ItemBody({ children, description }: { children: React.ReactNode; description?: React.ReactNode }) {\n return (\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span>{children}</span>\n {description && <span className=\"text-xs leading-normal text-secondary-muted-foreground\">{description}</span>}\n </span>\n );\n}\n\nexport const DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(({ className, children, description, variant = 'default', icon, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n itemBase,\n variant === 'destructive'\n ? 'text-ui-label-large text-destructive data-[highlighted]:bg-destructive-soft-hover group-data-[keyboard]/menu:data-[highlighted]:outline-solid group-data-[keyboard]/menu:data-[highlighted]:outline-2 group-data-[keyboard]/menu:data-[highlighted]:-outline-offset-2 group-data-[keyboard]/menu:data-[highlighted]:outline-ring'\n : itemHover,\n className,\n )}\n {...props}\n >\n {variant === 'destructive' && !icon ? <Trash size={16} aria-hidden className=\"shrink-0\" /> : icon}\n <ItemBody description={description}>{children}</ItemBody>\n </DropdownMenuPrimitive.Item>\n));\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nexport interface DropdownMenuSelectableItemProps {\n description?: React.ReactNode;\n}\n\n/** A checkable item: the selected state is accent-coloured with a trailing check (Figma: State = Selected). */\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem> & DropdownMenuSelectableItemProps\n>(({ className, children, description, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem ref={ref} className={cn(itemBase, itemHover, selectedItem, className)} {...props}>\n <ItemBody description={description}>{children}</ItemBody>\n <DropdownMenuPrimitive.ItemIndicator>\n <Check size={16} aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n\n/** One choice of a `DropdownMenuRadioGroup`, styled like a selected item when active. */\nexport const DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem> & DropdownMenuSelectableItemProps\n>(({ className, children, description, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem ref={ref} className={cn(itemBase, itemHover, selectedItem, className)} {...props}>\n <ItemBody description={description}>{children}</ItemBody>\n <DropdownMenuPrimitive.ItemIndicator>\n <Check size={16} aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n\n/** Item that opens a submenu, with a trailing caret (Figma: Expand = Yes). */\nexport const DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(itemBase, itemHover, 'data-[state=open]:bg-accent-soft', className)}\n {...props}\n >\n <span className=\"flex-1\">{children}</span>\n <CaretRight size={16} aria-hidden />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\nexport const DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, onKeyDown, onPointerMove, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n style={{ zIndex: 'var(--sys-z-30)' }}\n className={cn(contentClasses, 'group/menu flex flex-col gap-0.5', className)}\n {...useKeyboardModality(onKeyDown, onPointerMove)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\nexport const DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-ui-caption text-secondary-muted-foreground', className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n\nexport const DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />\n));\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface TimestampProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The time text, e.g. \"5 minutes ago\". */\n time: React.ReactNode;\n /** Action buttons (ghost icon `Button`s) shown next to the time. */\n children?: React.ReactNode;\n /** `before` puts the time left of the actions (user messages); `after` puts it right of them (AI replies). */\n timePosition?: 'before' | 'after';\n}\n\n// Figma: Timestamp (58) — 12px/16px `secondary-muted` time with 40px icon actions.\nexport const Timestamp = React.forwardRef<HTMLDivElement, TimestampProps>(\n ({ className, time, children, timePosition = 'before', ...props }, ref) => {\n const timeNode = (\n <time className=\"text-ui-caption whitespace-nowrap text-secondary-muted-foreground\">{time}</time>\n );\n return (\n <div\n ref={ref}\n className={cn('flex items-center gap-2', timePosition === 'before' && 'justify-end', className)}\n {...props}\n >\n {timePosition === 'before' && timeNode}\n {children && (\n <div role=\"toolbar\" aria-label=\"Message actions\" className=\"flex items-center\">\n {children}\n </div>\n )}\n {timePosition === 'after' && timeNode}\n </div>\n );\n },\n);\nTimestamp.displayName = 'Timestamp';\n","import * as React from 'react';\nimport { CaretRight, Check } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface TopicCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Leading 24px icon (a Phosphor icon, e.g. `<FolderOpen weight=\"fill\" />`). */\n icon?: React.ReactNode;\n title: React.ReactNode;\n /** Small tag beside the title (e.g. a language `Badge`). */\n badge?: React.ReactNode;\n description: React.ReactNode;\n /** Chips under the description (e.g. topic tags). */\n tags?: React.ReactNode;\n /** Meta line under the description (e.g. \"7 Questions · 30 minutes\"). */\n meta?: React.ReactNode;\n}\n\n// Figma: AI Response Container (55) › Topic — bordered 16px-radius card with a display-font title.\nexport const TopicCard = React.forwardRef<HTMLDivElement, TopicCardProps>(\n ({ className, icon, title, badge, description, tags, meta, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex w-full flex-col gap-4 overflow-hidden rounded-xl border border-border bg-surface p-4', className)}\n {...props}\n >\n <div className=\"flex items-center gap-4\">\n <div className=\"flex items-center gap-4 text-primary\">\n {icon && <span className=\"flex size-6 shrink-0 items-center justify-center [&>svg]:size-6\">{icon}</span>}\n <h3 className=\"text-heading-h3 whitespace-nowrap\">{title}</h3>\n </div>\n {badge}\n </div>\n <p className=\"text-body-base text-surface-foreground\">{description}</p>\n {tags && <div className=\"flex flex-wrap items-center gap-2\">{tags}</div>}\n {meta && <div className=\"flex items-center gap-2 text-ui-caption text-secondary-muted-foreground\">{meta}</div>}\n </div>\n ),\n);\nTopicCard.displayName = 'TopicCard';\n\nexport interface TopicCardMetaItemProps extends React.HTMLAttributes<HTMLSpanElement> {\n icon: React.ReactNode;\n}\n\n/** An icon + text item for `TopicCard`'s `meta` line. */\nexport function TopicCardMetaItem({ icon, children, className, ...props }: TopicCardMetaItemProps) {\n return (\n <span className={cn('flex items-center gap-1', className)} {...props}>\n <span aria-hidden=\"true\" className=\"flex size-4 items-center justify-center [&>svg]:size-4\">\n {icon}\n </span>\n {children}\n </span>\n );\n}\n\n/** A short chip for `TopicCard`'s `tags` row. */\nexport function TopicCardTag({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn(\n 'rounded-sm bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2 py-1 text-ui-caption text-surface-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface TopicActivityRowProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {\n /** Status text, e.g. \"New Activity Created\". */\n status: React.ReactNode;\n}\n\n// Figma: Topic › Variant 5 — a divider row linking to the created item.\nexport const TopicActivityRow = React.forwardRef<HTMLButtonElement, TopicActivityRowProps>(\n ({ className, status, children, ...props }, ref) => (\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n 'flex w-full items-center gap-4 border-b border-border bg-surface p-4 text-left text-body-small text-surface-foreground',\n className,\n )}\n {...props}\n >\n <span className=\"flex items-center gap-2 whitespace-nowrap\">\n <Check size={16} aria-hidden className=\"text-accent\" />\n {status}\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <CaretRight size={16} aria-hidden />\n </button>\n ),\n);\nTopicActivityRow.displayName = 'TopicActivityRow';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface UserMessageBubbleProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Attached files (`FileAttachment`s) shown above the text. */\n attachments?: React.ReactNode;\n /** Row under the bubble, usually a `Timestamp` with message actions. */\n footer?: React.ReactNode;\n}\n\n// Figma: User Message Bubble (54) › Message — `secondary` fill, 16px radius with a 4px bottom-right corner.\nexport const UserMessageBubble = React.forwardRef<HTMLDivElement, UserMessageBubbleProps>(\n ({ className, children, attachments, footer, ...props }, ref) => (\n <div ref={ref} className={cn('flex w-full max-w-125 flex-col items-end gap-2.5', className)} {...props}>\n <div className=\"flex w-full flex-col gap-4 rounded-tl-xl rounded-tr-xl rounded-br-xs rounded-bl-xl bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 p-4 text-body-base text-surface-foreground\">\n {attachments && <div className=\"flex flex-wrap gap-4\">{attachments}</div>}\n <p className=\"break-words\">{children}</p>\n </div>\n {footer && <div className=\"w-full\">{footer}</div>}\n </div>\n ),\n);\nUserMessageBubble.displayName = 'UserMessageBubble';\n","import { CaretDown, CaretLeft, CaretRight } from '@phosphor-icons/react';\nimport { DayPicker, type DayPickerProps } from 'react-day-picker';\n\nimport { cn } from '../../lib/utils';\n\nexport type CalendarProps = DayPickerProps & {\n /** Days to mark with a dashed outline (e.g. suggested interview slots). */\n recommendedDates?: Date[];\n};\n\nconst subtleFill = 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5';\n\n// Figma: Calendar (25) › Calendar / DayCell-24 — 36px round day cells on a 4px grid, month + year pickers in the header.\nexport function Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'dropdown',\n recommendedDates,\n modifiers,\n modifiersClassNames,\n startMonth,\n endMonth,\n ...props\n}: CalendarProps) {\n const year = new Date().getFullYear();\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n captionLayout={captionLayout}\n startMonth={startMonth ?? new Date(year - 10, 0)}\n endMonth={endMonth ?? new Date(year + 10, 11)}\n className={cn('w-71 text-surface-foreground', className)}\n modifiers={{ ...(recommendedDates ? { recommended: recommendedDates } : {}), ...modifiers }}\n modifiersClassNames={{\n recommended: 'border border-dashed border-border *:text-surface-foreground',\n ...modifiersClassNames,\n }}\n classNames={{\n root: 'relative',\n months: 'flex flex-col',\n month: 'flex flex-col items-center gap-4',\n nav: 'absolute inset-x-0 top-0 flex h-8 items-center justify-between',\n button_previous:\n 'inline-flex size-8 items-center justify-center rounded-sm text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground disabled:opacity-50',\n button_next:\n 'inline-flex size-8 items-center justify-center rounded-sm text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground disabled:opacity-50',\n month_caption: 'flex h-8 items-center justify-center',\n dropdowns: 'flex items-center gap-1',\n dropdown_root:\n 'relative inline-flex items-center rounded-md border border-input-muted bg-surface px-3 py-1.5 text-body-small shadow-xs hover:border-input-accent',\n dropdown: 'absolute inset-0 cursor-pointer opacity-0',\n caption_label: 'flex items-center gap-2 text-body-small text-surface-foreground',\n month_grid: 'w-full border-collapse',\n weekdays: 'flex gap-1',\n weekday: 'flex h-8 w-9 items-center justify-center text-ui-caption text-muted-foreground',\n weeks: 'flex flex-col gap-1',\n week: 'flex gap-1',\n day: 'size-9 rounded-full p-0 text-center',\n day_button:\n 'flex size-full items-center justify-center rounded-full text-ui-caption text-secondary-muted-foreground transition-colors hover:bg-accent-soft hover:text-accent-soft-foreground',\n selected: cn(subtleFill, '*:text-surface-foreground'),\n today: 'font-semibold',\n outside: 'opacity-60 *:text-muted-foreground',\n disabled: 'opacity-60 *:pointer-events-none *:text-muted-foreground',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) =>\n orientation === 'left' ? (\n <CaretLeft size={16} aria-hidden />\n ) : orientation === 'right' ? (\n <CaretRight size={16} aria-hidden />\n ) : (\n <CaretDown size={16} aria-hidden />\n ),\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = 'Calendar';\n","import * as React from 'react';\nimport { CalendarBlank } from '@phosphor-icons/react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Calendar, type CalendarProps } from './Calendar';\nimport { Field } from './Field';\nimport { formatDateTime } from './formatDateTime';\nimport { TimePicker, type TimePickerProps, type TimeValue } from './TimePicker';\n\nfunction toTimeValue(date: Date | undefined): TimeValue | undefined {\n if (!date) return undefined;\n const hours = date.getHours();\n return { hour: hours % 12 === 0 ? 12 : hours % 12, minute: date.getMinutes(), period: hours >= 12 ? 'PM' : 'AM' };\n}\n\nfunction combine(date: Date, time: TimeValue): Date {\n const next = new Date(date);\n next.setHours((time.hour % 12) + (time.period === 'PM' ? 12 : 0), time.minute, 0, 0);\n return next;\n}\n\nexport interface DateTimePickerProps {\n /** Initial selection. The picker keeps its own draft until Apply, so remount it (e.g. with a `key`) to reset from a new value. */\n value?: Date;\n defaultValue?: Date;\n /** Called with the chosen date (time included when `showTime`) when Apply is pressed. */\n onApply?: (value: Date | undefined) => void;\n onReset?: () => void;\n /** Show the time picker column next to the calendar. */\n showTime?: boolean;\n calendarProps?: Omit<CalendarProps, 'mode' | 'selected' | 'onSelect'>;\n timePickerProps?: Omit<TimePickerProps, 'value' | 'onValueChange'>;\n className?: string;\n}\n\n// Figma: Calendar (25) › Date & time picker — card with the calendar, an optional time column and Reset / Apply.\nexport function DateTimePicker({\n value,\n defaultValue,\n onApply,\n onReset,\n showTime = true,\n calendarProps,\n timePickerProps,\n className,\n}: DateTimePickerProps) {\n const [date, setDate] = React.useState<Date | undefined>(value ?? defaultValue);\n const [time, setTime] = React.useState<TimeValue | undefined>(toTimeValue(value ?? defaultValue));\n\n const apply = () => {\n if (!date) return onApply?.(undefined);\n onApply?.(showTime ? combine(date, time ?? { hour: 12, minute: 0, period: 'AM' }) : date);\n };\n\n return (\n <div\n className={cn(\n 'inline-flex flex-col gap-4 rounded-lg border border-border bg-surface p-4 shadow-md',\n className,\n )}\n >\n <div className=\"flex items-center gap-6\">\n <Calendar mode=\"single\" selected={date} onSelect={setDate} defaultMonth={date} {...calendarProps} />\n {showTime && (\n <>\n <div className=\"h-70 w-px self-center bg-border\" aria-hidden=\"true\" />\n <TimePicker value={time} onValueChange={setTime} {...timePickerProps} />\n </>\n )}\n </div>\n <div className=\"flex items-center justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n setDate(undefined);\n setTime(undefined);\n onReset?.();\n }}\n >\n Reset\n </Button>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={apply}>\n Apply\n </Button>\n </div>\n </div>\n );\n}\n\nexport interface DatePickerProps extends Omit<DateTimePickerProps, 'onApply' | 'className'> {\n label?: React.ReactNode;\n placeholder?: string;\n onValueChange?: (value: Date | undefined) => void;\n className?: string;\n}\n\n/** Field-style trigger that opens a `DateTimePicker` in a popover. Figma: Calendar (25) › Calendar & time. */\nexport const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(\n ({ label, placeholder = 'Select date and time', value, defaultValue, onValueChange, showTime = true, className, ...pickerProps }, ref) => {\n const [open, setOpen] = React.useState(false);\n const [internal, setInternal] = React.useState<Date | undefined>(defaultValue);\n const current = value ?? internal;\n\n return (\n <Field label={label} className={cn('w-75', className)}>\n {(control) => (\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n <button\n ref={ref}\n type=\"button\"\n {...control}\n className=\"flex h-10 w-full items-center gap-3 rounded-md border border-input-muted bg-surface px-3 py-2.5 text-left shadow-xs transition-colors hover:border-input-accent data-[state=open]:border-input-accent\"\n >\n <CalendarBlank size={24} aria-hidden className=\"shrink-0 text-surface-foreground\" />\n <span className={cn('truncate', current ? 'text-ui-label-large text-surface-foreground' : 'text-body-base text-muted-foreground')}>\n {current ? formatDateTime(current, showTime) : placeholder}\n </span>\n </button>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content align=\"start\" sideOffset={8} style={{ zIndex: 'var(--sys-z-20)' }}>\n <DateTimePicker\n {...pickerProps}\n showTime={showTime}\n value={current}\n onApply={(next) => {\n setInternal(next);\n onValueChange?.(next);\n setOpen(false);\n }}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n )}\n </Field>\n );\n },\n);\nDatePicker.displayName = 'DatePicker';\n","import * as React from 'react';\nimport { CheckCircle, WarningCircle } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Label } from './Label';\n\nexport type FieldStatus = 'default' | 'success' | 'error';\n\n/**\n * Classes for a bordered field surface (Figma: Text Input / Textarea / Select).\n * Hover and the open \"select\" state use `input-accent`; success and error swap\n * the border colour. Focus is handled by the global `:focus-visible` ring.\n */\nexport function fieldSurfaceClasses(status: FieldStatus = 'default') {\n return cn(\n 'border bg-surface text-surface-foreground transition-colors',\n status === 'success' && 'border-success-foreground',\n status === 'error' && 'border-destructive',\n status === 'default' && 'border-input-muted hover:border-input-accent',\n );\n}\n\nexport interface FieldControlProps {\n id: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: true;\n}\n\nexport interface FieldProps {\n /** Label shown above the control. */\n label?: React.ReactNode;\n /** Neutral helper text shown under the control. Replaced by `message` on success/error. */\n description?: React.ReactNode;\n /** Status message shown with an icon when `status` is `success` or `error`. */\n message?: React.ReactNode;\n status?: FieldStatus;\n /** Id for the control; generated when omitted. */\n id?: string;\n className?: string;\n /** Render the control, spreading the supplied props onto it. */\n children: (control: FieldControlProps) => React.ReactNode;\n}\n\n/**\n * Label + control + helper/status message, wired together with\n * `htmlFor`/`aria-describedby`/`aria-invalid`. Shared by Text Input, Textarea,\n * Select, Numerical input and Input with action.\n */\nexport function Field({ label, description, message, status = 'default', id, className, children }: FieldProps) {\n const generatedId = React.useId();\n const controlId = id ?? generatedId;\n const messageId = `${controlId}-message`;\n const showStatus = status !== 'default' && message != null;\n const text = showStatus ? message : description;\n\n return (\n <div className={cn('flex w-full flex-col gap-1.5', className)}>\n {label != null && <Label htmlFor={controlId}>{label}</Label>}\n {children({\n id: controlId,\n 'aria-describedby': text != null ? messageId : undefined,\n 'aria-invalid': status === 'error' ? true : undefined,\n })}\n {text != null && (\n <p\n id={messageId}\n className={cn(\n 'flex gap-2 text-ui-caption',\n status === 'default' && 'text-secondary-muted-foreground',\n status === 'success' && 'items-center text-success-foreground',\n status === 'error' && 'items-start text-destructive',\n )}\n >\n {showStatus &&\n (status === 'error' ? (\n <WarningCircle size={16} aria-hidden className=\"shrink-0\" />\n ) : (\n <CheckCircle size={16} aria-hidden className=\"shrink-0\" />\n ))}\n {text}\n </p>\n )}\n </div>\n );\n}\n","/** `September 23, 2026 - 11:30 AM` (or just the date when `showTime` is false). */\nexport function formatDateTime(date: Date, showTime = true) {\n const day = date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' });\n if (!showTime) return day;\n return `${day} - ${date.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' })}`;\n}\n","import * as React from 'react';\nimport { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { TabItem } from '../Navigation/TabItem';\nimport { TabNavigation, Tabs } from '../Navigation/TabNavigation';\n\nexport interface TimeValue {\n /** 1–12 */\n hour: number;\n /** 0–59 */\n minute: number;\n period: 'AM' | 'PM';\n}\n\nexport interface TimeItemProps extends React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> {\n /** Dashed outline to suggest this slot. */\n recommended?: boolean;\n}\n\n// Figma: Calendar (25) › Time Item — a 12px/16px chip; selected is the subtle fill, hover is accent-soft.\nexport const TimeItem = React.forwardRef<React.ElementRef<typeof ToggleGroupPrimitive.Item>, TimeItemProps>(\n ({ className, recommended, ...props }, ref) => (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'flex w-full justify-center rounded-sm px-2.5 py-1.5 text-ui-caption text-secondary-muted-foreground transition-colors',\n 'hover:bg-accent-soft hover:text-accent-soft-foreground',\n 'data-[state=on]:bg-secondary data-[state=on]:bg-linear-to-r data-[state=on]:from-overlay-dark-5 data-[state=on]:to-overlay-dark-5 data-[state=on]:text-surface-foreground',\n 'data-[state=on]:hover:bg-accent-soft data-[state=on]:hover:bg-none data-[state=on]:hover:text-accent-soft-foreground',\n 'disabled:pointer-events-none disabled:opacity-60 disabled:text-muted-foreground',\n recommended && 'border border-dashed border-border text-surface-foreground',\n className,\n )}\n {...props}\n />\n ),\n);\nTimeItem.displayName = 'TimeItem';\n\nexport interface TimePickerProps {\n value?: TimeValue;\n onValueChange?: (value: TimeValue) => void;\n /** Minute interval between options. */\n minuteStep?: number;\n isHourDisabled?: (hour: number, period: 'AM' | 'PM') => boolean;\n isMinuteDisabled?: (minute: number, hour: number, period: 'AM' | 'PM') => boolean;\n isHourRecommended?: (hour: number, period: 'AM' | 'PM') => boolean;\n isMinuteRecommended?: (minute: number, hour: number, period: 'AM' | 'PM') => boolean;\n className?: string;\n}\n\nconst pad = (n: number) => String(n).padStart(2, '0');\n\n/** Figma: Calendar (25) › Time Picker Panel — AM/PM switch with hour and minute columns. */\nexport function TimePicker({\n value,\n onValueChange,\n minuteStep = 5,\n isHourDisabled,\n isMinuteDisabled,\n isHourRecommended,\n isMinuteRecommended,\n className,\n}: TimePickerProps) {\n const current: TimeValue = value ?? { hour: 12, minute: 0, period: 'AM' };\n const root = React.useRef<HTMLDivElement>(null);\n // Bring the selected hour / minute into view when the (scrollable) columns mount.\n React.useEffect(() => {\n root.current?.querySelectorAll<HTMLElement>('[data-state=\"on\"]').forEach((item) => {\n const column = item.parentElement;\n if (column) column.scrollTop = Math.max(0, item.offsetTop - column.offsetTop - column.clientHeight / 2 + item.clientHeight / 2);\n });\n }, []);\n const hours = Array.from({ length: 12 }, (_, i) => i + 1);\n const minutes = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => i * minuteStep);\n\n return (\n <div ref={root} className={cn('flex w-45 flex-col gap-4 pt-2', className)}>\n <p className=\"text-ui-label text-surface-foreground\">Select Time</p>\n <Tabs\n value={current.period}\n onValueChange={(period) => onValueChange?.({ ...current, period: period as 'AM' | 'PM' })}\n >\n <TabNavigation variant=\"toggle\" aria-label=\"AM or PM\" className=\"self-start\">\n {(['AM', 'PM'] as const).map((period) => (\n <TabItem key={period} value={period}>\n {period}\n </TabItem>\n ))}\n </TabNavigation>\n </Tabs>\n <div className=\"flex h-47.5 w-full items-start gap-3\">\n <ToggleGroupPrimitive.Root\n type=\"single\"\n aria-label=\"Hour\"\n value={String(current.hour)}\n onValueChange={(next) => next && onValueChange?.({ ...current, hour: Number(next) })}\n className=\"flex h-full min-w-0 flex-1 flex-col gap-1 overflow-y-auto\"\n >\n {hours.map((hour) => (\n <TimeItem\n key={hour}\n value={String(hour)}\n disabled={isHourDisabled?.(hour, current.period)}\n recommended={isHourRecommended?.(hour, current.period)}\n >\n {pad(hour)}\n </TimeItem>\n ))}\n </ToggleGroupPrimitive.Root>\n <div className=\"flex h-full items-center text-ui-label-large text-surface-foreground\" aria-hidden=\"true\">\n :\n </div>\n <ToggleGroupPrimitive.Root\n type=\"single\"\n aria-label=\"Minute\"\n value={String(current.minute)}\n onValueChange={(next) => next && onValueChange?.({ ...current, minute: Number(next) })}\n className=\"flex h-full min-w-0 flex-1 flex-col gap-1 overflow-y-auto\"\n >\n {minutes.map((minute) => (\n <TimeItem\n key={minute}\n value={String(minute)}\n disabled={isMinuteDisabled?.(minute, current.hour, current.period)}\n recommended={isMinuteRecommended?.(minute, current.hour, current.period)}\n >\n {pad(minute)}\n </TimeItem>\n ))}\n </ToggleGroupPrimitive.Root>\n </div>\n </div>\n );\n}\n","import * as React from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { TabNavigationContext } from './TabNavigation';\n\nexport type TabItemProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>;\n\n// Figma: Tab Item (08). The shape and states follow the parent TabNavigation variant.\nconst base =\n 'inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap px-2.5 py-1 text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50';\n// `relative` puts the tab above the TabNavigation's sliding indicator, which draws the selected tab's background.\nconst filter =\n 'relative rounded-full text-surface-foreground hover:text-accent data-[state=active]:hover:bg-accent-soft data-[state=active]:hover:text-accent-soft-foreground disabled:text-muted-foreground';\nconst toggle =\n 'relative rounded-sm text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:text-surface-foreground';\n\n// Page-level tab bar: the tab fills the bar's height; the active one is semibold with a 2px accent underline.\nconst underline =\n 'relative h-full rounded-none px-4 py-3 font-medium text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:font-semibold data-[state=active]:text-surface-foreground after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 data-[state=active]:after:bg-accent';\n\nexport const TabItem = React.forwardRef<React.ElementRef<typeof TabsPrimitive.Trigger>, TabItemProps>(\n ({ className, ...props }, ref) => {\n const variant = React.useContext(TabNavigationContext);\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(base, variant === 'toggle' ? toggle : variant === 'underline' ? underline : filter, className)}\n {...props}\n />\n );\n },\n);\nTabItem.displayName = 'TabItem';\n","import * as React from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\n/** `filter` is the pill-shaped table filter; `toggle` is the icon-only mode switch; `underline` is the page-level tab bar (give it the height of its bar, e.g. `h-16`; the active tab gets an accent underline). */\nexport type TabNavigationVariant = 'filter' | 'toggle' | 'underline';\n\nexport const TabNavigationContext = React.createContext<TabNavigationVariant>('filter');\n\nconst tabNavigationVariants = cva('inline-flex items-start gap-1 p-0.5', {\n variants: {\n variant: {\n // `relative`: the sliding indicator is positioned against the list.\n filter: 'relative rounded-full border border-border bg-surface',\n toggle: 'relative rounded-md bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5',\n underline: 'items-stretch p-0',\n },\n },\n defaultVariants: { variant: 'filter' },\n});\n\n/** Radix `Tabs.Root` — owns the selected value; pair with `TabNavigation` + `TabItem` + `TabsContent`. */\nexport const Tabs = TabsPrimitive.Root;\nexport const TabsContent = TabsPrimitive.Content;\n\nexport interface TabNavigationProps\n extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>,\n VariantProps<typeof tabNavigationVariants> {}\n\ninterface Box {\n left: number\n top: number\n width: number\n height: number\n}\n\n// The selected tab's background is one element that slides to the newly selected tab (filter and toggle variants), instead of\n// each tab painting its own: it is measured from the active tab and follows it as the selection or the size of the list changes.\nconst indicatorClasses: Record<'filter' | 'toggle', string> = {\n filter: 'rounded-full bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5',\n toggle: 'rounded-sm bg-surface',\n};\n\nexport const TabNavigation = React.forwardRef<React.ElementRef<typeof TabsPrimitive.List>, TabNavigationProps>(\n ({ className, variant = 'filter', children, ...props }, forwardedRef) => {\n const kind = variant ?? 'filter';\n const slides = kind !== 'underline';\n const listRef = React.useRef<HTMLDivElement | null>(null);\n const [box, setBox] = React.useState<Box | null>(null);\n // The first placement is instant; only later moves are animated.\n const [animate, setAnimate] = React.useState(false);\n\n const setRefs = React.useCallback(\n (node: HTMLDivElement | null) => {\n listRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) (forwardedRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [forwardedRef],\n );\n\n React.useLayoutEffect(() => {\n const list = listRef.current;\n if (!slides || !list) return;\n const measure = () => {\n const active = list.querySelector<HTMLElement>('[role=\"tab\"][data-state=\"active\"]');\n const next = active ? { left: active.offsetLeft, top: active.offsetTop, width: active.offsetWidth, height: active.offsetHeight } : null;\n setBox((prev) => (prev && next && prev.left === next.left && prev.top === next.top && prev.width === next.width && prev.height === next.height ? prev : next));\n };\n measure();\n const mutations = new MutationObserver(measure);\n mutations.observe(list, { attributes: true, attributeFilter: ['data-state'], subtree: true, childList: true });\n const resizes = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(measure);\n resizes?.observe(list);\n const frame = requestAnimationFrame(() => setAnimate(true));\n return () => {\n mutations.disconnect();\n resizes?.disconnect();\n cancelAnimationFrame(frame);\n };\n }, [slides]);\n\n return (\n <TabNavigationContext.Provider value={kind}>\n <TabsPrimitive.List ref={setRefs} className={cn(tabNavigationVariants({ variant }), className)} {...props}>\n {slides && box && (\n <span\n aria-hidden\n data-slot=\"tab-indicator\"\n className={cn(\n 'pointer-events-none absolute',\n indicatorClasses[kind as 'filter' | 'toggle'],\n animate && 'transition-[left,top,width,height] duration-200 ease-out motion-reduce:transition-none',\n )}\n style={{ left: box.left, top: box.top, width: box.width, height: box.height }}\n />\n )}\n {children}\n </TabsPrimitive.List>\n </TabNavigationContext.Provider>\n );\n },\n);\nTabNavigation.displayName = 'TabNavigation';\n","import * as React from 'react';\nimport { Slot } from 'radix-ui';\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\n\nimport { cn } from '../../lib/utils';\nimport { Label } from './Label';\n\nexport const Form = FormProvider;\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nexport function FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(props: ControllerProps<TFieldValues, TName>) {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nexport function useFormField() {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext?.name });\n\n if (!fieldContext) {\n throw new Error('useFormField must be used within <FormField>');\n }\n if (!itemContext) {\n throw new Error('useFormField must be used within <FormItem>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n}\n\nexport type FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const FormItem = React.forwardRef<HTMLDivElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('flex flex-col gap-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n});\nFormItem.displayName = 'FormItem';\n\n// Deliberately not `ComponentPropsWithoutRef<typeof Label>` — that type\n// transitively references a private @radix-ui/react-label type that tsup's\n// declaration build can't re-export portably. Label's own prop surface is\n// just native label attributes, so this is equivalent.\nexport type FormLabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;\n\nexport const FormLabel = React.forwardRef<HTMLLabelElement, FormLabelProps>(\n ({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n return (\n <Label\n ref={ref}\n htmlFor={formItemId}\n className={cn(error && 'text-destructive-foreground', className)}\n {...props}\n />\n );\n },\n);\nFormLabel.displayName = 'FormLabel';\n\nexport type FormControlProps = React.ComponentPropsWithoutRef<typeof Slot.Root>;\n\nexport const FormControl = React.forwardRef<React.ElementRef<typeof Slot.Root>, FormControlProps>((props, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n return (\n <Slot.Root\n ref={ref}\n id={formItemId}\n aria-describedby={error ? `${formDescriptionId} ${formMessageId}` : formDescriptionId}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = 'FormControl';\n\nexport type FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nexport const FormDescription = React.forwardRef<HTMLParagraphElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-sm text-secondary-muted-foreground', className)}\n {...props}\n />\n );\n },\n);\nFormDescription.displayName = 'FormDescription';\n\nexport type FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nexport const FormMessage = React.forwardRef<HTMLParagraphElement, FormMessageProps>(\n ({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn('text-sm text-destructive-foreground', className)} {...props}>\n {body}\n </p>\n );\n },\n);\nFormMessage.displayName = 'FormMessage';\n","import * as React from 'react';\nimport { PencilSimple, WarningCircle } from '@phosphor-icons/react';\n\nimport { cn, lengthOutOfRange } from '../../lib/utils';\nimport { fieldSurfaceClasses } from './Field';\nimport { DraftMarks, MarkedText, remapMarks, splitMarks, type InlineEditMark } from './MarkedText';\n\nexport type { InlineEditMark };\n\nexport interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n /** Controlled value. Pair with `onValueChange`. */\n value?: string;\n defaultValue?: string;\n /** Called when an edit is committed (Enter, blur or the commit key for multiline) with a changed value. */\n onValueChange?: (value: string) => void;\n /** Shown in read mode while the value is empty, muted unless `placeholderTone` says otherwise. */\n placeholder?: string;\n /** `regular` shows the placeholder in the normal text colour instead of the muted one, for hints that read as real content. Default `muted`. */\n placeholderTone?: 'muted' | 'regular';\n /** Accessible name for the read button and the field. Required: there is no visible label. */\n 'aria-label': string;\n /** Use a textarea. Enter inserts a line break; Cmd/Ctrl+Enter commits. */\n multiline?: boolean;\n maxLength?: number;\n /**\n * Shortest value (in characters, ignoring surrounding spaces) that may be saved. An edit that is too short is not saved:\n * the field stays open with an error message, and Escape still reverts.\n */\n minLength?: number;\n /**\n * Checks an edit before it is saved (on Enter or blur). Return a message to refuse it: the field stays open showing the\n * message and `onValueChange` is not called. Return nothing (or `null`) to accept. Runs after `minLength`.\n */\n validate?: (value: string) => string | null | undefined;\n /**\n * While editing, shows the allowed length under the field (from `minLength` and `maxLength`) with a live character\n * counter, but only while the text is too short or too long (the count is an error hint, not a running total). After a\n * refused save the same line turns into the error state (error colour and icon) instead of a different message appears.\n */\n showLimits?: boolean;\n /**\n * Multiline only: Enter saves (like a single-line field) and Shift+Enter inserts a line break. Cmd/Ctrl+Enter keeps\n * saving too. The `question` variant already works this way.\n */\n submitOnEnter?: boolean;\n disabled?: boolean;\n /** Called when editing starts or ends. */\n onEditingChange?: (editing: boolean) => void;\n /** Called on every keystroke while editing (and with the saved value when editing ends), e.g. for a live character counter. */\n onDraftChange?: (value: string) => void;\n /**\n * `default` is a rounded field. A short single-line label shows the pencil and hugs its text; `multiline` (longer\n * text) hides the pencil and fills the width. `question` is for question text: it fills the width with no pencil,\n * has square corners and shows a 1px bottom border on hover and focus (in the input border colour) that becomes a bolder 2px muted accent border while `selected` (light enough to stay distinct from the destructive underline of a marked word). Enter saves; Shift+Enter adds a\n * line break when `multiline`.\n */\n variant?: 'default' | 'question';\n /** `question` variant: keeps the bottom border while the owning question is selected. */\n selected?: boolean;\n /** Classes for the displayed/edited text, e.g. a heading text style. The field itself keeps the same box. */\n textClassName?: string;\n /**\n * Ranges of the saved text to underline in the destructive colour, for example misspelled words found by a spell checker. `start` is the\n * first character and `end` the one after the last. While the field is being edited the underlines stay (as plain lines: they take no click),\n * moving with the text typed after them and going away when the words they mark are changed. Ranges that are out of bounds, empty or\n * overlapping are ignored.\n */\n marks?: InlineEditMark[];\n /**\n * Makes each mark clickable: clicking an underlined word opens a small card with the marked text, its `suggestions` and a Dismiss action,\n * instead of starting the edit. Called with the mark and the suggestion the reader chose; apply it to the value yourself.\n */\n onMarkApply?: (mark: InlineEditMark, replacement: string) => void;\n /** Called when the reader dismisses a mark from its card. Remove the mark to make the underline go away. */\n onMarkDismiss?: (mark: InlineEditMark) => void;\n}\n\n/** \"150 characters required\" (the maximum shows in the live count beside it), or \"Up to 500 characters\" when there is no minimum. */\nfunction limitsText(min?: number, max?: number) {\n if (min !== undefined) return `${min} ${min === 1 ? 'character' : 'characters'} required`;\n if (max !== undefined) return `Up to ${max} characters`;\n return '';\n}\n\n// Not in Figma: shadcn has no inline-edit primitive, so this is a plain toggle between a button and a field.\n// Read mode is a button (so it is keyboard- and screen-reader-reachable); editing swaps in an input that commits on\n// Enter/blur and reverts on Escape.\nexport const InlineEdit = React.forwardRef<HTMLDivElement, InlineEditProps>(\n (\n {\n className,\n textClassName,\n marks,\n onMarkApply,\n onMarkDismiss,\n value: valueProp,\n defaultValue = '',\n onValueChange,\n placeholder = 'Click to edit',\n placeholderTone = 'muted',\n multiline,\n maxLength,\n minLength,\n validate,\n showLimits,\n submitOnEnter,\n disabled,\n onEditingChange,\n onDraftChange,\n variant = 'default',\n selected,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState(defaultValue);\n const value = valueProp ?? internal;\n const [editing, setEditing] = React.useState(false);\n const [draft, setDraft] = React.useState(value);\n // The reason the last attempt to save was refused; cleared by the next valid keystroke, Escape or a save.\n const [error, setError] = React.useState<string | null>(null);\n const errorId = React.useId();\n // The limits and the live count show only when the text is too short or too long (or a save was refused), never while it is fine.\n const limitsVisible = !!showLimits && (!!error || lengthOutOfRange(draft, minLength, maxLength));\n const fieldRef = React.useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n // A one-line field scrolls sideways when its text is longer than the box; the underlines follow.\n const [scroll, setScroll] = React.useState(0);\n // The marks as they stand while the text is edited: carried over keystroke by keystroke (see `remapMarks`).\n const [draftMarks, setDraftMarks] = React.useState<InlineEditMark[]>([]);\n const readRef = React.useRef<HTMLButtonElement>(null);\n // Set while an Escape revert is pending so the blur that follows it does not commit.\n const cancelled = React.useRef(false);\n const restoreFocus = React.useRef(false);\n\n React.useEffect(() => {\n if (editing) {\n fieldRef.current?.focus();\n fieldRef.current?.select();\n } else if (restoreFocus.current) {\n restoreFocus.current = false;\n readRef.current?.focus();\n }\n }, [editing]);\n\n const problemWith = (text: string) => {\n if (minLength !== undefined && text.trim().length < minLength) {\n return `Enter at least ${minLength} characters (${text.trim().length} now).`;\n }\n return validate?.(text) ?? null;\n };\n\n const start = () => {\n if (disabled) return;\n setDraft(value);\n setDraftMarks(marks ?? []);\n setError(null);\n cancelled.current = false;\n setEditing(true);\n onEditingChange?.(true);\n };\n const finish = (commit: boolean, refocus: boolean) => {\n if (commit && draft !== value) {\n // An edit that fails validation is not saved: the field stays open and says why.\n const problem = problemWith(draft);\n if (problem) {\n setError(problem);\n return;\n }\n }\n setError(null);\n restoreFocus.current = refocus;\n if (commit && draft !== value) {\n if (valueProp === undefined) setInternal(draft);\n onValueChange?.(draft);\n }\n setEditing(false);\n onEditingChange?.(false);\n onDraftChange?.(commit ? draft : value);\n };\n\n const textClasses = cn('text-ui-input-value text-surface-foreground', textClassName);\n const question = variant === 'question';\n const draftMarksClass = cn('px-3 py-1', question ? 'border-0 border-b-2 border-transparent' : 'border border-transparent', multiline ? 'whitespace-pre-wrap break-words' : 'whitespace-pre', textClasses);\n // Longer text and question text fill the box and drop the pencil; a short label hugs its text.\n const fill = multiline || question;\n\n return (\n <div\n ref={ref}\n className={cn(fill ? 'flex w-full min-w-0' : 'inline-flex min-w-0 max-w-full', editing && (error || limitsVisible) && 'flex-col gap-1.5', className)}\n {...props}\n >\n {editing ? (\n <>\n {/* With marks, the highlight layer sits behind the field: a one-line or multi-line field with a surface of its own hands it to this wrapper, so the layer shows through. */}\n <div className={cn('relative flex w-full min-w-0', draftMarks.length > 0 && !question && 'rounded-md bg-surface')}>\n {draftMarks.length > 0 && (\n <DraftMarks\n layer=\"behind\"\n singleLine={!multiline}\n text={draft}\n marks={draftMarks}\n scrollLeft={multiline ? 0 : scroll}\n // The field's own box and type, so every line lands under its words.\n className={draftMarksClass}\n />\n )}\n {React.createElement(multiline ? 'textarea' : 'input', {\n ref: fieldRef,\n value: draft,\n maxLength,\n 'aria-label': ariaLabel,\n 'aria-invalid': error ? true : undefined,\n 'aria-describedby': error || limitsVisible ? errorId : undefined,\n ...(multiline ? { rows: 1 } : { type: 'text' }),\n className: cn(\n 'relative w-full px-3 py-1 outline-none',\n multiline && 'field-sizing-content resize-none',\n question\n ? cn('rounded-none border-0 border-b-2 bg-transparent', error ? 'border-destructive' : 'border-accent-muted')\n : cn('rounded-md', !error && 'focus-visible:border-input-accent', fieldSurfaceClasses(error ? 'error' : 'default')),\n textClasses,\n // Transparent over the highlight layer, so the highlight and the browser's text selection show together.\n draftMarks.length > 0 && 'bg-transparent',\n ),\n onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n setDraft(event.target.value);\n setDraftMarks(remapMarks(draft, event.target.value, draftMarks));\n requestAnimationFrame(() => setScroll(fieldRef.current?.scrollLeft ?? 0));\n // After a refused save, the message follows what is typed and goes away as soon as the text is acceptable.\n if (error) setError(problemWith(event.target.value));\n onDraftChange?.(event.target.value);\n },\n onKeyDown: (event: React.KeyboardEvent) => {\n if (event.key === 'Escape') {\n cancelled.current = true;\n setError(null);\n finish(false, true);\n } else if (\n event.key === 'Enter' &&\n (!multiline || event.metaKey || event.ctrlKey || ((question || submitOnEnter) && !event.shiftKey))\n ) {\n event.preventDefault();\n finish(true, true);\n }\n },\n onScroll: (event: React.UIEvent<HTMLInputElement | HTMLTextAreaElement>) => setScroll(event.currentTarget.scrollLeft),\n onBlur: () => {\n if (!cancelled.current) finish(true, false);\n },\n })}\n {draftMarks.length > 0 && (\n <DraftMarks\n layer=\"over\"\n singleLine={!multiline}\n text={draft}\n marks={draftMarks}\n scrollLeft={multiline ? 0 : scroll}\n // The field's own box and type, so every line lands under its words.\n className={draftMarksClass}\n />\n )}\n </div>\n {(error || limitsVisible) && (\n <p\n id={errorId}\n role={error ? 'alert' : undefined}\n className={cn('flex items-start justify-between gap-2 px-3 text-ui-caption', error ? 'text-destructive' : 'text-secondary-muted-foreground')}\n >\n <span className=\"flex items-start gap-2\">\n {error && <WarningCircle size={16} aria-hidden className=\"shrink-0\" />}\n {limitsVisible ? limitsText(minLength, maxLength) : error}\n {/* The line stays the same in the error state; screen readers also get the reason. */}\n {limitsVisible && error && <span className=\"sr-only\">{error}</span>}\n </span>\n {limitsVisible && (\n <span aria-hidden className=\"shrink-0 tabular-nums\">\n {draft.length}\n {maxLength !== undefined && `/${maxLength}`}\n </span>\n )}\n </p>\n )}\n </>\n ) : (\n <button\n ref={readRef}\n type=\"button\"\n disabled={disabled}\n aria-label={`${ariaLabel}: ${value || placeholder}. Edit`}\n onClick={start}\n className={cn(\n 'group inline-flex min-w-0 max-w-full items-center gap-2 px-3 text-left outline-none',\n fill && 'w-full',\n question\n ? // Hover and focus show a 1px bottom border in the input colour; only a selected question gets the 2px muted accent\n // one. The extra 1px of bottom padding keeps the height identical so the text never jumps.\n selected\n ? 'rounded-none border-b-2 border-accent-muted py-1'\n : 'rounded-none border-b border-transparent pb-1.25 pt-1 enabled:hover:border-input-muted enabled:focus-visible:border-input-muted'\n : 'rounded-md border border-transparent py-1 enabled:focus-visible:border-input-accent',\n // The text is editable in place, so hovering it shows the text cursor.\n // A selected question already stands out, so its text field takes no hover background.\n question && selected ? 'enabled:cursor-text' : 'enabled:cursor-text enabled:hover:bg-secondary',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n textClasses,\n )}\n >\n <span className={cn('min-w-0', multiline ? 'whitespace-pre-wrap' : 'truncate', fill && 'flex-1', !value && placeholderTone === 'muted' && 'text-muted-foreground')}>\n {value\n ? splitMarks(value, marks).map((piece) =>\n piece.mark ? (\n <MarkedText key={`${piece.mark.start}:${piece.text}`} mark={piece.mark} text={piece.text} onApply={onMarkApply} onDismiss={onMarkDismiss} />\n ) : (\n piece.text\n ),\n )\n : placeholder}\n </span>\n {!fill && (\n <PencilSimple\n size={16}\n aria-hidden\n className=\"shrink-0 text-secondary-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100\"\n />\n )}\n </button>\n )}\n </div>\n );\n },\n);\nInlineEdit.displayName = 'InlineEdit';\n","import * as React from 'react';\nimport { Trash } from '@phosphor-icons/react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\n// Internal: the underlined, clickable words shared by the text fields that can mark them (InlineEdit, QuestionOptionEditor). Only `InlineEditMark` is public.\n\nexport interface InlineEditMark {\n start: number;\n end: number;\n /** Corrections offered in the mark's card, best first (at most three are shown). Used with `onMarkApply`: with one the card has an Apply button; with several each is a choice applied by a click on it and there is no Apply button. An empty string offers to remove the marked text (the button reads \"Remove\"). */\n suggestions?: string[];\n /** The colour of the underline: `destructive` (default, for mistakes such as typos) or `warning` (for a recommendation, such as wording that could be clearer). */\n tone?: 'destructive' | 'warning';\n /** Why the words are marked, shown in the mark's card above the suggestions. Without it the card is unchanged. */\n message?: string;\n}\n\n/** The text split into plain and marked pieces; marks that don't fit the text are dropped. */\nexport function splitMarks(text: string, marks: InlineEditMark[] | undefined): { text: string; mark?: InlineEditMark }[] {\n const valid = (marks ?? []).filter((m) => Number.isInteger(m.start) && Number.isInteger(m.end) && m.start >= 0 && m.end > m.start && m.end <= text.length).sort((a, b) => a.start - b.start);\n const out: { text: string; mark?: InlineEditMark }[] = [];\n let at = 0;\n for (const m of valid) {\n if (m.start < at) continue;\n if (m.start > at) out.push({ text: text.slice(at, m.start) });\n out.push({ text: text.slice(m.start, m.end), mark: m });\n at = m.end;\n }\n if (at < text.length) out.push({ text: text.slice(at) });\n return out;\n}\n\n// The line under a marked word is destructive or warning (a warning mark also has the warning highlight behind the words). It is not drawn by the word's own box\n// but by one box per line of the word (`MarkLines`), so on a title that wraps every line reaches the field's edges the same way.\nconst lineClasses = (tone: InlineEditMark['tone'], hovered: boolean) =>\n cn('pointer-events-none absolute -z-10 rounded-xxs border-b-2', tone === 'warning' ? 'border-warning-foreground bg-warning-background-highlight' : cn('border-destructive-foreground', hovered && 'bg-destructive-soft'));\n\ninterface MarkLine {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\ninterface FieldBox {\n top: number;\n bottom: number;\n /** The text area inside the field's border and padding. */\n contentTop: number;\n contentBottom: number;\n lineHeight: number;\n}\n\n/**\n * The box of each line of a marked word, relative to `origin`. Each one is the line's own height, except that the first line reaches the field's top edge and the last\n * line the field's bottom edge: its line then lands exactly on the field's own bottom border (the field's hover and selected underline), covering it instead of showing a\n * second one a few pixels above. `rects` are the word's pieces, one per line. Without a field, each piece is its own box.\n */\nexport function markLines(rects: { left: number; top: number; width: number; height: number }[], origin: { left: number; top: number }, field?: FieldBox): MarkLine[] {\n const count = field ? Math.max(1, Math.round((field.contentBottom - field.contentTop) / field.lineHeight)) : 1;\n const boxes = rects\n .filter((r) => r.width > 0)\n .map((r) => {\n if (!field) return { left: r.left - origin.left, top: r.top - origin.top, width: r.width, height: r.height };\n const index = Math.min(count - 1, Math.max(0, Math.floor((r.top + r.height / 2 - field.contentTop) / field.lineHeight)));\n const top = index === 0 ? field.top : field.contentTop + index * field.lineHeight;\n const bottom = index === count - 1 ? field.bottom : field.contentTop + (index + 1) * field.lineHeight;\n return { left: r.left - origin.left, top: top - origin.top, width: r.width, height: bottom - top };\n });\n // A line can come in several pieces (the space where the text wraps is one): they make one box.\n return boxes.reduce<MarkLine[]>((out, box) => {\n const same = field ? out.find((o) => Math.abs(o.top - box.top) < 0.5 && Math.abs(o.height - box.height) < 0.5) : undefined;\n if (!same) return [...out, box];\n const left = Math.min(same.left, box.left);\n const right = Math.max(same.left + same.width, box.left + box.width);\n return out.map((o) => (o === same ? { ...o, left, width: right - left } : o));\n }, []);\n}\n\nconst sameLines = (a: MarkLine[], b: MarkLine[]) => a.length === b.length && a.every((l, i) => (Object.keys(l) as (keyof MarkLine)[]).every((k) => Math.abs(l[k] - b[i][k]) < 0.5));\n\n/** Measures the lines of a marked word after every render (a word can move when the text before it changes) and when the field changes size. */\nfunction useMarkLines(anchorRef: React.RefObject<HTMLSpanElement | null>, markRef: React.RefObject<HTMLSpanElement | null>) {\n const [lines, setLines] = React.useState<MarkLine[]>([]);\n const measure = React.useCallback(() => {\n const anchor = anchorRef.current;\n const mark = markRef.current;\n if (!anchor || !mark) return;\n const button = mark.closest('button');\n const a = anchor.getBoundingClientRect();\n let field: FieldBox | undefined;\n if (button) {\n const b = button.getBoundingClientRect();\n const style = getComputedStyle(button);\n const contentTop = b.top + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.paddingTop) || 0);\n const contentBottom = b.bottom - (parseFloat(style.borderBottomWidth) || 0) - (parseFloat(style.paddingBottom) || 0);\n field = { top: b.top, bottom: b.bottom, contentTop, contentBottom, lineHeight: parseFloat(style.lineHeight) || contentBottom - contentTop };\n }\n const next = markLines([...mark.getClientRects()], a, field);\n setLines((prev) => (sameLines(prev, next) ? prev : next));\n }, [anchorRef, markRef]);\n React.useLayoutEffect(measure);\n React.useLayoutEffect(() => {\n const button = markRef.current?.closest('button');\n if (!button) return;\n const observer = new ResizeObserver(measure);\n observer.observe(button);\n return () => observer.disconnect();\n }, [markRef, measure]);\n return lines;\n}\n\n/**\n * The marks of the saved text carried over to the text being edited, so the underlines stay while the field is open: the part before the edit keeps its marks,\n * the part after it keeps them moved by the change in length, and a mark the edit touches is dropped (those words are being rewritten).\n */\nexport function remapMarks(saved: string, draft: string, marks: InlineEditMark[] | undefined): InlineEditMark[] {\n if (!marks?.length) return [];\n if (saved === draft) return marks;\n const max = Math.min(saved.length, draft.length);\n let before = 0;\n while (before < max && saved[before] === draft[before]) before += 1;\n let after = 0;\n while (after < max - before && saved[saved.length - 1 - after] === draft[draft.length - 1 - after]) after += 1;\n const editEnd = saved.length - after;\n const delta = draft.length - saved.length;\n return marks.flatMap((m) => (m.end <= before ? [m] : m.start >= editEnd ? [{ ...m, start: m.start + delta, end: m.end + delta }] : []));\n}\n\n/**\n * The highlight and the underline of a field's marks while the field is being edited, drawn in two layers so the field looks as it does when it is not edited:\n * the same box per line of the marked words (see `markLines`), the first line reaching the field's top and the last line's underline landing on its bottom border.\n * - `behind` goes before the field and draws the highlight; the field is transparent and painted over it, so its letters and the browser's text selection show over the highlight.\n * - `over` goes after the field and draws the underlines, so the last line's underline covers the field's own bottom border.\n * Both hold the same text with invisible letters, to know where each line of the words is and follow the field's horizontal scroll. They never take a click (the field does).\n * `className` must give the text the field's own padding, border and type; `singleLine` is for a field whose text never wraps.\n */\nexport function DraftMarks({ text, marks, layer, className, scrollLeft = 0, singleLine }: { text: string; marks: InlineEditMark[]; layer: 'behind' | 'over'; className?: string; scrollLeft?: number; singleLine?: boolean }) {\n const rootRef = React.useRef<HTMLDivElement>(null);\n const textRef = React.useRef<HTMLDivElement>(null);\n const [boxes, setBoxes] = React.useState<{ tone: string; box: MarkLine }[]>([]);\n React.useLayoutEffect(() => {\n if (textRef.current) textRef.current.scrollLeft = scrollLeft;\n }, [scrollLeft, text]);\n // The boxes follow the text after every render, and are only replaced when they moved.\n React.useLayoutEffect(() => {\n const root = rootRef.current;\n const mirror = textRef.current;\n if (!root || !mirror) return;\n const r = root.getBoundingClientRect();\n const style = getComputedStyle(mirror);\n const contentTop = r.top + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.paddingTop) || 0);\n const contentBottom = r.bottom - (parseFloat(style.borderBottomWidth) || 0) - (parseFloat(style.paddingBottom) || 0);\n const lineHeight = singleLine ? contentBottom - contentTop : parseFloat(style.lineHeight) || contentBottom - contentTop;\n const field: FieldBox = { top: r.top, bottom: r.bottom, contentTop, contentBottom, lineHeight };\n const next = [...mirror.querySelectorAll<HTMLElement>('[data-draft-mark]')].flatMap((el) =>\n markLines([...el.getClientRects()], { left: r.left, top: r.top }, field).map((box) => ({ tone: el.dataset.tone ?? 'destructive', box })),\n );\n setBoxes((prev) => (prev.length === next.length && prev.every((p, i) => p.tone === next[i].tone && sameLines([p.box], [next[i].box])) ? prev : next));\n });\n return (\n <div ref={rootRef} aria-hidden data-draft-marks data-layer={layer} className=\"pointer-events-none absolute inset-0\">\n <div ref={textRef} className={cn(className, 'absolute inset-0 overflow-hidden text-transparent')}>\n {splitMarks(text, marks).map((piece, i) =>\n piece.mark ? (\n <span key={i} data-draft-mark data-tone={piece.mark.tone ?? 'destructive'}>\n {piece.text}\n </span>\n ) : (\n <span key={i}>{piece.text}</span>\n ),\n )}\n </div>\n {/* The boxes may reach a little past the field's edges (the last underline covers its border), but not sideways. */}\n <div className=\"absolute inset-0\" style={{ clipPath: 'inset(-4px 0)' }}>\n {boxes.map(({ tone, box }, i) =>\n layer === 'behind' ? (\n tone === 'warning' && <span key={i} data-draft-box className=\"absolute rounded-xxs bg-warning-background-highlight\" style={box} />\n ) : (\n <span key={i} data-draft-box className={cn('absolute rounded-xxs border-b-2', tone === 'warning' ? 'border-warning-foreground' : 'border-destructive-foreground')} style={box} />\n ),\n )}\n </div>\n </div>\n );\n}\n\n/** The card that is open right now, anywhere on the page: opening another one closes it, so only one is ever open. */\nlet closeOpenMarkCard: (() => void) | null = null;\n\n/** A marked piece of text. Plain underline, or, when the owner handles marks, a button that opens a card to apply a suggestion or dismiss the mark. */\nexport function MarkedText({ mark, text, onApply, onDismiss }: { mark: InlineEditMark; text: string; onApply?: (mark: InlineEditMark, replacement: string) => void; onDismiss?: (mark: InlineEditMark) => void }) {\n const ref = React.useRef<HTMLSpanElement>(null);\n const [open, setOpen] = React.useState(false);\n const close = React.useCallback(() => setOpen(false), []);\n React.useEffect(\n () => () => {\n if (closeOpenMarkCard === close) closeOpenMarkCard = null;\n },\n [close],\n );\n const anchorRef = React.useRef<HTMLSpanElement>(null);\n const [hovered, setHovered] = React.useState(false);\n const lines = useMarkLines(anchorRef, ref);\n // An empty, positioned anchor just before the word holds one box per line of it; the word comes after it and is positioned too, so its letters are painted over them.\n const layers = (\n <span ref={anchorRef} aria-hidden className=\"relative isolate\">\n {lines.map((line, i) => (\n <span key={i} data-mark-line className={lineClasses(mark.tone, hovered)} style={line} />\n ))}\n </span>\n );\n if (!onApply && !onDismiss) {\n return (\n <>\n {layers}\n <span ref={ref} data-mark data-tone={mark.tone ?? 'destructive'} className=\"relative\">\n {text}\n </span>\n </>\n );\n }\n const suggestions = (mark.suggestions ?? []).slice(0, 3);\n const warning = mark.tone === 'warning';\n // The struck-through words are the destructive color for every tone: they are what would be replaced.\n const struck = 'text-destructive-foreground';\n const handleOpenChange = (next: boolean) => {\n if (next) {\n if (closeOpenMarkCard && closeOpenMarkCard !== close) closeOpenMarkCard();\n closeOpenMarkCard = close;\n } else if (closeOpenMarkCard === close) {\n closeOpenMarkCard = null;\n }\n setOpen(next);\n };\n // The mark sits inside the read-mode button, so clicks and keys here must not also start the edit.\n const stop = (event: React.SyntheticEvent) => event.stopPropagation();\n return (\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n {layers}\n <PopoverPrimitive.Trigger asChild>\n <span\n ref={ref}\n data-mark\n data-tone={mark.tone ?? 'destructive'}\n role=\"button\"\n tabIndex={-1}\n onClick={stop}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n className=\"relative cursor-pointer\"\n >\n {text}\n </span>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={8}\n style={{ zIndex: 'var(--sys-z-40)' }}\n onClick={stop}\n onKeyDown={stop}\n // The mark is not focusable, and focus jumping back to it would make a card opened next think focus left it.\n onCloseAutoFocus={(event) => event.preventDefault()}\n className=\"flex w-72 flex-col gap-3 rounded-md border border-border bg-surface p-4 text-left text-body-base font-normal shadow-md outline-none\"\n >\n {suggestions.length > 1 && onApply ? (\n // Several possible fixes: each one is a choice, applied with a click, so there is no Apply button.\n <div className=\"flex flex-col gap-1\" role=\"group\" aria-label=\"Choose a correction\">\n {suggestions.map((suggestion) => (\n <Button key={suggestion} type=\"button\" size=\"sm\" variant=\"ghost\" className=\"h-auto justify-start px-2 py-1 whitespace-normal\" onClick={() => onApply(mark, suggestion)}>\n <s className={struck}>{text}</s> <span className=\"font-semibold text-accent-foreground\">{suggestion === '' ? 'Remove' : suggestion}</span>\n </Button>\n ))}\n </div>\n ) : (\n suggestions.length > 0 && (\n <p className=\"min-w-0 break-words\">\n <s className={struck}>{text}</s>\n {suggestions[0] !== '' && (\n <>\n {' '}\n <span className=\"font-semibold text-accent-foreground\">{suggestions[0]}</span>\n </>\n )}\n </p>\n )\n )}\n {/* The rationale comes after the correction it explains, and before the buttons. */}\n {mark.message && <p className=\"min-w-0 break-words text-body-small text-surface-foreground\">{mark.message}</p>}\n <div className={cn('flex items-center gap-3', warning ? 'justify-end' : 'justify-between')}>\n {onDismiss ? (\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={() => onDismiss(mark)}>\n <Trash size={16} aria-hidden /> Dismiss\n </Button>\n ) : (\n <span />\n )}\n {onApply && suggestions.length === 1 && (\n <Button type=\"button\" size=\"sm\" onClick={() => onApply(mark, suggestions[0])}>\n {suggestions[0] === '' ? 'Remove' : 'Apply'}\n </Button>\n )}\n </div>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { Field, fieldSurfaceClasses, type FieldStatus } from './Field';\n\nexport interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {\n /** Border/message state. `error` also sets `aria-invalid`. */\n status?: FieldStatus;\n /** Convenience: renders a Field (label + helper/status message) around the input. */\n label?: React.ReactNode;\n description?: React.ReactNode;\n message?: React.ReactNode;\n}\n\n// Figma: Text Input (19) — 40px tall, 12px inline padding, 8px radius, 16px value.\nconst inputClasses = (status: FieldStatus | undefined, className?: string) =>\n cn(\n 'flex h-10 w-full rounded-md px-3 py-2 text-ui-input-value placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n fieldSurfaceClasses(status),\n className,\n );\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, status = 'default', label, description, message, id, ...props }, ref) => {\n if (label == null && description == null && message == null) {\n return (\n <input\n ref={ref}\n id={id}\n aria-invalid={status === 'error' ? true : undefined}\n className={inputClasses(status, className)}\n {...props}\n />\n );\n }\n return (\n <Field label={label} description={description} message={message} status={status} id={id}>\n {(control) => <input ref={ref} className={inputClasses(status, className)} {...control} {...props} />}\n </Field>\n );\n },\n);\nInput.displayName = 'Input';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Field, type FieldStatus } from './Field';\n\nexport interface InputWithActionProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {\n /** Label of the trailing action button. */\n actionLabel: string;\n onAction?: React.MouseEventHandler<HTMLButtonElement>;\n /** Chips (e.g. `EditableTag`s) shown inside the field before the input. */\n tags?: React.ReactNode;\n status?: Exclude<FieldStatus, 'success'>;\n label?: React.ReactNode;\n /** Support text shown under the field. */\n description?: React.ReactNode;\n /** Error message shown when `status` is `error`. */\n message?: React.ReactNode;\n}\n\n// Figma: Input with Action (19) — field with a trailing subtle small button (e.g. \"Invite\").\nexport const InputWithAction = React.forwardRef<HTMLInputElement, InputWithActionProps>(\n (\n { className, actionLabel, onAction, tags, status = 'default', label, description, message, id, disabled, placeholder, ...props },\n ref,\n ) => (\n <Field label={label} description={description} message={message} status={status} id={id}>\n {(control) => (\n <div\n className={cn(\n 'flex min-h-10 w-full items-center gap-2 rounded-md border bg-surface py-2 pr-1 pl-3 transition-colors',\n 'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-ring',\n status === 'error' ? 'border-destructive' : 'border-input-muted hover:border-input-accent focus-within:border-input-muted',\n tags ? 'pl-1' : null,\n disabled && 'opacity-50',\n className,\n )}\n >\n {tags && <div className=\"flex shrink-0 items-center gap-1\">{tags}</div>}\n <input\n ref={ref}\n disabled={disabled}\n placeholder={tags ? undefined : placeholder}\n className=\"min-w-0 flex-1 truncate bg-transparent text-body-small text-surface-foreground outline-none placeholder:text-muted-foreground\"\n {...control}\n {...props}\n />\n <Button type=\"button\" variant=\"subtle\" size=\"sm\" disabled={disabled} onClick={onAction}>\n {actionLabel}\n </Button>\n </div>\n )}\n </Field>\n ),\n);\nInputWithAction.displayName = 'InputWithAction';\n","import * as React from 'react';\nimport { Minus, Plus } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Field, type FieldStatus } from './Field';\n\nexport interface NumberInputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'type' | 'size'> {\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n /** Unit shown after the value (e.g. \"minutes\"). */\n unit?: string;\n status?: FieldStatus;\n label?: React.ReactNode;\n description?: React.ReactNode;\n message?: React.ReactNode;\n}\n\n// Figma: Numerical input (23) — 200px stepper: − / value + unit / +, 40px tall, 4px inner padding.\nexport const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(\n (\n {\n className,\n value,\n defaultValue = 0,\n onValueChange,\n min = Number.NEGATIVE_INFINITY,\n max = Number.POSITIVE_INFINITY,\n step = 1,\n unit,\n status = 'default',\n label,\n description,\n message,\n id,\n disabled,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState(defaultValue);\n const current = value ?? internal;\n const clamp = (next: number) => Math.min(max, Math.max(min, next));\n const commit = (next: number) => {\n const clamped = clamp(next);\n setInternal(clamped);\n onValueChange?.(clamped);\n };\n\n return (\n <Field label={label} description={description} message={message} status={status} id={id} className=\"w-50\">\n {(control) => (\n <div\n className={cn(\n 'flex h-10 w-full items-center justify-between rounded-md border bg-surface p-1 transition-colors',\n 'has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-ring',\n status === 'error' ? 'border-destructive' : status === 'success' ? 'border-success-foreground' : 'border-border',\n disabled && 'opacity-50',\n className,\n )}\n >\n <Button\n type=\"button\"\n variant=\"subtle\"\n size=\"icon-sm\"\n aria-label=\"Decrease\"\n disabled={disabled || current <= min}\n onClick={() => commit(current - step)}\n >\n <Minus size={16} aria-hidden />\n </Button>\n <div className=\"flex items-center justify-center gap-1 text-center\">\n <input\n ref={ref}\n role=\"spinbutton\"\n inputMode=\"numeric\"\n aria-valuenow={current}\n aria-valuemin={Number.isFinite(min) ? min : undefined}\n aria-valuemax={Number.isFinite(max) ? max : undefined}\n disabled={disabled}\n value={String(current)}\n size={Math.max(1, String(current).length)}\n onChange={(event) => {\n const parsed = Number(event.target.value.replace(/[^\\d.-]/g, ''));\n if (!Number.isNaN(parsed)) commit(parsed);\n }}\n onKeyDown={(event) => {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n commit(current + step);\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n commit(current - step);\n }\n }}\n className=\"min-w-0 bg-transparent text-center text-ui-label text-surface-foreground outline-none\"\n {...control}\n {...props}\n />\n {unit && <span className=\"text-body-small text-secondary-muted-foreground\">{unit}</span>}\n </div>\n <Button\n type=\"button\"\n variant=\"subtle\"\n size=\"icon-sm\"\n aria-label=\"Increase\"\n disabled={disabled || current >= max}\n onClick={() => commit(current + step)}\n >\n <Plus size={16} aria-hidden />\n </Button>\n </div>\n )}\n </Field>\n );\n },\n);\nNumberInput.displayName = 'NumberInput';\n","import * as React from 'react';\nimport { MagnifyingGlass, X } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface SearchBarProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {\n /** Called when the clear (×) button is pressed, after the field has been emptied. */\n onClear?: () => void;\n /** Label for the clear button. */\n clearLabel?: string;\n}\n\n// Figma: Search Bar (18) — 40px, 1px muted border; focused/filled gets a 2px accent border.\nexport const SearchBar = React.forwardRef<HTMLInputElement, SearchBarProps>(\n ({ className, value, defaultValue, onChange, onClear, clearLabel = 'Clear search', disabled, ...props }, ref) => {\n const innerRef = React.useRef<HTMLInputElement>(null);\n React.useImperativeHandle(ref, () => innerRef.current as HTMLInputElement);\n const [uncontrolled, setUncontrolled] = React.useState(String(defaultValue ?? ''));\n const current = value !== undefined ? String(value) : uncontrolled;\n\n const clear = () => {\n const input = innerRef.current;\n if (input) {\n // Drive the native setter so React's onChange fires for controlled consumers too.\n const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n setter?.call(input, '');\n input.dispatchEvent(new Event('input', { bubbles: true }));\n input.focus();\n }\n onClear?.();\n };\n\n return (\n <div\n className={cn(\n 'flex h-10 w-full items-center gap-2 rounded-md border bg-surface px-3 py-2 transition-colors',\n 'border-input-muted focus-within:border-input-accent focus-within:ring-1 focus-within:ring-input-accent',\n current !== '' && 'border-input-accent ring-1 ring-input-accent',\n disabled && 'opacity-50',\n className,\n )}\n >\n <MagnifyingGlass size={16} aria-hidden className=\"shrink-0 text-surface-foreground\" />\n <input\n ref={innerRef}\n type=\"text\"\n role=\"searchbox\"\n value={value}\n defaultValue={defaultValue}\n disabled={disabled}\n onChange={(event) => {\n setUncontrolled(event.target.value);\n onChange?.(event);\n }}\n className=\"min-w-0 flex-1 bg-transparent text-ui-input-value text-surface-foreground outline-none placeholder:text-muted-foreground\"\n {...props}\n />\n {current !== '' && !disabled && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onClick={clear}\n className=\"inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground\"\n >\n <X size={16} aria-hidden />\n </button>\n )}\n </div>\n );\n },\n);\nSearchBar.displayName = 'SearchBar';\n","import * as React from 'react';\nimport { CaretDown } from '@phosphor-icons/react';\nimport { Select as SelectPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport const Select = SelectPrimitive.Root;\nexport const SelectValue = SelectPrimitive.Value;\nexport const SelectGroup = SelectPrimitive.Group;\n\nconst CheckIcon = () => (\n <svg width=\"10\" height=\"8\" viewBox=\"0 0 10 8\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M1 4L3.5 6.5L9 1\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nexport interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {\n /** Leading icon (Figma: \"With label = No\" shows a gear). */\n icon?: React.ReactNode;\n}\n\n// Figma: Select / Dropdown (22) — 40px, 8px radius; the open (\"select\") state takes the accent border.\nexport const SelectTrigger = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Trigger>, SelectTriggerProps>(\n ({ className, children, icon, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'flex h-10 w-full items-center gap-2 rounded-md border border-input-muted bg-surface px-3 py-2 text-left text-ui-input-value text-surface-foreground transition-colors',\n 'hover:border-input-accent data-[state=open]:border-input-accent',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[placeholder]:text-muted-foreground',\n className,\n )}\n {...props}\n >\n {icon && <span className=\"flex shrink-0 text-surface-foreground\">{icon}</span>}\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <SelectPrimitive.Icon className=\"shrink-0 text-surface-foreground\">\n <CaretDown size={16} aria-hidden />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n ),\n);\nSelectTrigger.displayName = 'SelectTrigger';\n\nexport type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;\n\nexport const SelectContent = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Content>, SelectContentProps>(\n ({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n // Tailwind has no --z-* theme namespace (it's a fixed static scale,\n // not theme-driven) and Radix's trigger-width variable is layout\n // data, not a design value — both are the rare case DESIGN_TOKENS.md\n // allows raw var() consumption via inline style rather than a\n // Tailwind class, arbitrary-value bracket syntax included.\n style={{\n zIndex: 'var(--sys-z-20)',\n width: position === 'popper' ? 'var(--radix-select-trigger-width)' : undefined,\n }}\n className={cn(\n 'overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md',\n className,\n )}\n {...props}\n >\n <SelectPrimitive.Viewport className=\"p-1\">{children}</SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n ),\n);\nSelectContent.displayName = 'SelectContent';\n\nexport type SelectItemProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;\n\nexport const SelectItem = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Item>, SelectItemProps>(\n ({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default items-center gap-2 rounded-sm py-2 pr-4 pl-8 text-sm text-popover-foreground select-none',\n 'outline-none data-[highlighted]:bg-accent-soft data-[highlighted]:text-accent-soft-foreground',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-4 w-4 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ),\n);\nSelectItem.displayName = 'SelectItem';\n","import * as React from 'react';\nimport { Slider as SliderPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport interface SliderProps extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {\n /** Text shown above the track on the left (e.g. \"Label\"). The max value is shown on the right. */\n label?: React.ReactNode;\n /** Show the min and max values above the track instead of a label. */\n showRange?: boolean;\n /**\n * Show the current value in a bubble above the thumb. `true` shows it while\n * the thumb is hovered, focused or dragged; `'always'` keeps it visible.\n */\n showValue?: boolean | 'always';\n}\n\n// Figma: Slider (26) — 4px `muted` track, `input-accent` fill, 16px accent thumb, `primary` value bubble.\nexport const Slider = React.forwardRef<React.ElementRef<typeof SliderPrimitive.Root>, SliderProps>(\n (\n {\n className,\n value,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n label,\n showRange,\n showValue,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState<number[]>(defaultValue ?? [min]);\n const thumbValues = value ?? internal;\n const hasHeader = label != null || showRange;\n\n return (\n <div className={cn('flex w-full flex-col gap-2', className)}>\n {hasHeader && (\n <div className=\"flex items-center justify-between text-secondary-muted-foreground\">\n {label != null ? (\n <span className=\"text-ui-label text-surface-foreground\">{label}</span>\n ) : (\n <span className=\"text-ui-caption\">{min}</span>\n )}\n <span className=\"text-body-small\">{max}</span>\n </div>\n )}\n <SliderPrimitive.Root\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n min={min}\n max={max}\n onValueChange={(next) => {\n setInternal(next);\n onValueChange?.(next);\n }}\n className=\"relative flex h-4 w-full touch-none items-center select-none\"\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-1 w-full grow overflow-hidden rounded-xxs bg-muted\">\n <SliderPrimitive.Range className=\"absolute h-full bg-input-accent\" />\n </SliderPrimitive.Track>\n {thumbValues.map((thumbValue, index) => (\n // The accessible name belongs on each individual thumb (the actual\n // role=\"slider\" element) — Root is just a group container. With\n // more than one thumb this applies the same label to each; give a\n // range slider distinct per-thumb labels via aria-labelledby instead.\n <SliderPrimitive.Thumb\n key={index}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className=\"group relative block size-4 rounded-full border-2 border-surface bg-input-accent shadow-sm transition-colors disabled:pointer-events-none disabled:opacity-50\"\n >\n {showValue && (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute bottom-full left-1/2 mb-2 flex min-w-4 -translate-x-1/2 items-center justify-center rounded-xs bg-primary p-0.5 text-ui-caption text-label',\n showValue !== 'always' && 'invisible group-hover:visible group-focus-visible:visible group-active:visible',\n )}\n >\n {thumbValue}\n </span>\n )}\n </SliderPrimitive.Thumb>\n ))}\n </SliderPrimitive.Root>\n </div>\n );\n },\n);\nSlider.displayName = 'Slider';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { Field, fieldSurfaceClasses, type FieldStatus } from './Field';\n\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n status?: FieldStatus;\n /** Convenience: renders a Field (label + helper/status message) around the textarea. */\n label?: React.ReactNode;\n description?: React.ReactNode;\n message?: React.ReactNode;\n}\n\n// Figma: Textarea (20) — min 100px tall, 12/10px padding, 8px radius, 16/28 value.\nconst textareaClasses = (status: FieldStatus | undefined, className?: string) =>\n cn(\n 'flex field-sizing-content min-h-25 w-full rounded-md px-3 py-2.5 text-body-base placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n fieldSurfaceClasses(status),\n className,\n );\n\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, status = 'default', label, description, message, id, ...props }, ref) => {\n if (label == null && description == null && message == null) {\n return (\n <textarea\n ref={ref}\n id={id}\n aria-invalid={status === 'error' ? true : undefined}\n className={textareaClasses(status, className)}\n {...props}\n />\n );\n }\n return (\n <Field label={label} description={description} message={message} status={status} id={id}>\n {(control) => <textarea ref={ref} className={textareaClasses(status, className)} {...control} {...props} />}\n </Field>\n );\n },\n);\nTextarea.displayName = 'Textarea';\n","import * as React from 'react';\nimport { CheckCircle, Circle, RadioButton, WarningCircle } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport type StepStatus = 'not-completed' | 'completed' | 'error';\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\nexport interface StepProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n label: React.ReactNode;\n /** Figma \"Completed\" and \"Error\": not completed (default), completed (success) or completed with an error. */\n status?: StepStatus;\n /** The step the user is on: the bolder label and the filled indicator. */\n selected?: boolean;\n /** Horizontal puts the label under the indicator; vertical puts it before the indicator, right-aligned. */\n orientation?: StepperOrientation;\n}\n\nconst STATUS_TEXT: Record<StepStatus, string> = { 'not-completed': 'not completed', completed: 'completed', error: 'error' };\n\n/** The 24px indicator: an empty ring, the selected radio, a check or a warning (filled when selected), all Phosphor icons. */\nfunction StepIndicator({ status, selected }: { status: StepStatus; selected: boolean }) {\n const props = { size: 24, 'aria-hidden': true, className: 'shrink-0' } as const;\n if (status === 'completed') return <CheckCircle {...props} weight={selected ? 'fill' : 'regular'} className=\"shrink-0 text-success-foreground\" />;\n if (status === 'error') return <WarningCircle {...props} weight={selected ? 'fill' : 'regular'} className=\"shrink-0 text-destructive-foreground\" />;\n if (selected) return <RadioButton {...props} weight=\"fill\" className=\"shrink-0 text-accent-foreground\" />;\n return <Circle {...props} className=\"shrink-0 text-input-muted\" />;\n}\n\n// Figma: Steps (785:557) — 12 variants: Completed × Selected × Error × Type. 136px wide, 64px min height; label body/small in secondary-muted, ui/label in foreground when selected.\nexport const Step = React.forwardRef<HTMLDivElement, StepProps>(\n ({ label, status = 'not-completed', selected = false, orientation = 'horizontal', className, ...props }, ref) => {\n const vertical = orientation === 'vertical';\n return (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-16 w-34 shrink-0',\n // The horizontal indicator sits 6px from the top, so a path beside it lines up whatever the label's length.\n vertical ? 'items-center justify-end gap-4 p-2' : 'flex-col items-center gap-2 pt-1.5',\n className,\n )}\n {...props}\n >\n {!vertical && <StepIndicator status={status} selected={selected} />}\n <span\n className={cn(\n vertical ? 'min-w-0 flex-1 text-right' : 'w-full text-center',\n selected ? 'text-ui-label text-foreground' : 'text-body-small text-secondary-muted-foreground',\n )}\n >\n {label}\n {status !== 'not-completed' && <span className=\"sr-only\">{`, ${STATUS_TEXT[status]}`}</span>}\n </span>\n {vertical && <StepIndicator status={status} selected={selected} />}\n </div>\n );\n },\n);\nStep.displayName = 'Step';\n\nexport interface StepPathProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: StepperOrientation;\n /** Both steps it joins are completed: the path turns success green. */\n completed?: boolean;\n}\n\n// Figma: Step path (787:278) — a 1px line in border (success when it joins completed steps), 32px across.\nexport const StepPath = React.forwardRef<HTMLDivElement, StepPathProps>(\n ({ orientation = 'horizontal', completed = false, className, ...props }, ref) => {\n const vertical = orientation === 'vertical';\n return (\n <div ref={ref} aria-hidden className={cn('flex items-center justify-center', vertical ? 'h-8 w-8 flex-col' : 'h-8 flex-1', className)} {...props}>\n <div className={cn(vertical ? 'w-px flex-1' : 'h-px flex-1', completed ? 'bg-success-foreground' : 'bg-border')} />\n </div>\n );\n },\n);\nStepPath.displayName = 'StepPath';\n\nexport interface StepperStep {\n label: React.ReactNode;\n /** The step went wrong: shown with the warning indicator (filled when it is the current step). */\n error?: boolean;\n}\n\nexport interface StepperProps extends Omit<React.HTMLAttributes<HTMLOListElement>, 'children'> {\n steps: StepperStep[];\n /** 0-based index of the step the user is on: the ones before it are completed, the ones after not completed. */\n current: number;\n orientation?: StepperOrientation;\n}\n\n/**\n * The steps of a flow joined by paths (Figma \"In use\": completed → selected → not completed). A path between two completed steps is green. An ordered list, with\n * `aria-current=\"step\"` on the current step and the status of the others read out after their label.\n */\nexport const Stepper = React.forwardRef<HTMLOListElement, StepperProps>(({ steps, current, orientation = 'horizontal', className, ...props }, ref) => {\n const vertical = orientation === 'vertical';\n const statusOf = (i: number, step: StepperStep): StepStatus => (step.error ? 'error' : i < current ? 'completed' : 'not-completed');\n return (\n <ol ref={ref} className={cn('flex', vertical ? 'flex-col items-end' : 'w-full items-start', className)} {...props}>\n {steps.map((step, i) => (\n <React.Fragment key={i}>\n {i > 0 && (\n // Horizontal: the path runs from one indicator's edge to the next (it reaches 56px into each 136px step), level with the indicators' centre.\n <li aria-hidden className={cn('flex', vertical ? 'pr-1' : '-mx-14 flex-1 pt-1.5')}>\n <StepPath orientation={orientation} completed={i < current} className={vertical ? undefined : 'h-6'} />\n </li>\n )}\n <li aria-current={i === current ? 'step' : undefined} className=\"flex\">\n <Step label={step.label} status={statusOf(i, step)} selected={i === current} orientation={orientation} />\n </li>\n </React.Fragment>\n ))}\n </ol>\n );\n});\nStepper.displayName = 'Stepper';\n","import * as React from 'react';\nimport { X } from '@phosphor-icons/react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport const Dialog = DialogPrimitive.Root;\nexport const DialogTrigger = DialogPrimitive.Trigger;\nexport const DialogClose = DialogPrimitive.Close;\n\nexport interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {\n /** Label for the corner close button. */\n closeLabel?: string;\n /** Hide the corner close button (e.g. when the footer is the only way out). */\n hideClose?: boolean;\n}\n\n// Figma: Dialog / Modal (48) — 600px card on a 30% `primary` scrim; 12px radius, `shadow-lg`.\nexport const DialogContent = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Content>, DialogContentProps>(\n ({ className, children, closeLabel = 'Close', hideClose, ...props }, ref) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n style={{ zIndex: 'var(--sys-z-30)' }}\n className=\"fixed inset-0 bg-primary/30\"\n />\n <DialogPrimitive.Content\n ref={ref}\n style={{ zIndex: 'var(--sys-z-30)' }}\n className={cn(\n 'fixed top-1/2 left-1/2 flex w-150 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-lg border border-border bg-surface shadow-lg',\n className,\n )}\n {...props}\n >\n {children}\n {!hideClose && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"ghost\" size=\"icon-sm\" aria-label={closeLabel} className=\"absolute top-4 right-6\">\n <X size={16} aria-hidden />\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n ),\n);\nDialogContent.displayName = 'DialogContent';\n\nexport const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-1.5 border-b border-border px-6 py-4 pr-16', className)} {...props} />\n);\n\nexport const DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg leading-6 font-semibold text-surface-foreground', className)}\n {...props}\n />\n));\nDialogTitle.displayName = 'DialogTitle';\n\nexport const DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-body-small text-secondary-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport const DialogBody = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-4 p-6', className)} {...props} />\n);\n\nexport const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex items-center justify-end gap-3 border-t border-border px-6 py-4', className)} {...props} />\n);\n","import * as React from 'react';\nimport { CheckCircle, Info, Warning, WarningCircle, X } from '@phosphor-icons/react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport type ToastVariant = 'info' | 'success' | 'warning' | 'destructive';\n\nconst toastVariants = cva('border', {\n variants: {\n variant: {\n info: 'border-info-border bg-surface',\n success: 'border-success-soft-border bg-success-soft',\n warning: 'border-warning-soft-border bg-warning-soft',\n destructive: 'border-destructive-soft-border bg-destructive-soft',\n },\n },\n defaultVariants: { variant: 'info' },\n});\n\n// The in-page banner also has a quiet look (Figma: Persistent Message › info), used for suggestions rather than status.\nconst inlineVariants = cva('border', {\n variants: {\n variant: {\n neutral: 'border-border bg-secondary',\n info: 'border-info-border bg-surface',\n success: 'border-success-soft-border bg-success-soft',\n warning: 'border-warning-soft-border bg-warning-soft',\n destructive: 'border-destructive-soft-border bg-destructive-soft',\n },\n },\n defaultVariants: { variant: 'info' },\n});\n\nexport type ToastInlineVariant = ToastVariant | 'neutral';\n\nconst iconColour: Record<ToastVariant, string> = {\n info: 'text-surface-foreground',\n success: 'text-success-soft-foreground',\n warning: 'text-warning-soft-foreground',\n destructive: 'text-destructive-soft-foreground',\n};\n\nconst titleColour: Record<ToastVariant, string> = {\n info: 'text-surface-foreground',\n success: 'text-success-soft-foreground',\n warning: 'text-warning-soft-foreground',\n destructive: 'text-destructive-soft-foreground',\n};\n\nfunction VariantIcon({ variant, size }: { variant: ToastVariant; size: number }) {\n const props = { size, 'aria-hidden': true, className: cn('shrink-0', iconColour[variant]) } as const;\n if (variant === 'success') return <CheckCircle {...props} />;\n if (variant === 'warning') return <Warning {...props} />;\n if (variant === 'destructive') return <WarningCircle {...props} />;\n return <Info {...props} />;\n}\n\nexport const ToastProvider = ToastPrimitive.Provider;\n\nexport const ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitive.Viewport\n ref={ref}\n style={{ zIndex: 'var(--sys-z-50)' }}\n className={cn('fixed right-4 bottom-4 flex w-89 max-w-full flex-col gap-3 outline-none', className)}\n {...props}\n />\n));\nToastViewport.displayName = 'ToastViewport';\n\nexport interface ToastProps\n extends Omit<React.ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, 'title'>,\n VariantProps<typeof toastVariants> {\n /** Bold first line. */\n title?: React.ReactNode;\n description?: React.ReactNode;\n /** Optional action button (e.g. Undo). Wrap it in `ToastAction`. */\n action?: React.ReactNode;\n closeLabel?: string;\n}\n\n// Figma: Toast / Sonner (52) › Toast — 356px card with a 20px status icon, title, description and close.\nexport const Toast = React.forwardRef<React.ElementRef<typeof ToastPrimitive.Root>, ToastProps>(\n ({ className, variant = 'info', title, description, action, closeLabel = 'Close', children, ...props }, ref) => {\n const v = variant ?? 'info';\n return (\n <ToastPrimitive.Root\n ref={ref}\n // Errors interrupt; everything else is polite.\n type={v === 'destructive' ? 'foreground' : 'background'}\n className={cn('flex items-start gap-3 rounded-lg p-4 shadow-lg', toastVariants({ variant: v }), className)}\n {...props}\n >\n <VariantIcon variant={v} size={20} />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1 text-body-small\">\n {title != null && (\n <ToastPrimitive.Title className={cn('font-semibold', titleColour[v])}>{title}</ToastPrimitive.Title>\n )}\n {description != null && (\n <ToastPrimitive.Description className=\"text-secondary-muted-foreground\">{description}</ToastPrimitive.Description>\n )}\n {children}\n {action}\n </div>\n <ToastPrimitive.Close\n aria-label={closeLabel}\n className=\"inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground\"\n >\n <X size={16} aria-hidden />\n </ToastPrimitive.Close>\n </ToastPrimitive.Root>\n );\n },\n);\nToast.displayName = 'Toast';\n\nexport const ToastAction = ToastPrimitive.Action;\n\nexport interface ToastInlineProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof inlineVariants> {\n /** Buttons shown after the message, for example a ghost \"Dismiss\" and an outline \"Fix\" (both `size=\"sm\"`). */\n actions?: React.ReactNode;\n /** Where the actions sit: `end` (default) after the message on the same line, or `bottom` under the message, for messages long enough to wrap. */\n actionsPlacement?: 'end' | 'bottom';\n /** Show a close button and call this when it is pressed. */\n onClose?: () => void;\n closeLabel?: string;\n}\n\n// Figma: Toast Inline / Persistent Message — a single-line banner (46px) for in-page messages, with optional actions.\nexport const ToastInline = React.forwardRef<HTMLDivElement, ToastInlineProps>(\n ({ className, variant = 'info', actions, actionsPlacement = 'end', onClose, closeLabel = 'Close', children, ...props }, ref) => {\n const v = variant ?? 'info';\n const below = actionsPlacement === 'bottom' && !!actions;\n return (\n <div\n ref={ref}\n role={v === 'destructive' ? 'alert' : 'status'}\n className={cn('flex gap-2 rounded-sm px-2 py-1.5', below ? 'items-start' : 'items-center', inlineVariants({ variant: v }), className)}\n {...props}\n >\n <span className={cn('inline-flex shrink-0', below && 'mt-0.5')}>\n <VariantIcon variant={v === 'neutral' ? 'info' : v} size={16} />\n </span>\n {below ? (\n <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n <p className=\"text-body-small text-secondary-muted-foreground\">{children}</p>\n <div className=\"flex items-center gap-2\">{actions}</div>\n </div>\n ) : (\n <>\n <p className=\"min-w-0 flex-1 text-body-small text-secondary-muted-foreground\">{children}</p>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </>\n )}\n {onClose && (\n <Button type=\"button\" variant=\"ghost\" size=\"icon-sm\" aria-label={closeLabel} onClick={onClose}>\n <X size={16} aria-hidden />\n </Button>\n )}\n </div>\n );\n },\n);\nToastInline.displayName = 'ToastInline';\n","import * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport const TooltipProvider = TooltipPrimitive.Provider;\nexport const Tooltip = TooltipPrimitive.Root;\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\nexport interface TooltipContentProps extends Omit<React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, 'title'> {\n /** Bold first line. With `description` this is the Descriptive tooltip. */\n title?: React.ReactNode;\n description?: React.ReactNode;\n /** Underlined action line under the description — the Rich tooltip. Usually a link or button. */\n action?: React.ReactNode;\n /** Show the pointer arrow toward the trigger. */\n arrow?: boolean;\n}\n\n// Figma: Tooltip (51) — `primary-soft-foreground` plum card, 6px radius. Simple = one line of label text;\n// Descriptive = title + description; Rich = adds an action link.\nexport const TooltipContent = React.forwardRef<React.ElementRef<typeof TooltipPrimitive.Content>, TooltipContentProps>(\n ({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {\n const detailed = title != null || description != null;\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n style={{ zIndex: 'var(--sys-z-40)' }}\n className={cn(\n 'rounded-sm bg-primary-soft-foreground text-label shadow-md',\n detailed ? 'flex max-w-60 min-w-50 flex-col gap-1 px-3 py-2.5' : 'px-2.5 py-1.5 text-ui-caption',\n action != null && 'max-w-65 min-w-55',\n className,\n )}\n {...props}\n >\n {detailed ? (\n <>\n {title != null && <p className=\"text-xs leading-4 font-semibold text-label\">{title}</p>}\n {description != null && <p className=\"text-xs leading-4.5 text-plum-200\">{description}</p>}\n {action != null && (\n <div className=\"mt-1 text-ui-caption text-plum-300 underline *:underline\">{action}</div>\n )}\n </>\n ) : (\n children\n )}\n {arrow && <TooltipPrimitive.Arrow width={12} height={8} className=\"fill-primary-soft-foreground\" />}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n },\n);\nTooltipContent.displayName = 'TooltipContent';\n","import * as React from 'react';\nimport { FileText, X } from '@phosphor-icons/react';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Tag } from '../Tags & Badges/Tag';\n\nexport interface FileUploadZoneProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'title' | 'type'> {\n title?: React.ReactNode;\n /** Supported formats line. */\n hint?: React.ReactNode;\n icon?: React.ReactNode;\n /** Called with the chosen or dropped files. */\n onFiles?: (files: File[]) => void;\n}\n\n// Figma: Question types › PDF, PPTX, or DOCX › Upload_Zone (568:6389) — a 143px dashed drop target with an icon, title and hint; hover fills with the page background.\nexport const FileUploadZone = React.forwardRef<HTMLInputElement, FileUploadZoneProps>(\n ({ className, title = 'Upload document', hint, icon, onFiles, ...props }, ref) => {\n const [over, setOver] = React.useState(false);\n return (\n <label\n className={cn(\n 'flex min-h-35.75 w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-md border-2 border-dashed border-border px-4 text-center transition-colors',\n 'hover:bg-background has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-ring',\n over && 'border-input-accent bg-accent-soft',\n className,\n )}\n onDragOver={(event) => {\n event.preventDefault();\n setOver(true);\n }}\n onDragLeave={() => setOver(false)}\n onDrop={(event) => {\n event.preventDefault();\n setOver(false);\n onFiles?.(Array.from(event.dataTransfer.files));\n }}\n >\n <span className=\"flex size-10 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground\">\n {icon ?? <FileText size={24} aria-hidden />}\n </span>\n <span className=\"flex flex-col gap-1\">\n <span className=\"text-body-small text-surface-foreground\">{title}</span>\n {hint && <span className=\"text-ui-caption text-secondary-muted-foreground\">{hint}</span>}\n </span>\n <input\n ref={ref}\n type=\"file\"\n className=\"sr-only\"\n onChange={(event) => onFiles?.(Array.from(event.target.files ?? []))}\n {...props}\n />\n </label>\n );\n },\n);\nFileUploadZone.displayName = 'FileUploadZone';\n\nexport interface FileUploadItemProps extends React.HTMLAttributes<HTMLDivElement> {\n name: string;\n /** File size text, e.g. \"443KB\". */\n size?: string;\n status?: 'uploading' | 'complete' | 'error';\n /** 0–100, shown while uploading. */\n progress?: number;\n /** Remaining time text while uploading, e.g. \"2 seconds left\". */\n timeLeft?: string;\n icon?: React.ReactNode;\n onRemove?: () => void;\n removeLabel?: string;\n}\n\n// Figma: File upload (339:2168) — a row with the file, its status and, while uploading, a thin progress bar.\nexport const FileUploadItem = React.forwardRef<HTMLDivElement, FileUploadItemProps>(\n ({ className, name, size, status = 'uploading', progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {\n const uploading = status === 'uploading';\n return (\n <div\n ref={ref}\n className={cn('flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2', className)}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground\">\n {icon ?? <FileText size={24} aria-hidden />}\n </span>\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div className=\"flex items-center justify-between gap-2\">\n <p className=\"min-w-0 truncate text-ui-label text-surface-foreground\">{name}</p>\n {onRemove && (\n <Button type=\"button\" variant=\"ghost\" size=\"icon-sm\" aria-label={removeLabel ?? `Remove ${name}`} onClick={onRemove}>\n <X size={16} aria-hidden />\n </Button>\n )}\n </div>\n <div className=\"flex items-center justify-between text-ui-caption text-secondary-muted-foreground\">\n <span className=\"flex items-center gap-2\">\n {size}\n {status === 'complete' && <Tag variant=\"success\">Complete</Tag>}\n {status === 'error' && <Tag variant=\"destructive\">Error</Tag>}\n {uploading && timeLeft && (\n <>\n <span aria-hidden=\"true\" className=\"size-0.5 rounded-full bg-secondary-muted-foreground\" />\n {timeLeft}\n </>\n )}\n </span>\n {uploading && <span className=\"text-body-xxs font-normal\">{Math.round(progress)}%</span>}\n </div>\n </div>\n </div>\n {uploading && (\n <ProgressPrimitive.Root\n value={progress}\n aria-label={`Uploading ${name}`}\n className=\"h-0.75 w-full overflow-hidden rounded-sm bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5\"\n >\n <ProgressPrimitive.Indicator className=\"h-full bg-accent transition-[width]\" style={{ width: `${progress}%` }} />\n </ProgressPrimitive.Root>\n )}\n </div>\n );\n },\n);\nFileUploadItem.displayName = 'FileUploadItem';\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\n// Figma: System Tag + Status Tag (41). Border + 6px radius, 12px/16px medium label.\nconst tagVariants = cva(\n 'inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption',\n {\n variants: {\n variant: {\n neutral: 'border-accent-soft-border bg-accent-soft text-accent-soft-foreground',\n default: 'border-border bg-surface text-surface-foreground',\n success: 'border-success-soft-border bg-success-soft text-success-soft-foreground',\n warning: 'border-warning-soft-border bg-warning-soft text-warning-soft-foreground',\n destructive: 'border-destructive-soft-border bg-destructive-soft text-destructive-soft-foreground',\n },\n },\n defaultVariants: { variant: 'neutral' },\n },\n);\n\nexport interface TagProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof tagVariants> {}\n\n/** Read-only label for system states (Live Interview, Self-paced, AI Interview). */\nexport const Tag = React.forwardRef<HTMLSpanElement, TagProps>(({ className, variant, ...props }, ref) => (\n <span ref={ref} className={cn(tagVariants({ variant }), className)} {...props} />\n));\nTag.displayName = 'Tag';\n\nconst statusDotVariants = cva('size-1.5 shrink-0 rounded-full', {\n variants: {\n status: {\n active: 'bg-success-800',\n inactive: 'bg-accent',\n pending: 'bg-warning',\n error: 'bg-destructive',\n },\n },\n defaultVariants: { status: 'active' },\n});\n\nexport interface StatusTagProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n Required<Pick<VariantProps<typeof statusDotVariants>, 'status'>> {}\n\n/** White tag with a coloured status dot (Active / Inactive / Pending / Error). */\nexport const StatusTag = React.forwardRef<HTMLSpanElement, StatusTagProps>(\n ({ className, status, children, ...props }, ref) => (\n <span ref={ref} className={cn(tagVariants({ variant: 'default' }), className)} {...props}>\n <span className={statusDotVariants({ status })} aria-hidden=\"true\" />\n {children}\n </span>\n ),\n);\nStatusTag.displayName = 'StatusTag';\n","import * as React from 'react';\nimport { CornersOut, DotsThree, Image as ImageIcon, Pause, Play, SpeakerSimpleHigh, SpeakerSimpleX, Trash } from '@phosphor-icons/react';\nimport { Slider as SliderPrimitive, ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport interface MediaInfoProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n name: string;\n /** Secondary line parts, e.g. [\"443KB\", \"1/5\"], joined with a dot. */\n details?: string[];\n onRemove?: () => void;\n removeLabel?: string;\n /** Larger name / details (the image preview uses these). */\n large?: boolean;\n}\n\n// Figma: File upload › video-info-section / image preview — file name + details with a trash button.\nexport function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }: MediaInfoProps) {\n return (\n <div className={cn('flex items-center justify-between border-t border-border bg-surface px-6 py-4', className)} {...props}>\n <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n <p className={cn('truncate text-surface-foreground', large ? 'text-body-section' : 'text-ui-label')}>{name}</p>\n {details && (\n <p className={cn('flex items-center gap-2 text-secondary-muted-foreground', large ? 'text-body-small' : 'text-ui-caption')}>\n {details.map((part, index) => (\n <React.Fragment key={part}>\n {index > 0 && <span aria-hidden=\"true\" className=\"size-0.5 rounded-full bg-secondary-muted-foreground\" />}\n {part}\n </React.Fragment>\n ))}\n </p>\n )}\n </div>\n {onRemove && (\n <Button type=\"button\" variant=\"destructive\" size=\"icon\" aria-label={removeLabel ?? `Remove ${name}`} onClick={onRemove}>\n <Trash size={16} aria-hidden />\n </Button>\n )}\n </div>\n );\n}\n\nexport interface ImagePreviewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** The image (an `<img>`). The preview area is as tall as the image at full width, up to 336px. Leave empty for the fixed-height placeholder fill. */\n children?: React.ReactNode;\n name: string;\n details?: string[];\n onRemove?: () => void;\n}\n\n// Figma: File upload › Image preview — a 12px-radius card: preview area over a name / size / count bar.\nexport const ImagePreview = React.forwardRef<HTMLDivElement, ImagePreviewProps>(\n ({ className, children, name, details, onRemove, ...props }, ref) => (\n <div ref={ref} className={cn('flex w-full flex-col overflow-hidden rounded-lg border border-border', className)} {...props}>\n <div\n className={cn(\n 'flex w-full items-center justify-center bg-accent-soft',\n // With an image the area hugs it (full width, its own height, at most 336px tall); the empty placeholder keeps the fixed height.\n children ? '[&>img]:block [&>img]:h-auto [&>img]:max-h-84 [&>img]:w-full [&>img]:object-contain' : 'h-84',\n )}\n >\n {children}\n </div>\n <MediaInfo name={name} details={details} onRemove={onRemove} large />\n </div>\n ),\n);\nImagePreview.displayName = 'ImagePreview';\n\nexport interface ImageThumbnailsProps\n extends Omit<React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root>, 'type' | 'value' | 'defaultValue' | 'onValueChange'> {\n /** Slots shown, e.g. 5. Slots past `images.length` render as empty dashed placeholders. */\n max: number;\n images: { id: string; src?: string; alt: string }[];\n value?: string;\n onValueChange?: (id: string) => void;\n}\n\n// Figma: File upload › Image thumbnail — selected (accent-soft + accent border), default, and dashed empty slots.\nexport const ImageThumbnails = React.forwardRef<React.ElementRef<typeof ToggleGroupPrimitive.Root>, ImageThumbnailsProps>(\n ({ className, max, images, value, onValueChange, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n ref={ref}\n type=\"single\"\n value={value ?? ''}\n onValueChange={(next) => next && onValueChange?.(next)}\n className={cn('flex w-full gap-2', className)}\n {...props}\n >\n {Array.from({ length: max }, (_, index) => {\n const image = images[index];\n if (!image) {\n return (\n <span\n key={`empty-${index}`}\n aria-hidden=\"true\"\n className=\"flex h-20 min-w-0 flex-1 items-center justify-center rounded-sm border border-dashed border-border text-accent-foreground\"\n >\n <ImageIcon size={24} />\n </span>\n );\n }\n return (\n <ToggleGroupPrimitive.Item\n key={image.id}\n value={image.id}\n aria-label={image.alt}\n className={cn(\n 'flex h-20 min-w-0 flex-1 items-center justify-center overflow-hidden rounded-sm border border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 p-2 text-surface-foreground transition-colors',\n 'hover:bg-accent-soft hover:bg-none',\n 'data-[state=on]:border-accent-foreground data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-foreground',\n )}\n >\n {image.src ? <img src={image.src} alt=\"\" className=\"size-full object-cover\" /> : <ImageIcon size={24} aria-hidden />}\n </ToggleGroupPrimitive.Item>\n );\n })}\n </ToggleGroupPrimitive.Root>\n ),\n);\nImageThumbnails.displayName = 'ImageThumbnails';\n\nconst formatTime = (seconds: number) => {\n const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));\n return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, '0')}`;\n};\n\nexport interface VideoPlayerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Video source. Without one, the area shows the placeholder fill. */\n src?: string;\n name?: string;\n details?: string[];\n onRemove?: () => void;\n /** Called by the \"more\" (…) button. */\n onMore?: () => void;\n /** Initial time values for static previews (seconds). */\n initialTime?: number;\n initialDuration?: number;\n}\n\n// Figma: File upload › Video player — preview area with a dark control bar (play, seek, time, volume, full screen), then file info.\nexport const VideoPlayer = React.forwardRef<HTMLDivElement, VideoPlayerProps>(\n ({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, ...props }, ref) => {\n const video = React.useRef<HTMLVideoElement>(null);\n const [playing, setPlaying] = React.useState(false);\n const [time, setTime] = React.useState(initialTime);\n const [duration, setDuration] = React.useState(initialDuration);\n const [volume, setVolume] = React.useState(1);\n const muted = volume === 0;\n\n const toggle = () => {\n const el = video.current;\n if (!el) return setPlaying((p) => !p);\n if (el.paused) void el.play();\n else el.pause();\n };\n\n return (\n <div ref={ref} className={cn('flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface', className)} {...props}>\n <div className=\"relative flex h-60.5 w-full items-end bg-accent-soft\">\n {src && (\n <video\n ref={video}\n src={src}\n className=\"absolute inset-0 size-full object-contain\"\n onPlay={() => setPlaying(true)}\n onPause={() => setPlaying(false)}\n onTimeUpdate={(event) => setTime(event.currentTarget.currentTime)}\n onLoadedMetadata={(event) => setDuration(event.currentTarget.duration)}\n onVolumeChange={(event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)}\n />\n )}\n <div className=\"relative flex w-full flex-col gap-2 bg-surface-foreground bg-linear-to-r from-primary/30 to-primary/30 px-4 pt-3 pb-4 text-surface\">\n <SliderPrimitive.Root\n min={0}\n max={duration || 1}\n step={0.1}\n value={[Math.min(time, duration || 1)]}\n onValueChange={([next]) => {\n if (next === undefined) return;\n setTime(next);\n if (video.current) video.current.currentTime = next;\n }}\n className=\"relative flex h-4 w-full touch-none items-center select-none\"\n >\n <SliderPrimitive.Track className=\"relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20\">\n <SliderPrimitive.Range className=\"absolute h-full bg-accent-foreground\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb aria-label=\"Seek\" className=\"block size-3 rounded-full border-2 border-surface bg-surface shadow-sm\" />\n </SliderPrimitive.Root>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n aria-label={playing ? 'Pause' : 'Play'}\n onClick={toggle}\n className=\"inline-flex size-10 items-center justify-center rounded-full bg-surface/12 text-surface transition-colors hover:bg-surface/20\"\n >\n {playing ? <Pause size={16} weight=\"fill\" aria-hidden /> : <Play size={16} weight=\"fill\" aria-hidden />}\n </button>\n <span className=\"text-ui-label whitespace-nowrap text-surface/80\">\n {formatTime(time)} / {formatTime(duration)}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <VolumeControl\n volume={volume}\n onVolumeChange={(next) => {\n setVolume(next);\n if (video.current) {\n video.current.volume = next;\n video.current.muted = next === 0;\n }\n }}\n />\n <button\n type=\"button\"\n aria-label=\"Full screen\"\n onClick={() => void video.current?.requestFullscreen?.()}\n className=\"inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12\"\n >\n <CornersOut size={16} aria-hidden />\n </button>\n <button\n type=\"button\"\n aria-label=\"More\"\n onClick={onMore}\n className=\"inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12\"\n >\n <DotsThree size={16} aria-hidden />\n </button>\n </div>\n </div>\n </div>\n </div>\n {name && <MediaInfo name={name} details={details} onRemove={onRemove} />}\n <span className=\"sr-only\" aria-live=\"polite\">\n {muted ? 'Muted' : ''}\n </span>\n </div>\n );\n },\n);\nVideoPlayer.displayName = 'VideoPlayer';\n\nexport interface VolumeControlProps {\n /** 0–1. */\n volume: number;\n onVolumeChange: (volume: number) => void;\n className?: string;\n}\n\n// Figma: Volume control — a speaker button that reveals a slider on hover or focus.\nexport function VolumeControl({ volume, onVolumeChange, className }: VolumeControlProps) {\n const last = React.useRef(volume || 1);\n if (volume > 0) last.current = volume;\n return (\n <div className={cn('group/volume flex items-center', className)}>\n <div className=\"w-0 overflow-hidden opacity-0 transition-all group-focus-within/volume:w-16 group-focus-within/volume:opacity-100 group-hover/volume:w-16 group-hover/volume:opacity-100\">\n <SliderPrimitive.Root\n min={0}\n max={1}\n step={0.05}\n value={[volume]}\n onValueChange={([next]) => next !== undefined && onVolumeChange(next)}\n className=\"relative flex h-4 w-14 touch-none items-center select-none\"\n >\n <SliderPrimitive.Track className=\"relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20\">\n <SliderPrimitive.Range className=\"absolute h-full bg-surface\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb aria-label=\"Volume\" className=\"block size-3 rounded-full bg-surface shadow-sm\" />\n </SliderPrimitive.Root>\n </div>\n <button\n type=\"button\"\n aria-label={volume === 0 ? 'Unmute' : 'Mute'}\n onClick={() => onVolumeChange(volume === 0 ? last.current : 0)}\n className=\"inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12\"\n >\n {volume === 0 ? <SpeakerSimpleX size={16} aria-hidden /> : <SpeakerSimpleHigh size={16} aria-hidden />}\n </button>\n </div>\n );\n}\n","import * as React from 'react';\n\nimport { Textarea, type TextareaProps } from '../Forms & Data Entry/Textarea';\n\nexport interface OpenEndAnswerProps extends Omit<TextareaProps, 'label' | 'description' | 'message' | 'maxLength'> {\n /** Character limit shown in the counter. */\n maxLength?: number;\n}\n\n// Figma: Question input › Open end — a multi-line field with a live \"0/1000 characters\" counter.\nexport const OpenEndAnswer = React.forwardRef<HTMLTextAreaElement, OpenEndAnswerProps>(\n ({ value, defaultValue, onChange, maxLength = 1000, placeholder = 'Write your answer', ...props }, ref) => {\n const [internal, setInternal] = React.useState(String(defaultValue ?? ''));\n const text = value !== undefined ? String(value) : internal;\n return (\n <Textarea\n ref={ref}\n value={text}\n maxLength={maxLength}\n placeholder={placeholder}\n description={`${text.length}/${maxLength} characters`}\n onChange={(event) => {\n setInternal(event.target.value);\n onChange?.(event);\n }}\n {...props}\n />\n );\n },\n);\nOpenEndAnswer.displayName = 'OpenEndAnswer';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\n// Figma: Question types (282:1491) — every question type sits on a 480px white card, 24px padding, 16px gap.\nexport const QuestionCard = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex w-120 max-w-200 flex-col gap-4 rounded-lg bg-surface p-6', className)}\n {...props}\n />\n ),\n);\nQuestionCard.displayName = 'QuestionCard';\n","import * as React from \"react\";\nimport {\n Clipboard,\n Copy,\n Eye,\n Plus,\n Sparkle,\n Trash,\n Warning,\n} from \"@phosphor-icons/react\";\n\nimport { keepEditingFocus } from \"../../lib/keepEditingFocus\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../Buttons & Actions/Button\";\nimport { QuestionHeader } from \"./QuestionHeader\";\nimport type { InlineEditMark } from \"../Forms & Data Entry/InlineEdit\";\nimport type { QuestionType } from \"./QuestionTypeIcon\";\n\nexport interface QuestionEditorCardProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n \"title\" | \"onChange\"\n> {\n /** Question number shown in the drag-handle tag. */\n number: number;\n title: string;\n onTitleChange?: (title: string) => void;\n /** Shown while the title is empty. Defaults to \"Click to write the question text\". */\n titlePlaceholder?: string;\n /** `regular` shows the title placeholder in the normal text colour instead of the muted one. Default `muted`. */\n titlePlaceholderTone?: 'muted' | 'regular';\n /** Shortest title (in characters) that may be saved. Turns on the title guardrail: see `QuestionHeader`'s `titleMinLength`. */\n titleMinLength?: number;\n /** A title longer than this many characters switches to the regular 16px body style, and shows `titleRecommendedNote` under it when given. See `QuestionHeader`. */\n titleRecommendedMax?: number;\n /** Optional text shown under a title that is longer than `titleRecommendedMax`; leave it out to change only the style. */\n titleRecommendedNote?: React.ReactNode;\n /** The question is being edited: accent border, counter and footer are shown. */\n active?: boolean;\n /**\n * Shows the hover look (lifted card, revealed actions and grip) without the pointer, for mirroring a hover that happens\n * elsewhere, such as over the same question's row in an outline.\n */\n hovered?: boolean;\n maxLength?: number;\n /** Footer label, e.g. \"4/20 choices\". Shown while `active`. */\n countLabel?: React.ReactNode;\n /** Header actions. Defaults to copy, delete and preview buttons wired to the `on*` callbacks. */\n actions?: React.ReactNode;\n onDuplicate?: () => void;\n onDelete?: () => void;\n onPreview?: () => void;\n /** Sparkle button beside the card, revealed on hover, focus or while `active`. Omit to hide it. */\n onAskAi?: () => void;\n /** Footer: adds an answer choice. Omit (with `onPaste`) to hide the footer buttons. */\n onAdd?: () => void;\n /** Footer: opens paste-many-choices. */\n onPaste?: () => void;\n /** Inline error shown at the bottom of the card, e.g. \"Not available in Self-Paced\". Keep it as short as possible. */\n error?: React.ReactNode;\n /** Content right beside the \"Question N\" tag, e.g. the time allowed for the question. */\n meta?: React.ReactNode;\n /** Optional strip under the card body, e.g. an \"Inferred\" assumption note. */\n note?: React.ReactNode;\n /** Makes the \"Question N\" tag a drag handle for reordering. See `QuestionHeader`'s `dragHandleProps`. */\n dragHandleProps?: React.ComponentPropsWithRef<'span'>;\n /** Whether the grip icon shows in the \"Question N\" tag on hover. Defaults to true; set false when the card can't be moved. See `QuestionHeader`. */\n showDragHandle?: boolean;\n /** The question's type, shown as an icon in the \"Question N\" tag in its default and selected states (the grip replaces it on hover). See `QuestionHeader`. */\n questionType?: QuestionType;\n /** Ranges of the saved question text to underline in the destructive colour, such as misspelled words. See `QuestionHeader`'s `titleMarks`. */\n titleMarks?: InlineEditMark[];\n /** Makes the underlined words clickable; called with the mark and the chosen correction. See `QuestionHeader`'s `onTitleMarkApply`. */\n onTitleMarkApply?: (mark: InlineEditMark, replacement: string) => void;\n /** Called when a mark is dismissed from its card. */\n onTitleMarkDismiss?: (mark: InlineEditMark) => void;\n}\n\n// Figma: Question editor (351:5944) — the authoring card for every question type. Idle is a flat bordered card, hover\n// lifts it and reveals the header actions, active takes the accent border and adds the counter and footer.\nexport const QuestionEditorCard = React.forwardRef<\n HTMLDivElement,\n QuestionEditorCardProps\n>(\n (\n {\n className,\n number,\n title,\n onTitleChange,\n titlePlaceholder,\n titlePlaceholderTone,\n titleMinLength,\n titleRecommendedMax,\n titleRecommendedNote,\n active,\n hovered,\n maxLength,\n countLabel,\n actions,\n onDuplicate,\n onDelete,\n onPreview,\n onAskAi,\n onAdd,\n onPaste,\n note,\n error,\n meta,\n dragHandleProps,\n showDragHandle,\n questionType,\n titleMarks,\n onTitleMarkApply,\n onTitleMarkDismiss,\n children,\n ...props\n },\n ref,\n ) => {\n const footer = active && (countLabel != null || onAdd || onPaste);\n return (\n <div\n ref={ref}\n className={cn(\"group/editor flex w-full items-start gap-2\", className)}\n data-hovered={hovered ? \"\" : undefined}\n {...props}\n // A click inside the card, outside the field, keeps a title being edited active.\n onMouseDown={(event) => {\n keepEditingFocus(event);\n props.onMouseDown?.(event);\n }}\n >\n <div\n className={cn(\n \"flex w-full max-w-200 flex-col overflow-hidden rounded-xl border bg-surface transition-shadow group-hover/editor:shadow-lg group-focus-within/editor:shadow-lg group-data-[hovered]/editor:shadow-lg\",\n active ? \"border-accent\" : \"border-border\",\n )}\n >\n <div className={cn(\"flex flex-col p-6\", footer ? \"gap-5\" : \"gap-4\")}>\n <div className=\"flex flex-col gap-4\">\n <QuestionHeader\n editor\n number={number}\n title={title}\n onTitleChange={onTitleChange}\n titlePlaceholder={titlePlaceholder}\n titlePlaceholderTone={titlePlaceholderTone}\n titleMinLength={titleMinLength}\n titleRecommendedMax={titleRecommendedMax}\n titleRecommendedNote={titleRecommendedNote}\n active={active}\n showCounter={!!active}\n dragHandleProps={dragHandleProps}\n showDragHandle={showDragHandle}\n questionType={questionType}\n titleMarks={titleMarks}\n onTitleMarkApply={onTitleMarkApply}\n onTitleMarkDismiss={onTitleMarkDismiss}\n meta={meta}\n maxLength={maxLength}\n actions={\n actions ?? (\n <>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Duplicate question\"\n onClick={onDuplicate}\n >\n <Copy size={16} aria-hidden />\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"icon-sm\"\n aria-label=\"Delete question\"\n onClick={onDelete}\n >\n <Trash size={16} aria-hidden />\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Preview question\"\n onClick={onPreview}\n >\n <Eye size={16} aria-hidden />\n </Button>\n </>\n )\n }\n />\n {children}\n </div>\n {error && (\n <p className=\"flex items-center gap-1 text-ui-caption text-destructive-foreground\">\n <Warning size={16} aria-hidden className=\"shrink-0\" />\n {error}\n </p>\n )}\n {footer && (\n <div className=\"flex items-center justify-between\">\n <p className=\"text-ui-caption text-secondary-muted-foreground\">\n {countLabel}\n </p>\n <div className=\"flex items-center gap-2\">\n {onAdd && (\n <Button type=\"button\" variant=\"outline\" onClick={onAdd}>\n <Plus size={16} aria-hidden />\n Add choice\n </Button>\n )}\n {onPaste && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n aria-label=\"Paste choices\"\n onClick={onPaste}\n >\n <Clipboard size={16} aria-hidden />\n </Button>\n )}\n </div>\n </div>\n )}\n </div>\n {note && (\n <div className=\"border-t border-border px-2 py-2 text-body-small text-surface-foreground\">\n {note}\n </div>\n )}\n </div>\n {onAskAi && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Ask AI\"\n onClick={onAskAi}\n className=\"shrink-0 opacity-0 transition-opacity group-hover/editor:opacity-100 group-focus-within/editor:opacity-100 group-data-[hovered]/editor:opacity-100 focus-visible:opacity-100\"\n >\n <Sparkle size={16} aria-hidden />\n </Button>\n )}\n </div>\n );\n },\n);\nQuestionEditorCard.displayName = \"QuestionEditorCard\";\n","import type * as React from 'react';\n\n/**\n * Keeps a text field that is being edited active while the reader clicks somewhere else inside the same card (its padding, its labels, the empty space\n * around the field). Put it on the card's `onMouseDown`: a click on a button, link, field or label still does its own job, anything else leaves the focus\n * where it is instead of ending the edit.\n */\nexport function keepEditingFocus(event: React.MouseEvent<HTMLElement>) {\n const target = event.target as HTMLElement;\n if (target.closest('button, a, input, textarea, select, label, [role=\"button\"], [role=\"dialog\"]')) return;\n const active = document.activeElement;\n if ((active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement) && event.currentTarget.contains(active)) event.preventDefault();\n}\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { InlineEdit, type InlineEditMark } from '../Forms & Data Entry/InlineEdit';\nimport { ToastInline } from '../Overlays & Feedback/Toast';\nimport { QuestionNumberTag } from './QuestionNumberTag';\nimport { type QuestionType } from './QuestionTypeIcon';\n\nexport interface QuestionHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'onChange'> {\n /** Question number, shown as \"QUESTION 01\". */\n number: number;\n title: React.ReactNode;\n /** Adds the red asterisk after the title. */\n required?: boolean;\n /** Shows an error banner above the header. `true` shows \"This question is mandatory.\"; pass a node for a custom message. */\n error?: boolean | React.ReactNode;\n onDismissError?: () => void;\n /** Editor mode: an editable title with a character counter and hover actions. */\n editor?: boolean;\n /** Editor mode: called as the title is typed. `title` must then be a string. */\n onTitleChange?: (title: string) => void;\n /** Editor mode: shown while the title is empty. Defaults to \"Click to write the question text\". */\n titlePlaceholder?: string;\n /** Editor mode: `regular` shows the title placeholder in the normal text colour instead of the muted one. Default `muted`. */\n titlePlaceholderTone?: 'muted' | 'regular';\n /**\n * Editor mode: shortest title (in characters) that may be saved. When set, the title's limits guardrail turns on: while the title\n * is being edited a line under it shows the allowed range and the live count (using `maxLength`), a title that is too short is not\n * saved (the field stays open and says why), and the always-on counter is replaced by that line.\n */\n titleMinLength?: number;\n /**\n * Editor mode: a title longer than this many characters (counted live while it is typed) switches to the regular 16px body style\n * instead of the heading style, and shows `titleRecommendedNote` under it when that is given.\n */\n titleRecommendedMax?: number;\n /** Editor mode: optional text shown under a title that is longer than `titleRecommendedMax`. Leave it out to change only the style (for example when the recommendation is shown elsewhere). */\n titleRecommendedNote?: React.ReactNode;\n /** Editor mode: action buttons (copy, delete, preview, AI) revealed on hover or focus. */\n actions?: React.ReactNode;\n /** Editor mode: content shown right beside the \"Question N\" tag, e.g. the time allowed for the question. */\n meta?: React.ReactNode;\n /** Editor mode: title length limit. */\n maxLength?: number;\n /** Editor mode: the question is being edited — the number tag turns accent. */\n active?: boolean;\n /** Editor mode: allow the \"n/2000 characters\" counter, which shows only when the title is over the maximum. Defaults to `true`. */\n showCounter?: boolean;\n /**\n * Editor mode: turns the \"Question N\" tag into a drag handle. Spread onto the tag, so it takes anything a drag-and-drop\n * library hands out (`ref`, `role`, `tabIndex`, pointer and keyboard listeners, aria attributes). The tag then shows a\n * grab cursor, is focusable and reveals the grip icon on keyboard focus; it is labelled \"Reorder question N\" unless you\n * pass your own `aria-label`. Omit it for the plain tag.\n */\n dragHandleProps?: React.ComponentPropsWithRef<'span'>;\n /**\n * Whether the grip icon appears in the \"Question N\" tag on hover or focus. Defaults to true. Set it to false when the question\n * can't be moved (for example while a translation is being edited), so the tag doesn't suggest dragging.\n */\n showDragHandle?: boolean;\n /**\n * Editor mode: the question's type, shown as a 16px icon at the start of the \"Question N\" tag in its default and selected states.\n * On hover or focus (when the tag can be dragged) the grip icon replaces it. Leave it out for a tag with the number only.\n */\n questionType?: QuestionType;\n /** Editor mode: ranges of the saved title to underline in the destructive colour (misspelled words, for example). See `InlineEdit`'s `marks`. */\n titleMarks?: InlineEditMark[];\n /** Editor mode: makes the underlined words clickable; called with the mark and the chosen correction. See `InlineEdit`'s `onMarkApply`. */\n onTitleMarkApply?: (mark: InlineEditMark, replacement: string) => void;\n /** Editor mode: called when a mark is dismissed from its card. See `InlineEdit`'s `onMarkDismiss`. */\n onTitleMarkDismiss?: (mark: InlineEditMark) => void;\n}\n\nconst eyebrow = 'text-ui-caption uppercase text-secondary-muted-foreground';\n\n// Figma: Question card components (357:4761) › Question_Header — eyebrow + display title; error and editor variants.\nexport const QuestionHeader = React.forwardRef<HTMLDivElement, QuestionHeaderProps>(\n (\n { className, number, title, required, error, onDismissError, editor, onTitleChange, titlePlaceholder = 'Click to write the question text', titlePlaceholderTone, titleMinLength, titleRecommendedMax, titleRecommendedNote, actions, meta, maxLength = 2000, active, showCounter = true, dragHandleProps, showDragHandle = true, questionType, titleMarks, onTitleMarkApply, onTitleMarkDismiss, ...props },\n ref,\n ) => {\n // Editor mode: live title length while typing; null once editing ends so the saved title is the source of truth.\n const [draft, setDraft] = React.useState<string | null>(null);\n const label = String(number).padStart(2, '0');\n const showError = error !== undefined && error !== false;\n\n if (editor) {\n const text = typeof title === 'string' ? title : '';\n const count = (draft ?? text).length;\n // A long title drops to the regular body style and gets a recommendation, because a long question is tiring to read.\n const long = titleRecommendedMax !== undefined && count > titleRecommendedMax;\n return (\n <div ref={ref} className={cn('group/header flex w-full flex-col gap-2', className)} {...props}>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <QuestionNumberTag number={number} active={active} questionType={questionType} showDragHandle={showDragHandle} dragHandleProps={dragHandleProps} />\n {meta}\n </div>\n {actions && (\n <div className={cn(\n 'flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100',\n // Inside a QuestionEditorCard, hovering or focusing anywhere on the card reveals them too.\n 'group-focus-within/editor:opacity-100 group-hover/editor:opacity-100 group-data-[hovered]/editor:opacity-100',\n )}>\n {actions}\n </div>\n )}\n </div>\n {/* The negative margin cancels InlineEdit's own padding so the text stays flush with the tag above. */}\n <InlineEdit\n variant=\"question\"\n multiline\n selected={active}\n className=\"-mx-3 w-auto\"\n aria-label=\"Question title\"\n placeholder={titlePlaceholder}\n placeholderTone={titlePlaceholderTone}\n minLength={titleMinLength}\n showLimits={titleMinLength !== undefined}\n value={text}\n maxLength={maxLength}\n onValueChange={onTitleChange}\n onDraftChange={setDraft}\n onEditingChange={(editing) => {\n if (!editing) setDraft(null);\n }}\n marks={titleMarks}\n onMarkApply={onTitleMarkApply}\n onMarkDismiss={onTitleMarkDismiss}\n textClassName={long ? 'text-body-base' : 'text-heading-h4'}\n />\n {long && titleRecommendedNote != null && <p className=\"text-ui-caption text-secondary-muted-foreground\">{titleRecommendedNote}</p>}\n {showCounter && titleMinLength === undefined && maxLength !== undefined && count > maxLength && (\n <p className=\"text-ui-caption text-secondary-muted-foreground\">\n {count}/{maxLength} characters\n </p>\n )}\n </div>\n );\n }\n\n return (\n <div ref={ref} className={cn('flex w-full flex-col gap-2', className)} {...props}>\n {showError && (\n <ToastInline variant=\"destructive\" onClose={onDismissError} className=\"min-h-10\">\n <span className=\"text-ui-label text-destructive\">{error === true ? 'This question is mandatory.' : error}</span>\n </ToastInline>\n )}\n <p className={eyebrow}>Question {label}</p>\n <h3 className=\"text-heading-h4 text-surface-foreground\">\n {title}\n {required && (\n <span aria-hidden=\"true\" className=\"text-destructive\">\n *\n </span>\n )}\n {required && <span className=\"sr-only\"> (required)</span>}\n </h3>\n </div>\n );\n },\n);\nQuestionHeader.displayName = 'QuestionHeader';\n","import * as React from 'react';\nimport { DotsSixVertical } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { QuestionTypeIcon, type QuestionType } from './QuestionTypeIcon';\n\nexport interface QuestionNumberTagProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** The question's number, shown as \"Question N\". */\n number: number;\n /** The question is being edited: the tag turns accent. */\n active?: boolean;\n /** The question's type, shown as a 16px icon at the start of the tag (the grip takes its place on hover when the tag can be dragged). */\n questionType?: QuestionType;\n /** Whether the grip icon appears on hover or focus. Defaults to true. Set false where the question can't be moved. */\n showDragHandle?: boolean;\n /** Turns the tag into a drag handle: spread onto it, so it takes anything a drag-and-drop library gives (listeners, attributes, a ref). */\n dragHandleProps?: React.ComponentPropsWithRef<'span'>;\n}\n\n// Figma: Question card components (357:4761) › Question_Header — the \"Question N\" tag of the editor variant, on its own so a list that is not an\n// editor (a plan, a summary) can number its questions the same way.\nexport const QuestionNumberTag = React.forwardRef<HTMLSpanElement, QuestionNumberTagProps>(\n ({ number, active, questionType, showDragHandle = true, dragHandleProps, className, ...props }, ref) => (\n <span\n ref={ref}\n aria-label={dragHandleProps ? `Reorder question ${number}` : undefined}\n {...props}\n {...dragHandleProps}\n className={cn(\n 'group/handle inline-flex h-6 shrink-0 items-center gap-1 rounded-sm px-2.5 text-ui-caption',\n // The tag makes room for the grip on hover, and inside a QuestionEditorCard whenever the card is hovered. With a type icon the grip\n // takes the icon's place, so the tag keeps its padding and its width.\n showDragHandle && !questionType && 'hover:pl-1 group-hover/editor:pl-1 group-data-[hovered]/editor:pl-1',\n active ? 'bg-accent-soft text-accent-soft-foreground' : 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground',\n dragHandleProps && 'cursor-grab touch-none select-none',\n dragHandleProps && showDragHandle && !questionType && 'focus-visible:pl-1',\n className,\n dragHandleProps?.className,\n )}\n >\n {questionType && (\n <QuestionTypeIcon\n type={questionType}\n size={16}\n // The grip takes the icon's place whenever it shows; a tag that can't be dragged keeps the icon.\n className={cn('shrink-0', showDragHandle && 'group-hover/editor:hidden group-data-[hovered]/editor:hidden group-hover/handle:hidden group-focus-visible/handle:hidden')}\n />\n )}\n {showDragHandle && (\n <DotsSixVertical\n size={16}\n aria-hidden\n className=\"hidden shrink-0 group-hover/editor:block group-data-[hovered]/editor:block group-hover/handle:block group-focus-visible/handle:block\"\n />\n )}\n Question {number}\n </span>\n ),\n);\nQuestionNumberTag.displayName = 'QuestionNumberTag';\n","import * as React from 'react';\nimport { ChatsCircle, CheckSquare, FileArrowUp, FileText, Image, ListNumbers, RadioButton, StarHalf, VideoCamera, type IconProps } from '@phosphor-icons/react';\n\n/**\n * `upload` is the generic file upload; `upload-video`, `upload-photo` and `upload-document` say which kind of file the respondent sends (a video icon, an image icon, a file-with-text\n * icon for PDF/PPTX/DOCX). A video upload shares the video camera with screen recording: no method offers both,\n * so they never meet in one activity.\n */\nexport type QuestionType =\n | 'select-one'\n | 'select-multiple'\n | 'ranking'\n | 'upload'\n | 'upload-video'\n | 'upload-photo'\n | 'upload-document'\n | 'rating'\n | 'open-end'\n | 'screen-recording';\n\nconst icons: Record<QuestionType, React.ComponentType<IconProps>> = {\n 'select-one': RadioButton,\n 'select-multiple': CheckSquare,\n ranking: ListNumbers,\n upload: FileArrowUp,\n 'upload-video': VideoCamera,\n 'upload-photo': Image,\n 'upload-document': FileText,\n rating: StarHalf,\n 'open-end': ChatsCircle,\n 'screen-recording': VideoCamera,\n};\n\nexport interface QuestionTypeIconProps extends Omit<IconProps, 'weight'> {\n type: QuestionType;\n}\n\n// Figma: Question types › Question type icons — duotone glyphs in the accent colour (22.5px).\nexport function QuestionTypeIcon({ type, size = 22.5, className, ...props }: QuestionTypeIconProps) {\n const Icon = icons[type];\n return <Icon size={size} weight=\"duotone\" aria-hidden className={className ?? 'text-accent-foreground'} {...props} />;\n}\n","import * as React from 'react';\nimport { DotsSixVertical, Warning, WarningCircle } from '@phosphor-icons/react';\nimport { Slot } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { QuestionTypeIcon, type QuestionType } from './QuestionTypeIcon';\n\nexport interface QuestionNavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** The question currently open in the editor. */\n selected?: boolean;\n /** Question type, shown as the leading 16px duotone icon. */\n questionType?: QuestionType;\n /** The question has validation problems — the type icon becomes the exclamation circle, in the destructive colour. */\n error?: boolean;\n /** The question has recommendations — the type icon becomes the exclamation triangle, in the warning colour. `error` wins when both are set. */\n warning?: boolean;\n /** Render the child element instead of a `<button>` (e.g. a router link). */\n asChild?: boolean;\n /**\n * Whether hovering swaps the type icon for the drag grip. Defaults to true. Set it to false when the row can't be moved (for\n * example while a translation is being edited), so the icon stays and the row doesn't suggest dragging.\n */\n showDragHandle?: boolean;\n /**\n * Shows the hover look (soft fill, drag grip in place of the type icon) without the pointer, for mirroring a hover that\n * happens elsewhere, such as over the same question's card.\n */\n hovered?: boolean;\n}\n\n// Figma: Question navigation (357:4645) — one row per question. Question-type icon (muted; accent when selected), exclamation circle on error (destructive border when selected, soft red fill on hover), exclamation triangle on warning (warning border when selected, soft amber fill on hover), drag handle on hover. Label is 14px.\nexport const QuestionNavItem = React.forwardRef<HTMLButtonElement, QuestionNavItemProps>(\n ({ className, questionType = 'select-one', selected, error, warning, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {\n const Comp = asChild ? Slot.Root : 'button';\n // An error outranks a warning: the row shows one problem state.\n const warn = !error && !!warning;\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : 'button'}\n aria-current={selected ? 'true' : undefined}\n data-hovered={hovered ? '' : undefined}\n className={cn(\n 'group/nav flex h-9.5 w-full max-w-106.5 items-center gap-2 rounded-sm border bg-surface p-2 text-left text-body-small text-surface-foreground transition-colors focus-visible:outline-none',\n error\n ? ['hover:bg-destructive-soft focus-visible:border-destructive', selected ? 'border-destructive' : 'border-border']\n : warn\n ? ['hover:bg-warning-soft focus-visible:border-warning-foreground', selected ? 'border-warning-foreground' : 'border-border']\n : [\n // Hover only changes the fill; the border stays as it is (default grey, or accent when selected).\n 'hover:bg-accent-soft focus-visible:border-input-accent',\n selected ? 'border-input-accent' : 'border-border',\n ],\n hovered && (error ? 'bg-destructive-soft' : warn ? 'bg-warning-soft' : 'bg-accent-soft'),\n className,\n )}\n {...props}\n >\n <span aria-hidden=\"true\" className=\"relative flex size-4 shrink-0 items-center justify-center\">\n {showDragHandle && <DotsSixVertical size={16} className=\"hidden group-hover/nav:block group-data-[hovered]/nav:block\" />}\n <span className={showDragHandle ? 'group-hover/nav:hidden group-data-[hovered]/nav:hidden' : undefined}>\n {error ? (\n <WarningCircle size={16} className=\"text-destructive-foreground\" />\n ) : warn ? (\n <Warning size={16} className=\"text-warning-foreground\" />\n ) : (\n <QuestionTypeIcon\n type={questionType}\n size={16}\n className={selected ? 'text-accent-foreground' : 'text-muted-foreground'}\n />\n )}\n </span>\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n {error && <span className=\"sr-only\">, has errors</span>}\n {warn && <span className=\"sr-only\">, has warnings</span>}\n </Comp>\n );\n },\n);\nQuestionNavItem.displayName = 'QuestionNavItem';\n","import * as React from 'react';\nimport { Check, DotsSixVertical, Plus, Trash, WarningCircle } from '@phosphor-icons/react';\n\nimport { cn, lengthOutOfRange } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Checkbox } from '../Forms & Data Entry/Checkbox';\nimport { DraftMarks, MarkedText, remapMarks, splitMarks, type InlineEditMark } from '../Forms & Data Entry/MarkedText';\nimport { RadioGroupItem } from '../Forms & Data Entry/RadioGroup';\n\nconst optionClasses =\n 'flex w-full max-w-150 cursor-pointer items-center gap-2 rounded-md border border-border bg-surface px-4 py-2 text-body-base text-surface-foreground transition-colors ' +\n // Hover changes the fill and shadow only; the border changes only when the option is selected.\n 'hover:bg-accent-soft hover:shadow-md ' +\n 'has-[[data-state=checked]]:border-accent-foreground ' +\n 'has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50';\n\ninterface OptionBase {\n label: React.ReactNode;\n className?: string;\n disabled?: boolean;\n}\n\nexport interface QuestionRadioOptionProps extends OptionBase {\n kind?: 'radio';\n /** Value in the surrounding `RadioGroup`. */\n value: string;\n}\n\nexport interface QuestionCheckboxOptionProps extends OptionBase {\n kind: 'checkbox';\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport type QuestionOptionProps = QuestionRadioOptionProps | QuestionCheckboxOptionProps;\n\n// Figma: Question input (282:1490) › Radio / Checkbox — a full-width answer card; hover changes the fill only, and only a selected option gets the accent border.\nexport function QuestionOption(props: QuestionOptionProps) {\n const id = React.useId();\n return (\n <label htmlFor={id} className={cn(optionClasses, props.className)}>\n {props.kind === 'checkbox' ? (\n <Checkbox\n id={id}\n checked={props.checked}\n defaultChecked={props.defaultChecked}\n onCheckedChange={(next) => props.onCheckedChange?.(next === true)}\n disabled={props.disabled}\n />\n ) : (\n <RadioGroupItem id={id} value={props.value} disabled={props.disabled} />\n )}\n <span className=\"min-w-0 flex-1\">{props.label}</span>\n </label>\n );\n}\n\nexport interface QuestionOtherOptionProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onSubmit'> {\n /** Called with the typed text when the confirm button (or Enter) is pressed. */\n onSubmit?: (value: string) => void;\n confirmLabel?: string;\n}\n\n// Figma: Question input › Other=Yes — a free-text answer with a small confirm button.\nexport const QuestionOtherOption = React.forwardRef<HTMLInputElement, QuestionOtherOptionProps>(\n ({ className, onSubmit, confirmLabel = 'Confirm answer', placeholder = 'Type your answer', ...props }, ref) => {\n const inner = React.useRef<HTMLInputElement>(null);\n React.useImperativeHandle(ref, () => inner.current as HTMLInputElement);\n const submit = () => onSubmit?.(inner.current?.value ?? '');\n return (\n <div\n className={cn(\n 'inline-flex items-center gap-2 rounded-md border border-border bg-surface py-2 pr-2 pl-4 focus-within:border-input-accent',\n className,\n )}\n >\n <input\n ref={inner}\n type=\"text\"\n placeholder={placeholder}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n submit();\n }\n }}\n className=\"min-w-0 bg-transparent text-body-base text-surface-foreground outline-none placeholder:text-muted-foreground\"\n {...props}\n />\n <Button type=\"button\" variant=\"subtle\" size=\"icon-sm\" aria-label={confirmLabel} onClick={submit}>\n <Check size={16} aria-hidden />\n </Button>\n </div>\n );\n },\n);\nQuestionOtherOption.displayName = 'QuestionOtherOption';\n\nexport interface QuestionOptionEditorProps {\n label: string;\n onLabelChange?: (label: string) => void;\n /** Called by the trash button. */\n onRemove?: () => void;\n /** Called by the add (+) button. */\n onAdd?: () => void;\n /** Shown while the option is empty, for example \"Option 1\". */\n placeholder?: string;\n /** `regular` shows the placeholder in the normal text colour instead of the muted one. Default `muted`. */\n placeholderTone?: 'muted' | 'regular';\n /**\n * Shortest label (in characters, ignoring surrounding spaces) that may be saved. With `minLength` or `maxLength` the label is\n * guarded like an `InlineEdit`: typing only changes a draft, Enter or leaving the field saves it through `onLabelChange`, a label\n * that is too short is not saved (the field stays open and says why), Escape reverts, and while it is being edited a line under\n * the row shows the allowed range and the live count, but only while the label is too short or too long. An unchanged label is never refused. Without either, `onLabelChange` is\n * called on every keystroke as before.\n */\n minLength?: number;\n /** Longest label (in characters). See `minLength`. */\n maxLength?: number;\n /** Disables the trash button, for example when the question is already at its minimum number of options. */\n removeDisabled?: boolean;\n /** Disables the add (+) button, for example when the question is already at its maximum number of options. */\n addDisabled?: boolean;\n className?: string;\n /**\n * Answer type. When set the row is quiet at rest: its normal border, the radio or checkbox indicator in front of the\n * label, and the remove/add buttons hidden but still taking their space, so the row is the same width in every state.\n * On hover or keyboard focus it becomes the editor: the shadow lifts, the drag handle replaces the indicator and the\n * buttons appear. The border colour does not change. Omit it for an always-on editor row.\n */\n kind?: 'radio' | 'checkbox' | 'rank';\n /**\n * `kind=\"rank\"` only: the position shown in the round number tag, as in `RankList`. For a ranking question the row keeps\n * its drag handle and number at rest and, like the other kinds, becomes the editor on hover or keyboard focus.\n */\n rank?: number;\n /**\n * Makes the grip a drag handle for reordering (spread the handle props of your drag library, e.g. dnd-kit's `attributes` and\n * `listeners`, with its `setActivatorNodeRef` as `ref`). The grip gets a grab cursor and is focusable; it is labelled\n * \"Reorder option N\" (N from `rank`) unless you pass your own `aria-label`. Omit it for a plain, decorative grip.\n */\n dragHandleProps?: React.ComponentPropsWithRef<'span'>;\n /**\n * The look of the row while it is being dragged: lifted shadow and the grip showing, as on hover. Use it on the copy that follows\n * the pointer; the row left behind in the list is dimmed by the caller.\n */\n lifted?: boolean;\n /**\n * Locks the row's place in the list: the label stays editable, but there is no drag grip (hover keeps the radio or checkbox\n * indicator; a ranking row keeps its number) and no remove or add buttons. For editing a translation, where the options themselves\n * are shared with the original.\n */\n locked?: boolean;\n /**\n * Ranges of the label to underline in the destructive colour, for example misspelled words found by a spell checker. The underline shows\n * while the label is not being edited. See `InlineEdit`'s `marks`.\n */\n marks?: InlineEditMark[];\n /** Makes each mark clickable: clicking an underlined word opens a card with the corrections and a Dismiss action. See `InlineEdit`'s `onMarkApply`. */\n onMarkApply?: (mark: InlineEditMark, replacement: string) => void;\n /** Called when a mark is dismissed from its card. */\n onMarkDismiss?: (mark: InlineEditMark) => void;\n}\n\n// Figma: Question input › Editor=Yes — an option being authored: drag handle, editable label, remove and add buttons.\n/** \"1 character required\" (the maximum shows in the live count beside it), or \"Up to 100 characters\" when there is no minimum. */\nfunction limitsText(min?: number, max?: number) {\n if (min !== undefined) return `${min} ${min === 1 ? 'character' : 'characters'} required`;\n if (max !== undefined) return `Up to ${max} characters`;\n return '';\n}\n\nexport function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone = 'muted', minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked, marks, onMarkApply, onMarkDismiss }: QuestionOptionEditorProps) {\n const reveal = kind !== undefined;\n const guarded = minLength !== undefined || maxLength !== undefined;\n // Guarded mode: `draft` is the text being typed (null while not editing) and `error` why the last save was refused.\n const [draft, setDraft] = React.useState<string | null>(null);\n const [error, setError] = React.useState<string | null>(null);\n const helperId = React.useId();\n const [focused, setFocused] = React.useState(false);\n const showMarks = !!marks?.length && !focused && draft === null;\n const fieldRef = React.useRef<HTMLInputElement>(null);\n // The marks as they stand while the label is edited: carried over keystroke by keystroke (see `remapMarks`).\n const [editMarks, setEditMarks] = React.useState<InlineEditMark[]>([]);\n const [scroll, setScroll] = React.useState(0);\n const typed = guarded ? (draft ?? label) : label;\n // Set while an Escape revert or a save by Enter is pending so the blur that follows does not save again.\n const skipBlur = React.useRef(false);\n const problemWith = (text: string) =>\n minLength !== undefined && text.trim().length < minLength ? `Enter at least ${minLength} ${minLength === 1 ? 'character' : 'characters'}.` : null;\n const save = () => {\n if (draft === null) return true;\n if (draft !== label) {\n const problem = problemWith(draft);\n if (problem) {\n setError(problem);\n return false;\n }\n onLabelChange?.(draft);\n }\n setDraft(null);\n setError(null);\n return true;\n };\n // The grip: decorative unless the caller makes it a drag handle.\n const gripProps: React.ComponentPropsWithRef<'span'> = dragHandleProps\n ? {\n 'aria-label': rank ? `Reorder option ${rank}` : 'Reorder option',\n ...dragHandleProps,\n className: cn('cursor-grab touch-none select-none', dragHandleProps.className),\n }\n : { 'aria-hidden': true };\n const grip = dragHandleProps ? (\n <span {...gripProps} className={cn('shrink-0', gripProps.className)}>\n <DotsSixVertical size={20} aria-hidden className=\"text-surface-foreground\" />\n </span>\n ) : (\n <DotsSixVertical size={20} aria-hidden className=\"shrink-0 text-surface-foreground\" />\n );\n return (\n <div className={cn('group/option flex w-full items-center gap-2', className)}>\n <div\n className={cn(\n 'flex min-h-11.5 min-w-0 flex-1 flex-col justify-center gap-1 rounded-md border bg-surface px-4 py-2 focus-within:border-input-accent',\n reveal\n ? // The border is always visible and does not change on hover; only the shadow lifts the row. The field being edited keeps the accent.\n cn('border-border group-hover/option:shadow-md group-focus-within/option:shadow-md', lifted && 'shadow-md')\n : 'border-border hover:border-input-muted hover:shadow-md',\n )}\n >\n <div className=\"flex min-w-0 items-start gap-2\">\n {/* The leading grip, indicator or number is as tall as the input's line (28px), so they stay centred on the text; the helper line then sits under the input. */}\n {(kind !== undefined || !locked) && (\n <div className=\"flex h-7 shrink-0 items-center gap-2\">\n {kind === 'rank' ? (\n <>\n {!locked && grip}\n <span\n aria-hidden=\"true\"\n className=\"flex size-6 shrink-0 items-center justify-center rounded-full border border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-ui-caption text-surface-foreground\"\n >\n {rank}\n </span>\n </>\n ) : reveal && locked ? (\n <span aria-hidden=\"true\" className=\"relative flex size-5 shrink-0 items-center justify-center\">\n <span className={cn('inline-flex size-4 border-2 border-input bg-surface', kind === 'radio' ? 'rounded-full' : 'rounded-xxs')} />\n </span>\n ) : reveal ? (\n <span {...gripProps} className={cn('relative flex size-5 shrink-0 items-center justify-center', gripProps.className)}>\n <span\n aria-hidden=\"true\"\n className={cn(\n 'inline-flex size-4 border-2 border-input bg-surface group-hover/option:hidden group-focus-within/option:hidden',\n lifted && 'hidden',\n kind === 'radio' ? 'rounded-full' : 'rounded-xxs',\n )}\n />\n <DotsSixVertical\n size={20}\n aria-hidden\n className={cn(\n 'hidden shrink-0 text-surface-foreground group-hover/option:block group-focus-within/option:block',\n lifted && 'block',\n )}\n />\n </span>\n ) : locked ? null : (\n grip\n )}\n </div>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div className=\"relative min-w-0\">\n {/* Behind the field, which is transparent and painted over it: the highlight and the browser's text selection show together. */}\n {focused && editMarks.length > 0 && <DraftMarks layer=\"behind\" singleLine text={typed} marks={editMarks} scrollLeft={scroll} className=\"flex items-center whitespace-pre text-body-base\" />}\n <input\n ref={fieldRef}\n aria-label=\"Option label\"\n aria-invalid={error ? true : undefined}\n aria-describedby={guarded && draft !== null ? helperId : undefined}\n placeholder={placeholder}\n maxLength={maxLength}\n value={guarded ? (draft ?? label) : label}\n onFocus={() => {\n setFocused(true);\n setEditMarks(marks ?? []);\n if (guarded && draft === null) setDraft(label);\n }}\n onChange={(event) => {\n requestAnimationFrame(() => setScroll(fieldRef.current?.scrollLeft ?? 0));\n setEditMarks(remapMarks(typed, event.target.value, editMarks));\n if (!guarded) return onLabelChange?.(event.target.value);\n setDraft(event.target.value);\n // After a refused save the message follows what is typed and goes away once the text is acceptable.\n if (error) setError(problemWith(event.target.value));\n }}\n onScroll={(event) => setScroll(event.currentTarget.scrollLeft)}\n onKeyDown={(event) => {\n if (!guarded) return;\n if (event.key === 'Escape') {\n skipBlur.current = true;\n setDraft(null);\n setError(null);\n fieldRef.current?.blur();\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (save()) {\n skipBlur.current = true;\n fieldRef.current?.blur();\n }\n }\n }}\n onBlur={() => {\n setFocused(false);\n if (!guarded) return;\n if (skipBlur.current) {\n skipBlur.current = false;\n return;\n }\n save();\n }}\n className={cn(\n 'relative w-full min-w-0 bg-transparent text-body-base text-surface-foreground outline-none',\n placeholderTone === 'regular' ? 'placeholder:text-surface-foreground' : 'placeholder:text-muted-foreground',\n // The marked text is drawn over the field, so the field's own letters step aside until it is edited.\n showMarks && 'text-transparent',\n )}\n />\n {focused && editMarks.length > 0 && <DraftMarks layer=\"over\" singleLine text={typed} marks={editMarks} scrollLeft={scroll} className=\"flex items-center whitespace-pre text-body-base\" />}\n {showMarks && (\n <div aria-hidden className=\"pointer-events-none absolute inset-0 flex items-center overflow-hidden whitespace-pre text-body-base text-surface-foreground [&_[data-mark]]:pointer-events-auto\">\n {splitMarks(label, marks).map((piece, i) =>\n piece.mark ? <MarkedText key={`${piece.mark.start}:${piece.text}`} mark={piece.mark} text={piece.text} onApply={onMarkApply} onDismiss={onMarkDismiss} /> : <span key={i}>{piece.text}</span>,\n )}\n </div>\n )}\n </div>\n {guarded && draft !== null && (error || lengthOutOfRange(draft, minLength, maxLength)) && (\n <p\n id={helperId}\n role={error ? 'alert' : undefined}\n className={cn('flex items-start justify-between gap-2 text-ui-caption', error ? 'text-destructive' : 'text-secondary-muted-foreground')}\n >\n <span className=\"flex items-start gap-2\">\n {error && <WarningCircle size={16} aria-hidden className=\"shrink-0\" />}\n {limitsText(minLength, maxLength)}\n {error && <span className=\"sr-only\">{error}</span>}\n </span>\n <span aria-hidden className=\"shrink-0 tabular-nums\">\n {draft.length}\n {maxLength !== undefined && `/${maxLength}`}\n </span>\n </p>\n )}\n </div>\n </div>\n </div>\n {!locked && (\n <div\n className={cn(\n 'flex items-center gap-2',\n reveal && 'opacity-0 transition-opacity group-hover/option:opacity-100 group-focus-within/option:opacity-100',\n )}\n >\n <Button type=\"button\" variant=\"destructive\" size=\"icon-sm\" aria-label=\"Remove option\" disabled={removeDisabled} onClick={onRemove}>\n <Trash size={16} aria-hidden />\n </Button>\n <Button type=\"button\" variant=\"ghost\" size=\"icon-sm\" aria-label=\"Add option\" disabled={addDisabled} onClick={onAdd}>\n <Plus size={16} aria-hidden />\n </Button>\n </div>\n )}\n </div>\n );\n}\n","import * as React from 'react';\nimport { DotsSixVertical } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface RankItemData {\n id: string;\n label: React.ReactNode;\n}\n\nexport interface RankListProps extends Omit<React.HTMLAttributes<HTMLOListElement>, 'onChange'> {\n items: RankItemData[];\n /** Called with the new order after a drag or a keyboard move. */\n onItemsChange: (items: RankItemData[]) => void;\n}\n\nfunction move<T>(list: T[], from: number, to: number): T[] {\n if (from === to || to < 0 || to >= list.length) return list;\n const next = list.slice();\n const [item] = next.splice(from, 1);\n next.splice(to, 0, item as T);\n return next;\n}\n\n// Figma: Question input › Rank_choice — draggable rows with a numbered badge; hover turns the row and badge accent.\nexport const RankList = React.forwardRef<HTMLOListElement, RankListProps>(\n ({ className, items, onItemsChange, ...props }, ref) => {\n const [dragIndex, setDragIndex] = React.useState<number | null>(null);\n const [announcement, setAnnouncement] = React.useState('');\n const handles = React.useRef(new Map<string, HTMLButtonElement>());\n const refocus = React.useRef<string | null>(null);\n\n React.useEffect(() => {\n if (refocus.current) {\n handles.current.get(refocus.current)?.focus();\n refocus.current = null;\n }\n });\n\n const reorder = (from: number, to: number, id: string) => {\n const next = move(items, from, to);\n if (next === items) return;\n refocus.current = id;\n setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);\n onItemsChange(next);\n };\n\n return (\n <>\n <ol ref={ref} className={cn('flex w-full max-w-150 flex-col gap-4', className)} {...props}>\n {items.map((item, index) => (\n <li\n key={item.id}\n draggable\n onDragStart={() => setDragIndex(index)}\n onDragOver={(event) => event.preventDefault()}\n onDrop={() => {\n if (dragIndex !== null) reorder(dragIndex, index, item.id);\n setDragIndex(null);\n }}\n onDragEnd={() => setDragIndex(null)}\n className={cn(\n 'group/rank flex items-center gap-3 overflow-hidden rounded-sm border border-border bg-surface px-4 py-2.5 text-body-base text-surface-foreground transition-colors',\n 'hover:border-accent-foreground hover:shadow-md',\n dragIndex === index && 'opacity-50',\n )}\n >\n <button\n type=\"button\"\n ref={(el) => {\n if (el) handles.current.set(item.id, el);\n else handles.current.delete(item.id);\n }}\n aria-label={`Reorder, position ${index + 1} of ${items.length}. Use the up and down arrow keys to move.`}\n onKeyDown={(event) => {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n reorder(index, index - 1, item.id);\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n reorder(index, index + 1, item.id);\n }\n }}\n className=\"inline-flex shrink-0 cursor-grab rounded-xs text-surface-foreground\"\n >\n <DotsSixVertical size={16} aria-hidden />\n </button>\n <span\n aria-hidden=\"true\"\n className=\"flex size-6 shrink-0 items-center justify-center rounded-full border border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-ui-caption text-surface-foreground group-hover/rank:border-accent-foreground group-hover/rank:bg-accent-soft group-hover/rank:bg-none group-hover/rank:text-accent-soft-foreground\"\n >\n {index + 1}\n </span>\n <span className=\"min-w-0 flex-1\">{item.label}</span>\n </li>\n ))}\n </ol>\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {announcement}\n </span>\n </>\n );\n },\n);\nRankList.displayName = 'RankList';\n","import * as React from 'react';\nimport { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport interface RatingScaleProps\n extends Omit<React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root>, 'type' | 'value' | 'defaultValue' | 'onValueChange'> {\n /** Number of points on the scale. */\n max?: number;\n /** Selected rating (1-based), or `undefined` for none. */\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number | undefined) => void;\n /** Caption under the first point (e.g. \"Not likely\"). */\n lowLabel?: React.ReactNode;\n /** Caption under the last point (e.g. \"Very likely\"). */\n highLabel?: React.ReactNode;\n}\n\n// Figma: Question input (282:1490) › Rating scale item — equal-width 48px buttons; selected has a 2px accent border.\nexport const RatingScale = React.forwardRef<React.ElementRef<typeof ToggleGroupPrimitive.Root>, RatingScaleProps>(\n ({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {\n const [internal, setInternal] = React.useState<number | undefined>(defaultValue);\n const current = value !== undefined ? value : internal;\n return (\n <div className={cn('flex w-full max-w-150 flex-col gap-2', className)}>\n <ToggleGroupPrimitive.Root\n ref={ref}\n type=\"single\"\n value={current ? String(current) : ''}\n onValueChange={(next) => {\n const parsed = next ? Number(next) : undefined;\n setInternal(parsed);\n onValueChange?.(parsed);\n }}\n className=\"flex gap-2\"\n {...props}\n >\n {Array.from({ length: max }, (_, i) => i + 1).map((n) => (\n <ToggleGroupPrimitive.Item\n key={n}\n value={String(n)}\n aria-label={`${n}`}\n className={cn(\n 'flex h-12 min-w-0 flex-1 items-center justify-center rounded-sm border-2 border-border bg-surface text-ui-label-large text-surface-foreground transition-colors',\n 'hover:bg-accent-soft',\n 'data-[state=on]:border-accent-foreground data-[state=on]:text-accent-foreground',\n )}\n >\n {n}\n </ToggleGroupPrimitive.Item>\n ))}\n </ToggleGroupPrimitive.Root>\n {(lowLabel != null || highLabel != null) && (\n <div className=\"flex justify-between text-ui-caption text-secondary-muted-foreground\" aria-hidden=\"true\">\n <span>{lowLabel}</span>\n <span>{highLabel}</span>\n </div>\n )}\n </div>\n );\n },\n);\nRatingScale.displayName = 'RatingScale';\n","import * as React from 'react';\nimport { Image as ImageIcon, ImageBroken, Trash } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { InlineEdit } from '../Forms & Data Entry/InlineEdit';\n\nexport interface StimulusCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Image shown in the square thumbnail (92-240px, as tall as the text). Without one the thumbnail shows `icon` on a neutral fill. */\n thumbnail?: string;\n /** Alt text for `thumbnail`. Leave empty when the caption already describes the image. */\n thumbnailAlt?: string;\n /** Placeholder shown in the thumbnail when there is no `thumbnail` (e.g. a video camera for a video). Defaults to an image icon. */\n icon?: React.ReactNode;\n /**\n * `error` swaps the thumbnail for a broken-image icon on the destructive soft fill, for a stimulus that could not be\n * loaded. It is also applied automatically when `thumbnail` fails to load.\n */\n status?: 'default' | 'error';\n /** Small line above the caption saying who speaks it. */\n label?: React.ReactNode;\n /** What the AI moderator says when it shows the stimulus, e.g. \"Look at this image\". */\n caption?: string;\n /** Editor mode: makes the caption editable (click to edit, Enter or blur saves) and is called with the new text. */\n onCaptionChange?: (caption: string) => void;\n /** Editor mode: placeholder for an empty caption. */\n captionPlaceholder?: string;\n /** Editor mode: caption length limit. Also what the counter counts against. */\n maxLength?: number;\n /** Editor mode: allow the \"n/2000 characters\" counter under the caption, which shows only when the caption is over `maxLength`. Defaults to `true`; needs `maxLength`. */\n showCounter?: boolean;\n /** Shows the trash button. */\n onRemove?: () => void;\n /** Accessible name of the trash button. Defaults to \"Remove stimulus\". */\n removeLabel?: string;\n}\n\n// 92px = the card's 98px minimum height minus its padding and border. A one-line caption with the counter showing is exactly that tall,\n// so the card keeps the same height with or without the counter (it shows only when the caption is over the maximum).\nconst MIN_THUMBNAIL = 92;\nconst MAX_THUMBNAIL = 240;\n\n// Figma: Stimulus card (605:3462) — a stimulus (image or video) with what the AI moderator says about it, and a remove button.\nexport const StimulusCard = React.forwardRef<HTMLDivElement, StimulusCardProps>(\n (\n {\n className,\n thumbnail,\n thumbnailAlt = '',\n icon,\n status = 'default',\n label = 'AI Moderator',\n caption,\n onCaptionChange,\n captionPlaceholder = 'Click to write what the AI moderator says',\n maxLength,\n showCounter = true,\n onRemove,\n removeLabel = 'Remove stimulus',\n ...props\n },\n ref,\n ) => {\n // Remember which source failed, so a new `thumbnail` gets a fresh chance to load.\n const [failedSrc, setFailedSrc] = React.useState<string | undefined>();\n const error = status === 'error' || (thumbnail !== undefined && failedSrc === thumbnail);\n const showImage = thumbnail !== undefined && !error;\n // Live character count while the caption is being edited (the saved value otherwise).\n const [draft, setDraft] = React.useState<string | null>(null);\n const count = (draft ?? caption ?? '').length;\n\n // The thumbnail is square and as tall as the text column (92-240px), so it grows when the caption wraps. That is circular in\n // plain CSS (its width narrows the text, which changes its height), so measure the text and size the thumbnail from it.\n const textRef = React.useRef<HTMLDivElement>(null);\n const [thumbnailSize, setThumbnailSize] = React.useState(MIN_THUMBNAIL);\n React.useEffect(() => {\n const el = textRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => {\n setThumbnailSize(Math.min(MAX_THUMBNAIL, Math.max(MIN_THUMBNAIL, Math.ceil(el.getBoundingClientRect().height))));\n });\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n return (\n <div\n ref={ref}\n data-status={error ? 'error' : 'default'}\n className={cn('flex min-h-24.5 w-full items-center gap-4 rounded-md border border-border p-0.5 pr-4', className)}\n {...props}\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-4\">\n <span\n style={{ width: thumbnailSize, height: thumbnailSize }}\n className={cn(\n 'relative flex shrink-0 items-center justify-center overflow-hidden rounded-sm border',\n error\n ? 'border-destructive-soft-border bg-destructive-soft bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-destructive'\n : 'border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground',\n showImage && 'bg-none',\n )}\n >\n {showImage ? (\n // Out of flow, so the image's own size never sets the thumbnail's size.\n <img src={thumbnail} alt={thumbnailAlt} className=\"absolute inset-0 size-full object-cover\" onError={() => setFailedSrc(thumbnail)} />\n ) : error ? (\n <ImageBroken size={24} aria-hidden />\n ) : (\n (icon ?? <ImageIcon size={24} aria-hidden />)\n )}\n </span>\n <div ref={textRef} className=\"flex min-w-0 flex-1 flex-col justify-center gap-2 py-2 text-surface-foreground\">\n <p className=\"w-full text-ui-label\">{label}</p>\n {onCaptionChange ? (\n <InlineEdit\n variant=\"question\"\n multiline\n // The editor pads its text (top 4px, bottom 5px plus a 1px border); pull that back so the card is as tall as its content.\n className=\"-mx-3 -mt-1 -mb-1.5 w-auto\"\n aria-label=\"Stimulus caption\"\n value={caption ?? ''}\n placeholder={captionPlaceholder}\n maxLength={maxLength}\n onValueChange={onCaptionChange}\n onDraftChange={setDraft}\n onEditingChange={(editing) => {\n if (!editing) setDraft(null);\n }}\n textClassName=\"text-body-base\"\n />\n ) : (\n <p className=\"w-full text-body-base [word-break:break-word]\">{caption}</p>\n )}\n {onCaptionChange && showCounter && maxLength !== undefined && count > maxLength && (\n <p className=\"text-ui-caption text-secondary-muted-foreground\">\n {count}/{maxLength} characters\n </p>\n )}\n </div>\n </div>\n {onRemove && (\n <Button type=\"button\" variant=\"destructive\" size=\"icon-sm\" aria-label={removeLabel} onClick={onRemove}>\n <Trash size={16} aria-hidden />\n </Button>\n )}\n </div>\n );\n },\n);\nStimulusCard.displayName = 'StimulusCard';\n","import * as React from 'react';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport interface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {\n /** Heading shown above the track, left-aligned (e.g. \"Project Progress\"). */\n label?: React.ReactNode;\n /** Right-aligned value above the track. Pass `true` to render `value%`. */\n valueLabel?: React.ReactNode | true;\n /** Left caption below the track (e.g. \"16 of 25 tasks completed\"). */\n detailsStart?: React.ReactNode;\n /** Right caption below the track (e.g. \"Est. 3 days remaining\"). */\n detailsEnd?: React.ReactNode;\n}\n\n// Figma: Progress Bar (36). Track is `secondary`, indicator is `accent`, both full-radius, 8px tall.\nexport const Progress = React.forwardRef<React.ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n ({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {\n const hasHeader = label != null || valueLabel != null;\n const hasDetails = detailsStart != null || detailsEnd != null;\n const clamped = Math.min(100, Math.max(0, value ?? 0));\n return (\n <div className={cn('flex w-full flex-col gap-2', className)}>\n {hasHeader && (\n <div className=\"flex items-center justify-between text-ui-label text-surface-foreground\">\n <span>{label}</span>\n <span>{valueLabel === true ? `${Math.round(clamped)}%` : valueLabel}</span>\n </div>\n )}\n <ProgressPrimitive.Root\n ref={ref}\n value={clamped}\n className=\"relative h-2 w-full overflow-hidden rounded-full bg-secondary\"\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full rounded-full bg-accent transition-[width]\"\n style={{ width: `${clamped}%` }}\n />\n </ProgressPrimitive.Root>\n {hasDetails && (\n <div className=\"flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground\">\n <span>{detailsStart}</span>\n <span>{detailsEnd}</span>\n </div>\n )}\n </div>\n );\n },\n);\nProgress.displayName = 'Progress';\n","import * as React from 'react';\nimport { CaretDown, CaretUp } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {\n /** Alternate row backgrounds (Figma: Stripe = Yes). */\n striped?: boolean;\n /** Class names for the bordered, rounded scroll container around the `<table>`. */\n containerClassName?: string;\n /** Ref to the scroll container around the `<table>`, e.g. for virtualization or infinite scrolling. */\n containerRef?: React.Ref<HTMLDivElement>;\n}\n\n// Figma: Tables (27) — 12px-radius bordered container; rows are separated by 1px `border` lines.\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n ({ className, containerClassName, containerRef, striped, ...props }, ref) => (\n <div ref={containerRef} className={cn('relative w-full overflow-auto rounded-lg border border-border bg-surface', containerClassName)}>\n <table\n ref={ref}\n data-striped={striped ? '' : undefined}\n className={cn('group/table w-full border-collapse text-body-small text-surface-foreground', className)}\n {...props}\n />\n </div>\n ),\n);\nTable.displayName = 'Table';\n\nexport const TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <thead ref={ref} className={className} {...props} />,\n);\nTableHeader.displayName = 'TableHeader';\n\nexport const TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <tfoot ref={ref} className={cn('border-t border-border bg-background text-ui-label', className)} {...props} />\n ),\n);\nTableFooter.displayName = 'TableFooter';\n\nexport const TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tbody ref={ref} className={className} {...props} />,\n);\nTableBody.displayName = 'TableBody';\n\nexport interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {\n /** Highlights the row and marks it with the accent edge (Figma: State = Selected). */\n selected?: boolean;\n}\n\n// Figma: Table Row (29) — Default / Hover (`accent-soft`) / Selected (accent left edge on the first cell).\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, selected, ...props }, ref) => (\n <tr\n ref={ref}\n data-state={selected ? 'selected' : undefined}\n aria-selected={selected || undefined}\n className={cn(\n 'group/row border-b border-border transition-colors last:border-b-0',\n 'group-data-[striped]/table:even:bg-background hover:bg-accent-soft group-data-[striped]/table:even:hover:bg-accent-soft',\n className,\n )}\n {...props}\n />\n ),\n);\nTableRow.displayName = 'TableRow';\n\ntype Align = 'left' | 'right';\n\nexport interface TableHeadProps extends Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> {\n align?: Align;\n /** Render the label as a sort button. Provide `sort` and `onSort`. */\n sortable?: boolean;\n sort?: 'none' | 'asc' | 'desc';\n onSort?: () => void;\n /** Narrow centred column for a select-all checkbox. */\n checkbox?: boolean;\n /** Drag handle rendered at the trailing edge of the header, e.g. for column resizing. Makes the cell `relative`. */\n resizer?: React.ReactNode;\n}\n\nconst ariaSort = { none: 'none', asc: 'ascending', desc: 'descending' } as const;\n\n// Figma: Table Header Row (28) › Table Header Cell — 40px, `ui/label` text; sortable cells show a caret.\nexport const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(\n ({ className, align = 'left', sortable, sort = 'none', onSort, checkbox, resizer, children, ...props }, ref) => {\n const caret =\n sort === 'asc' ? <CaretUp size={16} aria-hidden className=\"shrink-0\" /> : <CaretDown size={16} aria-hidden className=\"shrink-0\" />;\n return (\n <th\n ref={ref}\n scope=\"col\"\n aria-sort={sortable ? ariaSort[sort] : undefined}\n className={cn(\n 'h-10 border-b border-border text-ui-label whitespace-nowrap',\n checkbox ? 'w-13 px-0 text-center' : 'px-4 py-3',\n align === 'right' ? 'text-right' : 'text-left',\n resizer && 'relative',\n className,\n )}\n {...props}\n >\n {sortable ? (\n <button\n type=\"button\"\n onClick={onSort}\n className={cn('inline-flex items-center gap-1 rounded-xs', align === 'right' && 'flex-row-reverse')}\n >\n {children}\n {caret}\n </button>\n ) : checkbox ? (\n <div className=\"flex items-center justify-center\">{children}</div>\n ) : (\n children\n )}\n {resizer}\n </th>\n );\n },\n);\nTableHead.displayName = 'TableHead';\n\nexport interface TableCellProps extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> {\n align?: Align;\n /** Secondary text colour (Figma: Type = Muted). */\n muted?: boolean;\n /** Narrow centred cell for a checkbox or radio. */\n checkbox?: boolean;\n /** Right-aligned cell for row actions; lays its children out in a row with 4px gaps. */\n actions?: boolean;\n}\n\n// Figma: Table Row (29) › Table Cell — 40px tall, 16px inline padding, 14/20 value.\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ className, align = 'left', muted, checkbox, actions, children, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'h-10 text-body-small',\n 'group-data-[state=selected]/row:first:border-l-2 group-data-[state=selected]/row:first:border-l-input-accent',\n checkbox ? 'w-13 px-0 text-center' : actions ? 'px-4 py-1.5 text-right' : 'px-4 py-3',\n align === 'right' && 'text-right',\n muted ? 'text-secondary-muted-foreground' : 'text-surface-foreground',\n className,\n )}\n {...props}\n >\n {checkbox ? <div className=\"flex items-center justify-center\">{children}</div> : actions ? <div className=\"flex items-start justify-end gap-1\">{children}</div> : children}\n </td>\n ),\n);\nTableCell.displayName = 'TableCell';\n\nexport interface TableCellTwoLinesProps extends React.HTMLAttributes<HTMLDivElement> {\n primary: React.ReactNode;\n secondary?: React.ReactNode;\n /** Leading avatar / image (Figma: Two Lines Avatar). */\n avatar?: React.ReactNode;\n}\n\n/** Primary + support text stack for a `TableCell` (Figma: Type = Two Lines / Option). Set the row/cell height to `h-14`. */\nexport function TableCellTwoLines({ primary, secondary, avatar, className, ...props }: TableCellTwoLinesProps) {\n return (\n <div className={cn('flex items-center gap-2', className)} {...props}>\n {avatar}\n <div className=\"flex flex-col gap-0.5 whitespace-nowrap\">\n <span className=\"text-ui-label text-surface-foreground\">{primary}</span>\n {secondary && <span className=\"text-ui-caption text-secondary-muted-foreground\">{secondary}</span>}\n </div>\n </div>\n );\n}\n","import * as React from 'react';\nimport { CaretDown, CaretRight, PushPin, PushPinSlash, Rows, Sliders, Stack } from '@phosphor-icons/react';\nimport {\n aggregationFn_count,\n aggregationFn_extent,\n aggregationFn_max,\n aggregationFn_mean,\n aggregationFn_median,\n aggregationFn_min,\n aggregationFn_sum,\n aggregationFn_unique,\n aggregationFn_uniqueCount,\n cellSelectionFeature,\n cellSpanningFeature,\n columnFacetingFeature,\n columnFilteringFeature,\n columnGroupingFeature,\n columnOrderingFeature,\n columnPinningFeature,\n columnResizingFeature,\n columnSizingFeature,\n columnVisibilityFeature,\n createExpandedRowModel,\n createFacetedMinMaxValues,\n createFacetedRowModel,\n createFacetedUniqueValues,\n createFilteredRowModel,\n createGroupedRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n filterFn_arrIncludesSome,\n filterFn_equals,\n filterFn_equalsString,\n filterFn_inNumberRange,\n filterFn_includesString,\n flexRender,\n globalFilteringFeature,\n rowAggregationFeature,\n rowExpandingFeature,\n rowPaginationFeature,\n rowPinningFeature,\n rowSelectionFeature,\n rowSortingFeature,\n sortFn_alphanumeric,\n sortFn_basic,\n sortFn_datetime,\n sortFn_text,\n tableFeatures,\n useTable,\n type CellSelectionState,\n type Column,\n type ColumnDef,\n type ColumnFiltersState,\n type ColumnOrderState,\n type ColumnPinningState,\n type ColumnVisibilityState,\n type ExpandedState,\n type GroupingState,\n type PaginationState,\n type Row,\n type RowData,\n type RowPinningState,\n type RowSelectionState,\n type SortingState,\n} from '@tanstack/react-table';\nimport { useVirtualizer } from '@tanstack/react-virtual';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Checkbox } from '../Forms & Data Entry/Checkbox';\nimport { Input } from '../Forms & Data Entry/Input';\nimport { SearchBar } from '../Forms & Data Entry/SearchBar';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../Forms & Data Entry/Select';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../Overlays & Feedback/DropdownMenu';\nimport { Pagination } from '../Utility/Pagination';\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n type TableProps,\n} from './Table';\n\n// Every TanStack feature DataTable can turn on. Declared once at module scope so TanStack keeps stable row models;\n// a feature only does work when the matching prop (or column option) switches it on.\nconst features = tableFeatures({\n rowSortingFeature,\n rowPaginationFeature,\n rowSelectionFeature,\n rowExpandingFeature,\n rowPinningFeature,\n rowAggregationFeature,\n columnVisibilityFeature,\n columnOrderingFeature,\n columnPinningFeature,\n columnSizingFeature,\n columnResizingFeature,\n columnFilteringFeature,\n globalFilteringFeature,\n columnFacetingFeature,\n columnGroupingFeature,\n cellSelectionFeature,\n cellSpanningFeature,\n // Row-model pipeline order: filter → group → sort → expand → paginate.\n facetedRowModel: createFacetedRowModel(),\n facetedUniqueValues: createFacetedUniqueValues(),\n facetedMinMaxValues: createFacetedMinMaxValues(),\n filteredRowModel: createFilteredRowModel(),\n groupedRowModel: createGroupedRowModel(),\n sortedRowModel: createSortedRowModel(),\n expandedRowModel: createExpandedRowModel(),\n paginatedRowModel: createPaginatedRowModel(),\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n basic: sortFn_basic,\n datetime: sortFn_datetime,\n text: sortFn_text,\n },\n filterFns: {\n arrIncludesSome: filterFn_arrIncludesSome,\n equals: filterFn_equals,\n equalsString: filterFn_equalsString,\n includesString: filterFn_includesString,\n inNumberRange: filterFn_inNumberRange,\n },\n aggregationFns: {\n count: aggregationFn_count,\n extent: aggregationFn_extent,\n max: aggregationFn_max,\n mean: aggregationFn_mean,\n median: aggregationFn_median,\n min: aggregationFn_min,\n sum: aggregationFn_sum,\n unique: aggregationFn_unique,\n uniqueCount: aggregationFn_uniqueCount,\n },\n});\n\n/**\n * A column definition for `DataTable`. Built with TanStack Table's `ColumnDef`, e.g. `{ accessorKey: 'name', header: 'Name' }`.\n * Besides the usual options it understands `aggregationFn` / `aggregatedCell` (grouping), `spanRows` / `spanColumns`\n * (cell spanning), `size` / `minSize` / `maxSize` (sizing and resizing), `footer`, and the `meta` below.\n */\nexport type DataTableColumnDef<TData extends RowData> = ColumnDef<typeof features, TData>;\n\n/** Optional `meta` on a column that `DataTable` understands. */\nexport interface DataTableColumnMeta {\n /** Right-align the header and cells, for numbers and amounts. */\n align?: 'left' | 'right';\n /** Secondary text colour for the column's cells. */\n muted?: boolean;\n /** Label shown in menus and used for accessible names. Defaults to the column id. */\n label?: string;\n /** Control shown in the filter row (`enableColumnFilters`). `select` offers the values found in the data, with counts. */\n filterVariant?: 'text' | 'select' | 'range';\n /** Render the cell as an input; pair with the table's `onCellEdit`. */\n editable?: boolean;\n /** Input type of an editable cell. */\n editType?: 'text' | 'number';\n}\n\nconst getMeta = (meta: unknown) => (meta ?? {}) as DataTableColumnMeta;\n\n/** Everything `DataTable` can start with when its state is not controlled. */\nexport interface DataTableInitialState {\n sorting?: SortingState;\n rowSelection?: RowSelectionState;\n columnVisibility?: ColumnVisibilityState;\n columnPinning?: Partial<ColumnPinningState>;\n columnOrder?: ColumnOrderState;\n columnFilters?: ColumnFiltersState;\n globalFilter?: string;\n grouping?: GroupingState;\n expanded?: ExpandedState;\n rowPinning?: Partial<RowPinningState>;\n pagination?: PaginationState;\n}\n\nexport interface DataTableProps<TData extends RowData>\n extends Omit<TableProps, 'children' | 'onSelect' | 'onChange'> {\n /** Column definitions (TanStack `ColumnDef`). Keep the array referentially stable (module scope or `useMemo`). */\n columns: DataTableColumnDef<TData>[];\n /** Row data. Keep referentially stable between renders. */\n data: TData[];\n /** Stable row id, used for selection, pinning and expansion. Defaults to the row index. */\n getRowId?: (row: TData, index: number) => string;\n /** Starting values for state the table owns. Ignored for state you control. */\n initialState?: DataTableInitialState;\n\n /** Let columns be sorted by clicking their header. Opt a single column out with `enableSorting: false`. */\n enableSorting?: boolean;\n /** Add a leading checkbox column with a select-all header checkbox. */\n enableRowSelection?: boolean;\n /** Show a \"Columns\" menu that toggles column visibility. */\n enableColumnVisibility?: boolean;\n /** Stick columns to the start or end edge. Pin with `initialState.columnPinning` or `column.pin('start' | 'end')`. */\n enableColumnPinning?: boolean;\n /** Apply each column's `size` (and `minSize` / `maxSize`) as its width. Implied by column pinning and resizing. */\n enableColumnSizing?: boolean;\n /** Drag the header edge to resize columns. Size columns with `size`, `minSize` and `maxSize` in the column definition. */\n enableColumnResizing?: boolean;\n /** `onChange` resizes live while dragging; `onEnd` applies the new width on release. */\n columnResizeMode?: 'onChange' | 'onEnd';\n /** Reorder columns by dragging their headers, or with Alt + arrow keys on a focused header. */\n enableColumnOrdering?: boolean;\n /** Show a filter row under the header. Pick each column's control with `meta.filterVariant`. */\n enableColumnFilters?: boolean;\n /** Show a search field above the table that filters across all columns. */\n enableGlobalFilter?: boolean;\n /** Placeholder of the global search field. */\n globalFilterPlaceholder?: string;\n /** Group rows by one or more columns, with a \"Group by\" menu. Aggregate with each column's `aggregationFn`. */\n enableGrouping?: boolean;\n /** Add a disclosure column to expand sub-rows (`getSubRows`) or a detail panel (`renderSubComponent`). */\n enableExpanding?: boolean;\n /** Add a column with a button that pins the row to the top of the table. */\n enableRowPinning?: boolean;\n /** Spreadsheet-style selection of cell ranges: drag, Shift-click, Ctrl/Cmd-click, arrow keys, Ctrl/Cmd + A. */\n enableCellSelection?: boolean;\n /** Render a footer row from each column's `footer`. */\n showFooter?: boolean;\n /** Show the row-density toggle in the toolbar. */\n enableDensityToggle?: boolean;\n /** Row density. `compact` uses shorter rows. */\n density?: 'default' | 'compact';\n onDensityChange?: (density: 'default' | 'compact') => void;\n\n /** Sub-rows of a row, for tree data. */\n getSubRows?: (row: TData, index: number) => TData[] | undefined;\n /** Whether a row can expand. Defaults to \"has sub-rows\", or \"always\" when `renderSubComponent` is set. */\n getRowCanExpand?: (row: Row<typeof features, TData>) => boolean;\n /** Detail panel shown under an expanded row. */\n renderSubComponent?: (row: TData) => React.ReactNode;\n\n /** Rows per page. The pagination bar is hidden when everything fits on one page. */\n pageSize?: number;\n /**\n * Sorting, filtering and pagination happen on your server: pass one page of already processed `data` plus the total `rowCount`,\n * and read the state through the controlled props below to build the request.\n */\n serverSide?: boolean;\n /** Total number of rows on the server. Required with `serverSide` for the page count. */\n rowCount?: number;\n\n /** Controlled sorting state. Pair with `onSortingChange`. */\n sorting?: SortingState;\n onSortingChange?: (sorting: SortingState) => void;\n /** Controlled selection state, keyed by row id. Pair with `onRowSelectionChange`. */\n rowSelection?: RowSelectionState;\n onRowSelectionChange?: (rowSelection: RowSelectionState) => void;\n /** Controlled pagination state. Pair with `onPaginationChange`. */\n pagination?: PaginationState;\n onPaginationChange?: (pagination: PaginationState) => void;\n /** Controlled column visibility, keyed by column id. Pair with `onColumnVisibilityChange`. */\n columnVisibility?: ColumnVisibilityState;\n onColumnVisibilityChange?: (columnVisibility: ColumnVisibilityState) => void;\n /** Controlled column pinning. Pair with `onColumnPinningChange`. */\n columnPinning?: ColumnPinningState;\n onColumnPinningChange?: (columnPinning: ColumnPinningState) => void;\n /** Controlled column order (column ids). Pair with `onColumnOrderChange`. */\n columnOrder?: ColumnOrderState;\n onColumnOrderChange?: (columnOrder: ColumnOrderState) => void;\n /** Controlled column filters. Pair with `onColumnFiltersChange`. */\n columnFilters?: ColumnFiltersState;\n onColumnFiltersChange?: (columnFilters: ColumnFiltersState) => void;\n /** Controlled global search text. Pair with `onGlobalFilterChange`. */\n globalFilter?: string;\n onGlobalFilterChange?: (globalFilter: string) => void;\n /** Controlled grouping (column ids). Pair with `onGroupingChange`. */\n grouping?: GroupingState;\n onGroupingChange?: (grouping: GroupingState) => void;\n /** Controlled expansion. Pair with `onExpandedChange`. */\n expanded?: ExpandedState;\n onExpandedChange?: (expanded: ExpandedState) => void;\n /** Controlled row pinning. Pair with `onRowPinningChange`. */\n rowPinning?: RowPinningState;\n onRowPinningChange?: (rowPinning: RowPinningState) => void;\n /** Called whenever the selected cell ranges change. */\n onCellSelectionChange?: (cellSelection: CellSelectionState) => void;\n\n /** Called when an editable cell (`meta.editable`) is committed with Enter or blur. Update your data in response. */\n onCellEdit?: (edit: { row: TData; rowId: string; columnId: string; value: string }) => void;\n\n /** Render only the visible rows. Give the table a bounded height with `containerClassName`, e.g. `max-h-96`. */\n virtualized?: boolean;\n /** Row height in pixels used before a row has been measured. Match `h-10` (40) unless rows are taller. */\n estimateRowHeight?: number;\n /** Infinite scrolling: called when the end of the table scrolls into view and `hasMore` is true. Disables pagination. Bound the height with `containerClassName` to scroll inside the table. */\n onLoadMore?: () => void;\n /** Whether more rows can be loaded. */\n hasMore?: boolean;\n /** A page of rows is loading; shows placeholder rows at the end. */\n loadingMore?: boolean;\n\n /** Keep the header in view while the table scrolls. On by default with row pinning and virtualization. */\n stickyHeader?: boolean;\n /** Show placeholder rows instead of data. */\n loading?: boolean;\n /** Content of the empty state. Defaults to \"No results.\" */\n emptyState?: React.ReactNode;\n /** Called when a row is clicked (not when its controls are). */\n onRowClick?: (row: TData) => void;\n /** Content for the left side of the toolbar, e.g. filter tabs. */\n toolbar?: React.ReactNode;\n /** Class names for the wrapper around the toolbar, table and pagination. */\n wrapperClassName?: string;\n}\n\n/** Controlled when `value` is defined, otherwise local state seeded with `initial`. */\nfunction useControllable<T>(value: T | undefined, initial: T, onChange?: (next: T) => void) {\n const [internal, setInternal] = React.useState<T>(initial);\n const current = value ?? internal;\n const update = React.useCallback(\n (updater: T | ((previous: T) => T)) => {\n const next = typeof updater === 'function' ? (updater as (previous: T) => T)(current) : updater;\n if (value === undefined) setInternal(next);\n onChange?.(next);\n },\n [current, value, onChange],\n );\n return [current, update] as const;\n}\n\nconst ALL = '__all__';\n\nconst labelOf = <TData extends RowData>(column: Column<typeof features, TData>) =>\n getMeta(column.columnDef.meta).label ?? (typeof column.columnDef.header === 'string' ? column.columnDef.header : column.id);\n\n// Sticky offsets for pinned columns. Widths come from TanStack's sizing model, so they are data, not design values.\nfunction pinning<TData extends RowData>(column: Column<typeof features, TData>, sized: boolean, header = false) {\n const side = column.getIsPinned();\n const style: React.CSSProperties = {};\n if (sized) {\n style.width = column.getSize();\n style.minWidth = column.getSize();\n style.maxWidth = column.getSize();\n }\n if (side) {\n style.position = 'sticky';\n if (side === 'start') style.insetInlineStart = column.getStart('start');\n else style.insetInlineEnd = column.getAfter('end');\n }\n const className = side\n ? cn(\n header ? 'z-30' : 'z-10',\n 'bg-surface',\n side === 'start' && column.getIsLastColumn('start') && 'border-r border-border',\n side === 'end' && column.getIsFirstColumn('end') && 'border-l border-border',\n )\n : undefined;\n return { style, className };\n}\n\ninterface ColumnFilterProps<TData extends RowData> {\n column: Column<typeof features, TData>;\n}\n\nfunction ColumnFilter<TData extends RowData>({ column }: ColumnFilterProps<TData>) {\n const variant = getMeta(column.columnDef.meta).filterVariant ?? 'text';\n const label = labelOf(column);\n const value = column.getFilterValue();\n\n if (variant === 'select') {\n const options = [...column.getFacetedUniqueValues().entries()].sort((a, b) => String(a[0]).localeCompare(String(b[0])));\n return (\n <Select\n value={typeof value === 'string' ? value : ALL}\n onValueChange={(next) => column.setFilterValue(next === ALL ? undefined : next)}\n >\n <SelectTrigger aria-label={`Filter ${label}`} className=\"h-8 text-body-small\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={ALL}>All</SelectItem>\n {options.map(([option, count]) => (\n <SelectItem key={String(option)} value={String(option)}>\n {String(option)} ({count})\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n );\n }\n\n if (variant === 'range') {\n const [min, max] = column.getFacetedMinMaxValues() ?? [];\n const range = (Array.isArray(value) ? value : []) as [number | undefined, number | undefined];\n const update = (index: 0 | 1, raw: string) => {\n const next: [number | undefined, number | undefined] = [range[0], range[1]];\n next[index] = raw === '' ? undefined : Number(raw);\n column.setFilterValue(next[0] === undefined && next[1] === undefined ? undefined : next);\n };\n return (\n <div className=\"flex gap-1\">\n <Input\n type=\"number\"\n aria-label={`${label} minimum`}\n placeholder={min !== undefined ? String(min) : 'Min'}\n value={range[0] ?? ''}\n onChange={(event) => update(0, event.target.value)}\n className=\"h-8 text-body-small\"\n />\n <Input\n type=\"number\"\n aria-label={`${label} maximum`}\n placeholder={max !== undefined ? String(max) : 'Max'}\n value={range[1] ?? ''}\n onChange={(event) => update(1, event.target.value)}\n className=\"h-8 text-body-small\"\n />\n </div>\n );\n }\n\n return (\n <Input\n aria-label={`Filter ${label}`}\n placeholder=\"Filter…\"\n value={typeof value === 'string' ? value : ''}\n onChange={(event) => column.setFilterValue(event.target.value || undefined)}\n className=\"h-8 text-body-small\"\n />\n );\n}\n\ninterface EditableCellProps {\n value: unknown;\n label: string;\n type: 'text' | 'number';\n onCommit: (value: string) => void;\n}\n\nfunction EditableCell({ value, label, type, onCommit }: EditableCellProps) {\n const initial = value == null ? '' : String(value);\n // `null` while not editing, so the input always shows the latest value from the data.\n const [draft, setDraft] = React.useState<string | null>(null);\n const cancelled = React.useRef(false);\n return (\n <Input\n type={type}\n aria-label={label}\n value={draft ?? initial}\n onChange={(event) => setDraft(event.target.value)}\n onBlur={() => {\n if (!cancelled.current && draft !== null && draft !== initial) onCommit(draft);\n cancelled.current = false;\n setDraft(null);\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') event.currentTarget.blur();\n if (event.key === 'Escape') {\n cancelled.current = true;\n event.currentTarget.blur();\n }\n }}\n className={cn('h-8 border-transparent bg-transparent text-body-small', type === 'number' && 'text-right')}\n />\n );\n}\n\n// Figma: Tables (27) — the visual layer is `Table`; TanStack Table supplies sorting, selection, paging, filtering,\n// grouping, pinning and the rest.\nfunction DataTableInner<TData extends RowData>(\n {\n columns,\n data,\n getRowId,\n initialState,\n enableSorting = false,\n enableRowSelection = false,\n enableColumnVisibility = false,\n enableColumnPinning = false,\n enableColumnSizing = false,\n enableColumnResizing = false,\n columnResizeMode = 'onChange',\n enableColumnOrdering = false,\n enableColumnFilters = false,\n enableGlobalFilter = false,\n globalFilterPlaceholder = 'Search',\n enableGrouping = false,\n enableExpanding = false,\n enableRowPinning = false,\n enableCellSelection = false,\n showFooter = false,\n enableDensityToggle = false,\n density: densityProp,\n onDensityChange,\n getSubRows,\n getRowCanExpand,\n renderSubComponent,\n pageSize = 10,\n serverSide = false,\n rowCount,\n sorting: sortingProp,\n onSortingChange,\n rowSelection: rowSelectionProp,\n onRowSelectionChange,\n pagination: paginationProp,\n onPaginationChange,\n columnVisibility: columnVisibilityProp,\n onColumnVisibilityChange,\n columnPinning: columnPinningProp,\n onColumnPinningChange,\n columnOrder: columnOrderProp,\n onColumnOrderChange,\n columnFilters: columnFiltersProp,\n onColumnFiltersChange,\n globalFilter: globalFilterProp,\n onGlobalFilterChange,\n grouping: groupingProp,\n onGroupingChange,\n expanded: expandedProp,\n onExpandedChange,\n rowPinning: rowPinningProp,\n onRowPinningChange,\n onCellSelectionChange,\n onCellEdit,\n virtualized = false,\n estimateRowHeight = 40,\n onLoadMore,\n hasMore = false,\n loadingMore = false,\n stickyHeader,\n loading = false,\n emptyState,\n onRowClick,\n toolbar,\n wrapperClassName,\n striped,\n containerClassName,\n containerRef,\n style: tableStyle,\n ...tableProps\n }: DataTableProps<TData>,\n ref: React.ForwardedRef<HTMLTableElement>,\n) {\n const [sorting, setSorting] = useControllable<SortingState>(sortingProp, initialState?.sorting ?? [], onSortingChange);\n const [rowSelection, setRowSelection] = useControllable<RowSelectionState>(\n rowSelectionProp,\n initialState?.rowSelection ?? {},\n onRowSelectionChange,\n );\n const [columnVisibility, setColumnVisibility] = useControllable<ColumnVisibilityState>(\n columnVisibilityProp,\n initialState?.columnVisibility ?? {},\n onColumnVisibilityChange,\n );\n const [columnPinning, setColumnPinning] = useControllable<ColumnPinningState>(\n columnPinningProp,\n { start: initialState?.columnPinning?.start ?? [], end: initialState?.columnPinning?.end ?? [] },\n onColumnPinningChange,\n );\n const [columnOrder, setColumnOrder] = useControllable<ColumnOrderState>(\n columnOrderProp,\n initialState?.columnOrder ?? [],\n onColumnOrderChange,\n );\n const [columnFilters, setColumnFilters] = useControllable<ColumnFiltersState>(\n columnFiltersProp,\n initialState?.columnFilters ?? [],\n onColumnFiltersChange,\n );\n const [globalFilter, setGlobalFilter] = useControllable<string>(\n globalFilterProp,\n initialState?.globalFilter ?? '',\n onGlobalFilterChange,\n );\n const [grouping, setGrouping] = useControllable<GroupingState>(groupingProp, initialState?.grouping ?? [], onGroupingChange);\n const [expanded, setExpanded] = useControllable<ExpandedState>(expandedProp, initialState?.expanded ?? {}, onExpandedChange);\n const [rowPinning, setRowPinning] = useControllable<RowPinningState>(\n rowPinningProp,\n { top: initialState?.rowPinning?.top ?? [], bottom: initialState?.rowPinning?.bottom ?? [] },\n onRowPinningChange,\n );\n const [pagination, setPagination] = useControllable<PaginationState>(\n paginationProp,\n initialState?.pagination ?? { pageIndex: 0, pageSize },\n onPaginationChange,\n );\n const [density, setDensity] = useControllable<'default' | 'compact'>(densityProp, 'default', onDensityChange);\n const [cellSelection, setCellSelection] = React.useState<CellSelectionState>([]);\n\n const infinite = Boolean(onLoadMore);\n const paginate = !virtualized && !infinite;\n const compact = density === 'compact';\n const sized = enableColumnSizing || enableColumnResizing || enableColumnPinning;\n const sticky = stickyHeader ?? (enableRowPinning || virtualized);\n\n const table = useTable({\n features,\n columns,\n data,\n getRowId,\n getSubRows,\n getRowCanExpand: getRowCanExpand ?? (renderSubComponent ? () => true : undefined),\n enableSorting,\n enableRowSelection,\n enableColumnResizing,\n enableColumnPinning,\n enableColumnFilters,\n enableGlobalFilter,\n enableGrouping,\n enableRowPinning,\n enableCellSelection,\n columnResizeMode,\n globalFilterFn: 'includesString',\n manualSorting: serverSide,\n manualFiltering: serverSide,\n manualPagination: serverSide || !paginate,\n rowCount: serverSide ? rowCount : undefined,\n autoResetPageIndex: !serverSide,\n state: {\n sorting,\n rowSelection,\n columnVisibility,\n columnPinning,\n columnOrder,\n columnFilters,\n globalFilter,\n grouping,\n expanded,\n rowPinning,\n cellSelection,\n pagination: { ...pagination, pageSize: paginationProp ? pagination.pageSize : pageSize },\n },\n onSortingChange: setSorting,\n onRowSelectionChange: setRowSelection,\n onColumnVisibilityChange: setColumnVisibility,\n onColumnPinningChange: setColumnPinning,\n onColumnOrderChange: setColumnOrder,\n onColumnFiltersChange: setColumnFilters,\n onGlobalFilterChange: setGlobalFilter,\n onGroupingChange: setGrouping,\n onExpandedChange: setExpanded,\n onRowPinningChange: setRowPinning,\n onCellSelectionChange: (updater) => {\n const next = typeof updater === 'function' ? updater(cellSelection) : updater;\n setCellSelection(next);\n onCellSelectionChange?.(next);\n },\n onPaginationChange: setPagination,\n });\n\n const headerGroups = table.getHeaderGroups();\n const leafColumns = table.getVisibleLeafColumns();\n const hasExpander = enableExpanding;\n const leadingCount = (enableRowSelection ? 1 : 0) + (hasExpander ? 1 : 0) + (enableRowPinning ? 1 : 0);\n const columnSpan = leafColumns.length + leadingCount;\n const pageCount = table.getPageCount();\n const selectedCount = Object.values(rowSelection).filter(Boolean).length;\n const hideableColumns = table.getAllLeafColumns().filter((column) => column.getCanHide());\n const groupableColumns = table.getAllLeafColumns().filter((column) => column.getCanGroup());\n const showToolbar = Boolean(toolbar) || enableColumnVisibility || enableGlobalFilter || enableGrouping || enableDensityToggle;\n const cellDensity = compact ? 'h-8 py-1.5' : undefined;\n const allSelected = table.getIsAllPageRowsSelected();\n const someSelected = table.getIsSomePageRowsSelected();\n const dragged = React.useRef<string | null>(null);\n\n const topRows = enableRowPinning ? table.getTopRows() : [];\n const bottomRows = enableRowPinning ? table.getBottomRows() : [];\n const bodyRows = enableRowPinning ? table.getCenterRows() : table.getRowModel().rows;\n\n // Virtualization of the body rows. Disabled (and cheap) unless `virtualized`.\n const scrollRef = React.useRef<HTMLDivElement | null>(null);\n const setScrollRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n scrollRef.current = node;\n if (typeof containerRef === 'function') containerRef(node);\n else if (containerRef) (containerRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [containerRef],\n );\n const virtualizer = useVirtualizer({\n count: bodyRows.length,\n getScrollElement: () => scrollRef.current,\n estimateSize: () => estimateRowHeight,\n overscan: 8,\n enabled: virtualized,\n initialRect: { width: 0, height: estimateRowHeight * 10 },\n });\n const virtualItems = virtualized ? virtualizer.getVirtualItems() : [];\n const paddingTop = virtualItems.length > 0 ? (virtualItems[0]?.start ?? 0) : 0;\n const paddingBottom = virtualItems.length > 0 ? virtualizer.getTotalSize() - (virtualItems.at(-1)?.end ?? 0) : 0;\n\n // Infinite scrolling: load more when the sentinel row scrolls into view.\n const sentinelRef = React.useRef<HTMLTableRowElement | null>(null);\n React.useEffect(() => {\n const node = sentinelRef.current;\n if (!node || !onLoadMore || !hasMore || loadingMore || typeof IntersectionObserver === 'undefined') return;\n // Watch inside the scroll container once it scrolls, otherwise against the page.\n const container = scrollRef.current;\n const root = container && container.scrollHeight > container.clientHeight ? container : null;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) onLoadMore();\n },\n { root, rootMargin: '0px 0px 160px 0px' },\n );\n observer.observe(node);\n return () => observer.disconnect();\n }, [onLoadMore, hasMore, loadingMore, bodyRows.length]);\n\n const reorder = (activeId: string, overId: string) => {\n if (activeId === overId) return;\n const ids = table.getAllLeafColumns().map((column) => column.id);\n const next = ids.filter((id) => id !== activeId);\n const at = next.indexOf(overId);\n next.splice(at === -1 ? next.length : at, 0, activeId);\n table.setColumnOrder(next);\n };\n\n const onGridKeyDown = (event: React.KeyboardEvent) => {\n const directions: Record<string, 'up' | 'down' | 'left' | 'right'> = {\n ArrowUp: 'up',\n ArrowDown: 'down',\n ArrowLeft: 'left',\n ArrowRight: 'right',\n };\n const direction = directions[event.key];\n if (direction) {\n event.preventDefault();\n if (event.shiftKey) table.extendCellSelection(direction);\n else table.moveCellSelection(direction);\n } else if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'a') {\n event.preventDefault();\n table.selectAllCells();\n } else if (event.key === 'Escape') {\n table.resetCellSelection(true);\n }\n };\n\n const skeletonRow = (rowKey: string) => (\n <TableRow key={rowKey} className=\"hover:bg-transparent\">\n {Array.from({ length: columnSpan }, (_, cell) => (\n <TableCell key={cell} checkbox={enableRowSelection && cell === 0} className={cellDensity}>\n <span aria-hidden className=\"block h-4 w-3/4 animate-pulse rounded-xs bg-border\" />\n </TableCell>\n ))}\n </TableRow>\n );\n\n const renderRow = (\n row: Row<typeof features, TData>,\n options: { pinned?: 'top' | 'bottom'; pinnedIndex?: number; pinnedCount?: number; virtualIndex?: number } = {},\n ) => {\n const { pinned, pinnedIndex = 0, pinnedCount = 1, virtualIndex } = options;\n const grouped = row.getIsGrouped();\n const rowUnits = compact ? 8 : 10;\n const pinStyle: React.CSSProperties | undefined = pinned\n ? pinned === 'top'\n ? { position: 'sticky', top: `calc(var(--spacing) * ${rowUnits * (pinnedIndex + 1)})` }\n : { position: 'sticky', bottom: `calc(var(--spacing) * ${rowUnits * (pinnedCount - 1 - pinnedIndex)})` }\n : undefined;\n const cells = row.getVisibleCells();\n\n return (\n <React.Fragment key={row.id}>\n <TableRow\n ref={virtualized && virtualIndex !== undefined ? virtualizer.measureElement : undefined}\n data-index={virtualIndex}\n selected={row.getIsSelected()}\n style={pinStyle}\n onClick={onRowClick && !grouped ? () => onRowClick(row.original) : undefined}\n className={cn(pinned && 'z-20 bg-surface', grouped && 'bg-background', onRowClick && !grouped && 'cursor-pointer')}\n >\n {enableRowSelection && (\n <TableCell checkbox className={cellDensity} onClick={(event) => event.stopPropagation()}>\n {!grouped && (\n <Checkbox\n aria-label=\"Select row\"\n checked={row.getIsSelected()}\n disabled={!row.getCanSelect()}\n onCheckedChange={(checked) => row.toggleSelected(Boolean(checked))}\n />\n )}\n </TableCell>\n )}\n {hasExpander && (\n <TableCell checkbox className={cellDensity} onClick={(event) => event.stopPropagation()}>\n {!grouped && row.getCanExpand() && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={row.getIsExpanded() ? 'Collapse row' : 'Expand row'}\n aria-expanded={row.getIsExpanded()}\n onClick={() => row.toggleExpanded()}\n >\n {row.getIsExpanded() ? <CaretDown size={16} aria-hidden /> : <CaretRight size={16} aria-hidden />}\n </Button>\n )}\n </TableCell>\n )}\n {enableRowPinning && (\n <TableCell checkbox className={cellDensity} onClick={(event) => event.stopPropagation()}>\n {!grouped && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={row.getIsPinned() ? 'Unpin row' : 'Pin row to top'}\n aria-pressed={Boolean(row.getIsPinned())}\n onClick={() => row.pin(row.getIsPinned() ? false : 'top')}\n >\n {row.getIsPinned() ? <PushPinSlash size={16} aria-hidden /> : <PushPin size={16} aria-hidden />}\n </Button>\n )}\n </TableCell>\n )}\n {cells.map((cell, index) => {\n if (cell.getIsCovered()) return null;\n const meta = getMeta(cell.column.columnDef.meta);\n const pin = pinning(cell.column, sized);\n const rowSpan = cell.getRowSpan();\n const colSpan = cell.getColSpan();\n const edges = enableCellSelection && cell.getIsSelected() ? cell.getSelectionEdges() : undefined;\n const indent = index === 0 && hasExpander && row.depth > 0 ? row.depth * 4 : 0;\n\n let content: React.ReactNode;\n if (cell.getIsGrouped()) {\n content = (\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 rounded-xs text-ui-label\"\n aria-expanded={row.getIsExpanded()}\n onClick={row.getToggleExpandedHandler()}\n >\n {row.getIsExpanded() ? <CaretDown size={16} aria-hidden /> : <CaretRight size={16} aria-hidden />}\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n <span className=\"text-secondary-muted-foreground\">({row.subRows.length})</span>\n </button>\n );\n } else if (cell.getIsAggregated()) {\n content = flexRender(cell.column.columnDef.aggregatedCell ?? cell.column.columnDef.cell, cell.getContext());\n } else if (cell.getIsPlaceholder()) {\n content = null;\n } else if (meta.editable) {\n content = (\n <EditableCell\n value={cell.getValue()}\n label={`${labelOf(cell.column)}, row ${row.index + 1}`}\n type={meta.editType ?? 'text'}\n onCommit={(value) => onCellEdit?.({ row: row.original, rowId: row.id, columnId: cell.column.id, value })}\n />\n );\n } else {\n content = flexRender(cell.column.columnDef.cell, cell.getContext());\n }\n\n return (\n <TableCell\n key={cell.id}\n align={meta.align}\n muted={meta.muted && !grouped}\n rowSpan={rowSpan > 1 ? rowSpan : undefined}\n colSpan={colSpan > 1 ? colSpan : undefined}\n style={{\n ...pin.style,\n ...(indent ? { paddingInlineStart: `calc(var(--spacing) * ${indent + 4})` } : null),\n }}\n data-selected={edges ? '' : undefined}\n onMouseDown={enableCellSelection ? cell.getSelectionStartHandler() : undefined}\n onMouseEnter={enableCellSelection ? cell.getSelectionExtendHandler() : undefined}\n className={cn(\n cellDensity,\n pin.className,\n enableCellSelection && 'select-none',\n edges && 'bg-accent-soft',\n edges?.top && 'border-t-2 border-t-input-accent',\n edges?.bottom && 'border-b-2 border-b-input-accent',\n edges?.left && 'border-l-2 border-l-input-accent',\n edges?.right && 'border-r-2 border-r-input-accent',\n meta.editable && 'py-1',\n )}\n >\n {content}\n </TableCell>\n );\n })}\n </TableRow>\n {renderSubComponent && !grouped && row.getIsExpanded() && (\n <TableRow className=\"bg-background hover:bg-background\">\n <TableCell colSpan={columnSpan}>{renderSubComponent(row.original)}</TableCell>\n </TableRow>\n )}\n </React.Fragment>\n );\n };\n\n const renderHeaderCell = (header: (typeof headerGroups)[number]['headers'][number]) => {\n const { column } = header;\n const { align } = getMeta(column.columnDef.meta);\n const leaf = header.subHeaders.length === 0;\n const sortState = column.getIsSorted();\n const pin = pinning(column, sized, true);\n const reorderable = enableColumnOrdering && leaf && !column.getIsPinned();\n const label = labelOf(column);\n\n return (\n <TableHead\n key={header.id}\n colSpan={header.colSpan > 1 ? header.colSpan : undefined}\n align={leaf ? align : undefined}\n sortable={leaf && column.getCanSort()}\n sort={sortState === false ? 'none' : sortState}\n onSort={() => column.toggleSorting(sortState === 'asc')}\n style={pin.style}\n draggable={reorderable || undefined}\n tabIndex={reorderable ? 0 : undefined}\n title={reorderable ? 'Drag, or press Alt + arrow keys, to reorder' : undefined}\n onDragStart={reorderable ? () => (dragged.current = column.id) : undefined}\n onDragOver={reorderable ? (event) => event.preventDefault() : undefined}\n onDrop={\n reorderable\n ? (event) => {\n event.preventDefault();\n if (dragged.current) reorder(dragged.current, column.id);\n dragged.current = null;\n }\n : undefined\n }\n onKeyDown={\n reorderable\n ? (event) => {\n if (!event.altKey || (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')) return;\n event.preventDefault();\n const ids = table.getAllLeafColumns().map((item) => item.id);\n const at = ids.indexOf(column.id);\n const target = ids[at + (event.key === 'ArrowLeft' ? -1 : 2)];\n if (event.key === 'ArrowLeft' && ids[at - 1]) reorder(column.id, ids[at - 1]!);\n else if (event.key === 'ArrowRight' && at < ids.length - 1) reorder(column.id, target ?? '__end__');\n }\n : undefined\n }\n className={cn(\n pin.className,\n cellDensity,\n sticky && !column.getIsPinned() && 'sticky top-0 z-20 bg-surface',\n sticky && column.getIsPinned() && 'top-0',\n reorderable && 'cursor-grab',\n !leaf && 'text-center',\n )}\n resizer={\n enableColumnResizing && column.getCanResize() ? (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={`Resize ${label}`}\n onMouseDown={header.getResizeHandler()}\n onTouchStart={header.getResizeHandler()}\n onClick={(event) => event.stopPropagation()}\n className={cn(\n 'absolute inset-y-0 end-0 w-1 cursor-col-resize touch-none select-none hover:bg-input-accent',\n column.getIsResizing() && 'bg-input-accent',\n )}\n />\n ) : undefined\n }\n >\n {header.isPlaceholder ? null : <table.FlexRender header={header} />}\n </TableHead>\n );\n };\n\n const stickyLeading = cn(cellDensity, sticky && 'sticky top-0 z-20 bg-surface');\n const leadingHeaderCells = (rowSpan: number) => (\n <>\n {enableRowSelection && (\n <TableHead checkbox rowSpan={rowSpan} className={stickyLeading}>\n <Checkbox\n aria-label=\"Select all rows\"\n checked={allSelected ? true : someSelected ? 'indeterminate' : false}\n disabled={loading}\n onCheckedChange={(checked) => table.toggleAllPageRowsSelected(Boolean(checked))}\n />\n </TableHead>\n )}\n {hasExpander && (\n <TableHead checkbox rowSpan={rowSpan} className={stickyLeading}>\n <span className=\"sr-only\">Expand</span>\n </TableHead>\n )}\n {enableRowPinning && (\n <TableHead checkbox rowSpan={rowSpan} className={stickyLeading}>\n <span className=\"sr-only\">Pin</span>\n </TableHead>\n )}\n </>\n );\n\n const rowsToRender = virtualized ? virtualItems.map((item) => ({ row: bodyRows[item.index]!, index: item.index })) : null;\n const totalRows = topRows.length + bodyRows.length + bottomRows.length;\n\n return (\n <div className={cn('flex w-full flex-col gap-2', wrapperClassName)}>\n {showToolbar && (\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex items-center gap-2\">\n {enableGlobalFilter && (\n <SearchBar\n aria-label=\"Search table\"\n placeholder={globalFilterPlaceholder}\n value={globalFilter}\n onChange={(event) => table.setGlobalFilter(event.target.value)}\n onClear={() => table.setGlobalFilter('')}\n className=\"w-64\"\n />\n )}\n {toolbar}\n </div>\n <div className=\"flex items-center gap-2\">\n {enableDensityToggle && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n aria-pressed={compact}\n onClick={() => setDensity(compact ? 'default' : 'compact')}\n >\n <Rows size={16} aria-hidden />\n Compact\n </Button>\n )}\n {enableGrouping && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\">\n <Stack size={16} aria-hidden />\n Group by\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuLabel>Group rows by</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {groupableColumns.map((column) => (\n <DropdownMenuCheckboxItem\n key={column.id}\n checked={column.getIsGrouped()}\n onCheckedChange={() => column.toggleGrouping()}\n >\n {labelOf(column)}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {enableColumnVisibility && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\">\n <Sliders size={16} aria-hidden />\n Columns\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {hideableColumns.map((column) => (\n <DropdownMenuCheckboxItem\n key={column.id}\n checked={column.getIsVisible()}\n onCheckedChange={(checked) => column.toggleVisibility(Boolean(checked))}\n >\n {labelOf(column)}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n )}\n\n <Table\n ref={ref}\n containerRef={setScrollRef}\n containerClassName={containerClassName}\n striped={striped}\n aria-busy={loading || loadingMore || undefined}\n style={sized ? { width: table.getTotalSize(), minWidth: '100%', tableLayout: 'fixed', ...tableStyle } : tableStyle}\n onKeyDown={enableCellSelection ? onGridKeyDown : undefined}\n tabIndex={enableCellSelection ? 0 : undefined}\n {...tableProps}\n >\n <TableHeader>\n {headerGroups.map((group, groupIndex) => (\n <TableRow key={group.id} className=\"hover:bg-transparent\">\n {groupIndex === 0 && leadingHeaderCells(headerGroups.length + (enableColumnFilters ? 1 : 0))}\n {group.headers.map(renderHeaderCell)}\n </TableRow>\n ))}\n {enableColumnFilters && (\n <TableRow className=\"hover:bg-transparent\">\n {leafColumns.map((column) => {\n const pin = pinning(column, sized, true);\n return (\n <TableHead\n key={column.id}\n style={pin.style}\n className={cn('h-auto py-2 font-normal', pin.className, sticky && !column.getIsPinned() && 'bg-surface')}\n >\n {column.getCanFilter() ? <ColumnFilter column={column} /> : null}\n </TableHead>\n );\n })}\n </TableRow>\n )}\n </TableHeader>\n <TableBody>\n {loading ? (\n Array.from({ length: pageSize }, (_, index) => skeletonRow(`loading-${index}`))\n ) : totalRows === 0 ? (\n <TableRow className=\"hover:bg-transparent\">\n <TableCell colSpan={columnSpan} muted className=\"h-24 text-center\">\n {emptyState ?? 'No results.'}\n </TableCell>\n </TableRow>\n ) : (\n <>\n {topRows.map((row, index) => renderRow(row, { pinned: 'top', pinnedIndex: index, pinnedCount: topRows.length }))}\n {virtualized && paddingTop > 0 && (\n <tr aria-hidden>\n <td colSpan={columnSpan} style={{ height: paddingTop }} />\n </tr>\n )}\n {rowsToRender\n ? rowsToRender.map(({ row, index }) => renderRow(row, { virtualIndex: index }))\n : bodyRows.map((row) => renderRow(row))}\n {virtualized && paddingBottom > 0 && (\n <tr aria-hidden>\n <td colSpan={columnSpan} style={{ height: paddingBottom }} />\n </tr>\n )}\n {bottomRows.map((row, index) =>\n renderRow(row, { pinned: 'bottom', pinnedIndex: index, pinnedCount: bottomRows.length }),\n )}\n </>\n )}\n {infinite && (\n <>\n {loadingMore && Array.from({ length: 3 }, (_, index) => skeletonRow(`more-${index}`))}\n <tr ref={sentinelRef} aria-hidden>\n <td colSpan={columnSpan} className=\"h-px p-0\" />\n </tr>\n </>\n )}\n </TableBody>\n {showFooter && (\n <TableFooter>\n {table.getFooterGroups().map((group) => (\n <TableRow key={group.id} className=\"hover:bg-transparent\">\n {leadingCount > 0 && <TableCell colSpan={leadingCount} className={cellDensity} />}\n {group.headers.map((header) => {\n const { align } = getMeta(header.column.columnDef.meta);\n const pin = pinning(header.column, sized);\n return (\n <TableCell\n key={header.id}\n align={align}\n colSpan={header.colSpan > 1 ? header.colSpan : undefined}\n style={pin.style}\n className={cn('text-ui-label', pin.className, cellDensity)}\n >\n {header.isPlaceholder ? null : <table.FlexRender footer={header} />}\n </TableCell>\n );\n })}\n </TableRow>\n ))}\n </TableFooter>\n )}\n </Table>\n\n {(enableRowSelection || (paginate && pageCount > 1)) && (\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"text-body-small text-secondary-muted-foreground\" aria-live=\"polite\">\n {enableRowSelection ? `${selectedCount} of ${table.getCoreRowModel().rows.length} row(s) selected` : null}\n </span>\n {paginate && pageCount > 1 && (\n <Pagination\n page={pagination.pageIndex + 1}\n pageCount={pageCount}\n onPageChange={(page) => table.setPageIndex(page - 1)}\n />\n )}\n </div>\n )}\n </div>\n );\n}\n\n/**\n * Data-driven table. Wraps `Table` with TanStack Table (`@tanstack/react-table`): sorting, row selection, pagination,\n * column visibility, pinning, sizing, resizing and ordering, column and global filtering with faceted options, grouping with\n * aggregation, row expansion and detail panels, row pinning, cell selection and spanning, grouped headers, footers,\n * inline editing, server-side data, virtualization and infinite scrolling. Every feature is off until its prop is set.\n * Pass `columns` and `data`; state is local unless you control it.\n */\nexport const DataTable = React.forwardRef(DataTableInner) as <TData extends RowData>(\n props: DataTableProps<TData> & { ref?: React.ForwardedRef<HTMLTableElement> },\n) => ReturnType<typeof DataTableInner>;\n(DataTable as { displayName?: string }).displayName = 'DataTable';\n","import * as React from 'react';\nimport { ArrowLeft, ArrowRight, DotsThree } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport type PaginationItemValue = number | 'ellipsis';\n\n/** 1-based page list with ellipses, e.g. `[1, 2, 'ellipsis', 5]`. Keeps first, last and the current page ± `siblings`. */\nexport function getPaginationItems(page: number, pageCount: number, siblings = 1): PaginationItemValue[] {\n const keep = new Set<number>([1, pageCount]);\n for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);\n // Show a neighbouring page instead of an ellipsis that would hide just one.\n const sorted = [...keep].sort((a, b) => a - b);\n const items: PaginationItemValue[] = [];\n sorted.forEach((p, index) => {\n const previous = sorted[index - 1];\n if (previous !== undefined && p - previous === 2) items.push(previous + 1);\n else if (previous !== undefined && p - previous > 2) items.push('ellipsis');\n items.push(p);\n });\n return items;\n}\n\nexport interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {\n /** Current page, 1-based. */\n page: number;\n pageCount: number;\n onPageChange: (page: number) => void;\n /** `full` lists page numbers; `compact` shows `1/5` between the arrows. */\n variant?: 'full' | 'compact';\n /** How many pages to show either side of the current one (full variant). */\n siblings?: number;\n}\n\n// Figma: Pagination (71) — 32px items; the current page is `subtle`, the rest are outlined.\nexport const Pagination = React.forwardRef<HTMLElement, PaginationProps>(\n ({ className, page, pageCount, onPageChange, variant = 'full', siblings = 1, ...props }, ref) => {\n const go = (next: number) => onPageChange(Math.min(pageCount, Math.max(1, next)));\n const previous = (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label=\"Previous page\"\n disabled={page <= 1}\n onClick={() => go(page - 1)}\n >\n <ArrowLeft size={16} aria-hidden />\n </Button>\n );\n const next = (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label=\"Next page\"\n disabled={page >= pageCount}\n onClick={() => go(page + 1)}\n >\n <ArrowRight size={16} aria-hidden />\n </Button>\n );\n\n return (\n <nav\n ref={ref}\n aria-label=\"Pagination\"\n className={cn('flex items-center', variant === 'compact' ? 'w-35 justify-between' : 'gap-2', className)}\n {...props}\n >\n {previous}\n {variant === 'compact' ? (\n <span className=\"text-body-small text-surface-foreground\" aria-live=\"polite\">\n {page}/{pageCount}\n </span>\n ) : (\n <ul className=\"flex items-center gap-2\">\n {getPaginationItems(page, pageCount, siblings).map((item, index) => (\n <li key={item === 'ellipsis' ? `ellipsis-${index}` : item}>\n {item === 'ellipsis' ? (\n <span className=\"inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground\">\n <DotsThree size={16} aria-hidden />\n <span className=\"sr-only\">More pages</span>\n </span>\n ) : (\n <Button\n type=\"button\"\n variant={item === page ? 'subtle' : 'outline'}\n size=\"sm\"\n aria-label={`Page ${item}`}\n aria-current={item === page ? 'page' : undefined}\n onClick={() => go(item)}\n >\n {item}\n </Button>\n )}\n </li>\n ))}\n </ul>\n )}\n {next}\n </nav>\n );\n },\n);\nPagination.displayName = 'Pagination';\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\nconst statCardVariants = cva('flex min-w-0 flex-col gap-2 rounded-md border p-3', {\n variants: {\n variant: {\n default: 'border-border bg-transparent',\n // A card tinted with the secondary background and no border, for stats on a white panel.\n subtle: 'border-transparent bg-secondary',\n warning: 'border-warning-soft-border bg-warning-soft',\n success: 'border-success-soft-border bg-success-soft',\n destructive: 'border-destructive-soft-border bg-destructive-soft',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport interface StatCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, VariantProps<typeof statCardVariants> {\n label: React.ReactNode;\n value: React.ReactNode;\n /** Leading icon beside the value (24px). */\n icon?: React.ReactNode;\n /** Small muted text under the value that says what it refers to or breaks it down (\"11 open-ended · 5 closed-ended\"). */\n caption?: React.ReactNode;\n}\n\n// Figma: Activity control (361:5214) › stat-card — a small bordered label/value tile; `warning` tints it yellow, `success` green and `destructive` red.\nexport const StatCard = React.forwardRef<HTMLDivElement, StatCardProps>(\n ({ className, variant, label, value, icon, caption, ...props }, ref) => (\n <div ref={ref} className={cn(statCardVariants({ variant }), className)} {...props}>\n <p className=\"truncate text-ui-caption text-secondary-muted-foreground\">{label}</p>\n <p className=\"flex items-center gap-2 text-body-base text-surface-foreground\">\n {icon && (\n <span aria-hidden=\"true\" className=\"inline-flex size-6 shrink-0 items-center justify-center\">\n {icon}\n </span>\n )}\n {value}\n </p>\n {caption && <p className=\"text-ui-caption text-secondary-muted-foreground\">{caption}</p>}\n </div>\n ),\n);\nStatCard.displayName = 'StatCard';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { StatCard, type StatCardProps } from '../Data Display/StatCard';\nimport { EditableTag } from '../Tags & Badges/EditableTag';\n\nexport interface ActivityStat extends Pick<StatCardProps, 'label' | 'value' | 'icon' | 'variant'> {\n id: string;\n}\n\nexport interface ActivitySection {\n id: string;\n heading: React.ReactNode;\n /** Section text. May contain block elements (e.g. an `InlineEdit`), so it is rendered in a `div`. */\n body: React.ReactNode;\n /** Removable tags shown under the body. */\n tags?: string[];\n}\n\nexport interface ActivityStructureProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {\n title?: React.ReactNode;\n /** Stat tiles, laid out in a two-column grid. */\n stats: ActivityStat[];\n /** Text sections (e.g. Research Goal, Target Audience), optionally with tags. */\n sections?: ActivitySection[];\n /** Optional control (e.g. a button) shown at the right of the title. */\n action?: React.ReactNode;\n /** Called with `(sectionId, tag)` when a tag's remove button is pressed. Omit for read-only tags. */\n onRemoveTag?: (sectionId: string, tag: string) => void;\n /** Called with the section id by the dashed \"Add tag\" chip. Omit to hide it. */\n onAddTag?: (sectionId: string) => void;\n addTagLabel?: string;\n /**\n * Content shown under the stats and sections. With `stats={[]}` and `children` the card is a single-purpose widget\n * (e.g. \"Research Goal\") with the same card, title style and colour as the full summary.\n */\n children?: React.ReactNode;\n}\n\n// Figma: Activity control (361:5214) › Activity structure — summary card with stat tiles and text sections with tags; also usable as a single-purpose widget via children.\nexport const ActivityStructure = React.forwardRef<HTMLElement, ActivityStructureProps>(\n ({ className, title = 'Activity Structure', stats, sections, onRemoveTag, onAddTag, addTagLabel = 'Add tag', action, children, ...props }, ref) => (\n <section\n ref={ref}\n className={cn('flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4', className)}\n {...props}\n >\n <div className=\"flex items-center justify-between gap-2\">\n <h3 className=\"text-body-section text-surface-foreground\">{title}</h3>\n {action}\n </div>\n {stats.length > 0 && (\n <div className=\"grid grid-cols-2 gap-3\">\n {stats.map(({ id, ...stat }) => (\n <StatCard key={id} {...stat} />\n ))}\n </div>\n )}\n {sections?.map(({ id, heading, body, tags }) => (\n <div key={id} className=\"flex flex-col gap-2\">\n <h4 className=\"text-heading-h4 text-surface-foreground\">{heading}</h4>\n <div className=\"text-body-base text-surface-foreground\">{body}</div>\n {(tags?.length || onAddTag) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {tags?.map((tag) => (\n <EditableTag key={tag} type=\"editable\" onRemove={onRemoveTag && (() => onRemoveTag(id, tag))}>\n {tag}\n </EditableTag>\n ))}\n {onAddTag && (\n <EditableTag type=\"add\" onClick={() => onAddTag(id)}>\n {addTagLabel}\n </EditableTag>\n )}\n </div>\n )}\n </div>\n ))}\n {children}\n </section>\n ),\n);\nActivityStructure.displayName = 'ActivityStructure';\n","import * as React from 'react';\nimport { Crown, Plus, X } from '@phosphor-icons/react';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\n// Figma: Editable tags (41). Compact 26px chip used for removable / addable values.\nconst editableTagVariants = cva(\n 'inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors',\n {\n variants: {\n type: {\n default: 'gap-1 bg-accent-muted pl-2.5 pr-1.5 text-primary',\n editable:\n 'gap-1 bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 pl-2.5 pr-1.5 text-surface-foreground hover:bg-accent-soft hover:bg-none hover:text-accent-soft-foreground',\n add: 'gap-1 border border-dashed border-border pl-2.5 pr-1.5 text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground',\n multiple:\n 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 text-surface-foreground hover:bg-accent-soft hover:bg-none hover:text-accent-soft-foreground',\n },\n },\n defaultVariants: { type: 'default' },\n },\n);\n\nexport interface EditableTagProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onClick'> {\n /** `default` is the highlighted (primary) value, `editable` is removable, `add` adds a value, `multiple` is the \"+N more\" overflow chip. */\n type?: 'default' | 'editable' | 'add' | 'multiple';\n /** Leading icon. `default` shows a crown unless you pass `null`. */\n icon?: React.ReactNode;\n /** Renders a remove button on `editable`/`default` tags. */\n onRemove?: () => void;\n /** Click handler for `add` and `multiple` (rendered as a button when set). */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n children: React.ReactNode;\n}\n\nexport const EditableTag = React.forwardRef<HTMLElement, EditableTagProps>(\n ({ className, type = 'default', icon, onRemove, onClick, children, ...props }, ref) => {\n const classes = cn(editableTagVariants({ type }), className);\n const leading =\n type === 'add' ? (\n <Plus size={12} aria-hidden />\n ) : icon !== undefined ? (\n icon\n ) : type === 'default' ? (\n <Crown size={12} weight=\"fill\" aria-hidden />\n ) : null;\n\n if (type === 'add' || (type === 'multiple' && onClick)) {\n return (\n <button ref={ref as React.Ref<HTMLButtonElement>} type=\"button\" className={classes} onClick={onClick} {...props}>\n {leading}\n {children}\n </button>\n );\n }\n\n return (\n <span ref={ref as React.Ref<HTMLSpanElement>} className={classes} {...props}>\n {leading}\n {children}\n {onRemove && (\n <button\n type=\"button\"\n aria-label={typeof children === 'string' ? `Remove ${children}` : 'Remove'}\n onClick={onRemove}\n className=\"inline-flex size-3 items-center justify-center rounded-xs\"\n >\n <X size={12} aria-hidden />\n </button>\n )}\n </span>\n );\n },\n);\nEditableTag.displayName = 'EditableTag';\n","import * as React from 'react';\nimport { DotsSixVertical, RadioButton } from '@phosphor-icons/react';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\n// Figma: Role Tag (41), now the system Badge. 24px chip; `interactable` reveals a drag handle on hover.\nconst roleTagVariants = cva(\n 'group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors',\n {\n variants: {\n type: {\n primary: 'bg-primary-soft px-2.5 text-primary-soft-foreground',\n secondary:\n 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 text-secondary-muted-foreground',\n question: 'gap-1 bg-primary-soft pl-1 pr-2.5 text-plum-500',\n interactable: 'gap-1 pl-2.5 pr-2.5 hover:pl-1',\n id: 'gap-1 bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 tabular-nums text-surface-foreground',\n count:\n 'min-w-6 justify-center rounded-full bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2 tabular-nums text-surface-foreground',\n },\n selected: { true: '', false: '' },\n },\n compoundVariants: [\n {\n type: 'interactable',\n selected: false,\n className:\n 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground',\n },\n { type: 'interactable', selected: true, className: 'bg-accent-soft text-accent-foreground' },\n ],\n defaultVariants: { type: 'primary', selected: false },\n },\n);\n\nexport interface BadgeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onClick'> {\n /**\n * `id` prefixes the content with a muted \"ID\" label (children is the identifier); `count` is a round pill for a number.\n */\n type?: 'primary' | 'secondary' | 'question' | 'interactable' | 'id' | 'count';\n /** Pressed state for `interactable` tags. */\n selected?: boolean;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n children: React.ReactNode;\n}\n\nexport const Badge = React.forwardRef<HTMLElement, BadgeProps>(\n ({ className, type = 'primary', selected = false, onClick, children, ...props }, ref) => {\n const classes = cn(roleTagVariants({ type, selected: type === 'interactable' ? selected : false }), className);\n\n if (type === 'interactable') {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n aria-pressed={selected}\n className={classes}\n onClick={onClick}\n {...props}\n >\n <DotsSixVertical size={16} aria-hidden className=\"hidden shrink-0 group-hover:block\" />\n {children}\n </button>\n );\n }\n\n return (\n <span ref={ref as React.Ref<HTMLSpanElement>} className={classes} {...props}>\n {type === 'question' && <RadioButton size={16} weight=\"fill\" aria-hidden />}\n {type === 'id' && <span className=\"text-secondary-muted-foreground\">ID</span>}\n {children}\n </span>\n );\n },\n);\nBadge.displayName = 'Badge';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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,kCAAgB,MAAM,IAAI,eAAW,MAAC,WAAU,qCAAoC;AAAA,YACpF;AAAA;AAAA;AAAA,MACH;AAAA,IAEJ;AAEA,WACE,+CAAC,UAAK,KAAwC,WAAW,SAAU,GAAG,OACnE;AAAA,eAAS,cAAc,8CAAC,8BAAY,MAAM,IAAI,QAAO,QAAO,eAAW,MAAC;AAAA,MACxE,SAAS,QAAQ,8CAAC,UAAK,WAAU,mCAAkC,gBAAE;AAAA,MACrE;AAAA,OACH;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":["React","import_radix_ui","import_jsx_runtime","SwitchPrimitive","React","import_radix_ui","import_jsx_runtime","TogglePrimitive","React","import_jsx_runtime","React","import_jsx_runtime","React","import_class_variance_authority","import_radix_ui","import_jsx_runtime","TogglePrimitive","React","React","import_react","import_radix_ui","React","import_radix_ui","import_jsx_runtime","LabelPrimitive","import_jsx_runtime","CheckboxPrimitive","React","import_radix_ui","import_jsx_runtime","RadioGroupPrimitive","import_jsx_runtime","title","description","className","React","import_react","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_react","React","import_react","import_radix_ui","import_jsx_runtime","DropdownMenuPrimitive","import_jsx_runtime","React","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_jsx_runtime","import_react","import_jsx_runtime","React","import_react","import_radix_ui","React","import_react","import_jsx_runtime","React","import_radix_ui","React","import_radix_ui","React","import_radix_ui","import_class_variance_authority","import_jsx_runtime","TabsPrimitive","import_jsx_runtime","TabsPrimitive","import_jsx_runtime","ToggleGroupPrimitive","import_jsx_runtime","PopoverPrimitive","React","import_radix_ui","import_jsx_runtime","React","import_react","React","import_react","import_radix_ui","import_jsx_runtime","PopoverPrimitive","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_react","import_radix_ui","import_jsx_runtime","SelectPrimitive","React","import_radix_ui","import_jsx_runtime","SliderPrimitive","React","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_react","import_radix_ui","import_jsx_runtime","DialogPrimitive","React","import_react","import_class_variance_authority","import_radix_ui","import_jsx_runtime","ToastPrimitive","React","import_radix_ui","import_jsx_runtime","TooltipPrimitive","React","import_react","import_radix_ui","React","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","ProgressPrimitive","React","import_react","import_radix_ui","import_jsx_runtime","ToggleGroupPrimitive","ImageIcon","toggle","SliderPrimitive","React","import_jsx_runtime","React","import_jsx_runtime","React","import_react","React","React","import_react","React","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","React","import_react","import_radix_ui","import_jsx_runtime","React","import_react","import_jsx_runtime","limitsText","React","import_react","import_jsx_runtime","React","import_radix_ui","import_jsx_runtime","ToggleGroupPrimitive","React","import_react","import_jsx_runtime","ImageIcon","React","import_radix_ui","import_jsx_runtime","ProgressPrimitive","React","import_react","import_jsx_runtime","React","import_react","React","import_react","import_jsx_runtime","next","import_jsx_runtime","React","import_class_variance_authority","import_jsx_runtime","React","React","import_react","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","React","import_react","import_class_variance_authority","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/components/Buttons & Actions/Button.tsx","../src/lib/utils.ts","../src/components/Buttons & Actions/Switch.tsx","../src/components/Buttons & Actions/Toggle.tsx","../src/components/Conversation & AI Chat/AIMiniAvatar.tsx","../src/components/Conversation & AI Chat/aiGlyphPaths.ts","../src/components/Conversation & AI Chat/AIResponseContainer.tsx","../src/components/Conversation & AI Chat/AskAiToggle.tsx","../src/components/Conversation & AI Chat/ChatChoices.tsx","../src/components/Forms & Data Entry/Checkbox.tsx","../src/components/Forms & Data Entry/Label.tsx","../src/components/Forms & Data Entry/RadioGroup.tsx","../src/components/Conversation & AI Chat/ChatInput.tsx","../src/components/Conversation & AI Chat/FileAttachment.tsx","../src/components/Conversation & AI Chat/ProjectSelector.tsx","../src/components/Overlays & Feedback/DropdownMenu.tsx","../src/components/Conversation & AI Chat/Timestamp.tsx","../src/components/Conversation & AI Chat/TopicCard.tsx","../src/components/Conversation & AI Chat/UserMessageBubble.tsx","../src/components/Forms & Data Entry/Calendar.tsx","../src/components/Forms & Data Entry/DateTimePicker.tsx","../src/components/Forms & Data Entry/Field.tsx","../src/components/Forms & Data Entry/formatDateTime.ts","../src/components/Forms & Data Entry/TimePicker.tsx","../src/components/Navigation/TabItem.tsx","../src/components/Navigation/TabNavigation.tsx","../src/components/Forms & Data Entry/Form.tsx","../src/components/Forms & Data Entry/InlineEdit.tsx","../src/components/Forms & Data Entry/MarkedText.tsx","../src/components/Forms & Data Entry/Input.tsx","../src/components/Forms & Data Entry/InputWithAction.tsx","../src/components/Forms & Data Entry/NumberInput.tsx","../src/components/Forms & Data Entry/SearchBar.tsx","../src/components/Forms & Data Entry/Select.tsx","../src/components/Forms & Data Entry/Slider.tsx","../src/components/Forms & Data Entry/Textarea.tsx","../src/components/Navigation/Stepper.tsx","../src/components/Overlays & Feedback/Dialog.tsx","../src/components/Overlays & Feedback/Toast.tsx","../src/components/Overlays & Feedback/Tooltip.tsx","../src/components/Question Types/FileUpload.tsx","../src/components/Tags & Badges/Tag.tsx","../src/components/Question Types/Media.tsx","../src/components/Question Types/OpenEndAnswer.tsx","../src/components/Question Types/QuestionCard.tsx","../src/components/Question Types/QuestionEditorCard.tsx","../src/lib/keepEditingFocus.ts","../src/components/Question Types/QuestionHeader.tsx","../src/components/Question Types/QuestionNumberTag.tsx","../src/components/Question Types/QuestionTypeIcon.tsx","../src/components/Question Types/QuestionNavItem.tsx","../src/components/Question Types/QuestionOption.tsx","../src/components/Question Types/RankList.tsx","../src/components/Question Types/RatingScale.tsx","../src/components/Question Types/StimulusCard.tsx","../src/components/Data Display/Progress.tsx","../src/components/Data Display/Table.tsx","../src/components/Data Display/DataTable.tsx","../src/components/Utility/Pagination.tsx","../src/components/Data Display/StatCard.tsx","../src/components/Research-Specific/ActivityStructure.tsx","../src/components/Tags & Badges/EditableTag.tsx","../src/components/Tags & Badges/Badge.tsx"],"sourcesContent":["// Public component exports.\n//\n// Each implemented component is re-exported here from its folder under\n// src/components/<Section>/<Component>. See ../../../.context/COMPONENT_STATUS.md\n// for the build queue and ../../../.context/COMPONENT_CONTRACTS.md for the\n// export-barrel convention components must follow once they land here.\nexport * from './components/Buttons & Actions';\nexport * from './components/Conversation & AI Chat';\nexport * from './components/Forms & Data Entry';\nexport * from './components/Navigation';\nexport * from './components/Overlays & Feedback';\nexport * from './components/Question Types';\nexport * from './components/Data Display';\nexport * from './components/Research-Specific';\nexport * from './components/Tags & Badges';\nexport * from './components/Utility';\n","import * as React from 'react';\nimport { Slot } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\nconst subtle =\n 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground hover:bg-accent-soft hover:bg-none hover:text-accent-soft-foreground disabled:bg-muted disabled:bg-none disabled:text-muted-foreground';\n\n// Figma: Buttons (13) + Button Small/Reaction (16). Disabled is a flat 50%\n// opacity for every type; the hover fill is `accent-soft` everywhere except\n// primary (`primary-hover`) and destructive (a 10% black overlay).\nconst buttonVariants = cva(\n 'inline-flex shrink-0 items-center justify-center whitespace-nowrap text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default: 'bg-primary text-label hover:bg-primary-hover',\n subtle,\n // Alias of `subtle`, kept so existing consumers don't break.\n secondary: subtle,\n destructive: 'bg-destructive text-label hover:bg-destructive-hover',\n outline:\n 'border border-border bg-surface text-surface-foreground hover:border-input-muted hover:bg-accent-soft hover:text-accent-soft-foreground disabled:bg-transparent disabled:border-input-muted disabled:text-muted-foreground',\n ghost:\n 'text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground disabled:text-muted-foreground',\n link: 'text-surface-foreground underline hover:text-accent-foreground',\n },\n size: {\n md: 'h-10 min-w-10 gap-2.5 rounded-md px-4 py-2',\n sm: 'h-8 min-w-8 gap-1 rounded-sm px-2.5 py-1.5',\n lg: 'h-12 gap-2.5 rounded-md px-6 py-3 text-ui-label-large',\n icon: 'size-10 rounded-md p-0',\n 'icon-sm': 'size-8 rounded-sm p-0',\n },\n },\n compoundVariants: [\n // Primary icon-only is a circle at 40px (and a rounded square at 32px).\n { variant: 'default', size: 'icon', className: 'rounded-full' },\n {\n variant: 'default',\n size: ['icon', 'icon-sm'],\n className: 'disabled:border disabled:border-border disabled:bg-transparent disabled:text-muted-foreground disabled:opacity-100',\n },\n // Destructive icon-only drops the fill and tints the glyph instead.\n {\n variant: 'destructive',\n size: ['icon', 'icon-sm'],\n className: 'bg-transparent text-destructive hover:bg-destructive-soft-hover',\n },\n { variant: 'outline', size: ['icon', 'icon-sm'], className: 'disabled:border-border' },\n // Links have no box of their own.\n { variant: 'link', className: 'rounded-md bg-transparent px-4' },\n ],\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /**\n * Render `props.children` into the child element instead of wrapping it in\n * a `<button>` (Radix `Slot`) — lets consumers compose e.g.\n * `<Button asChild><a href=\"...\">Label</a></Button>` without double-wrapping.\n * The ref then targets whatever element the child renders, not necessarily\n * an `HTMLButtonElement`.\n */\n asChild?: boolean;\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot.Root : 'button';\n return <Comp ref={ref} className={cn(buttonVariants({ variant, size }), className)} {...props} />;\n },\n);\nButton.displayName = 'Button';\n","import { type ClassValue, clsx } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\n// tailwind-merge only knows Tailwind's built-in class names. Without these\n// registrations it reads our composite type styles (`text-ui-label`) as a text\n// *colour* — so a later `text-surface-foreground` silently drops the type\n// style — and `bg-linear-to-r` (Tailwind v4) as a background colour, dropping\n// `bg-secondary`.\nconst twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n 'font-size': [\n {\n text: [\n 'heading-h1',\n 'heading-h2',\n 'heading-h3',\n 'heading-h4',\n 'body-section',\n 'body-base',\n 'body-small',\n 'body-xs',\n 'body-xxs',\n 'ui-label',\n 'ui-label-large',\n 'ui-badge',\n 'ui-caption',\n 'ui-overline',\n 'ui-code',\n 'ui-placeholder',\n 'ui-input-value',\n ],\n },\n ],\n 'bg-image': [{ 'bg-linear': ['to-t', 'to-tr', 'to-r', 'to-br', 'to-b', 'to-bl', 'to-l', 'to-tl'] }],\n },\n },\n});\n\n/**\n * Merge class lists, resolving Tailwind class conflicts so a consumer-supplied\n * `className` always wins over an internal default. See COMPONENT_CONTRACTS.md.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/** Whether a length is too short (under the minimum, ignoring surrounding spaces) or too long (over the maximum): the only time a character count is shown. */\nexport function lengthOutOfRange(text: string, min?: number, max?: number) {\n return (min !== undefined && text.trim().length < min) || (max !== undefined && text.length > max);\n}\n","import * as React from 'react';\nimport { Switch as SwitchPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>;\n\n// Figma: Toggle / Switch (17) — 44×24 track, 20px white thumb. Off is `muted`, on is the accent.\nexport const Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitive.Root>, SwitchProps>(\n ({ className, ...props }, ref) => (\n <SwitchPrimitive.Root\n ref={ref}\n className={cn(\n 'inline-flex h-6 w-11 shrink-0 items-center rounded-full p-0.5 transition-colors',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Brand override: selected controls use `ring`, not `primary`/`accent`.\n 'data-[state=checked]:bg-ring data-[state=unchecked]:bg-muted',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n 'block size-5 rounded-full bg-surface shadow-sm transition-transform',\n 'data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0',\n )}\n />\n </SwitchPrimitive.Root>\n ),\n);\nSwitch.displayName = 'Switch';\n","import * as React from 'react';\nimport { Toggle as TogglePrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport type ToggleProps = React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>;\n\n// Figma: Toggle / Switch (17) › Toggle menu — a 40px square icon button that fills with `secondary` when pressed.\nexport const Toggle = React.forwardRef<React.ElementRef<typeof TogglePrimitive.Root>, ToggleProps>(\n ({ className, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(\n 'inline-flex size-10 shrink-0 items-center justify-center rounded-md text-surface-foreground transition-colors',\n 'hover:bg-accent-soft hover:text-accent-soft-foreground',\n 'data-[state=on]:bg-secondary data-[state=on]:hover:bg-accent-soft',\n 'disabled:pointer-events-none disabled:opacity-50',\n className,\n )}\n {...props}\n />\n ),\n);\nToggle.displayName = 'Toggle';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { AI_GLYPH_THINKING, AI_GLYPH_WORKING } from './aiGlyphPaths';\n\nexport type AIStatus = 'idle' | 'thinking' | 'executing' | 'working';\n\nconst defaultLabel: Record<Exclude<AIStatus, 'idle'>, string> = {\n thinking: 'Thinking...',\n executing: 'Executing...',\n working: 'Working on it...',\n};\n\nexport interface AIMiniAvatarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** `idle` shows only the mark; the others add a status line next to it. */\n status?: AIStatus;\n /** Override the status text. */\n label?: React.ReactNode;\n /** Elapsed time shown after the label while `working` (e.g. \"45 s\"). */\n elapsed?: React.ReactNode;\n}\n\n// Figma: AI Mini Avatar (57) › AI feedback — the accent squiggle mark with an optional status line.\n// While busy the mark draws itself on along its own path, holds, clears the same way and repeats (still under prefers-reduced-motion).\nexport const AIMiniAvatar = React.forwardRef<HTMLDivElement, AIMiniAvatarProps>(\n ({ className, status = 'idle', label, elapsed, ...props }, ref) => {\n const glyph = status === 'working' ? AI_GLYPH_WORKING : AI_GLYPH_THINKING;\n const busy = status !== 'idle';\n // The busy mark is drawn on along its own path, so each instance needs its own mask.\n const maskId = React.useId();\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-live=\"polite\"\n className={cn('flex items-center gap-2.5', className)}\n {...props}\n >\n <svg\n aria-hidden=\"true\"\n viewBox={glyph.viewBox}\n fill=\"none\"\n className={cn(\n 'h-5.75 shrink-0 fill-accent',\n status === 'working' ? 'w-5' : 'w-5.25',\n )}\n >\n {busy && (\n <>\n <mask id={maskId} maskUnits=\"userSpaceOnUse\" style={{ maskType: 'alpha' }}>\n {/* A thick stroke along the mark's centre line. It is revealed gradually (see `animate-ai-draw-on`), uncovering the mark behind it. */}\n <path\n d={glyph.line}\n pathLength={1}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"motion-safe:animate-ai-draw-on\"\n />\n </mask>\n <path d={glyph.d} mask={`url(#${maskId})`} />\n </>\n )}\n {!busy && <path d={glyph.d} />}\n </svg>\n {busy && (\n <span\n className={cn(\n 'text-ui-caption whitespace-nowrap',\n status === 'executing'\n ? 'bg-linear-to-r from-secondary-muted-foreground to-secondary-muted-foreground/40 bg-clip-text text-transparent'\n : 'text-secondary-muted-foreground',\n )}\n >\n {label ?? defaultLabel[status]}\n </span>\n )}\n {status === 'working' && elapsed != null && (\n <>\n <span aria-hidden=\"true\" className=\"size-0.5 rounded-full bg-secondary-muted-foreground\" />\n <span className=\"text-ui-caption whitespace-nowrap text-secondary-muted-foreground\">{elapsed}</span>\n </>\n )}\n </div>\n );\n },\n);\nAIMiniAvatar.displayName = 'AIMiniAvatar';\n","// Hand-off from Figma (AI feedback › AI assistant): the squiggle mark shown while the assistant works.\n// The path data is the exported vector, unmodified. `line` is the stroke's centre line, traced by hand along the vector in the same\n// coordinates: AIMiniAvatar draws it on as a mask, so the mark appears as if it were being drawn from its first end to its last.\nexport const AI_GLYPH_THINKING = {\n viewBox: '0 0 23.5102 10.31',\n d: 'M20.7764 6.13895C20.8091 6.08935 20.9139 6.07477 20.9653 6.02535C21.1265 5.87047 21.227 5.79769 21.3523 5.6889L21.3349 5.70985C21.3757 5.67187 21.4194 5.629 21.4687 5.57648C21.7621 5.26894 22.4786 4.16096 22.8403 4.43013C22.8403 4.43014 22.8403 4.43014 22.8403 4.43015C22.8438 4.43279 22.8474 4.43556 22.8508 4.43847C22.9168 4.49352 22.9251 4.63928 22.993 4.71056C23.061 4.78185 23.5711 5.14655 23.5041 5.29532C23.4036 5.50831 22.9412 5.85678 22.8715 5.95956C22.8242 6.02999 22.8059 6.14803 22.7475 6.24057C22.6464 6.40032 22.5565 6.50906 22.4809 6.62923C22.4785 6.632 22.4718 6.64062 22.4693 6.64331C22.3989 6.74734 22.341 6.85851 22.2892 7.02244C22.1391 7.06575 21.9883 7.10631 21.8375 7.14262C21.7434 7.29292 21.476 7.39415 21.4003 7.4664C21.3382 7.52673 21.3404 7.6092 21.2705 7.66966C21.2189 7.71436 21.1282 7.74838 21.0302 7.79812C21.0228 7.80313 21.0008 7.8182 20.9928 7.8224C20.9494 7.83706 20.9028 7.85865 20.856 7.89199C20.6266 8.05556 20.6529 8.23489 20.4981 8.34362C20.4171 8.3997 20.2989 8.44071 20.1779 8.48367C20.0629 8.52373 19.9434 8.57023 19.8501 8.64564C19.8314 8.67452 19.8127 8.70339 19.7937 8.73228C19.83 8.76183 19.8664 8.79129 19.9028 8.82072C19.8037 8.88716 19.7221 8.82963 19.622 8.8719C19.5039 8.92146 19.4745 9.02208 19.3928 9.05557C19.3259 9.0829 19.2105 9.05922 19.1237 9.09701C18.9965 9.1516 19.0573 9.22895 18.9919 9.2717C18.9722 9.29205 18.4308 9.51795 18.3887 9.52197C18.1304 9.58812 18.0801 9.46546 17.8631 9.48595C17.8361 9.48814 17.8091 9.4903 17.782 9.49237C17.3207 9.52161 16.8743 9.67817 16.3789 9.7352C16.285 9.7455 16.1851 9.74966 16.0822 9.74684C15.9622 9.74345 15.8411 9.73294 15.7225 9.71759C16.0452 9.39607 15.3567 9.12062 15.6025 9.64387C15.3808 9.56394 15.2157 9.69807 14.9941 9.66267C14.8498 9.63874 14.7566 9.5627 14.5364 9.54137C14.3208 9.51495 14.0878 9.5587 13.7616 9.41848C13.6405 9.36165 13.5631 9.27393 13.5919 9.09969C13.4354 9.05602 13.2983 8.98697 13.1658 8.92556C13.0992 8.89457 13.0342 8.86595 12.9619 8.83793C12.8815 8.79834 12.8349 8.81997 12.6347 8.66553C12.5818 8.65788 12.5185 8.66138 12.4458 8.68578C12.3597 8.6238 12.3017 8.26898 12.2414 8.14791C12.1605 8.05685 11.7146 7.13701 11.7091 6.94414C11.7083 6.94093 11.7074 6.93768 11.7065 6.93438C11.6552 6.75979 11.6158 6.47257 11.5821 6.33303C11.5388 6.16728 11.1933 5.9876 11.6352 5.69928C11.6536 5.50058 11.6924 5.35814 11.7614 5.21539C11.7996 5.14267 11.8487 5.06108 11.9231 4.94138C11.9508 4.89665 12.0069 4.91427 12.0188 4.88607C12.0432 4.82851 12.0458 4.71199 12.0891 4.60378C12.1604 4.42562 12.3223 4.38132 12.1443 4.31661C12.1745 4.18591 12.2099 4.05361 12.2533 3.91918C12.3093 3.89617 12.3653 3.87434 12.4217 3.85356C12.4277 3.77084 12.4368 3.68676 12.4498 3.60124C12.6122 3.82914 12.8149 3.31965 12.5882 3.35167C12.6971 3.26408 12.8129 3.18134 12.936 3.10694C13.0432 3.05147 13.1502 2.9942 13.2575 2.93523C13.445 3.18433 13.6433 2.62036 13.4965 2.52782C13.5159 2.50978 13.5359 2.49118 13.5559 2.47273C13.6468 2.43151 13.7186 2.3762 13.8101 2.30215C13.9339 2.20399 14.0605 2.08848 14.2572 2.00205C14.5866 1.86654 14.5863 1.91818 14.7383 2.00328C14.8117 1.96386 14.8906 1.92778 14.9768 1.89808C15.2046 1.61986 15.3871 1.74917 15.5554 1.87821C15.6574 1.92057 15.8644 2.08723 15.9086 2.24717C15.9561 2.38086 15.9647 2.4401 16.0174 2.50589C16.0362 2.5325 16.059 2.56113 16.0862 2.59267C15.9089 2.83438 16.1252 3.33908 16.1251 3.71466C16.1272 3.75694 16.1742 3.7651 16.1787 3.82326C16.1923 3.96864 16.0396 4.27583 16.1879 4.30844C16.1104 4.40775 16.0302 4.50104 15.9487 4.58956C15.9485 4.59211 15.9483 4.59466 15.9481 4.59722C15.9434 4.68512 15.9381 4.77303 15.9326 4.86089C15.9773 4.87807 16.0219 4.89524 16.0666 4.91242C15.8514 5.01394 15.8076 5.2888 15.7201 5.39794C15.7026 5.41968 15.6395 5.39969 15.591 5.46924C15.5342 5.55031 15.482 5.72425 15.4171 5.82229C15.4664 5.89261 15.5154 5.96317 15.5642 6.03418C15.516 6.24242 15.3088 6.23112 15.2434 6.33666C15.2371 6.34685 15.1897 6.45661 15.1414 6.56252C15.1003 6.65319 15.0605 6.74017 15.0575 6.75026C14.9983 6.92736 15.1953 6.94548 14.8653 7.42471C14.8017 7.51174 14.7031 7.55363 14.6374 7.63359C14.5939 7.68676 14.5258 7.79471 14.4522 7.90588C14.359 8.0661 14.2337 8.27035 14.258 8.34435C13.9929 8.37671 13.5599 8.69876 13.4026 8.72273C13.3557 8.73114 13.3039 8.65181 13.1715 8.69189C13.1196 8.70739 13.0387 8.75964 12.9539 8.81245C12.8709 8.86549 12.783 8.9216 12.7186 8.94208C12.5852 8.98412 12.5082 8.92996 12.4483 8.94919C12.3923 8.9672 12.3668 9.04791 12.2925 9.07862C12.0591 9.1738 11.8082 9.16385 11.6213 9.23522C11.3502 9.33814 11.1776 9.60661 10.949 9.76888C10.9348 9.77067 10.9203 9.77115 10.9058 9.77095C10.8529 9.76975 10.7975 9.7598 10.7466 9.77439C9.99772 10.0005 9.00243 10.0857 8.1768 9.85282C8.13481 9.84174 8.09342 9.83033 8.0522 9.8185C7.65595 9.74342 6.84265 9.06031 6.88897 9.55865C6.80575 9.55556 6.53393 9.38444 6.29758 9.12608C6.231 9.02829 5.91504 8.73378 5.8576 8.6732C5.70806 8.5387 5.53716 8.47446 5.42743 8.35204C5.23871 8.13938 5.11803 7.9385 4.98784 7.72031C4.93094 7.62219 4.78289 7.41761 4.64906 7.18544C4.56629 7.04595 4.42492 6.92507 4.39704 6.84099C4.36359 6.73961 4.41467 6.60764 4.3839 6.48312C4.3266 6.25751 4.2228 5.90491 4.15903 5.6261C4.13709 5.5314 4.11932 5.43956 4.10919 5.36422C4.10191 5.30774 4.17499 5.27443 4.18647 5.19139C4.22915 4.86817 4.21424 4.52439 3.96715 4.59214C4.0923 4.18224 4.00781 3.80768 4.06914 3.4305C4.07049 3.42228 4.07191 3.41407 4.0734 3.40587C4.17848 2.77229 4.60265 1.62744 5.42728 1.02539C5.5388 0.936113 5.63885 0.851595 5.72033 0.774897C6.02466 0.499997 5.92843 0.404094 6.57046 0.168732C6.72019 0.118531 6.87745 0.0750992 7.10515 0.029663C7.44001 -0.0409616 8.00784 0.000885725 8.42487 0.305113C8.52342 0.370349 8.66824 0.438081 8.84918 0.507494C9.00601 0.701494 9.15341 0.965493 9.19962 1.24429C9.25461 1.59798 9.20706 1.9295 9.02072 2.15487C9.06272 2.2086 9.10331 2.26358 9.14209 2.32146C9.12853 2.38467 9.11273 2.44783 9.09564 2.50868C9.04342 2.51339 8.99124 2.51735 8.93911 2.52058C8.80099 2.92074 8.72119 3.45798 8.53257 3.73379C8.51917 3.75362 8.50452 3.77482 8.48864 3.79731C8.18299 4.22988 7.45145 5.14772 7.14208 5.47284C6.97081 5.65357 7.04778 5.72472 6.79141 5.71506C6.77155 5.76833 6.75129 5.82205 6.73113 5.87552C6.74881 5.93119 6.76688 5.98626 6.78446 6.04197C6.67655 6.19317 6.53517 6.34587 6.39918 6.49486C6.30179 6.60171 6.20676 6.7071 6.12771 6.80983C5.86753 7.16626 5.41116 7.79089 4.96904 8.10513C4.87549 8.1762 4.78037 8.24183 4.68809 8.2947C4.56491 8.36535 4.36563 8.39839 4.25536 8.48329C4.09377 8.60676 4.15002 8.76609 3.93397 8.92203C3.68203 9.10323 3.21465 9.30524 2.7946 9.44827C2.61334 9.50835 2.4488 9.5679 2.33086 9.62822C2.22328 9.68313 2.19724 9.76099 2.12265 9.80252C1.81329 9.9754 1.54922 10.089 1.27057 10.31C0.871376 10.3138 0.823743 10.1166 0.644008 9.97432C0.509878 9.86688 0.126525 9.63933 0.0856048 9.51058C0.0484623 9.42509 0.051783 9.29751 0 9.20711C0.311082 9.00323 0.527575 9.0048 0.893831 9.00304C1.355 8.7957 1.81246 8.57815 2.27037 8.35384C2.37271 8.30354 2.47492 8.24832 2.57658 8.1893C2.6503 8.2117 2.72528 8.23255 2.80124 8.252C2.8013 8.25211 2.80136 8.25221 2.80143 8.25232C3.03486 8.18581 3.03979 8.00743 3.12463 7.91046C3.36205 7.63959 3.68578 7.33424 4.07988 6.99574C4.53563 6.62516 4.89846 6.21727 5.32159 5.69439C5.74872 5.17021 6.15919 4.65793 6.46139 4.25093C6.64154 4.00919 7.13955 3.16034 7.33028 3.04133C7.34208 3.03408 7.35548 3.03074 7.36955 3.02924C7.41387 3.02544 7.46598 3.03904 7.49046 3.00739C7.70834 2.58993 7.86103 2.13779 7.83041 1.79989C7.8547 1.70941 7.86312 1.62307 7.85378 1.53151C7.87209 1.5287 7.84915 1.45435 7.69179 1.34775C7.77026 1.34362 7.49926 1.35778 7.23888 1.52474C6.97348 1.67631 6.69939 1.87603 6.42229 2.07271C6.36356 2.11454 6.30432 2.15719 6.24453 2.20056C5.85524 2.48354 5.60232 3.08823 5.49387 3.71498C5.39928 4.24892 5.42498 4.76811 5.56179 5.30683C5.73246 5.96207 5.84566 6.51339 6.19333 6.98921C6.31865 7.19227 6.46019 7.37337 6.62146 7.53296C6.79615 7.70852 6.92033 7.78019 7.25856 8.05634C7.33453 8.12545 7.42269 8.18946 7.52192 8.24799C7.75285 8.38685 8.10613 8.47857 8.4572 8.54593C8.61666 8.57713 8.77013 8.59963 8.91167 8.62268C9.08941 8.64956 9.17441 8.79085 9.4164 8.66989C9.42212 8.70681 9.42791 8.74373 9.43379 8.78063C9.65293 8.71479 9.77712 8.60908 10.021 8.54539C10.1203 8.51928 10.2997 8.46967 10.4831 8.41151C10.6699 8.35263 10.8737 8.27862 10.9746 8.24849C11.0761 8.21757 11.0641 8.29673 11.157 8.26042C11.3161 8.19806 11.6214 7.97025 11.8416 7.87728C12.0071 7.80802 12.2892 7.74718 12.4664 7.68389C12.5014 7.67152 12.5303 7.65958 12.5544 7.6466C12.9362 7.44059 13.2264 7.19551 13.4781 6.90736C13.5439 6.83289 13.5972 6.76236 13.6731 6.65907C13.7546 6.55024 13.9356 6.40299 13.9581 6.35458C14.0011 6.26124 13.9376 6.19233 13.9591 6.12514C13.9721 6.08459 13.9882 6.04256 14.0073 5.9983C14.1356 5.69579 14.4023 5.27933 14.5269 4.98849C14.6407 4.72311 14.7511 4.44958 14.8552 4.17601C14.9522 3.92097 15.0207 3.66979 15.0372 3.45937C15.0531 3.24138 15.027 3.11048 14.9379 2.78902C14.9187 2.70766 14.878 2.57482 14.9201 2.69356C14.9293 2.78057 15.2047 3.01121 15.3025 3.00426C15.3103 3.005 15.2823 2.99694 15.209 3.02009C15.1006 3.05115 14.8991 3.17087 14.6896 3.3475C14.4622 3.54526 14.1241 3.87681 13.8343 4.11513C13.7102 4.21459 13.5954 4.34064 13.4984 4.45314C13.4195 4.54661 13.3558 4.46837 13.2997 4.56139C13.2381 4.66643 13.2646 4.75718 13.2429 4.81048C13.1582 5.0115 13.0582 5.33059 12.8983 5.73083C12.8528 5.84656 12.829 6.11681 12.8105 6.25296C12.8013 6.311 12.7318 6.36264 12.7373 6.39885C12.74 6.41716 12.7967 6.44932 12.8133 6.49994C12.8239 6.53247 12.835 6.56327 12.8464 6.59222C13.0113 6.99361 13.2145 7.29577 13.6284 7.75962C13.6287 7.75995 13.629 7.76028 13.6292 7.7606C13.5327 7.66867 13.5735 7.71591 13.5864 7.71996C13.6067 7.73297 13.6364 7.74994 13.6682 7.76708C13.7325 7.8017 13.8061 7.838 13.8819 7.87409C14.0342 7.94645 14.1967 8.01873 14.3624 8.09149C14.4295 8.12341 14.8213 8.16242 15.1241 8.16799C15.4466 8.17777 15.7837 8.17904 16.12 8.1862C16.4042 8.19173 16.7364 8.16186 17.0675 8.14113C17.3555 8.12227 17.5732 8.24796 17.6136 8.24221C17.625 8.2406 17.6357 8.23751 17.6461 8.23323C17.7042 8.20464 17.7441 8.12089 17.8688 8.07355C18.3421 7.89885 19.1022 7.67963 19.5971 7.39003C19.6136 7.38042 19.6303 7.37015 19.6473 7.35931C19.8747 7.2155 20.0413 6.98443 20.2828 6.80153C20.3065 6.7842 20.3357 6.76481 20.3699 6.74391L20.298 6.79064C20.4619 6.66741 20.7621 6.44192 20.7839 6.34931C20.7993 6.28776 20.7412 6.19318 20.7764 6.13895ZM14.3029 9.42491C14.3405 9.34309 14.2314 9.3194 14.1139 9.3164C13.9993 9.31488 13.861 9.3268 13.9789 9.41542C14.0391 9.45982 14.2868 9.46988 14.3029 9.42491ZM9.59175 9.70184C9.60097 9.75063 9.61033 9.7994 9.61981 9.84815C9.67917 9.8212 9.73753 9.79318 9.79481 9.76425C9.75681 9.73961 9.71928 9.71456 9.68227 9.6891C9.65216 9.69362 9.62202 9.69787 9.59175 9.70184Z',\n line: 'M0.41 9.67C0.71 9.55 1.58 9.27 2.18 8.97C2.79 8.68 3.46 8.34 4.04 7.9C4.62 7.46 5.17 6.92 5.67 6.32C6.17 5.72 6.63 4.99 7.06 4.32C7.48 3.65 8.01 2.89 8.22 2.32C8.43 1.75 8.51 1.26 8.32 0.92C8.13 0.58 7.54 0.27 7.06 0.27C6.58 0.27 5.87 0.48 5.43 0.92C4.99 1.36 4.55 2.16 4.41 2.92C4.27 3.68 4.39 4.67 4.6 5.48C4.81 6.29 5.26 7.23 5.67 7.81C6.08 8.39 6.52 8.7 7.06 8.97C7.6 9.24 8.26 9.41 8.92 9.43C9.58 9.45 10.35 9.26 11.01 9.11C11.67 8.96 12.33 8.72 12.87 8.5C13.41 8.28 13.87 8.23 14.27 7.81C14.67 7.38 15.08 6.61 15.29 5.95C15.5 5.29 15.58 4.46 15.53 3.85C15.48 3.25 15.24 2.57 14.97 2.32C14.7 2.06 14.29 2.14 13.9 2.32C13.51 2.5 12.95 2.86 12.64 3.39C12.33 3.92 12 4.78 12.04 5.48C12.08 6.18 12.46 7.06 12.87 7.57C13.28 8.08 13.92 8.32 14.5 8.55C15.08 8.78 15.7 9.02 16.36 8.97C17.02 8.92 17.76 8.66 18.46 8.27C19.16 7.88 20.01 7.07 20.55 6.64C21.09 6.21 21.32 5.96 21.71 5.71C22.11 5.46 22.72 5.21 22.92 5.11',\n} as const;\n\nexport const AI_GLYPH_WORKING = {\n viewBox: '0 0 21.6653 7.31887',\n d: 'M21.5195 2.20094C21.5632 2.27281 21.5435 2.40302 21.5694 2.49163C21.6275 2.6923 21.6417 2.82523 21.6527 2.95596C21.6564 2.97027 21.6628 3.01397 21.6653 3.02853C21.6641 3.13693 21.6598 3.24436 21.6586 3.38773C21.6816 3.85362 21.6618 5.13496 21.204 5.07451C21.204 5.0745 21.204 5.0745 21.204 5.0745C21.1996 5.074 21.1952 5.07338 21.1907 5.07263C21.1061 5.05815 21.0241 4.94601 20.929 4.92104C20.8337 4.89639 20.2098 4.84129 20.1872 4.70468C20.162 4.5075 20.3424 4.05165 20.3322 3.94693C20.3275 3.87626 20.2696 3.79112 20.2564 3.70362C20.2253 3.50095 20.228 3.36832 20.1618 3.22753L20.1705 3.27725C20.1408 3.22743 20.1002 3.17862 20.0419 3.13125C20.0967 3.02469 20.1456 2.91373 20.1862 2.79711C20.1085 2.70121 20.1178 2.49436 20.0701 2.43438C20.0329 2.38632 19.9603 2.39539 19.9218 2.35006C19.8787 2.3002 19.8633 2.1732 19.7612 2.09203C19.7034 2.0461 19.6466 2.03107 19.595 2.02843L19.7627 2.11426C19.6671 2.14605 19.6042 2.2088 19.5173 2.20366C19.3811 2.19547 19.1788 2.06914 18.9898 2.10943C18.9652 2.12544 18.9407 2.1416 18.9163 2.1579C18.9287 2.20111 18.9406 2.24436 18.9521 2.28762C18.8618 2.29819 18.8311 2.20964 18.7478 2.20237C18.6497 2.19419 18.5963 2.27357 18.5308 2.27097C18.4776 2.26885 18.4048 2.20215 18.3342 2.20612C18.2309 2.21188 18.2544 2.30623 18.2002 2.32458C18.1776 2.32896 17.7784 2.40078 17.7565 2.40615C17.5856 2.42463 17.557 2.29863 17.4163 2.30438C17.0252 2.32264 16.6544 2.50901 16.341 2.64771C16.2001 2.7096 16.0505 2.75491 15.9061 2.79231C16.0092 2.39243 15.4001 2.37041 15.7957 2.76269C15.7449 2.76246 15.7042 2.7768 15.67 2.79808C15.5564 2.86487 15.4802 2.97434 15.3466 3.01614C15.2272 3.05323 15.1197 3.02273 14.9627 3.09457C14.6814 3.2228 14.4809 3.53873 14.2487 3.24296C13.9703 3.44596 13.6586 3.47244 13.7401 3.80561C13.6873 3.86035 13.4234 3.80763 13.3424 3.84086C13.2469 3.85834 12.8209 4.21338 12.8015 4.30503C12.7577 4.37886 12.704 4.52293 12.7165 4.60386C12.7165 4.60456 12.7165 4.60525 12.7166 4.60594C12.7245 4.73675 13.038 4.86932 12.6198 5.00545C12.6218 5.24087 12.6062 5.31289 12.5709 5.505C12.5653 5.5391 12.5078 5.54892 12.51 5.56912C12.5148 5.61101 12.5679 5.67144 12.5899 5.73138C12.625 5.82708 12.5422 5.92847 12.7068 5.83917C12.7265 5.85366 12.7463 5.86629 12.7663 5.87733C12.8032 5.90096 12.8414 5.92124 12.8766 5.93338C12.8592 5.96968 12.8434 6.00666 12.8291 6.04399C12.8751 6.0348 12.9151 6.01504 12.9349 5.9805C12.8531 6.08998 12.8602 6.12516 12.8542 6.09438C12.8536 6.06287 12.7741 5.97616 12.8523 5.90639C12.814 5.91011 12.7686 5.91968 12.7291 5.93658C12.8704 5.95935 13.0187 5.97102 13.1668 5.97103C13.2458 6.27758 13.5375 5.8631 13.4165 5.7269C13.4322 5.71942 13.4481 5.7116 13.4633 5.70383C13.6382 5.70301 13.7156 5.57219 13.8729 5.49571C14.0312 5.4108 14.0391 5.43683 14.1889 5.47644C14.2098 5.43405 14.2279 5.39151 14.2438 5.3483C14.0282 5.01309 14.4813 5.23839 14.467 4.9003C14.4628 4.86036 14.4497 4.81226 14.424 4.75824C14.6924 4.64645 14.5813 4.22813 14.4827 3.98518C14.4718 3.95634 14.4244 3.95942 14.4063 3.92204C14.3646 3.8314 14.3895 3.57996 14.2385 3.6136C14.269 3.52481 14.297 3.43419 14.3224 3.34163C14.2805 3.27925 14.2374 3.21883 14.1932 3.15937C14.147 3.17171 14.1008 3.18404 14.0545 3.19636C14.1795 3.02404 14.0534 2.83228 14.0536 2.72057C14.0538 2.69796 14.1146 2.67123 14.1077 2.60167C14.1053 2.5772 14.097 2.54816 14.0858 2.51695C14.0606 2.4458 14.0206 2.3664 14.0068 2.30319C13.9256 2.30215 13.845 2.30379 13.7653 2.30835C13.664 2.19886 13.8037 2.06102 13.7674 1.97878C13.7632 1.95836 13.5836 1.76062 13.569 1.76088C13.4625 1.71319 13.3938 1.83751 13.1876 1.69055C13.1768 1.68378 13.1679 1.67414 13.1594 1.66314C13.1251 1.62875 13.0976 1.58516 13.0563 1.56847C12.9543 1.52205 12.6158 1.57037 12.5754 1.68805C12.488 1.51352 12.1471 1.54577 12.0499 1.50822C12.0197 1.49536 12.0125 1.39933 11.915 1.38294C11.8348 1.36858 11.641 1.46343 11.5414 1.4673C11.4886 1.46852 11.4499 1.45238 11.417 1.43601C11.379 1.41974 11.3502 1.40253 11.3222 1.40479C11.2702 1.40908 11.2364 1.48093 11.1663 1.49376C10.9506 1.53213 10.7369 1.4686 10.5668 1.5019C10.3215 1.54967 10.1495 1.7839 9.97459 1.91406C9.92313 1.91395 9.86479 1.88637 9.81474 1.89889C9.18393 2.05373 8.52084 2.24974 8.06049 2.55947C7.97673 2.61393 7.82886 2.68357 7.70707 2.77585C7.47457 2.96164 7.29957 3.141 7.58115 3.23461C7.55145 3.37335 6.85892 3.81217 6.75779 3.91528C6.65223 4.01974 6.62886 4.1568 6.55292 4.24037C6.3287 4.49052 6.12192 4.63806 5.97447 4.97688C5.93734 5.06497 5.97217 5.18888 5.95013 5.22858C5.92305 5.27641 5.81725 5.29086 5.78729 5.35168C5.72348 5.47691 5.72292 5.63535 5.74247 5.70235C5.7392 5.69015 5.73474 5.68324 5.73057 5.6806C5.7259 5.67767 5.6564 5.71443 5.64159 5.73607C5.59977 5.79621 5.66356 5.86599 5.71545 5.8044C5.74124 5.7781 5.76378 5.72791 5.79373 5.65487C5.7797 5.76571 5.84646 5.7256 5.86464 5.68044C5.89311 5.65904 5.9217 5.63652 5.95175 5.6189C6.02236 5.57879 6.10324 5.51868 6.14438 5.46754C6.52517 4.99861 6.93077 4.48918 7.03916 4.16128C7.131 3.87843 7.03817 3.83671 7.2777 3.53191C7.3285 3.46368 7.38339 3.39761 7.43515 3.31198C7.55556 3.123 7.78512 2.91105 7.53243 2.74719C7.53788 2.72612 7.54202 2.70518 7.54516 2.6844C7.57114 2.34511 7.5461 2.13531 7.71559 1.91428C7.66205 1.8939 7.6084 1.87498 7.55468 1.85784C7.54899 1.82465 7.54284 1.79249 7.53625 1.76174C7.58249 1.7438 7.62858 1.72536 7.6745 1.70638C7.66025 1.58943 7.57775 1.48171 7.50533 1.44831C7.42954 1.40963 7.39741 1.46692 7.42084 1.47901C7.42785 1.48323 7.43783 1.48634 7.4422 1.48541C7.17989 1.34605 6.43947 1.33364 6.13402 1.38718C5.94822 1.40777 5.97834 1.51041 5.80067 1.34866C5.76607 1.37821 5.73267 1.40807 5.6993 1.43868C5.69344 1.49226 5.68877 1.54561 5.68469 1.59899C5.60346 1.6368 5.51247 1.67081 5.41947 1.70715C5.25719 1.77218 5.08842 1.83937 4.95565 1.92193C4.5607 2.16343 4.07316 2.6724 3.66471 2.90149C3.56135 2.95829 3.38743 2.97861 3.30147 3.05515C3.17694 3.16659 3.25374 3.3124 3.10481 3.45557C2.97543 3.58045 2.7598 3.72772 2.55869 3.88391C2.36237 4.0352 2.17431 4.20354 2.0791 4.34155C2.02181 4.42439 2.04245 4.49771 2.00764 4.55703C1.86276 4.80728 1.7279 5.00722 1.67572 5.28395C1.40472 5.45513 1.24398 5.34517 1.02204 5.34271C0.85587 5.34339 0.443166 5.39397 0.298309 5.53289C0.195382 5.59242 0.114988 5.33164 0 5.398C0.0672404 4.97998 0.13697 4.91763 0.231708 4.78102C0.32599 4.66409 0.441105 4.57777 0.588846 4.47063C0.890159 3.96002 1.2295 3.4868 1.62503 3.03919C1.6425 3.01952 1.66013 2.99985 1.67793 2.98018C1.75746 2.97633 1.83576 2.97461 1.91436 2.97328C1.91444 2.97336 1.91453 2.97345 1.91462 2.97353C2.12092 2.85218 2.0899 2.68327 2.15819 2.5722C2.597 1.85461 3.67978 1.04205 4.76963 0.519159C5.32989 0.243909 5.91307 0.0975681 6.38788 0.0444249C6.6555 -0.0118234 7.54053 -0.0488161 7.88667 0.153048C7.94618 0.17965 7.98958 0.207339 8.01918 0.232423C8.08533 0.290805 8.06243 0.37677 8.1281 0.424204C8.788 0.858895 8.84837 1.50779 8.95406 1.97915C8.94198 2.20167 8.92957 2.41449 8.93075 2.60529C8.95493 3.51671 8.63286 4.38247 8.20801 5.05868C7.91193 5.53227 7.58085 5.95424 7.27747 6.35851C7.01913 6.69107 6.69575 6.90231 6.33432 7.03688C5.96029 7.1761 5.5056 7.15874 5.13666 6.97761C4.77988 6.8026 4.46111 6.49764 4.34143 6.02344C4.13016 4.94119 4.72195 4.23827 5.12818 3.69949C5.57383 3.15323 6.05227 2.7034 6.49909 2.26167C6.60356 2.1588 6.70991 2.04377 6.81333 1.92552C7.11534 1.5805 7.51671 1.27415 7.87436 1.12238C8.09128 1.03067 8.22986 1.1177 8.46139 0.914443C8.47778 0.948059 8.49413 0.981695 8.51042 1.01535C8.72666 0.884509 8.85128 0.753639 9.11283 0.667108C9.33416 0.590984 9.91261 0.445577 10.1078 0.420265C10.2081 0.405908 10.1856 0.481938 10.2787 0.461915C10.4358 0.427279 10.7555 0.265817 10.9724 0.225515C11.0344 0.213886 11.1095 0.207961 11.1911 0.203672C11.3902 0.189668 11.6101 0.200757 11.7294 0.184671C12.3244 0.0941229 13.0686 0.0795288 13.6887 0.360932C13.7173 0.373361 13.7452 0.386407 13.7732 0.400348C13.9935 0.504733 14.1863 0.761282 14.2374 0.804733C14.3459 0.889986 14.4353 0.85695 14.5099 0.917486C14.8544 1.19506 15.0555 1.7393 15.1651 2.08618C15.1811 2.13408 15.1962 2.17883 15.2114 2.2209C15.5209 3.10883 15.7231 4.06037 15.5398 5.11604C15.4759 5.44103 15.3468 5.76469 15.156 6.04424C14.7344 6.73319 13.702 7.23955 12.966 7.30853C12.4728 7.37179 12.1947 7.12924 12.0524 6.99922C11.8908 6.83031 12.009 6.80775 11.9034 6.68162C11.8329 6.59062 11.7694 6.53954 11.7184 6.49409C11.6899 6.46762 11.6662 6.44349 11.6504 6.41689C11.2557 5.85657 11.3479 4.693 11.5144 4.34149C11.5151 4.33971 11.5158 4.33796 11.5166 4.33623C11.5524 4.24664 11.6398 4.2033 11.6561 4.14998C11.6648 4.12266 11.6353 4.04477 11.6651 3.9555C11.9475 3.16456 12.4817 2.80074 13.0494 2.47332C13.7152 2.10344 14.4121 1.81425 15.0508 1.49401C15.5692 1.23861 16.1097 1.07617 16.6335 0.991567C16.9162 0.946369 17.1285 1.06931 17.1663 1.06219C17.2508 1.04785 17.2925 0.940458 17.4657 0.897656C18.0451 0.752637 18.8417 0.865944 19.4146 0.908582C19.6055 0.920524 19.8557 0.905474 20.0965 0.923509C20.1598 0.938582 20.3128 1.02252 20.3653 1.06104C20.4783 1.12075 20.5849 1.18937 20.6707 1.26172C20.897 1.42686 21.21 2.00184 21.2965 2.08728C21.3583 2.13718 21.4717 2.12365 21.5195 2.20094ZM14.7616 3.09249C14.7223 2.91995 14.4452 3.20284 14.6094 3.23071C14.6457 3.23713 14.7714 3.13732 14.7616 3.09249ZM8.90352 1.8629C8.92394 1.90808 8.94428 1.9533 8.96454 1.99855C8.99986 1.96338 9.03568 1.92859 9.07244 1.894C9.0381 1.87445 9.00388 1.85503 8.96929 1.83592C8.94712 1.84485 8.92519 1.85385 8.90352 1.8629Z',\n line: 'M0.35 5.29C0.54 5.08 1.02 4.5 1.47 4C1.92 3.5 2.47 2.79 3.06 2.29C3.65 1.79 4.33 1.3 4.99 1C5.66 0.7 6.51 0.45 7.05 0.48C7.59 0.51 8.07 0.78 8.21 1.17C8.35 1.56 8.1 2.26 7.91 2.8C7.72 3.34 7.39 3.86 7.05 4.43C6.71 5 6.21 5.92 5.85 6.24C5.49 6.56 5.13 6.48 4.91 6.32C4.7 6.16 4.46 5.77 4.56 5.29C4.66 4.81 5.08 4.02 5.51 3.45C5.94 2.88 6.55 2.23 7.14 1.86C7.73 1.49 8.43 1.4 9.07 1.21C9.71 1.02 10.4 0.86 11.01 0.74C11.62 0.62 12.18 0.41 12.72 0.48C13.26 0.55 13.86 0.77 14.23 1.17C14.6 1.57 14.91 2.25 14.96 2.89C15.01 3.54 14.82 4.42 14.53 5.04C14.24 5.66 13.63 6.31 13.24 6.58C12.85 6.85 12.49 6.81 12.21 6.67C11.93 6.53 11.6 6.09 11.56 5.72C11.52 5.35 11.67 4.86 11.95 4.43C12.23 4 12.75 3.48 13.24 3.15C13.73 2.82 14.31 2.69 14.87 2.46C15.43 2.23 15.98 1.99 16.59 1.77C17.2 1.55 17.91 1.23 18.52 1.17C19.13 1.11 19.77 1.21 20.24 1.43C20.7 1.65 21.13 1.93 21.31 2.46C21.49 2.99 21.31 4.25 21.31 4.61',\n} as const;\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface AIResponseContainerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Display-font heading at the top of the reply (e.g. \"Confirm new project.\"). */\n title?: React.ReactNode;\n /** Message actions row — a `Timestamp` with copy / like / dislike / retry buttons. */\n actions?: React.ReactNode;\n /** Status line under the reply — an `AIMiniAvatar`. */\n feedback?: React.ReactNode;\n}\n\n// Figma: AI Response Container (55) › Chat reply — 16px-gapped column with an h4 title, rich content, actions and AI status.\nexport const AIResponseContainer = React.forwardRef<HTMLDivElement, AIResponseContainerProps>(\n ({ className, title, children, actions, feedback, ...props }, ref) => (\n <div ref={ref} className={cn('flex w-full max-w-188 flex-col items-start gap-4', className)} {...props}>\n {title && <h2 className=\"text-heading-h4 text-surface-foreground\">{title}</h2>}\n <div className=\"flex w-full flex-col gap-4 text-body-base text-surface-foreground [&>p]:opacity-90\">{children}</div>\n {actions}\n {feedback}\n </div>\n ),\n);\nAIResponseContainer.displayName = 'AIResponseContainer';\n","import * as React from 'react';\nimport { Sparkle } from '@phosphor-icons/react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Toggle as TogglePrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nconst askAiToggleVariants = cva(\n 'inline-flex shrink-0 items-center justify-center text-surface-foreground transition-colors disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n type: {\n // 40px, filled with the subtle fill until pressed.\n menu: 'size-10 rounded-md bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-soft-foreground',\n // 32px, bare until pressed.\n action: 'size-8 rounded-sm hover:bg-accent-soft data-[state=on]:bg-accent-soft data-[state=on]:text-accent-soft-foreground',\n },\n },\n defaultVariants: { type: 'menu' },\n },\n);\n\nexport interface AskAiToggleProps\n extends Omit<React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>, 'type'>,\n VariantProps<typeof askAiToggleVariants> {}\n\n// Figma: User Message Bubble (54) › Ask AI toggle — sparkle toggle in a 40px menu or a 32px action size.\nexport const AskAiToggle = React.forwardRef<React.ElementRef<typeof TogglePrimitive.Root>, AskAiToggleProps>(\n ({ className, type, 'aria-label': ariaLabel = 'Ask AI', pressed, defaultPressed, ...props }, ref) => {\n const [internal, setInternal] = React.useState(defaultPressed ?? false);\n const on = pressed ?? internal;\n return (\n <TogglePrimitive.Root\n ref={ref}\n aria-label={ariaLabel}\n pressed={pressed}\n defaultPressed={defaultPressed}\n onPressedChange={(next) => {\n setInternal(next);\n props.onPressedChange?.(next);\n }}\n className={cn(askAiToggleVariants({ type }), className)}\n {...props}\n >\n <Sparkle size={16} weight={on ? 'fill' : 'regular'} aria-hidden />\n </TogglePrimitive.Root>\n );\n },\n);\nAskAiToggle.displayName = 'AskAiToggle';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { Checkbox } from '../Forms & Data Entry/Checkbox';\nimport { RadioGroupItem } from '../Forms & Data Entry/RadioGroup';\n\nexport interface ChatChoicesProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** The question the assistant is asking. */\n title: React.ReactNode;\n}\n\n// Figma: Chat Input (56) › Choices — a question header over a list of options, shown above the input.\nexport const ChatChoices = React.forwardRef<HTMLDivElement, ChatChoicesProps>(\n ({ className, title, children, ...props }, ref) => (\n <div ref={ref} className={cn('flex flex-col', className)} {...props}>\n <div className=\"border-b border-border px-6 pt-5 pb-4\">\n <p className=\"text-body-section text-surface-foreground\">{title}</p>\n </div>\n {children}\n </div>\n ),\n);\nChatChoices.displayName = 'ChatChoices';\n\ninterface ChatOptionBaseProps {\n title: React.ReactNode;\n description?: React.ReactNode;\n className?: string;\n}\n\nexport interface ChatOptionActionProps\n extends ChatOptionBaseProps,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {\n kind?: 'action';\n}\n\nexport interface ChatOptionRadioProps extends ChatOptionBaseProps {\n kind: 'radio';\n /** Value in the surrounding `RadioGroup`. */\n value: string;\n disabled?: boolean;\n}\n\nexport interface ChatOptionCheckboxProps extends ChatOptionBaseProps {\n kind: 'checkbox';\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n disabled?: boolean;\n}\n\nexport type ChatOptionProps = ChatOptionActionProps | ChatOptionRadioProps | ChatOptionCheckboxProps;\n\nconst rowClasses = 'flex w-full flex-col gap-1 border-b border-border px-6 py-4 text-left text-body-small';\n\n// Figma: Chat Input (56) › AI option — a quick reply (action), or a radio / checkbox choice with a description.\nexport function ChatOption(props: ChatOptionProps) {\n const id = React.useId();\n const descriptionId = `${id}-description`;\n\n if (props.kind === 'radio' || props.kind === 'checkbox') {\n const { title, description, className } = props;\n const control =\n props.kind === 'radio' ? (\n <RadioGroupItem id={id} value={props.value} disabled={props.disabled} aria-describedby={description ? descriptionId : undefined} />\n ) : (\n <Checkbox\n id={id}\n checked={props.checked}\n defaultChecked={props.defaultChecked}\n onCheckedChange={(next) => props.onCheckedChange?.(next === true)}\n disabled={props.disabled}\n aria-describedby={description ? descriptionId : undefined}\n />\n );\n return (\n <div className={cn(rowClasses, 'cursor-default', className)}>\n <div className=\"flex items-center gap-2.5 py-1\">\n {control}\n <label htmlFor={id} className=\"text-ui-label text-surface-foreground\">\n {title}\n </label>\n </div>\n {description && (\n <p id={descriptionId} className=\"pl-7.75 text-sm leading-[1.4] text-secondary-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n );\n }\n\n const { title, description, className, kind: _kind, ...buttonProps } = props;\n return (\n <button\n type=\"button\"\n className={cn(rowClasses, 'transition-colors hover:bg-accent-soft', className)}\n {...buttonProps}\n >\n <span className=\"text-ui-label text-surface-foreground\">{title}</span>\n {description && <span className=\"text-body-small text-secondary-muted-foreground\">{description}</span>}\n </button>\n );\n}\n","import * as React from 'react';\nimport { Check, Minus } from '@phosphor-icons/react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Label } from './Label';\n\nexport type CheckboxProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>;\n\n// Figma: Checkbox (21) — 1.5px muted border at rest; accent fill when checked or indeterminate.\nexport const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n ({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'peer inline-flex size-4 shrink-0 items-center justify-center rounded-xxs border-2 border-input bg-surface transition-colors',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Brand override: selected controls use `ring`, not `primary`/`accent`.\n 'data-[state=checked]:border-ring data-[state=checked]:bg-ring data-[state=checked]:text-label',\n 'data-[state=indeterminate]:border-ring data-[state=indeterminate]:bg-ring data-[state=indeterminate]:text-label',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n {props.checked === 'indeterminate' ? <Minus size={12} weight=\"bold\" aria-hidden /> : <Check size={12} weight=\"bold\" aria-hidden />}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n ),\n);\nCheckbox.displayName = 'Checkbox';\n\nexport interface CheckboxFieldProps extends CheckboxProps {\n label: React.ReactNode;\n /** Secondary line under the label. */\n description?: React.ReactNode;\n}\n\n/** Checkbox with its label (and optional description) laid out per Figma. */\nexport const CheckboxField = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxFieldProps>(\n ({ label, description, id, className, disabled, ...props }, ref) => {\n const generatedId = React.useId();\n const controlId = id ?? generatedId;\n const descriptionId = `${controlId}-description`;\n return (\n <div\n className={cn('flex gap-2', description ? 'items-start pt-0.5' : 'items-center', disabled && 'opacity-50', className)}\n >\n <Checkbox\n ref={ref}\n id={controlId}\n disabled={disabled}\n aria-describedby={description ? descriptionId : undefined}\n className={description ? 'mt-0.5' : undefined}\n {...props}\n />\n <div className=\"flex flex-col gap-0.5\">\n <Label htmlFor={controlId} className={cn(!description && 'font-normal leading-5')}>\n {label}\n </Label>\n {description && (\n <p id={descriptionId} className=\"text-xs text-secondary-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n </div>\n );\n },\n);\nCheckboxField.displayName = 'CheckboxField';\n","import * as React from 'react';\nimport { Label as LabelPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nexport const Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n 'text-ui-label text-surface-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n ),\n);\nLabel.displayName = 'Label';\n","import * as React from 'react';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Label } from './Label';\n\nexport type RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;\n\nexport const RadioGroup = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Root>, RadioGroupProps>(\n ({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root ref={ref} className={cn('flex flex-col gap-2', className)} {...props} />\n ),\n);\nRadioGroup.displayName = 'RadioGroup';\n\nexport type RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;\n\n// Figma: Radio Group (24) — 16px ring in muted (same size as the checkbox), accent when selected with a solid centre dot.\nexport const RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioGroupItemProps\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'peer inline-flex size-4 shrink-0 items-center justify-center rounded-full border-2 border-input bg-surface transition-colors',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Brand override: selected controls use `ring`, not `primary`/`accent`.\n 'data-[state=checked]:border-ring',\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"size-2 rounded-full bg-ring\" />\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = 'RadioGroupItem';\n\nexport interface RadioGroupFieldItemProps extends RadioGroupItemProps {\n label: React.ReactNode;\n /** Secondary line under the label. */\n description?: React.ReactNode;\n}\n\n/** A radio with its label (and optional description) laid out per Figma. */\nexport const RadioGroupFieldItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioGroupFieldItemProps\n>(({ label, description, id, className, disabled, ...props }, ref) => {\n const generatedId = React.useId();\n const controlId = id ?? generatedId;\n const descriptionId = `${controlId}-description`;\n return (\n <div\n className={cn('flex gap-2', description ? 'items-start pt-0.5' : 'items-center', disabled && 'opacity-50', className)}\n >\n <RadioGroupItem\n ref={ref}\n id={controlId}\n disabled={disabled}\n aria-describedby={description ? descriptionId : undefined}\n {...props}\n />\n <div className=\"flex flex-col gap-0.5\">\n <Label htmlFor={controlId} className={cn(!description && 'font-normal leading-5')}>\n {label}\n </Label>\n {description && (\n <p id={descriptionId} className=\"text-xs text-secondary-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n </div>\n );\n});\nRadioGroupFieldItem.displayName = 'RadioGroupFieldItem';\n","import * as React from 'react';\nimport { ArrowUp, Plus } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport interface ChatInputProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSubmit' | 'defaultValue' | 'onChange'> {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Called with the text when the send button (or Enter) is pressed. */\n onSubmit?: (value: string) => void;\n placeholder?: string;\n /** Accessible name for the text area. */\n 'aria-label'?: string;\n /** Attached files (`FileAttachment`s) shown above the text. */\n attachments?: React.ReactNode;\n /** A `ChatChoices` block shown above the text area. */\n choices?: React.ReactNode;\n /** Slot before the send button — usually a `ProjectSelector`. */\n trailing?: React.ReactNode;\n /** Called when the add (+) button is pressed. Hides the button when omitted. */\n onAdd?: () => void;\n addLabel?: string;\n sendLabel?: string;\n disabled?: boolean;\n}\n\n// Figma: Chat Input (56) › Chat input — a rounded card: optional choices, attachments + text, then an actions row.\nexport const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(\n (\n {\n className,\n value,\n defaultValue = '',\n onValueChange,\n onSubmit,\n placeholder = 'Add context or ask for changes...',\n 'aria-label': ariaLabel = 'Message',\n attachments,\n choices,\n trailing,\n onAdd,\n addLabel = 'Add',\n sendLabel = 'Send',\n disabled,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState(defaultValue);\n const text = value ?? internal;\n const filled = text.trim() !== '' || attachments != null;\n\n const submit = () => {\n if (!text.trim() && attachments == null) return;\n onSubmit?.(text);\n };\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex w-full flex-col overflow-hidden rounded-2xl border border-border bg-surface shadow-xs',\n 'focus-within:border-input-accent',\n className,\n )}\n {...props}\n >\n {choices}\n <div className=\"flex flex-col gap-4 p-4\">\n {attachments && <div className=\"flex flex-wrap gap-4\">{attachments}</div>}\n <textarea\n rows={1}\n aria-label={ariaLabel}\n value={text}\n disabled={disabled}\n placeholder={placeholder}\n onChange={(event) => {\n setInternal(event.target.value);\n onValueChange?.(event.target.value);\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n submit();\n }\n }}\n className=\"field-sizing-content max-h-60 min-h-7 w-full resize-none bg-transparent text-body-base text-surface-foreground outline-none placeholder:text-muted-foreground\"\n />\n </div>\n <div className=\"flex items-center gap-1.5 px-2.5 pt-2 pb-2.5\">\n {onAdd && (\n <Button type=\"button\" variant=\"ghost\" size=\"icon\" aria-label={addLabel} disabled={disabled} onClick={onAdd}>\n <Plus size={16} aria-hidden />\n </Button>\n )}\n <div className=\"flex flex-1 items-center justify-end gap-1.5\">\n {trailing}\n <Button\n type=\"button\"\n variant={filled ? 'default' : 'outline'}\n size=\"icon\"\n aria-label={sendLabel}\n disabled={disabled || !filled}\n onClick={submit}\n className={cn('rounded-full', !filled && 'disabled:opacity-100 disabled:border-border disabled:text-muted-foreground')}\n >\n <ArrowUp size={16} aria-hidden />\n </Button>\n </div>\n </div>\n </div>\n );\n },\n);\nChatInput.displayName = 'ChatInput';\n\nexport interface AskAiInputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onSubmit'> {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onSubmit?: (value: string) => void;\n sendLabel?: string;\n}\n\n// Figma: Chat Input (56) › Ask AI — the compact one-line pill (\"Ask for changes\").\nexport const AskAiInput = React.forwardRef<HTMLInputElement, AskAiInputProps>(\n (\n { className, value, defaultValue = '', onValueChange, onSubmit, sendLabel = 'Send', placeholder = 'Ask for changes', disabled, ...props },\n ref,\n ) => {\n const [internal, setInternal] = React.useState(defaultValue);\n const text = value ?? internal;\n const filled = text.trim() !== '';\n return (\n <form\n className={cn(\n 'flex min-h-10 w-full items-center gap-2 rounded-full border border-border bg-surface py-1.5 pr-1.5 pl-2 shadow-sm',\n 'focus-within:border-input-accent',\n className,\n )}\n onSubmit={(event) => {\n event.preventDefault();\n if (filled) onSubmit?.(text);\n }}\n >\n <input\n ref={ref}\n value={text}\n disabled={disabled}\n placeholder={placeholder}\n onChange={(event) => {\n setInternal(event.target.value);\n onValueChange?.(event.target.value);\n }}\n className=\"min-w-0 flex-1 bg-transparent text-body-small text-surface-foreground outline-none placeholder:text-muted-foreground\"\n {...props}\n />\n <Button\n type=\"submit\"\n variant={filled ? 'default' : 'outline'}\n size=\"icon\"\n aria-label={sendLabel}\n disabled={disabled || !filled}\n className={cn(!filled && 'disabled:opacity-100 disabled:border-border disabled:text-muted-foreground')}\n >\n <ArrowUp size={16} aria-hidden />\n </Button>\n </form>\n );\n },\n);\nAskAiInput.displayName = 'AskAiInput';\n","import * as React from 'react';\nimport { X } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport interface FileAttachmentProps extends React.HTMLAttributes<HTMLDivElement> {\n name: string;\n /** File type badge text, e.g. \"PDF\". */\n type?: string;\n /** Shows the round remove button on hover or keyboard focus (Figma: Default). Omit for the sent-message card (Figma: Variant 3). */\n onRemove?: () => void;\n removeLabel?: string;\n}\n\n// Figma: User Message Bubble (54) › File attached — 128px card; the composer variant has a remove button.\nexport const FileAttachment = React.forwardRef<HTMLDivElement, FileAttachmentProps>(\n ({ className, name, type, onRemove, removeLabel, ...props }, ref) => (\n <div ref={ref} className={cn('group/file relative w-32 shrink-0', className)} {...props}>\n <div\n className={cn(\n 'flex flex-col gap-1.5 border border-border bg-surface px-2.5 pt-2.5 pb-3',\n onRemove ? 'rounded-xl' : 'rounded-lg',\n )}\n >\n <p className=\"line-clamp-2 min-h-8 break-all text-ui-caption text-surface-foreground\" title={name}>\n {name}\n </p>\n {type && (\n <span className=\"w-fit rounded-xs bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-1.5 py-px text-body-xxs font-semibold tracking-wider text-secondary-muted-foreground uppercase\">\n {type}\n </span>\n )}\n </div>\n {onRemove && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={removeLabel ?? `Remove ${name}`}\n onClick={onRemove}\n className=\"absolute right-0 bottom-0 rounded-full opacity-0 transition-opacity group-hover/file:opacity-100 group-focus-within/file:opacity-100\"\n >\n <X size={16} aria-hidden />\n </Button>\n )}\n </div>\n ),\n);\nFileAttachment.displayName = 'FileAttachment';\n","import * as React from 'react';\nimport { CaretDown, FolderOpen, FolderSimple } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from '../Overlays & Feedback/DropdownMenu';\n\nconst NEW_PROJECT = '__new__';\n\nexport interface ProjectSelectorProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue'> {\n /** Name of the chosen project. Leave empty for \"New Project\". */\n project?: string;\n /**\n * Existing project names. When given, pressing the selector opens a menu with\n * \"New Project\" and these names; the current choice is checked.\n */\n projects?: string[];\n /** Called with the chosen project name, or `undefined` for \"New Project\". */\n onProjectChange?: (project: string | undefined) => void;\n /** Label of the \"new project\" menu item and of the pill when no project is chosen. */\n newProjectLabel?: string;\n /**\n * `selected` means the project is locked for this chat: the pill is read-only\n * (no caret, neutral border). Otherwise it is a trigger with a caret.\n */\n selected?: boolean;\n}\n\n// Figma: Chat Input (56) › Project selector — a pill showing the project folder, \"New Project\" until one is chosen.\nexport const ProjectSelector = React.forwardRef<HTMLButtonElement, ProjectSelectorProps>(\n ({ className, project, projects, onProjectChange, newProjectLabel = 'New Project', selected = false, children, ...props }, ref) => {\n const label = children ?? project ?? newProjectLabel;\n const classes = cn(\n 'inline-flex h-10 items-center gap-2 rounded-full border bg-surface px-3 py-2 text-ui-label whitespace-nowrap text-surface-foreground transition-colors',\n selected\n ? 'border-border'\n : 'border-input-muted hover:border-input-muted hover:bg-accent-soft hover:text-accent-soft-foreground data-[state=open]:bg-accent-soft data-[state=open]:text-accent-soft-foreground',\n className,\n );\n const content = (\n <>\n {project ? (\n <FolderOpen size={16} weight=\"fill\" aria-hidden className=\"shrink-0\" />\n ) : (\n <FolderSimple size={16} aria-hidden className=\"shrink-0\" />\n )}\n <span>{label}</span>\n {!selected && <CaretDown size={16} aria-hidden className=\"shrink-0\" />}\n </>\n );\n if (selected) {\n return (\n <span className={classes} title={typeof label === 'string' ? label : undefined}>\n {content}\n </span>\n );\n }\n const trigger = (\n <button ref={ref} type=\"button\" aria-haspopup=\"menu\" className={classes} {...props}>\n {content}\n </button>\n );\n if (!projects) return trigger;\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>{trigger}</DropdownMenuTrigger>\n <DropdownMenuContent side=\"top\" align=\"end\" className=\"min-w-60\">\n <DropdownMenuRadioGroup\n value={project ?? NEW_PROJECT}\n onValueChange={(next) => onProjectChange?.(next === NEW_PROJECT ? undefined : next)}\n >\n <DropdownMenuRadioItem value={NEW_PROJECT}>{newProjectLabel}</DropdownMenuRadioItem>\n {projects.map((name) => (\n <DropdownMenuRadioItem key={name} value={name}>\n {name}\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n },\n);\nProjectSelector.displayName = 'ProjectSelector';\n","import * as React from 'react';\nimport { CaretRight, Check, Trash } from '@phosphor-icons/react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport const DropdownMenu = DropdownMenuPrimitive.Root;\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nexport const DropdownMenuGroup = DropdownMenuPrimitive.Group;\nexport const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n// Figma: Dropdown Menu (50) — white card, 1px border, 8px radius, 4px padding and 2px between items.\nconst contentClasses =\n 'min-w-80 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md';\n\nexport type DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;\n\n/**\n * Radix moves DOM focus to the hovered item, so `:focus-visible` can't tell hover\n * from keyboard navigation. Track the last input modality instead: hover only\n * fills the item, and the ring is drawn only after a key press.\n */\nfunction useKeyboardModality<T extends HTMLElement>(\n onKeyDown?: React.KeyboardEventHandler<T>,\n onPointerMove?: React.PointerEventHandler<T>,\n) {\n const [keyboard, setKeyboard] = React.useState(false);\n return {\n 'data-keyboard': keyboard ? '' : undefined,\n onKeyDown: (event: React.KeyboardEvent<T>) => {\n setKeyboard(true);\n onKeyDown?.(event);\n },\n onPointerMove: (event: React.PointerEvent<T>) => {\n setKeyboard(false);\n onPointerMove?.(event);\n },\n };\n}\n\nexport const DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuContentProps\n>(({ className, sideOffset = 4, onKeyDown, onPointerMove, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n style={{ zIndex: 'var(--sys-z-30)' }}\n className={cn(contentClasses, 'group/menu flex flex-col gap-0.5', className)}\n {...useKeyboardModality(onKeyDown, onPointerMove)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\nconst itemBase =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-body-base text-surface-foreground outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50';\nconst itemHover =\n 'data-[highlighted]:bg-accent-soft group-data-[keyboard]/menu:data-[highlighted]:outline-solid group-data-[keyboard]/menu:data-[highlighted]:outline-2 group-data-[keyboard]/menu:data-[highlighted]:-outline-offset-2 group-data-[keyboard]/menu:data-[highlighted]:outline-ring';\nconst selectedItem = 'data-[state=checked]:text-ui-label-large data-[state=checked]:text-accent-foreground';\n\nexport interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n /** Secondary line under the label. */\n description?: React.ReactNode;\n /** `destructive` shows a trash icon and red text (Figma: State = Destructive). */\n variant?: 'default' | 'destructive';\n /** Leading icon. */\n icon?: React.ReactNode;\n}\n\nfunction ItemBody({ children, description }: { children: React.ReactNode; description?: React.ReactNode }) {\n return (\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span>{children}</span>\n {description && <span className=\"text-xs leading-normal text-secondary-muted-foreground\">{description}</span>}\n </span>\n );\n}\n\nexport const DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(({ className, children, description, variant = 'default', icon, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n itemBase,\n variant === 'destructive'\n ? 'text-ui-label-large text-destructive data-[highlighted]:bg-destructive-soft-hover group-data-[keyboard]/menu:data-[highlighted]:outline-solid group-data-[keyboard]/menu:data-[highlighted]:outline-2 group-data-[keyboard]/menu:data-[highlighted]:-outline-offset-2 group-data-[keyboard]/menu:data-[highlighted]:outline-ring'\n : itemHover,\n className,\n )}\n {...props}\n >\n {variant === 'destructive' && !icon ? <Trash size={16} aria-hidden className=\"shrink-0\" /> : icon}\n <ItemBody description={description}>{children}</ItemBody>\n </DropdownMenuPrimitive.Item>\n));\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nexport interface DropdownMenuSelectableItemProps {\n description?: React.ReactNode;\n}\n\n/** A checkable item: the selected state is accent-coloured with a trailing check (Figma: State = Selected). */\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem> & DropdownMenuSelectableItemProps\n>(({ className, children, description, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem ref={ref} className={cn(itemBase, itemHover, selectedItem, className)} {...props}>\n <ItemBody description={description}>{children}</ItemBody>\n <DropdownMenuPrimitive.ItemIndicator>\n <Check size={16} aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n\n/** One choice of a `DropdownMenuRadioGroup`, styled like a selected item when active. */\nexport const DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem> & DropdownMenuSelectableItemProps\n>(({ className, children, description, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem ref={ref} className={cn(itemBase, itemHover, selectedItem, className)} {...props}>\n <ItemBody description={description}>{children}</ItemBody>\n <DropdownMenuPrimitive.ItemIndicator>\n <Check size={16} aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n\n/** Item that opens a submenu, with a trailing caret (Figma: Expand = Yes). */\nexport const DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(itemBase, itemHover, 'data-[state=open]:bg-accent-soft', className)}\n {...props}\n >\n <span className=\"flex-1\">{children}</span>\n <CaretRight size={16} aria-hidden />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\nexport const DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, onKeyDown, onPointerMove, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n style={{ zIndex: 'var(--sys-z-30)' }}\n className={cn(contentClasses, 'group/menu flex flex-col gap-0.5', className)}\n {...useKeyboardModality(onKeyDown, onPointerMove)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\nexport const DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-ui-caption text-secondary-muted-foreground', className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n\nexport const DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />\n));\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface TimestampProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The time text, e.g. \"5 minutes ago\". */\n time: React.ReactNode;\n /** Action buttons (ghost icon `Button`s) shown next to the time. */\n children?: React.ReactNode;\n /** `before` puts the time left of the actions (user messages); `after` puts it right of them (AI replies). */\n timePosition?: 'before' | 'after';\n}\n\n// Figma: Timestamp (58) — 12px/16px `secondary-muted` time with 40px icon actions.\nexport const Timestamp = React.forwardRef<HTMLDivElement, TimestampProps>(\n ({ className, time, children, timePosition = 'before', ...props }, ref) => {\n const timeNode = (\n <time className=\"text-ui-caption whitespace-nowrap text-secondary-muted-foreground\">{time}</time>\n );\n return (\n <div\n ref={ref}\n className={cn('flex items-center gap-2', timePosition === 'before' && 'justify-end', className)}\n {...props}\n >\n {timePosition === 'before' && timeNode}\n {children && (\n <div role=\"toolbar\" aria-label=\"Message actions\" className=\"flex items-center\">\n {children}\n </div>\n )}\n {timePosition === 'after' && timeNode}\n </div>\n );\n },\n);\nTimestamp.displayName = 'Timestamp';\n","import * as React from 'react';\nimport { CaretRight, Check } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface TopicCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Leading 24px icon (a Phosphor icon, e.g. `<FolderOpen weight=\"fill\" />`). */\n icon?: React.ReactNode;\n title: React.ReactNode;\n /** Small tag beside the title (e.g. a language `Badge`). */\n badge?: React.ReactNode;\n description: React.ReactNode;\n /** Chips under the description (e.g. topic tags). */\n tags?: React.ReactNode;\n /** Meta line under the description (e.g. \"7 Questions · 30 minutes\"). */\n meta?: React.ReactNode;\n}\n\n// Figma: AI Response Container (55) › Topic — bordered 16px-radius card with a display-font title.\nexport const TopicCard = React.forwardRef<HTMLDivElement, TopicCardProps>(\n ({ className, icon, title, badge, description, tags, meta, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex w-full flex-col gap-4 overflow-hidden rounded-xl border border-border bg-surface p-4', className)}\n {...props}\n >\n <div className=\"flex items-center gap-4\">\n <div className=\"flex items-center gap-4 text-primary\">\n {icon && <span className=\"flex size-6 shrink-0 items-center justify-center [&>svg]:size-6\">{icon}</span>}\n <h3 className=\"text-heading-h3 whitespace-nowrap\">{title}</h3>\n </div>\n {badge}\n </div>\n <p className=\"text-body-base text-surface-foreground\">{description}</p>\n {tags && <div className=\"flex flex-wrap items-center gap-2\">{tags}</div>}\n {meta && <div className=\"flex items-center gap-2 text-ui-caption text-secondary-muted-foreground\">{meta}</div>}\n </div>\n ),\n);\nTopicCard.displayName = 'TopicCard';\n\nexport interface TopicCardMetaItemProps extends React.HTMLAttributes<HTMLSpanElement> {\n icon: React.ReactNode;\n}\n\n/** An icon + text item for `TopicCard`'s `meta` line. */\nexport function TopicCardMetaItem({ icon, children, className, ...props }: TopicCardMetaItemProps) {\n return (\n <span className={cn('flex items-center gap-1', className)} {...props}>\n <span aria-hidden=\"true\" className=\"flex size-4 items-center justify-center [&>svg]:size-4\">\n {icon}\n </span>\n {children}\n </span>\n );\n}\n\n/** A short chip for `TopicCard`'s `tags` row. */\nexport function TopicCardTag({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn(\n 'rounded-sm bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2 py-1 text-ui-caption text-surface-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface TopicActivityRowProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {\n /** Status text, e.g. \"New Activity Created\". */\n status: React.ReactNode;\n}\n\n// Figma: Topic › Variant 5 — a divider row linking to the created item.\nexport const TopicActivityRow = React.forwardRef<HTMLButtonElement, TopicActivityRowProps>(\n ({ className, status, children, ...props }, ref) => (\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n 'flex w-full items-center gap-4 border-b border-border bg-surface p-4 text-left text-body-small text-surface-foreground',\n className,\n )}\n {...props}\n >\n <span className=\"flex items-center gap-2 whitespace-nowrap\">\n <Check size={16} aria-hidden className=\"text-accent\" />\n {status}\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <CaretRight size={16} aria-hidden />\n </button>\n ),\n);\nTopicActivityRow.displayName = 'TopicActivityRow';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface UserMessageBubbleProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Attached files (`FileAttachment`s) shown above the text. */\n attachments?: React.ReactNode;\n /** Row under the bubble, usually a `Timestamp` with message actions. */\n footer?: React.ReactNode;\n}\n\n// Figma: User Message Bubble (54) › Message — `secondary` fill, 16px radius with a 4px bottom-right corner.\nexport const UserMessageBubble = React.forwardRef<HTMLDivElement, UserMessageBubbleProps>(\n ({ className, children, attachments, footer, ...props }, ref) => (\n <div ref={ref} className={cn('flex w-full max-w-125 flex-col items-end gap-2.5', className)} {...props}>\n <div className=\"flex w-full flex-col gap-4 rounded-tl-xl rounded-tr-xl rounded-br-xs rounded-bl-xl bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 p-4 text-body-base text-surface-foreground\">\n {attachments && <div className=\"flex flex-wrap gap-4\">{attachments}</div>}\n <p className=\"break-words\">{children}</p>\n </div>\n {footer && <div className=\"w-full\">{footer}</div>}\n </div>\n ),\n);\nUserMessageBubble.displayName = 'UserMessageBubble';\n","import { CaretDown, CaretLeft, CaretRight } from '@phosphor-icons/react';\nimport { DayPicker, type DayPickerProps } from 'react-day-picker';\n\nimport { cn } from '../../lib/utils';\n\nexport type CalendarProps = DayPickerProps & {\n /** Days to mark with a dashed outline (e.g. suggested interview slots). */\n recommendedDates?: Date[];\n};\n\nconst subtleFill = 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5';\n\n// Figma: Calendar (25) › Calendar / DayCell-24 — 36px round day cells on a 4px grid, month + year pickers in the header.\nexport function Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'dropdown',\n recommendedDates,\n modifiers,\n modifiersClassNames,\n startMonth,\n endMonth,\n ...props\n}: CalendarProps) {\n const year = new Date().getFullYear();\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n captionLayout={captionLayout}\n startMonth={startMonth ?? new Date(year - 10, 0)}\n endMonth={endMonth ?? new Date(year + 10, 11)}\n className={cn('w-71 text-surface-foreground', className)}\n modifiers={{ ...(recommendedDates ? { recommended: recommendedDates } : {}), ...modifiers }}\n modifiersClassNames={{\n recommended: 'border border-dashed border-border *:text-surface-foreground',\n ...modifiersClassNames,\n }}\n classNames={{\n root: 'relative',\n months: 'flex flex-col',\n month: 'flex flex-col items-center gap-4',\n nav: 'absolute inset-x-0 top-0 flex h-8 items-center justify-between',\n button_previous:\n 'inline-flex size-8 items-center justify-center rounded-sm text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground disabled:opacity-50',\n button_next:\n 'inline-flex size-8 items-center justify-center rounded-sm text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground disabled:opacity-50',\n month_caption: 'flex h-8 items-center justify-center',\n dropdowns: 'flex items-center gap-1',\n dropdown_root:\n 'relative inline-flex items-center rounded-md border border-input-muted bg-surface px-3 py-1.5 text-body-small shadow-xs hover:border-input-accent',\n dropdown: 'absolute inset-0 cursor-pointer opacity-0',\n caption_label: 'flex items-center gap-2 text-body-small text-surface-foreground',\n month_grid: 'w-full border-collapse',\n weekdays: 'flex gap-1',\n weekday: 'flex h-8 w-9 items-center justify-center text-ui-caption text-muted-foreground',\n weeks: 'flex flex-col gap-1',\n week: 'flex gap-1',\n day: 'size-9 rounded-full p-0 text-center',\n day_button:\n 'flex size-full items-center justify-center rounded-full text-ui-caption text-secondary-muted-foreground transition-colors hover:bg-accent-soft hover:text-accent-soft-foreground',\n selected: cn(subtleFill, '*:text-surface-foreground'),\n today: 'font-semibold',\n outside: 'opacity-60 *:text-muted-foreground',\n disabled: 'opacity-60 *:pointer-events-none *:text-muted-foreground',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) =>\n orientation === 'left' ? (\n <CaretLeft size={16} aria-hidden />\n ) : orientation === 'right' ? (\n <CaretRight size={16} aria-hidden />\n ) : (\n <CaretDown size={16} aria-hidden />\n ),\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = 'Calendar';\n","import * as React from 'react';\nimport { CalendarBlank } from '@phosphor-icons/react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Calendar, type CalendarProps } from './Calendar';\nimport { Field } from './Field';\nimport { formatDateTime } from './formatDateTime';\nimport { TimePicker, type TimePickerProps, type TimeValue } from './TimePicker';\n\nfunction toTimeValue(date: Date | undefined): TimeValue | undefined {\n if (!date) return undefined;\n const hours = date.getHours();\n return { hour: hours % 12 === 0 ? 12 : hours % 12, minute: date.getMinutes(), period: hours >= 12 ? 'PM' : 'AM' };\n}\n\nfunction combine(date: Date, time: TimeValue): Date {\n const next = new Date(date);\n next.setHours((time.hour % 12) + (time.period === 'PM' ? 12 : 0), time.minute, 0, 0);\n return next;\n}\n\nexport interface DateTimePickerProps {\n /** Initial selection. The picker keeps its own draft until Apply, so remount it (e.g. with a `key`) to reset from a new value. */\n value?: Date;\n defaultValue?: Date;\n /** Called with the chosen date (time included when `showTime`) when Apply is pressed. */\n onApply?: (value: Date | undefined) => void;\n onReset?: () => void;\n /** Show the time picker column next to the calendar. */\n showTime?: boolean;\n calendarProps?: Omit<CalendarProps, 'mode' | 'selected' | 'onSelect'>;\n timePickerProps?: Omit<TimePickerProps, 'value' | 'onValueChange'>;\n className?: string;\n}\n\n// Figma: Calendar (25) › Date & time picker — card with the calendar, an optional time column and Reset / Apply.\nexport function DateTimePicker({\n value,\n defaultValue,\n onApply,\n onReset,\n showTime = true,\n calendarProps,\n timePickerProps,\n className,\n}: DateTimePickerProps) {\n const [date, setDate] = React.useState<Date | undefined>(value ?? defaultValue);\n const [time, setTime] = React.useState<TimeValue | undefined>(toTimeValue(value ?? defaultValue));\n\n const apply = () => {\n if (!date) return onApply?.(undefined);\n onApply?.(showTime ? combine(date, time ?? { hour: 12, minute: 0, period: 'AM' }) : date);\n };\n\n return (\n <div\n className={cn(\n 'inline-flex flex-col gap-4 rounded-lg border border-border bg-surface p-4 shadow-md',\n className,\n )}\n >\n <div className=\"flex items-center gap-6\">\n <Calendar mode=\"single\" selected={date} onSelect={setDate} defaultMonth={date} {...calendarProps} />\n {showTime && (\n <>\n <div className=\"h-70 w-px self-center bg-border\" aria-hidden=\"true\" />\n <TimePicker value={time} onValueChange={setTime} {...timePickerProps} />\n </>\n )}\n </div>\n <div className=\"flex items-center justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n setDate(undefined);\n setTime(undefined);\n onReset?.();\n }}\n >\n Reset\n </Button>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={apply}>\n Apply\n </Button>\n </div>\n </div>\n );\n}\n\nexport interface DatePickerProps extends Omit<DateTimePickerProps, 'onApply' | 'className'> {\n label?: React.ReactNode;\n placeholder?: string;\n onValueChange?: (value: Date | undefined) => void;\n className?: string;\n}\n\n/** Field-style trigger that opens a `DateTimePicker` in a popover. Figma: Calendar (25) › Calendar & time. */\nexport const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(\n ({ label, placeholder = 'Select date and time', value, defaultValue, onValueChange, showTime = true, className, ...pickerProps }, ref) => {\n const [open, setOpen] = React.useState(false);\n const [internal, setInternal] = React.useState<Date | undefined>(defaultValue);\n const current = value ?? internal;\n\n return (\n <Field label={label} className={cn('w-75', className)}>\n {(control) => (\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n <button\n ref={ref}\n type=\"button\"\n {...control}\n className=\"flex h-10 w-full items-center gap-3 rounded-md border border-input-muted bg-surface px-3 py-2.5 text-left shadow-xs transition-colors hover:border-input-accent data-[state=open]:border-input-accent\"\n >\n <CalendarBlank size={24} aria-hidden className=\"shrink-0 text-surface-foreground\" />\n <span className={cn('truncate', current ? 'text-ui-label-large text-surface-foreground' : 'text-body-base text-muted-foreground')}>\n {current ? formatDateTime(current, showTime) : placeholder}\n </span>\n </button>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content align=\"start\" sideOffset={8} style={{ zIndex: 'var(--sys-z-20)' }}>\n <DateTimePicker\n {...pickerProps}\n showTime={showTime}\n value={current}\n onApply={(next) => {\n setInternal(next);\n onValueChange?.(next);\n setOpen(false);\n }}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n )}\n </Field>\n );\n },\n);\nDatePicker.displayName = 'DatePicker';\n","import * as React from 'react';\nimport { CheckCircle, WarningCircle } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Label } from './Label';\n\nexport type FieldStatus = 'default' | 'success' | 'error';\n\n/**\n * Classes for a bordered field surface (Figma: Text Input / Textarea / Select).\n * Hover and the open \"select\" state use `input-accent`; success and error swap\n * the border colour. Focus is handled by the global `:focus-visible` ring.\n */\nexport function fieldSurfaceClasses(status: FieldStatus = 'default') {\n return cn(\n 'border bg-surface text-surface-foreground transition-colors',\n status === 'success' && 'border-success-foreground',\n status === 'error' && 'border-destructive',\n status === 'default' && 'border-input-muted hover:border-input-accent',\n );\n}\n\nexport interface FieldControlProps {\n id: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: true;\n}\n\nexport interface FieldProps {\n /** Label shown above the control. */\n label?: React.ReactNode;\n /** Neutral helper text shown under the control. Replaced by `message` on success/error. */\n description?: React.ReactNode;\n /** Status message shown with an icon when `status` is `success` or `error`. */\n message?: React.ReactNode;\n status?: FieldStatus;\n /** Id for the control; generated when omitted. */\n id?: string;\n className?: string;\n /** Render the control, spreading the supplied props onto it. */\n children: (control: FieldControlProps) => React.ReactNode;\n}\n\n/**\n * Label + control + helper/status message, wired together with\n * `htmlFor`/`aria-describedby`/`aria-invalid`. Shared by Text Input, Textarea,\n * Select, Numerical input and Input with action.\n */\nexport function Field({ label, description, message, status = 'default', id, className, children }: FieldProps) {\n const generatedId = React.useId();\n const controlId = id ?? generatedId;\n const messageId = `${controlId}-message`;\n const showStatus = status !== 'default' && message != null;\n const text = showStatus ? message : description;\n\n return (\n <div className={cn('flex w-full flex-col gap-1.5', className)}>\n {label != null && <Label htmlFor={controlId}>{label}</Label>}\n {children({\n id: controlId,\n 'aria-describedby': text != null ? messageId : undefined,\n 'aria-invalid': status === 'error' ? true : undefined,\n })}\n {text != null && (\n <p\n id={messageId}\n className={cn(\n 'flex gap-2 text-ui-caption',\n status === 'default' && 'text-secondary-muted-foreground',\n status === 'success' && 'items-center text-success-foreground',\n status === 'error' && 'items-start text-destructive',\n )}\n >\n {showStatus &&\n (status === 'error' ? (\n <WarningCircle size={16} aria-hidden className=\"shrink-0\" />\n ) : (\n <CheckCircle size={16} aria-hidden className=\"shrink-0\" />\n ))}\n {text}\n </p>\n )}\n </div>\n );\n}\n","/** `September 23, 2026 - 11:30 AM` (or just the date when `showTime` is false). */\nexport function formatDateTime(date: Date, showTime = true) {\n const day = date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' });\n if (!showTime) return day;\n return `${day} - ${date.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' })}`;\n}\n","import * as React from 'react';\nimport { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { TabItem } from '../Navigation/TabItem';\nimport { TabNavigation, Tabs } from '../Navigation/TabNavigation';\n\nexport interface TimeValue {\n /** 1–12 */\n hour: number;\n /** 0–59 */\n minute: number;\n period: 'AM' | 'PM';\n}\n\nexport interface TimeItemProps extends React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> {\n /** Dashed outline to suggest this slot. */\n recommended?: boolean;\n}\n\n// Figma: Calendar (25) › Time Item — a 12px/16px chip; selected is the subtle fill, hover is accent-soft.\nexport const TimeItem = React.forwardRef<React.ElementRef<typeof ToggleGroupPrimitive.Item>, TimeItemProps>(\n ({ className, recommended, ...props }, ref) => (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'flex w-full justify-center rounded-sm px-2.5 py-1.5 text-ui-caption text-secondary-muted-foreground transition-colors',\n 'hover:bg-accent-soft hover:text-accent-soft-foreground',\n 'data-[state=on]:bg-secondary data-[state=on]:bg-linear-to-r data-[state=on]:from-overlay-dark-5 data-[state=on]:to-overlay-dark-5 data-[state=on]:text-surface-foreground',\n 'data-[state=on]:hover:bg-accent-soft data-[state=on]:hover:bg-none data-[state=on]:hover:text-accent-soft-foreground',\n 'disabled:pointer-events-none disabled:opacity-60 disabled:text-muted-foreground',\n recommended && 'border border-dashed border-border text-surface-foreground',\n className,\n )}\n {...props}\n />\n ),\n);\nTimeItem.displayName = 'TimeItem';\n\nexport interface TimePickerProps {\n value?: TimeValue;\n onValueChange?: (value: TimeValue) => void;\n /** Minute interval between options. */\n minuteStep?: number;\n isHourDisabled?: (hour: number, period: 'AM' | 'PM') => boolean;\n isMinuteDisabled?: (minute: number, hour: number, period: 'AM' | 'PM') => boolean;\n isHourRecommended?: (hour: number, period: 'AM' | 'PM') => boolean;\n isMinuteRecommended?: (minute: number, hour: number, period: 'AM' | 'PM') => boolean;\n className?: string;\n}\n\nconst pad = (n: number) => String(n).padStart(2, '0');\n\n/** Figma: Calendar (25) › Time Picker Panel — AM/PM switch with hour and minute columns. */\nexport function TimePicker({\n value,\n onValueChange,\n minuteStep = 5,\n isHourDisabled,\n isMinuteDisabled,\n isHourRecommended,\n isMinuteRecommended,\n className,\n}: TimePickerProps) {\n const current: TimeValue = value ?? { hour: 12, minute: 0, period: 'AM' };\n const root = React.useRef<HTMLDivElement>(null);\n // Bring the selected hour / minute into view when the (scrollable) columns mount.\n React.useEffect(() => {\n root.current?.querySelectorAll<HTMLElement>('[data-state=\"on\"]').forEach((item) => {\n const column = item.parentElement;\n if (column) column.scrollTop = Math.max(0, item.offsetTop - column.offsetTop - column.clientHeight / 2 + item.clientHeight / 2);\n });\n }, []);\n const hours = Array.from({ length: 12 }, (_, i) => i + 1);\n const minutes = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => i * minuteStep);\n\n return (\n <div ref={root} className={cn('flex w-45 flex-col gap-4 pt-2', className)}>\n <p className=\"text-ui-label text-surface-foreground\">Select Time</p>\n <Tabs\n value={current.period}\n onValueChange={(period) => onValueChange?.({ ...current, period: period as 'AM' | 'PM' })}\n >\n <TabNavigation variant=\"toggle\" aria-label=\"AM or PM\" className=\"self-start\">\n {(['AM', 'PM'] as const).map((period) => (\n <TabItem key={period} value={period}>\n {period}\n </TabItem>\n ))}\n </TabNavigation>\n </Tabs>\n <div className=\"flex h-47.5 w-full items-start gap-3\">\n <ToggleGroupPrimitive.Root\n type=\"single\"\n aria-label=\"Hour\"\n value={String(current.hour)}\n onValueChange={(next) => next && onValueChange?.({ ...current, hour: Number(next) })}\n className=\"flex h-full min-w-0 flex-1 flex-col gap-1 overflow-y-auto\"\n >\n {hours.map((hour) => (\n <TimeItem\n key={hour}\n value={String(hour)}\n disabled={isHourDisabled?.(hour, current.period)}\n recommended={isHourRecommended?.(hour, current.period)}\n >\n {pad(hour)}\n </TimeItem>\n ))}\n </ToggleGroupPrimitive.Root>\n <div className=\"flex h-full items-center text-ui-label-large text-surface-foreground\" aria-hidden=\"true\">\n :\n </div>\n <ToggleGroupPrimitive.Root\n type=\"single\"\n aria-label=\"Minute\"\n value={String(current.minute)}\n onValueChange={(next) => next && onValueChange?.({ ...current, minute: Number(next) })}\n className=\"flex h-full min-w-0 flex-1 flex-col gap-1 overflow-y-auto\"\n >\n {minutes.map((minute) => (\n <TimeItem\n key={minute}\n value={String(minute)}\n disabled={isMinuteDisabled?.(minute, current.hour, current.period)}\n recommended={isMinuteRecommended?.(minute, current.hour, current.period)}\n >\n {pad(minute)}\n </TimeItem>\n ))}\n </ToggleGroupPrimitive.Root>\n </div>\n </div>\n );\n}\n","import * as React from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { TabNavigationContext } from './TabNavigation';\n\nexport type TabItemProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>;\n\n// Figma: Tab Item (08). The shape and states follow the parent TabNavigation variant.\nconst base =\n 'inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap px-2.5 py-1 text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50';\n// `relative` puts the tab above the TabNavigation's sliding indicator, which draws the selected tab's background.\nconst filter =\n 'relative rounded-full text-surface-foreground hover:text-accent data-[state=active]:hover:bg-accent-soft data-[state=active]:hover:text-accent-soft-foreground disabled:text-muted-foreground';\nconst toggle =\n 'relative rounded-sm text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:text-surface-foreground';\n\n// Page-level tab bar: the tab fills the bar's height; the active one is semibold with a 2px accent underline.\nconst underline =\n 'relative h-full rounded-none px-4 py-3 font-medium text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:font-semibold data-[state=active]:text-surface-foreground after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 data-[state=active]:after:bg-accent';\n\nexport const TabItem = React.forwardRef<React.ElementRef<typeof TabsPrimitive.Trigger>, TabItemProps>(\n ({ className, ...props }, ref) => {\n const variant = React.useContext(TabNavigationContext);\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(base, variant === 'toggle' ? toggle : variant === 'underline' ? underline : filter, className)}\n {...props}\n />\n );\n },\n);\nTabItem.displayName = 'TabItem';\n","import * as React from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\n/** `filter` is the pill-shaped table filter; `toggle` is the icon-only mode switch; `underline` is the page-level tab bar (give it the height of its bar, e.g. `h-16`; the active tab gets an accent underline). */\nexport type TabNavigationVariant = 'filter' | 'toggle' | 'underline';\n\nexport const TabNavigationContext = React.createContext<TabNavigationVariant>('filter');\n\nconst tabNavigationVariants = cva('inline-flex items-start gap-1 p-0.5', {\n variants: {\n variant: {\n // `relative`: the sliding indicator is positioned against the list.\n filter: 'relative rounded-full border border-border bg-surface',\n toggle: 'relative rounded-md bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5',\n underline: 'items-stretch p-0',\n },\n },\n defaultVariants: { variant: 'filter' },\n});\n\n/** Radix `Tabs.Root` — owns the selected value; pair with `TabNavigation` + `TabItem` + `TabsContent`. */\nexport const Tabs = TabsPrimitive.Root;\nexport const TabsContent = TabsPrimitive.Content;\n\nexport interface TabNavigationProps\n extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>,\n VariantProps<typeof tabNavigationVariants> {}\n\ninterface Box {\n left: number\n top: number\n width: number\n height: number\n}\n\n// The selected tab's background is one element that slides to the newly selected tab (filter and toggle variants), instead of\n// each tab painting its own: it is measured from the active tab and follows it as the selection or the size of the list changes.\nconst indicatorClasses: Record<'filter' | 'toggle', string> = {\n filter: 'rounded-full bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5',\n toggle: 'rounded-sm bg-surface',\n};\n\nexport const TabNavigation = React.forwardRef<React.ElementRef<typeof TabsPrimitive.List>, TabNavigationProps>(\n ({ className, variant = 'filter', children, ...props }, forwardedRef) => {\n const kind = variant ?? 'filter';\n const slides = kind !== 'underline';\n const listRef = React.useRef<HTMLDivElement | null>(null);\n const [box, setBox] = React.useState<Box | null>(null);\n // The first placement is instant; only later moves are animated.\n const [animate, setAnimate] = React.useState(false);\n\n const setRefs = React.useCallback(\n (node: HTMLDivElement | null) => {\n listRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) (forwardedRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [forwardedRef],\n );\n\n React.useLayoutEffect(() => {\n const list = listRef.current;\n if (!slides || !list) return;\n const measure = () => {\n const active = list.querySelector<HTMLElement>('[role=\"tab\"][data-state=\"active\"]');\n const next = active ? { left: active.offsetLeft, top: active.offsetTop, width: active.offsetWidth, height: active.offsetHeight } : null;\n setBox((prev) => (prev && next && prev.left === next.left && prev.top === next.top && prev.width === next.width && prev.height === next.height ? prev : next));\n };\n measure();\n const mutations = new MutationObserver(measure);\n mutations.observe(list, { attributes: true, attributeFilter: ['data-state'], subtree: true, childList: true });\n const resizes = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(measure);\n resizes?.observe(list);\n const frame = requestAnimationFrame(() => setAnimate(true));\n return () => {\n mutations.disconnect();\n resizes?.disconnect();\n cancelAnimationFrame(frame);\n };\n }, [slides]);\n\n return (\n <TabNavigationContext.Provider value={kind}>\n <TabsPrimitive.List ref={setRefs} className={cn(tabNavigationVariants({ variant }), className)} {...props}>\n {slides && box && (\n <span\n aria-hidden\n data-slot=\"tab-indicator\"\n className={cn(\n 'pointer-events-none absolute',\n indicatorClasses[kind as 'filter' | 'toggle'],\n animate && 'transition-[left,top,width,height] duration-200 ease-out motion-reduce:transition-none',\n )}\n style={{ left: box.left, top: box.top, width: box.width, height: box.height }}\n />\n )}\n {children}\n </TabsPrimitive.List>\n </TabNavigationContext.Provider>\n );\n },\n);\nTabNavigation.displayName = 'TabNavigation';\n","import * as React from 'react';\nimport { Slot } from 'radix-ui';\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\n\nimport { cn } from '../../lib/utils';\nimport { Label } from './Label';\n\nexport const Form = FormProvider;\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nexport function FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(props: ControllerProps<TFieldValues, TName>) {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nexport function useFormField() {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext?.name });\n\n if (!fieldContext) {\n throw new Error('useFormField must be used within <FormField>');\n }\n if (!itemContext) {\n throw new Error('useFormField must be used within <FormItem>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n}\n\nexport type FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const FormItem = React.forwardRef<HTMLDivElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('flex flex-col gap-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n});\nFormItem.displayName = 'FormItem';\n\n// Deliberately not `ComponentPropsWithoutRef<typeof Label>` — that type\n// transitively references a private @radix-ui/react-label type that tsup's\n// declaration build can't re-export portably. Label's own prop surface is\n// just native label attributes, so this is equivalent.\nexport type FormLabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;\n\nexport const FormLabel = React.forwardRef<HTMLLabelElement, FormLabelProps>(\n ({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n return (\n <Label\n ref={ref}\n htmlFor={formItemId}\n className={cn(error && 'text-destructive-foreground', className)}\n {...props}\n />\n );\n },\n);\nFormLabel.displayName = 'FormLabel';\n\nexport type FormControlProps = React.ComponentPropsWithoutRef<typeof Slot.Root>;\n\nexport const FormControl = React.forwardRef<React.ElementRef<typeof Slot.Root>, FormControlProps>((props, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n return (\n <Slot.Root\n ref={ref}\n id={formItemId}\n aria-describedby={error ? `${formDescriptionId} ${formMessageId}` : formDescriptionId}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = 'FormControl';\n\nexport type FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nexport const FormDescription = React.forwardRef<HTMLParagraphElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-sm text-secondary-muted-foreground', className)}\n {...props}\n />\n );\n },\n);\nFormDescription.displayName = 'FormDescription';\n\nexport type FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nexport const FormMessage = React.forwardRef<HTMLParagraphElement, FormMessageProps>(\n ({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn('text-sm text-destructive-foreground', className)} {...props}>\n {body}\n </p>\n );\n },\n);\nFormMessage.displayName = 'FormMessage';\n","import * as React from 'react';\nimport { PencilSimple, WarningCircle } from '@phosphor-icons/react';\n\nimport { cn, lengthOutOfRange } from '../../lib/utils';\nimport { fieldSurfaceClasses } from './Field';\nimport { DraftMarks, MarkedText, remapMarks, splitMarks, type InlineEditMark } from './MarkedText';\n\nexport type { InlineEditMark };\n\nexport interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n /** Controlled value. Pair with `onValueChange`. */\n value?: string;\n defaultValue?: string;\n /** Called when an edit is committed (Enter, blur or the commit key for multiline) with a changed value. */\n onValueChange?: (value: string) => void;\n /** Shown in read mode while the value is empty, muted unless `placeholderTone` says otherwise. */\n placeholder?: string;\n /** `regular` shows the placeholder in the normal text colour instead of the muted one, for hints that read as real content. Default `muted`. */\n placeholderTone?: 'muted' | 'regular';\n /** Accessible name for the read button and the field. Required: there is no visible label. */\n 'aria-label': string;\n /** Use a textarea. Enter inserts a line break; Cmd/Ctrl+Enter commits. */\n multiline?: boolean;\n maxLength?: number;\n /**\n * Shortest value (in characters, ignoring surrounding spaces) that may be saved. An edit that is too short is not saved:\n * the field stays open with an error message, and Escape still reverts.\n */\n minLength?: number;\n /**\n * Checks an edit before it is saved (on Enter or blur). Return a message to refuse it: the field stays open showing the\n * message and `onValueChange` is not called. Return nothing (or `null`) to accept. Runs after `minLength`.\n */\n validate?: (value: string) => string | null | undefined;\n /**\n * While editing, shows the allowed length under the field (from `minLength` and `maxLength`) with a live character\n * counter, but only while the text is too short or too long (the count is an error hint, not a running total). After a\n * refused save the same line turns into the error state (error colour and icon) instead of a different message appears.\n */\n showLimits?: boolean;\n /**\n * Multiline only: Enter saves (like a single-line field) and Shift+Enter inserts a line break. Cmd/Ctrl+Enter keeps\n * saving too. The `question` variant already works this way.\n */\n submitOnEnter?: boolean;\n disabled?: boolean;\n /**\n * Opens the field for editing when it turns `true` (or is `true` on mount), as if the read button was clicked, for example when the\n * row or card it belongs to is selected. The field is focused without scrolling the page. Editing still ends the usual way (Enter,\n * blur or Escape) and `onEditingChange` reports it; set `editing` back to `false` before asking again. Leave it out to open on click only.\n */\n editing?: boolean;\n /** Called when editing starts or ends. */\n onEditingChange?: (editing: boolean) => void;\n /** Called on every keystroke while editing (and with the saved value when editing ends), e.g. for a live character counter. */\n onDraftChange?: (value: string) => void;\n /**\n * `default` is a rounded field. A short single-line label shows the pencil and hugs its text; `multiline` (longer\n * text) hides the pencil and fills the width. `question` is for question text: it fills the width with no pencil,\n * has square corners and shows a 1px bottom border on hover and focus (in the input border colour) that becomes a bolder 2px muted accent border while `selected` (light enough to stay distinct from the destructive underline of a marked word). Enter saves; Shift+Enter adds a\n * line break when `multiline`.\n */\n variant?: 'default' | 'question';\n /** `question` variant: keeps the bottom border while the owning question is selected. */\n selected?: boolean;\n /** Classes for the displayed/edited text, e.g. a heading text style. The field itself keeps the same box. */\n textClassName?: string;\n /**\n * Ranges of the saved text to underline in the destructive colour, for example misspelled words found by a spell checker. `start` is the\n * first character and `end` the one after the last. While the field is being edited the underlines stay (as plain lines: they take no click),\n * moving with the text typed after them and going away when the words they mark are changed. Ranges that are out of bounds, empty or\n * overlapping are ignored.\n */\n marks?: InlineEditMark[];\n /**\n * Makes each mark clickable: clicking an underlined word opens a small card with the marked text, its `suggestions` and a Dismiss action,\n * instead of starting the edit. Called with the mark and the suggestion the reader chose; apply it to the value yourself.\n */\n onMarkApply?: (mark: InlineEditMark, replacement: string) => void;\n /** Called when the reader dismisses a mark from its card. Remove the mark to make the underline go away. */\n onMarkDismiss?: (mark: InlineEditMark) => void;\n}\n\n/** \"150 characters required\" (the maximum shows in the live count beside it), or \"Up to 500 characters\" when there is no minimum. */\nfunction limitsText(min?: number, max?: number) {\n if (min !== undefined) return `${min} ${min === 1 ? 'character' : 'characters'} required`;\n if (max !== undefined) return `Up to ${max} characters`;\n return '';\n}\n\n// Not in Figma: shadcn has no inline-edit primitive, so this is a plain toggle between a button and a field.\n// Read mode is a button (so it is keyboard- and screen-reader-reachable); editing swaps in an input that commits on\n// Enter/blur and reverts on Escape.\nexport const InlineEdit = React.forwardRef<HTMLDivElement, InlineEditProps>(\n (\n {\n className,\n textClassName,\n marks,\n onMarkApply,\n onMarkDismiss,\n value: valueProp,\n defaultValue = '',\n onValueChange,\n placeholder = 'Click to edit',\n placeholderTone = 'muted',\n multiline,\n maxLength,\n minLength,\n validate,\n showLimits,\n submitOnEnter,\n disabled,\n editing: openRequested,\n onEditingChange,\n onDraftChange,\n variant = 'default',\n selected,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState(defaultValue);\n const value = valueProp ?? internal;\n const [editing, setEditing] = React.useState(false);\n const [draft, setDraft] = React.useState(value);\n // The reason the last attempt to save was refused; cleared by the next valid keystroke, Escape or a save.\n const [error, setError] = React.useState<string | null>(null);\n const errorId = React.useId();\n // The limits and the live count show only when the text is too short or too long (or a save was refused), never while it is fine.\n const limitsVisible = !!showLimits && (!!error || lengthOutOfRange(draft, minLength, maxLength));\n const fieldRef = React.useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n // A one-line field scrolls sideways when its text is longer than the box; the underlines follow.\n const [scroll, setScroll] = React.useState(0);\n // The marks as they stand while the text is edited: carried over keystroke by keystroke (see `remapMarks`).\n const [draftMarks, setDraftMarks] = React.useState<InlineEditMark[]>([]);\n const readRef = React.useRef<HTMLButtonElement>(null);\n // Set while an Escape revert is pending so the blur that follows it does not commit.\n const cancelled = React.useRef(false);\n const restoreFocus = React.useRef(false);\n // Set when the `editing` prop opened the field: it is focused without scrolling the page.\n const openedByProp = React.useRef(false);\n\n React.useEffect(() => {\n if (editing) {\n fieldRef.current?.focus(openedByProp.current ? { preventScroll: true } : undefined);\n openedByProp.current = false;\n fieldRef.current?.select();\n } else if (restoreFocus.current) {\n restoreFocus.current = false;\n readRef.current?.focus();\n }\n }, [editing]);\n\n const problemWith = (text: string) => {\n if (minLength !== undefined && text.trim().length < minLength) {\n return `Enter at least ${minLength} characters (${text.trim().length} now).`;\n }\n return validate?.(text) ?? null;\n };\n\n const start = () => {\n if (disabled) return;\n setDraft(value);\n setDraftMarks(marks ?? []);\n setError(null);\n cancelled.current = false;\n setEditing(true);\n onEditingChange?.(true);\n };\n // The parent asks for edit mode: open once each time `editing` turns true.\n React.useEffect(() => {\n if (openRequested && !editing && !disabled) {\n openedByProp.current = true;\n start();\n }\n // Only a change of the request opens the field; a value change while it is true does not reopen it.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [openRequested]);\n\n const finish = (commit: boolean, refocus: boolean) => {\n if (commit && draft !== value) {\n // An edit that fails validation is not saved: the field stays open and says why.\n const problem = problemWith(draft);\n if (problem) {\n setError(problem);\n return;\n }\n }\n setError(null);\n restoreFocus.current = refocus;\n if (commit && draft !== value) {\n if (valueProp === undefined) setInternal(draft);\n onValueChange?.(draft);\n }\n setEditing(false);\n onEditingChange?.(false);\n onDraftChange?.(commit ? draft : value);\n };\n\n const textClasses = cn('text-ui-input-value text-surface-foreground', textClassName);\n const question = variant === 'question';\n const draftMarksClass = cn('px-3 py-1', question ? 'border-0 border-b-2 border-transparent' : 'border border-transparent', multiline ? 'whitespace-pre-wrap break-words' : 'whitespace-pre', textClasses);\n // Longer text and question text fill the box and drop the pencil; a short label hugs its text.\n const fill = multiline || question;\n\n return (\n <div\n ref={ref}\n className={cn(fill ? 'flex w-full min-w-0' : 'inline-flex min-w-0 max-w-full', editing && (error || limitsVisible) && 'flex-col gap-1.5', className)}\n {...props}\n >\n {editing ? (\n <>\n {/* With marks, the highlight layer sits behind the field: a one-line or multi-line field with a surface of its own hands it to this wrapper, so the layer shows through. */}\n <div className={cn('relative flex w-full min-w-0', draftMarks.length > 0 && !question && 'rounded-md bg-surface')}>\n {draftMarks.length > 0 && (\n <DraftMarks\n layer=\"behind\"\n singleLine={!multiline}\n text={draft}\n marks={draftMarks}\n scrollLeft={multiline ? 0 : scroll}\n // The field's own box and type, so every line lands under its words.\n className={draftMarksClass}\n />\n )}\n {React.createElement(multiline ? 'textarea' : 'input', {\n ref: fieldRef,\n value: draft,\n maxLength,\n 'aria-label': ariaLabel,\n 'aria-invalid': error ? true : undefined,\n 'aria-describedby': error || limitsVisible ? errorId : undefined,\n ...(multiline ? { rows: 1 } : { type: 'text' }),\n className: cn(\n 'relative w-full px-3 py-1 outline-none',\n multiline && 'field-sizing-content resize-none',\n question\n ? cn('rounded-none border-0 border-b-2 bg-transparent', error ? 'border-destructive' : 'border-accent-muted')\n : cn('rounded-md', !error && 'focus-visible:border-input-accent', fieldSurfaceClasses(error ? 'error' : 'default')),\n textClasses,\n // Transparent over the highlight layer, so the highlight and the browser's text selection show together.\n draftMarks.length > 0 && 'bg-transparent',\n ),\n onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n setDraft(event.target.value);\n setDraftMarks(remapMarks(draft, event.target.value, draftMarks));\n requestAnimationFrame(() => setScroll(fieldRef.current?.scrollLeft ?? 0));\n // After a refused save, the message follows what is typed and goes away as soon as the text is acceptable.\n if (error) setError(problemWith(event.target.value));\n onDraftChange?.(event.target.value);\n },\n onKeyDown: (event: React.KeyboardEvent) => {\n if (event.key === 'Escape') {\n cancelled.current = true;\n setError(null);\n finish(false, true);\n } else if (\n event.key === 'Enter' &&\n (!multiline || event.metaKey || event.ctrlKey || ((question || submitOnEnter) && !event.shiftKey))\n ) {\n event.preventDefault();\n finish(true, true);\n }\n },\n onScroll: (event: React.UIEvent<HTMLInputElement | HTMLTextAreaElement>) => setScroll(event.currentTarget.scrollLeft),\n onBlur: () => {\n if (!cancelled.current) finish(true, false);\n },\n })}\n {draftMarks.length > 0 && (\n <DraftMarks\n layer=\"over\"\n singleLine={!multiline}\n text={draft}\n marks={draftMarks}\n scrollLeft={multiline ? 0 : scroll}\n // The field's own box and type, so every line lands under its words.\n className={draftMarksClass}\n />\n )}\n </div>\n {(error || limitsVisible) && (\n <p\n id={errorId}\n role={error ? 'alert' : undefined}\n className={cn('flex items-start justify-between gap-2 px-3 text-ui-caption', error ? 'text-destructive' : 'text-secondary-muted-foreground')}\n >\n <span className=\"flex items-start gap-2\">\n {error && <WarningCircle size={16} aria-hidden className=\"shrink-0\" />}\n {limitsVisible ? limitsText(minLength, maxLength) : error}\n {/* The line stays the same in the error state; screen readers also get the reason. */}\n {limitsVisible && error && <span className=\"sr-only\">{error}</span>}\n </span>\n {limitsVisible && (\n <span aria-hidden className=\"shrink-0 tabular-nums\">\n {draft.length}\n {maxLength !== undefined && `/${maxLength}`}\n </span>\n )}\n </p>\n )}\n </>\n ) : (\n <button\n ref={readRef}\n type=\"button\"\n disabled={disabled}\n aria-label={`${ariaLabel}: ${value || placeholder}. Edit`}\n onClick={start}\n className={cn(\n 'group inline-flex min-w-0 max-w-full items-center gap-2 px-3 text-left outline-none',\n fill && 'w-full',\n question\n ? // Hover and focus show a 1px bottom border in the input colour; only a selected question gets the 2px muted accent\n // one. The extra 1px of bottom padding keeps the height identical so the text never jumps.\n selected\n ? 'rounded-none border-b-2 border-accent-muted py-1'\n : 'rounded-none border-b border-transparent pb-1.25 pt-1 enabled:hover:border-input-muted enabled:focus-visible:border-input-muted'\n : 'rounded-md border border-transparent py-1 enabled:focus-visible:border-input-accent',\n // The text is editable in place, so hovering it shows the text cursor.\n // A selected question already stands out, so its text field takes no hover background.\n question && selected ? 'enabled:cursor-text' : 'enabled:cursor-text enabled:hover:bg-secondary',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n textClasses,\n )}\n >\n <span className={cn('min-w-0', multiline ? 'whitespace-pre-wrap' : 'truncate', fill && 'flex-1', !value && placeholderTone === 'muted' && 'text-muted-foreground')}>\n {value\n ? splitMarks(value, marks).map((piece) =>\n piece.mark ? (\n <MarkedText key={`${piece.mark.start}:${piece.text}`} mark={piece.mark} text={piece.text} onApply={onMarkApply} onDismiss={onMarkDismiss} />\n ) : (\n piece.text\n ),\n )\n : placeholder}\n </span>\n {!fill && (\n <PencilSimple\n size={16}\n aria-hidden\n className=\"shrink-0 text-secondary-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100\"\n />\n )}\n </button>\n )}\n </div>\n );\n },\n);\nInlineEdit.displayName = 'InlineEdit';\n","import * as React from 'react';\nimport { Trash } from '@phosphor-icons/react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\n// Internal: the underlined, clickable words shared by the text fields that can mark them (InlineEdit, QuestionOptionEditor). Only `InlineEditMark` is public.\n\nexport interface InlineEditMark {\n start: number;\n end: number;\n /** Corrections offered in the mark's card, best first (at most three are shown). Used with `onMarkApply`: with one the card has an Apply button; with several each is a choice applied by a click on it and there is no Apply button. An empty string offers to remove the marked text (the button reads \"Remove\"). */\n suggestions?: string[];\n /** The colour of the underline: `destructive` (default, for mistakes such as typos) or `warning` (for a recommendation, such as wording that could be clearer). */\n tone?: 'destructive' | 'warning';\n /** Why the words are marked, shown in the mark's card above the suggestions. Without it the card is unchanged. */\n message?: string;\n}\n\n/** The text split into plain and marked pieces; marks that don't fit the text are dropped. */\nexport function splitMarks(text: string, marks: InlineEditMark[] | undefined): { text: string; mark?: InlineEditMark }[] {\n const valid = (marks ?? []).filter((m) => Number.isInteger(m.start) && Number.isInteger(m.end) && m.start >= 0 && m.end > m.start && m.end <= text.length).sort((a, b) => a.start - b.start);\n const out: { text: string; mark?: InlineEditMark }[] = [];\n let at = 0;\n for (const m of valid) {\n if (m.start < at) continue;\n if (m.start > at) out.push({ text: text.slice(at, m.start) });\n out.push({ text: text.slice(m.start, m.end), mark: m });\n at = m.end;\n }\n if (at < text.length) out.push({ text: text.slice(at) });\n return out;\n}\n\n// The line under a marked word is destructive or warning (a warning mark also has the warning highlight behind the words). It is not drawn by the word's own box\n// but by one box per line of the word (`MarkLines`), so on a title that wraps every line reaches the field's edges the same way.\nconst lineClasses = (tone: InlineEditMark['tone'], hovered: boolean) =>\n cn('pointer-events-none absolute -z-10 rounded-xxs border-b-2', tone === 'warning' ? 'border-warning-foreground bg-warning-background-highlight' : cn('border-destructive-foreground', hovered && 'bg-destructive-soft'));\n\ninterface MarkLine {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\ninterface FieldBox {\n top: number;\n bottom: number;\n /** The text area inside the field's border and padding. */\n contentTop: number;\n contentBottom: number;\n lineHeight: number;\n}\n\n/**\n * The box of each line of a marked word, relative to `origin`. Each one is the line's own height, except that the first line reaches the field's top edge and the last\n * line the field's bottom edge: its line then lands exactly on the field's own bottom border (the field's hover and selected underline), covering it instead of showing a\n * second one a few pixels above. `rects` are the word's pieces, one per line. Without a field, each piece is its own box.\n */\nexport function markLines(rects: { left: number; top: number; width: number; height: number }[], origin: { left: number; top: number }, field?: FieldBox): MarkLine[] {\n const count = field ? Math.max(1, Math.round((field.contentBottom - field.contentTop) / field.lineHeight)) : 1;\n const boxes = rects\n .filter((r) => r.width > 0)\n .map((r) => {\n if (!field) return { left: r.left - origin.left, top: r.top - origin.top, width: r.width, height: r.height };\n const index = Math.min(count - 1, Math.max(0, Math.floor((r.top + r.height / 2 - field.contentTop) / field.lineHeight)));\n const top = index === 0 ? field.top : field.contentTop + index * field.lineHeight;\n const bottom = index === count - 1 ? field.bottom : field.contentTop + (index + 1) * field.lineHeight;\n return { left: r.left - origin.left, top: top - origin.top, width: r.width, height: bottom - top };\n });\n // A line can come in several pieces (the space where the text wraps is one): they make one box.\n return boxes.reduce<MarkLine[]>((out, box) => {\n const same = field ? out.find((o) => Math.abs(o.top - box.top) < 0.5 && Math.abs(o.height - box.height) < 0.5) : undefined;\n if (!same) return [...out, box];\n const left = Math.min(same.left, box.left);\n const right = Math.max(same.left + same.width, box.left + box.width);\n return out.map((o) => (o === same ? { ...o, left, width: right - left } : o));\n }, []);\n}\n\nconst sameLines = (a: MarkLine[], b: MarkLine[]) => a.length === b.length && a.every((l, i) => (Object.keys(l) as (keyof MarkLine)[]).every((k) => Math.abs(l[k] - b[i][k]) < 0.5));\n\n/** Measures the lines of a marked word after every render (a word can move when the text before it changes) and when the field changes size. */\nfunction useMarkLines(anchorRef: React.RefObject<HTMLSpanElement | null>, markRef: React.RefObject<HTMLSpanElement | null>) {\n const [lines, setLines] = React.useState<MarkLine[]>([]);\n const measure = React.useCallback(() => {\n const anchor = anchorRef.current;\n const mark = markRef.current;\n if (!anchor || !mark) return;\n const button = mark.closest('button');\n const a = anchor.getBoundingClientRect();\n let field: FieldBox | undefined;\n if (button) {\n const b = button.getBoundingClientRect();\n const style = getComputedStyle(button);\n const contentTop = b.top + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.paddingTop) || 0);\n const contentBottom = b.bottom - (parseFloat(style.borderBottomWidth) || 0) - (parseFloat(style.paddingBottom) || 0);\n field = { top: b.top, bottom: b.bottom, contentTop, contentBottom, lineHeight: parseFloat(style.lineHeight) || contentBottom - contentTop };\n }\n const next = markLines([...mark.getClientRects()], a, field);\n setLines((prev) => (sameLines(prev, next) ? prev : next));\n }, [anchorRef, markRef]);\n React.useLayoutEffect(measure);\n React.useLayoutEffect(() => {\n const button = markRef.current?.closest('button');\n if (!button) return;\n const observer = new ResizeObserver(measure);\n observer.observe(button);\n return () => observer.disconnect();\n }, [markRef, measure]);\n return lines;\n}\n\n/**\n * The marks of the saved text carried over to the text being edited, so the underlines stay while the field is open: the part before the edit keeps its marks,\n * the part after it keeps them moved by the change in length, and a mark the edit touches is dropped (those words are being rewritten).\n */\nexport function remapMarks(saved: string, draft: string, marks: InlineEditMark[] | undefined): InlineEditMark[] {\n if (!marks?.length) return [];\n if (saved === draft) return marks;\n const max = Math.min(saved.length, draft.length);\n let before = 0;\n while (before < max && saved[before] === draft[before]) before += 1;\n let after = 0;\n while (after < max - before && saved[saved.length - 1 - after] === draft[draft.length - 1 - after]) after += 1;\n const editEnd = saved.length - after;\n const delta = draft.length - saved.length;\n return marks.flatMap((m) => (m.end <= before ? [m] : m.start >= editEnd ? [{ ...m, start: m.start + delta, end: m.end + delta }] : []));\n}\n\n/**\n * The highlight and the underline of a field's marks while the field is being edited, drawn in two layers so the field looks as it does when it is not edited:\n * the same box per line of the marked words (see `markLines`), the first line reaching the field's top and the last line's underline landing on its bottom border.\n * - `behind` goes before the field and draws the highlight; the field is transparent and painted over it, so its letters and the browser's text selection show over the highlight.\n * - `over` goes after the field and draws the underlines, so the last line's underline covers the field's own bottom border.\n * Both hold the same text with invisible letters, to know where each line of the words is and follow the field's horizontal scroll. They never take a click (the field does).\n * `className` must give the text the field's own padding, border and type; `singleLine` is for a field whose text never wraps.\n */\nexport function DraftMarks({ text, marks, layer, className, scrollLeft = 0, singleLine }: { text: string; marks: InlineEditMark[]; layer: 'behind' | 'over'; className?: string; scrollLeft?: number; singleLine?: boolean }) {\n const rootRef = React.useRef<HTMLDivElement>(null);\n const textRef = React.useRef<HTMLDivElement>(null);\n const [boxes, setBoxes] = React.useState<{ tone: string; box: MarkLine }[]>([]);\n React.useLayoutEffect(() => {\n if (textRef.current) textRef.current.scrollLeft = scrollLeft;\n }, [scrollLeft, text]);\n // The boxes follow the text after every render, and are only replaced when they moved.\n React.useLayoutEffect(() => {\n const root = rootRef.current;\n const mirror = textRef.current;\n if (!root || !mirror) return;\n const r = root.getBoundingClientRect();\n const style = getComputedStyle(mirror);\n const contentTop = r.top + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.paddingTop) || 0);\n const contentBottom = r.bottom - (parseFloat(style.borderBottomWidth) || 0) - (parseFloat(style.paddingBottom) || 0);\n const lineHeight = singleLine ? contentBottom - contentTop : parseFloat(style.lineHeight) || contentBottom - contentTop;\n const field: FieldBox = { top: r.top, bottom: r.bottom, contentTop, contentBottom, lineHeight };\n const next = [...mirror.querySelectorAll<HTMLElement>('[data-draft-mark]')].flatMap((el) =>\n markLines([...el.getClientRects()], { left: r.left, top: r.top }, field).map((box) => ({ tone: el.dataset.tone ?? 'destructive', box })),\n );\n setBoxes((prev) => (prev.length === next.length && prev.every((p, i) => p.tone === next[i].tone && sameLines([p.box], [next[i].box])) ? prev : next));\n });\n return (\n <div ref={rootRef} aria-hidden data-draft-marks data-layer={layer} className=\"pointer-events-none absolute inset-0\">\n <div ref={textRef} className={cn(className, 'absolute inset-0 overflow-hidden text-transparent')}>\n {splitMarks(text, marks).map((piece, i) =>\n piece.mark ? (\n <span key={i} data-draft-mark data-tone={piece.mark.tone ?? 'destructive'}>\n {piece.text}\n </span>\n ) : (\n <span key={i}>{piece.text}</span>\n ),\n )}\n </div>\n {/* The boxes may reach a little past the field's edges (the last underline covers its border), but not sideways. */}\n <div className=\"absolute inset-0\" style={{ clipPath: 'inset(-4px 0)' }}>\n {boxes.map(({ tone, box }, i) =>\n layer === 'behind' ? (\n tone === 'warning' && <span key={i} data-draft-box className=\"absolute rounded-xxs bg-warning-background-highlight\" style={box} />\n ) : (\n <span key={i} data-draft-box className={cn('absolute rounded-xxs border-b-2', tone === 'warning' ? 'border-warning-foreground' : 'border-destructive-foreground')} style={box} />\n ),\n )}\n </div>\n </div>\n );\n}\n\n/** The card that is open right now, anywhere on the page: opening another one closes it, so only one is ever open. */\nlet closeOpenMarkCard: (() => void) | null = null;\n\n/** A marked piece of text. Plain underline, or, when the owner handles marks, a button that opens a card to apply a suggestion or dismiss the mark. */\nexport function MarkedText({ mark, text, onApply, onDismiss }: { mark: InlineEditMark; text: string; onApply?: (mark: InlineEditMark, replacement: string) => void; onDismiss?: (mark: InlineEditMark) => void }) {\n const ref = React.useRef<HTMLSpanElement>(null);\n const [open, setOpen] = React.useState(false);\n const close = React.useCallback(() => setOpen(false), []);\n React.useEffect(\n () => () => {\n if (closeOpenMarkCard === close) closeOpenMarkCard = null;\n },\n [close],\n );\n const anchorRef = React.useRef<HTMLSpanElement>(null);\n const [hovered, setHovered] = React.useState(false);\n const lines = useMarkLines(anchorRef, ref);\n // An empty, positioned anchor just before the word holds one box per line of it; the word comes after it and is positioned too, so its letters are painted over them.\n const layers = (\n <span ref={anchorRef} aria-hidden className=\"relative isolate\">\n {lines.map((line, i) => (\n <span key={i} data-mark-line className={lineClasses(mark.tone, hovered)} style={line} />\n ))}\n </span>\n );\n if (!onApply && !onDismiss) {\n return (\n <>\n {layers}\n <span ref={ref} data-mark data-tone={mark.tone ?? 'destructive'} className=\"relative\">\n {text}\n </span>\n </>\n );\n }\n const suggestions = (mark.suggestions ?? []).slice(0, 3);\n const warning = mark.tone === 'warning';\n // The struck-through words are the destructive color for every tone: they are what would be replaced.\n const struck = 'text-destructive-foreground';\n const handleOpenChange = (next: boolean) => {\n if (next) {\n if (closeOpenMarkCard && closeOpenMarkCard !== close) closeOpenMarkCard();\n closeOpenMarkCard = close;\n } else if (closeOpenMarkCard === close) {\n closeOpenMarkCard = null;\n }\n setOpen(next);\n };\n // The mark sits inside the read-mode button, so clicks and keys here must not also start the edit.\n const stop = (event: React.SyntheticEvent) => event.stopPropagation();\n return (\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n {layers}\n <PopoverPrimitive.Trigger asChild>\n <span\n ref={ref}\n data-mark\n data-tone={mark.tone ?? 'destructive'}\n role=\"button\"\n tabIndex={-1}\n onClick={stop}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n className=\"relative cursor-pointer\"\n >\n {text}\n </span>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={8}\n style={{ zIndex: 'var(--sys-z-40)' }}\n onClick={stop}\n onKeyDown={stop}\n // The mark is not focusable, and focus jumping back to it would make a card opened next think focus left it.\n onCloseAutoFocus={(event) => event.preventDefault()}\n className=\"flex w-72 flex-col gap-3 rounded-md border border-border bg-surface p-4 text-left text-body-base font-normal shadow-md outline-none\"\n >\n {suggestions.length > 1 && onApply ? (\n // Several possible fixes: each one is a choice, applied with a click, so there is no Apply button.\n <div className=\"flex flex-col gap-1\" role=\"group\" aria-label=\"Choose a correction\">\n {suggestions.map((suggestion) => (\n <Button key={suggestion} type=\"button\" size=\"sm\" variant=\"ghost\" className=\"h-auto justify-start px-2 py-1 whitespace-normal\" onClick={() => onApply(mark, suggestion)}>\n <s className={struck}>{text}</s> <span className=\"font-semibold text-accent-foreground\">{suggestion === '' ? 'Remove' : suggestion}</span>\n </Button>\n ))}\n </div>\n ) : (\n suggestions.length > 0 && (\n <p className=\"min-w-0 break-words\">\n <s className={struck}>{text}</s>\n {suggestions[0] !== '' && (\n <>\n {' '}\n <span className=\"font-semibold text-accent-foreground\">{suggestions[0]}</span>\n </>\n )}\n </p>\n )\n )}\n {/* The rationale comes after the correction it explains, and before the buttons. */}\n {mark.message && <p className=\"min-w-0 break-words text-body-small text-surface-foreground\">{mark.message}</p>}\n <div className={cn('flex items-center gap-3', warning ? 'justify-end' : 'justify-between')}>\n {onDismiss ? (\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={() => onDismiss(mark)}>\n <Trash size={16} aria-hidden /> Dismiss\n </Button>\n ) : (\n <span />\n )}\n {onApply && suggestions.length === 1 && (\n <Button type=\"button\" size=\"sm\" onClick={() => onApply(mark, suggestions[0])}>\n {suggestions[0] === '' ? 'Remove' : 'Apply'}\n </Button>\n )}\n </div>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { Field, fieldSurfaceClasses, type FieldStatus } from './Field';\n\nexport interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {\n /** Border/message state. `error` also sets `aria-invalid`. */\n status?: FieldStatus;\n /** Convenience: renders a Field (label + helper/status message) around the input. */\n label?: React.ReactNode;\n description?: React.ReactNode;\n message?: React.ReactNode;\n}\n\n// Figma: Text Input (19) — 40px tall, 12px inline padding, 8px radius, 16px value.\nconst inputClasses = (status: FieldStatus | undefined, className?: string) =>\n cn(\n 'flex h-10 w-full rounded-md px-3 py-2 text-ui-input-value placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n fieldSurfaceClasses(status),\n className,\n );\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, status = 'default', label, description, message, id, ...props }, ref) => {\n if (label == null && description == null && message == null) {\n return (\n <input\n ref={ref}\n id={id}\n aria-invalid={status === 'error' ? true : undefined}\n className={inputClasses(status, className)}\n {...props}\n />\n );\n }\n return (\n <Field label={label} description={description} message={message} status={status} id={id}>\n {(control) => <input ref={ref} className={inputClasses(status, className)} {...control} {...props} />}\n </Field>\n );\n },\n);\nInput.displayName = 'Input';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Field, type FieldStatus } from './Field';\n\nexport interface InputWithActionProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {\n /** Label of the trailing action button. */\n actionLabel: string;\n onAction?: React.MouseEventHandler<HTMLButtonElement>;\n /** Chips (e.g. `EditableTag`s) shown inside the field before the input. */\n tags?: React.ReactNode;\n status?: Exclude<FieldStatus, 'success'>;\n label?: React.ReactNode;\n /** Support text shown under the field. */\n description?: React.ReactNode;\n /** Error message shown when `status` is `error`. */\n message?: React.ReactNode;\n}\n\n// Figma: Input with Action (19) — field with a trailing subtle small button (e.g. \"Invite\").\nexport const InputWithAction = React.forwardRef<HTMLInputElement, InputWithActionProps>(\n (\n { className, actionLabel, onAction, tags, status = 'default', label, description, message, id, disabled, placeholder, ...props },\n ref,\n ) => (\n <Field label={label} description={description} message={message} status={status} id={id}>\n {(control) => (\n <div\n className={cn(\n 'flex min-h-10 w-full items-center gap-2 rounded-md border bg-surface py-2 pr-1 pl-3 transition-colors',\n 'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-ring',\n status === 'error' ? 'border-destructive' : 'border-input-muted hover:border-input-accent focus-within:border-input-muted',\n tags ? 'pl-1' : null,\n disabled && 'opacity-50',\n className,\n )}\n >\n {tags && <div className=\"flex shrink-0 items-center gap-1\">{tags}</div>}\n <input\n ref={ref}\n disabled={disabled}\n placeholder={tags ? undefined : placeholder}\n className=\"min-w-0 flex-1 truncate bg-transparent text-body-small text-surface-foreground outline-none placeholder:text-muted-foreground\"\n {...control}\n {...props}\n />\n <Button type=\"button\" variant=\"subtle\" size=\"sm\" disabled={disabled} onClick={onAction}>\n {actionLabel}\n </Button>\n </div>\n )}\n </Field>\n ),\n);\nInputWithAction.displayName = 'InputWithAction';\n","import * as React from 'react';\nimport { Minus, Plus } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Field, type FieldStatus } from './Field';\n\nexport interface NumberInputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'type' | 'size'> {\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n /** Unit shown after the value (e.g. \"minutes\"). */\n unit?: string;\n status?: FieldStatus;\n label?: React.ReactNode;\n description?: React.ReactNode;\n message?: React.ReactNode;\n}\n\n// Figma: Numerical input (23) — 200px stepper: − / value + unit / +, 40px tall, 4px inner padding.\nexport const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(\n (\n {\n className,\n value,\n defaultValue = 0,\n onValueChange,\n min = Number.NEGATIVE_INFINITY,\n max = Number.POSITIVE_INFINITY,\n step = 1,\n unit,\n status = 'default',\n label,\n description,\n message,\n id,\n disabled,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState(defaultValue);\n const current = value ?? internal;\n const clamp = (next: number) => Math.min(max, Math.max(min, next));\n const commit = (next: number) => {\n const clamped = clamp(next);\n setInternal(clamped);\n onValueChange?.(clamped);\n };\n\n return (\n <Field label={label} description={description} message={message} status={status} id={id} className=\"w-50\">\n {(control) => (\n <div\n className={cn(\n 'flex h-10 w-full items-center justify-between rounded-md border bg-surface p-1 transition-colors',\n 'has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-ring',\n status === 'error' ? 'border-destructive' : status === 'success' ? 'border-success-foreground' : 'border-border',\n disabled && 'opacity-50',\n className,\n )}\n >\n <Button\n type=\"button\"\n variant=\"subtle\"\n size=\"icon-sm\"\n aria-label=\"Decrease\"\n disabled={disabled || current <= min}\n onClick={() => commit(current - step)}\n >\n <Minus size={16} aria-hidden />\n </Button>\n <div className=\"flex items-center justify-center gap-1 text-center\">\n <input\n ref={ref}\n role=\"spinbutton\"\n inputMode=\"numeric\"\n aria-valuenow={current}\n aria-valuemin={Number.isFinite(min) ? min : undefined}\n aria-valuemax={Number.isFinite(max) ? max : undefined}\n disabled={disabled}\n value={String(current)}\n size={Math.max(1, String(current).length)}\n onChange={(event) => {\n const parsed = Number(event.target.value.replace(/[^\\d.-]/g, ''));\n if (!Number.isNaN(parsed)) commit(parsed);\n }}\n onKeyDown={(event) => {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n commit(current + step);\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n commit(current - step);\n }\n }}\n className=\"min-w-0 bg-transparent text-center text-ui-label text-surface-foreground outline-none\"\n {...control}\n {...props}\n />\n {unit && <span className=\"text-body-small text-secondary-muted-foreground\">{unit}</span>}\n </div>\n <Button\n type=\"button\"\n variant=\"subtle\"\n size=\"icon-sm\"\n aria-label=\"Increase\"\n disabled={disabled || current >= max}\n onClick={() => commit(current + step)}\n >\n <Plus size={16} aria-hidden />\n </Button>\n </div>\n )}\n </Field>\n );\n },\n);\nNumberInput.displayName = 'NumberInput';\n","import * as React from 'react';\nimport { MagnifyingGlass, X } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface SearchBarProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {\n /** Called when the clear (×) button is pressed, after the field has been emptied. */\n onClear?: () => void;\n /** Label for the clear button. */\n clearLabel?: string;\n}\n\n// Figma: Search Bar (18) — 40px, 1px muted border; focused/filled gets a 2px accent border.\nexport const SearchBar = React.forwardRef<HTMLInputElement, SearchBarProps>(\n ({ className, value, defaultValue, onChange, onClear, clearLabel = 'Clear search', disabled, ...props }, ref) => {\n const innerRef = React.useRef<HTMLInputElement>(null);\n React.useImperativeHandle(ref, () => innerRef.current as HTMLInputElement);\n const [uncontrolled, setUncontrolled] = React.useState(String(defaultValue ?? ''));\n const current = value !== undefined ? String(value) : uncontrolled;\n\n const clear = () => {\n const input = innerRef.current;\n if (input) {\n // Drive the native setter so React's onChange fires for controlled consumers too.\n const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n setter?.call(input, '');\n input.dispatchEvent(new Event('input', { bubbles: true }));\n input.focus();\n }\n onClear?.();\n };\n\n return (\n <div\n className={cn(\n 'flex h-10 w-full items-center gap-2 rounded-md border bg-surface px-3 py-2 transition-colors',\n 'border-input-muted focus-within:border-input-accent focus-within:ring-1 focus-within:ring-input-accent',\n current !== '' && 'border-input-accent ring-1 ring-input-accent',\n disabled && 'opacity-50',\n className,\n )}\n >\n <MagnifyingGlass size={16} aria-hidden className=\"shrink-0 text-surface-foreground\" />\n <input\n ref={innerRef}\n type=\"text\"\n role=\"searchbox\"\n value={value}\n defaultValue={defaultValue}\n disabled={disabled}\n onChange={(event) => {\n setUncontrolled(event.target.value);\n onChange?.(event);\n }}\n className=\"min-w-0 flex-1 bg-transparent text-ui-input-value text-surface-foreground outline-none placeholder:text-muted-foreground\"\n {...props}\n />\n {current !== '' && !disabled && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onClick={clear}\n className=\"inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground\"\n >\n <X size={16} aria-hidden />\n </button>\n )}\n </div>\n );\n },\n);\nSearchBar.displayName = 'SearchBar';\n","import * as React from 'react';\nimport { CaretDown } from '@phosphor-icons/react';\nimport { Select as SelectPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport const Select = SelectPrimitive.Root;\nexport const SelectValue = SelectPrimitive.Value;\nexport const SelectGroup = SelectPrimitive.Group;\n\nconst CheckIcon = () => (\n <svg width=\"10\" height=\"8\" viewBox=\"0 0 10 8\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M1 4L3.5 6.5L9 1\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nexport interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {\n /** Leading icon (Figma: \"With label = No\" shows a gear). */\n icon?: React.ReactNode;\n}\n\n// Figma: Select / Dropdown (22) — 40px, 8px radius; the open (\"select\") state takes the accent border.\nexport const SelectTrigger = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Trigger>, SelectTriggerProps>(\n ({ className, children, icon, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'flex h-10 w-full items-center gap-2 rounded-md border border-input-muted bg-surface px-3 py-2 text-left text-ui-input-value text-surface-foreground transition-colors',\n 'hover:border-input-accent data-[state=open]:border-input-accent',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[placeholder]:text-muted-foreground',\n className,\n )}\n {...props}\n >\n {icon && <span className=\"flex shrink-0 text-surface-foreground\">{icon}</span>}\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <SelectPrimitive.Icon className=\"shrink-0 text-surface-foreground\">\n <CaretDown size={16} aria-hidden />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n ),\n);\nSelectTrigger.displayName = 'SelectTrigger';\n\nexport type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;\n\nexport const SelectContent = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Content>, SelectContentProps>(\n ({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n // Tailwind has no --z-* theme namespace (it's a fixed static scale,\n // not theme-driven) and Radix's trigger-width variable is layout\n // data, not a design value — both are the rare case DESIGN_TOKENS.md\n // allows raw var() consumption via inline style rather than a\n // Tailwind class, arbitrary-value bracket syntax included.\n style={{\n zIndex: 'var(--sys-z-20)',\n width: position === 'popper' ? 'var(--radix-select-trigger-width)' : undefined,\n }}\n className={cn(\n 'overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md',\n className,\n )}\n {...props}\n >\n <SelectPrimitive.Viewport className=\"p-1\">{children}</SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n ),\n);\nSelectContent.displayName = 'SelectContent';\n\nexport type SelectItemProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;\n\nexport const SelectItem = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Item>, SelectItemProps>(\n ({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default items-center gap-2 rounded-sm py-2 pr-4 pl-8 text-sm text-popover-foreground select-none',\n 'outline-none data-[highlighted]:bg-accent-soft data-[highlighted]:text-accent-soft-foreground',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-4 w-4 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ),\n);\nSelectItem.displayName = 'SelectItem';\n","import * as React from 'react';\nimport { Slider as SliderPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport interface SliderProps extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {\n /** Text shown above the track on the left (e.g. \"Label\"). The max value is shown on the right. */\n label?: React.ReactNode;\n /** Show the min and max values above the track instead of a label. */\n showRange?: boolean;\n /**\n * Show the current value in a bubble above the thumb. `true` shows it while\n * the thumb is hovered, focused or dragged; `'always'` keeps it visible.\n */\n showValue?: boolean | 'always';\n}\n\n// Figma: Slider (26) — 4px `muted` track, `input-accent` fill, 16px accent thumb, `primary` value bubble.\nexport const Slider = React.forwardRef<React.ElementRef<typeof SliderPrimitive.Root>, SliderProps>(\n (\n {\n className,\n value,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n label,\n showRange,\n showValue,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState<number[]>(defaultValue ?? [min]);\n const thumbValues = value ?? internal;\n const hasHeader = label != null || showRange;\n\n return (\n <div className={cn('flex w-full flex-col gap-2', className)}>\n {hasHeader && (\n <div className=\"flex items-center justify-between text-secondary-muted-foreground\">\n {label != null ? (\n <span className=\"text-ui-label text-surface-foreground\">{label}</span>\n ) : (\n <span className=\"text-ui-caption\">{min}</span>\n )}\n <span className=\"text-body-small\">{max}</span>\n </div>\n )}\n <SliderPrimitive.Root\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n min={min}\n max={max}\n onValueChange={(next) => {\n setInternal(next);\n onValueChange?.(next);\n }}\n className=\"relative flex h-4 w-full touch-none items-center select-none\"\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-1 w-full grow overflow-hidden rounded-xxs bg-muted\">\n <SliderPrimitive.Range className=\"absolute h-full bg-input-accent\" />\n </SliderPrimitive.Track>\n {thumbValues.map((thumbValue, index) => (\n // The accessible name belongs on each individual thumb (the actual\n // role=\"slider\" element) — Root is just a group container. With\n // more than one thumb this applies the same label to each; give a\n // range slider distinct per-thumb labels via aria-labelledby instead.\n <SliderPrimitive.Thumb\n key={index}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className=\"group relative block size-4 rounded-full border-2 border-surface bg-input-accent shadow-sm transition-colors disabled:pointer-events-none disabled:opacity-50\"\n >\n {showValue && (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute bottom-full left-1/2 mb-2 flex min-w-4 -translate-x-1/2 items-center justify-center rounded-xs bg-primary p-0.5 text-ui-caption text-label',\n showValue !== 'always' && 'invisible group-hover:visible group-focus-visible:visible group-active:visible',\n )}\n >\n {thumbValue}\n </span>\n )}\n </SliderPrimitive.Thumb>\n ))}\n </SliderPrimitive.Root>\n </div>\n );\n },\n);\nSlider.displayName = 'Slider';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { Field, fieldSurfaceClasses, type FieldStatus } from './Field';\n\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n status?: FieldStatus;\n /** Convenience: renders a Field (label + helper/status message) around the textarea. */\n label?: React.ReactNode;\n description?: React.ReactNode;\n message?: React.ReactNode;\n}\n\n// Figma: Textarea (20) — min 100px tall, 12/10px padding, 8px radius, 16/28 value.\nconst textareaClasses = (status: FieldStatus | undefined, className?: string) =>\n cn(\n 'flex field-sizing-content min-h-25 w-full rounded-md px-3 py-2.5 text-body-base placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n fieldSurfaceClasses(status),\n className,\n );\n\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, status = 'default', label, description, message, id, ...props }, ref) => {\n if (label == null && description == null && message == null) {\n return (\n <textarea\n ref={ref}\n id={id}\n aria-invalid={status === 'error' ? true : undefined}\n className={textareaClasses(status, className)}\n {...props}\n />\n );\n }\n return (\n <Field label={label} description={description} message={message} status={status} id={id}>\n {(control) => <textarea ref={ref} className={textareaClasses(status, className)} {...control} {...props} />}\n </Field>\n );\n },\n);\nTextarea.displayName = 'Textarea';\n","import * as React from 'react';\nimport { CheckCircle, Circle, RadioButton, WarningCircle } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport type StepStatus = 'not-completed' | 'completed' | 'error';\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\nexport interface StepProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n label: React.ReactNode;\n /** Figma \"Completed\" and \"Error\": not completed (default), completed (success) or completed with an error. */\n status?: StepStatus;\n /** The step the user is on: the bolder label and the filled indicator. */\n selected?: boolean;\n /** Horizontal puts the label under the indicator; vertical puts it before the indicator, right-aligned. */\n orientation?: StepperOrientation;\n}\n\nconst STATUS_TEXT: Record<StepStatus, string> = { 'not-completed': 'not completed', completed: 'completed', error: 'error' };\n\n/** The 24px indicator: an empty ring, the selected radio, a check or a warning (filled when selected), all Phosphor icons. */\nfunction StepIndicator({ status, selected }: { status: StepStatus; selected: boolean }) {\n const props = { size: 24, 'aria-hidden': true, className: 'shrink-0' } as const;\n if (status === 'completed') return <CheckCircle {...props} weight={selected ? 'fill' : 'regular'} className=\"shrink-0 text-success-foreground\" />;\n if (status === 'error') return <WarningCircle {...props} weight={selected ? 'fill' : 'regular'} className=\"shrink-0 text-destructive-foreground\" />;\n if (selected) return <RadioButton {...props} weight=\"fill\" className=\"shrink-0 text-accent-foreground\" />;\n return <Circle {...props} className=\"shrink-0 text-input-muted\" />;\n}\n\n// Figma: Steps (785:557) — 12 variants: Completed × Selected × Error × Type. 136px wide, 64px min height; label body/small in secondary-muted, ui/label in foreground when selected.\nexport const Step = React.forwardRef<HTMLDivElement, StepProps>(\n ({ label, status = 'not-completed', selected = false, orientation = 'horizontal', className, ...props }, ref) => {\n const vertical = orientation === 'vertical';\n return (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-16 w-34 shrink-0',\n // The horizontal indicator sits 6px from the top, so a path beside it lines up whatever the label's length.\n vertical ? 'items-center justify-end gap-4 p-2' : 'flex-col items-center gap-2 pt-1.5',\n className,\n )}\n {...props}\n >\n {!vertical && <StepIndicator status={status} selected={selected} />}\n <span\n className={cn(\n vertical ? 'min-w-0 flex-1 text-right' : 'w-full text-center',\n selected ? 'text-ui-label text-foreground' : 'text-body-small text-secondary-muted-foreground',\n )}\n >\n {label}\n {status !== 'not-completed' && <span className=\"sr-only\">{`, ${STATUS_TEXT[status]}`}</span>}\n </span>\n {vertical && <StepIndicator status={status} selected={selected} />}\n </div>\n );\n },\n);\nStep.displayName = 'Step';\n\nexport interface StepPathProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: StepperOrientation;\n /** Both steps it joins are completed: the path turns success green. */\n completed?: boolean;\n}\n\n// Figma: Step path (787:278) — a 1px line in border (success when it joins completed steps), 32px across.\nexport const StepPath = React.forwardRef<HTMLDivElement, StepPathProps>(\n ({ orientation = 'horizontal', completed = false, className, ...props }, ref) => {\n const vertical = orientation === 'vertical';\n return (\n <div ref={ref} aria-hidden className={cn('flex items-center justify-center', vertical ? 'h-8 w-8 flex-col' : 'h-8 flex-1', className)} {...props}>\n <div className={cn(vertical ? 'w-px flex-1' : 'h-px flex-1', completed ? 'bg-success-foreground' : 'bg-border')} />\n </div>\n );\n },\n);\nStepPath.displayName = 'StepPath';\n\nexport interface StepperStep {\n label: React.ReactNode;\n /** The step went wrong: shown with the warning indicator (filled when it is the current step). */\n error?: boolean;\n}\n\nexport interface StepperProps extends Omit<React.HTMLAttributes<HTMLOListElement>, 'children'> {\n steps: StepperStep[];\n /** 0-based index of the step the user is on: the ones before it are completed, the ones after not completed. */\n current: number;\n orientation?: StepperOrientation;\n}\n\n/**\n * The steps of a flow joined by paths (Figma \"In use\": completed → selected → not completed). A path between two completed steps is green. An ordered list, with\n * `aria-current=\"step\"` on the current step and the status of the others read out after their label.\n */\nexport const Stepper = React.forwardRef<HTMLOListElement, StepperProps>(({ steps, current, orientation = 'horizontal', className, ...props }, ref) => {\n const vertical = orientation === 'vertical';\n const statusOf = (i: number, step: StepperStep): StepStatus => (step.error ? 'error' : i < current ? 'completed' : 'not-completed');\n return (\n <ol ref={ref} className={cn('flex', vertical ? 'flex-col items-end' : 'w-full items-start', className)} {...props}>\n {steps.map((step, i) => (\n <React.Fragment key={i}>\n {i > 0 && (\n // Horizontal: the path runs from one indicator's edge to the next (it reaches 56px into each 136px step), level with the indicators' centre.\n <li aria-hidden className={cn('flex', vertical ? 'pr-1' : '-mx-14 flex-1 pt-1.5')}>\n <StepPath orientation={orientation} completed={i < current} className={vertical ? undefined : 'h-6'} />\n </li>\n )}\n <li aria-current={i === current ? 'step' : undefined} className=\"flex\">\n <Step label={step.label} status={statusOf(i, step)} selected={i === current} orientation={orientation} />\n </li>\n </React.Fragment>\n ))}\n </ol>\n );\n});\nStepper.displayName = 'Stepper';\n","import * as React from 'react';\nimport { X } from '@phosphor-icons/react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport const Dialog = DialogPrimitive.Root;\nexport const DialogTrigger = DialogPrimitive.Trigger;\nexport const DialogClose = DialogPrimitive.Close;\n\nexport interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {\n /** Label for the corner close button. */\n closeLabel?: string;\n /** Hide the corner close button (e.g. when the footer is the only way out). */\n hideClose?: boolean;\n}\n\n// Figma: Dialog / Modal (48) — 600px card on a 30% `primary` scrim; 12px radius, `shadow-lg`.\nexport const DialogContent = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Content>, DialogContentProps>(\n ({ className, children, closeLabel = 'Close', hideClose, ...props }, ref) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n style={{ zIndex: 'var(--sys-z-30)' }}\n className=\"fixed inset-0 bg-primary/30\"\n />\n <DialogPrimitive.Content\n ref={ref}\n style={{ zIndex: 'var(--sys-z-30)' }}\n className={cn(\n 'fixed top-1/2 left-1/2 flex w-150 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-lg border border-border bg-surface shadow-lg',\n className,\n )}\n {...props}\n >\n {children}\n {!hideClose && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"ghost\" size=\"icon-sm\" aria-label={closeLabel} className=\"absolute top-4 right-6\">\n <X size={16} aria-hidden />\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n ),\n);\nDialogContent.displayName = 'DialogContent';\n\nexport const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-1.5 border-b border-border px-6 py-4 pr-16', className)} {...props} />\n);\n\nexport const DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg leading-6 font-semibold text-surface-foreground', className)}\n {...props}\n />\n));\nDialogTitle.displayName = 'DialogTitle';\n\nexport const DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-body-small text-secondary-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport const DialogBody = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-4 p-6', className)} {...props} />\n);\n\nexport const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex items-center justify-end gap-3 border-t border-border px-6 py-4', className)} {...props} />\n);\n","import * as React from 'react';\nimport { CheckCircle, Info, Warning, WarningCircle, X } from '@phosphor-icons/react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport type ToastVariant = 'info' | 'success' | 'warning' | 'destructive';\n\nconst toastVariants = cva('border', {\n variants: {\n variant: {\n info: 'border-info-border bg-surface',\n success: 'border-success-soft-border bg-success-soft',\n warning: 'border-warning-soft-border bg-warning-soft',\n destructive: 'border-destructive-soft-border bg-destructive-soft',\n },\n },\n defaultVariants: { variant: 'info' },\n});\n\n// The in-page banner also has a quiet look (Figma: Persistent Message › info), used for suggestions rather than status.\nconst inlineVariants = cva('border', {\n variants: {\n variant: {\n neutral: 'border-border bg-secondary',\n info: 'border-info-border bg-surface',\n success: 'border-success-soft-border bg-success-soft',\n warning: 'border-warning-soft-border bg-warning-soft',\n destructive: 'border-destructive-soft-border bg-destructive-soft',\n },\n },\n defaultVariants: { variant: 'info' },\n});\n\nexport type ToastInlineVariant = ToastVariant | 'neutral';\n\nconst iconColour: Record<ToastVariant, string> = {\n info: 'text-surface-foreground',\n success: 'text-success-soft-foreground',\n warning: 'text-warning-soft-foreground',\n destructive: 'text-destructive-soft-foreground',\n};\n\nconst titleColour: Record<ToastVariant, string> = {\n info: 'text-surface-foreground',\n success: 'text-success-soft-foreground',\n warning: 'text-warning-soft-foreground',\n destructive: 'text-destructive-soft-foreground',\n};\n\nfunction VariantIcon({ variant, size }: { variant: ToastVariant; size: number }) {\n const props = { size, 'aria-hidden': true, className: cn('shrink-0', iconColour[variant]) } as const;\n if (variant === 'success') return <CheckCircle {...props} />;\n if (variant === 'warning') return <Warning {...props} />;\n if (variant === 'destructive') return <WarningCircle {...props} />;\n return <Info {...props} />;\n}\n\nexport const ToastProvider = ToastPrimitive.Provider;\n\nexport const ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitive.Viewport\n ref={ref}\n style={{ zIndex: 'var(--sys-z-50)' }}\n className={cn('fixed right-4 bottom-4 flex w-89 max-w-full flex-col gap-3 outline-none', className)}\n {...props}\n />\n));\nToastViewport.displayName = 'ToastViewport';\n\nexport interface ToastProps\n extends Omit<React.ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, 'title'>,\n VariantProps<typeof toastVariants> {\n /** Bold first line. */\n title?: React.ReactNode;\n description?: React.ReactNode;\n /** Optional action button (e.g. Undo). Wrap it in `ToastAction`. */\n action?: React.ReactNode;\n closeLabel?: string;\n}\n\n// Figma: Toast / Sonner (52) › Toast — 356px card with a 20px status icon, title, description and close.\nexport const Toast = React.forwardRef<React.ElementRef<typeof ToastPrimitive.Root>, ToastProps>(\n ({ className, variant = 'info', title, description, action, closeLabel = 'Close', children, ...props }, ref) => {\n const v = variant ?? 'info';\n return (\n <ToastPrimitive.Root\n ref={ref}\n // Errors interrupt; everything else is polite.\n type={v === 'destructive' ? 'foreground' : 'background'}\n className={cn('flex items-start gap-3 rounded-lg p-4 shadow-lg', toastVariants({ variant: v }), className)}\n {...props}\n >\n <VariantIcon variant={v} size={20} />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1 text-body-small\">\n {title != null && (\n <ToastPrimitive.Title className={cn('font-semibold', titleColour[v])}>{title}</ToastPrimitive.Title>\n )}\n {description != null && (\n <ToastPrimitive.Description className=\"text-secondary-muted-foreground\">{description}</ToastPrimitive.Description>\n )}\n {children}\n {action}\n </div>\n <ToastPrimitive.Close\n aria-label={closeLabel}\n className=\"inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground\"\n >\n <X size={16} aria-hidden />\n </ToastPrimitive.Close>\n </ToastPrimitive.Root>\n );\n },\n);\nToast.displayName = 'Toast';\n\nexport const ToastAction = ToastPrimitive.Action;\n\nexport interface ToastInlineProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof inlineVariants> {\n /** Buttons shown after the message, for example a ghost \"Dismiss\" and an outline \"Fix\" (both `size=\"sm\"`). */\n actions?: React.ReactNode;\n /** Where the actions sit: `end` (default) after the message on the same line, or `bottom` under the message, for messages long enough to wrap. */\n actionsPlacement?: 'end' | 'bottom';\n /** Show a close button and call this when it is pressed. */\n onClose?: () => void;\n closeLabel?: string;\n}\n\n// Figma: Toast Inline / Persistent Message — a single-line banner (46px) for in-page messages, with optional actions.\nexport const ToastInline = React.forwardRef<HTMLDivElement, ToastInlineProps>(\n ({ className, variant = 'info', actions, actionsPlacement = 'end', onClose, closeLabel = 'Close', children, ...props }, ref) => {\n const v = variant ?? 'info';\n const below = actionsPlacement === 'bottom' && !!actions;\n return (\n <div\n ref={ref}\n role={v === 'destructive' ? 'alert' : 'status'}\n className={cn('flex gap-2 rounded-sm px-2 py-1.5', below ? 'items-start' : 'items-center', inlineVariants({ variant: v }), className)}\n {...props}\n >\n <span className={cn('inline-flex shrink-0', below && 'mt-0.5')}>\n <VariantIcon variant={v === 'neutral' ? 'info' : v} size={16} />\n </span>\n {below ? (\n <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n <p className=\"text-body-small text-secondary-muted-foreground\">{children}</p>\n <div className=\"flex items-center gap-2\">{actions}</div>\n </div>\n ) : (\n <>\n <p className=\"min-w-0 flex-1 text-body-small text-secondary-muted-foreground\">{children}</p>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </>\n )}\n {onClose && (\n <Button type=\"button\" variant=\"ghost\" size=\"icon-sm\" aria-label={closeLabel} onClick={onClose}>\n <X size={16} aria-hidden />\n </Button>\n )}\n </div>\n );\n },\n);\nToastInline.displayName = 'ToastInline';\n","import * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport const TooltipProvider = TooltipPrimitive.Provider;\nexport const Tooltip = TooltipPrimitive.Root;\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\nexport interface TooltipContentProps extends Omit<React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, 'title'> {\n /** Bold first line. With `description` this is the Descriptive tooltip. */\n title?: React.ReactNode;\n description?: React.ReactNode;\n /** Underlined action line under the description — the Rich tooltip. Usually a link or button. */\n action?: React.ReactNode;\n /** Show the pointer arrow toward the trigger. */\n arrow?: boolean;\n}\n\n// Figma: Tooltip (51) — `primary-soft-foreground` plum card, 6px radius. Simple = one line of label text;\n// Descriptive = title + description; Rich = adds an action link.\nexport const TooltipContent = React.forwardRef<React.ElementRef<typeof TooltipPrimitive.Content>, TooltipContentProps>(\n ({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {\n const detailed = title != null || description != null;\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n style={{ zIndex: 'var(--sys-z-40)' }}\n className={cn(\n 'rounded-sm bg-primary-soft-foreground text-label shadow-md',\n detailed ? 'flex max-w-60 min-w-50 flex-col gap-1 px-3 py-2.5' : 'px-2.5 py-1.5 text-ui-caption',\n action != null && 'max-w-65 min-w-55',\n className,\n )}\n {...props}\n >\n {detailed ? (\n <>\n {title != null && <p className=\"text-xs leading-4 font-semibold text-label\">{title}</p>}\n {description != null && <p className=\"text-xs leading-4.5 text-plum-200\">{description}</p>}\n {action != null && (\n <div className=\"mt-1 text-ui-caption text-plum-300 underline *:underline\">{action}</div>\n )}\n </>\n ) : (\n children\n )}\n {arrow && <TooltipPrimitive.Arrow width={12} height={8} className=\"fill-primary-soft-foreground\" />}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n },\n);\nTooltipContent.displayName = 'TooltipContent';\n","import * as React from 'react';\nimport { FileText, X } from '@phosphor-icons/react';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Tag } from '../Tags & Badges/Tag';\n\nexport interface FileUploadZoneProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'title' | 'type'> {\n title?: React.ReactNode;\n /** Supported formats line. */\n hint?: React.ReactNode;\n icon?: React.ReactNode;\n /** Called with the chosen or dropped files. */\n onFiles?: (files: File[]) => void;\n}\n\n// Figma: Question types › PDF, PPTX, or DOCX › Upload_Zone (568:6389) — a 143px dashed drop target with an icon, title and hint; hover fills with the page background.\nexport const FileUploadZone = React.forwardRef<HTMLInputElement, FileUploadZoneProps>(\n ({ className, title = 'Upload document', hint, icon, onFiles, ...props }, ref) => {\n const [over, setOver] = React.useState(false);\n return (\n <label\n className={cn(\n 'flex min-h-35.75 w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-md border-2 border-dashed border-border px-4 text-center transition-colors',\n 'hover:bg-background has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-ring',\n over && 'border-input-accent bg-accent-soft',\n className,\n )}\n onDragOver={(event) => {\n event.preventDefault();\n setOver(true);\n }}\n onDragLeave={() => setOver(false)}\n onDrop={(event) => {\n event.preventDefault();\n setOver(false);\n onFiles?.(Array.from(event.dataTransfer.files));\n }}\n >\n <span className=\"flex size-10 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground\">\n {icon ?? <FileText size={24} aria-hidden />}\n </span>\n <span className=\"flex flex-col gap-1\">\n <span className=\"text-body-small text-surface-foreground\">{title}</span>\n {hint && <span className=\"text-ui-caption text-secondary-muted-foreground\">{hint}</span>}\n </span>\n <input\n ref={ref}\n type=\"file\"\n className=\"sr-only\"\n onChange={(event) => onFiles?.(Array.from(event.target.files ?? []))}\n {...props}\n />\n </label>\n );\n },\n);\nFileUploadZone.displayName = 'FileUploadZone';\n\nexport interface FileUploadItemProps extends React.HTMLAttributes<HTMLDivElement> {\n name: string;\n /** File size text, e.g. \"443KB\". */\n size?: string;\n status?: 'uploading' | 'complete' | 'error';\n /** 0–100, shown while uploading. */\n progress?: number;\n /** Remaining time text while uploading, e.g. \"2 seconds left\". */\n timeLeft?: string;\n icon?: React.ReactNode;\n onRemove?: () => void;\n removeLabel?: string;\n}\n\n// Figma: File upload (339:2168) — a row with the file, its status and, while uploading, a thin progress bar.\nexport const FileUploadItem = React.forwardRef<HTMLDivElement, FileUploadItemProps>(\n ({ className, name, size, status = 'uploading', progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {\n const uploading = status === 'uploading';\n return (\n <div\n ref={ref}\n className={cn('flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2', className)}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground\">\n {icon ?? <FileText size={24} aria-hidden />}\n </span>\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div className=\"flex items-center justify-between gap-2\">\n <p className=\"min-w-0 truncate text-ui-label text-surface-foreground\">{name}</p>\n {onRemove && (\n <Button type=\"button\" variant=\"ghost\" size=\"icon-sm\" aria-label={removeLabel ?? `Remove ${name}`} onClick={onRemove}>\n <X size={16} aria-hidden />\n </Button>\n )}\n </div>\n <div className=\"flex items-center justify-between text-ui-caption text-secondary-muted-foreground\">\n <span className=\"flex items-center gap-2\">\n {size}\n {status === 'complete' && <Tag variant=\"success\">Complete</Tag>}\n {status === 'error' && <Tag variant=\"destructive\">Error</Tag>}\n {uploading && timeLeft && (\n <>\n <span aria-hidden=\"true\" className=\"size-0.5 rounded-full bg-secondary-muted-foreground\" />\n {timeLeft}\n </>\n )}\n </span>\n {uploading && <span className=\"text-body-xxs font-normal\">{Math.round(progress)}%</span>}\n </div>\n </div>\n </div>\n {uploading && (\n <ProgressPrimitive.Root\n value={progress}\n aria-label={`Uploading ${name}`}\n className=\"h-0.75 w-full overflow-hidden rounded-sm bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5\"\n >\n <ProgressPrimitive.Indicator className=\"h-full bg-accent transition-[width]\" style={{ width: `${progress}%` }} />\n </ProgressPrimitive.Root>\n )}\n </div>\n );\n },\n);\nFileUploadItem.displayName = 'FileUploadItem';\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\n// Figma: System Tag + Status Tag (41). Border + 6px radius, 12px/16px medium label.\nconst tagVariants = cva(\n 'inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption',\n {\n variants: {\n variant: {\n neutral: 'border-accent-soft-border bg-accent-soft text-accent-soft-foreground',\n default: 'border-border bg-surface text-surface-foreground',\n success: 'border-success-soft-border bg-success-soft text-success-soft-foreground',\n warning: 'border-warning-soft-border bg-warning-soft text-warning-soft-foreground',\n destructive: 'border-destructive-soft-border bg-destructive-soft text-destructive-soft-foreground',\n },\n },\n defaultVariants: { variant: 'neutral' },\n },\n);\n\nexport interface TagProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof tagVariants> {}\n\n/** Read-only label for system states (Live Interview, Self-paced, AI Interview). */\nexport const Tag = React.forwardRef<HTMLSpanElement, TagProps>(({ className, variant, ...props }, ref) => (\n <span ref={ref} className={cn(tagVariants({ variant }), className)} {...props} />\n));\nTag.displayName = 'Tag';\n\nconst statusDotVariants = cva('size-1.5 shrink-0 rounded-full', {\n variants: {\n status: {\n active: 'bg-success-800',\n inactive: 'bg-accent',\n pending: 'bg-warning',\n error: 'bg-destructive',\n },\n },\n defaultVariants: { status: 'active' },\n});\n\nexport interface StatusTagProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n Required<Pick<VariantProps<typeof statusDotVariants>, 'status'>> {}\n\n/** White tag with a coloured status dot (Active / Inactive / Pending / Error). */\nexport const StatusTag = React.forwardRef<HTMLSpanElement, StatusTagProps>(\n ({ className, status, children, ...props }, ref) => (\n <span ref={ref} className={cn(tagVariants({ variant: 'default' }), className)} {...props}>\n <span className={statusDotVariants({ status })} aria-hidden=\"true\" />\n {children}\n </span>\n ),\n);\nStatusTag.displayName = 'StatusTag';\n","import * as React from 'react';\nimport { CornersOut, DotsThree, Image as ImageIcon, Pause, Play, SpeakerSimpleHigh, SpeakerSimpleX, Trash } from '@phosphor-icons/react';\nimport { Slider as SliderPrimitive, ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport interface MediaInfoProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n name: string;\n /** Secondary line parts, e.g. [\"443KB\", \"1/5\"], joined with a dot. */\n details?: string[];\n onRemove?: () => void;\n removeLabel?: string;\n /** Larger name / details (the image preview uses these). */\n large?: boolean;\n}\n\n// Figma: File upload › video-info-section / image preview — file name + details with a trash button.\nexport function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }: MediaInfoProps) {\n return (\n <div className={cn('flex items-center justify-between border-t border-border bg-surface px-6 py-4', className)} {...props}>\n <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n <p className={cn('truncate text-surface-foreground', large ? 'text-body-section' : 'text-ui-label')}>{name}</p>\n {details && (\n <p className={cn('flex items-center gap-2 text-secondary-muted-foreground', large ? 'text-body-small' : 'text-ui-caption')}>\n {details.map((part, index) => (\n <React.Fragment key={part}>\n {index > 0 && <span aria-hidden=\"true\" className=\"size-0.5 rounded-full bg-secondary-muted-foreground\" />}\n {part}\n </React.Fragment>\n ))}\n </p>\n )}\n </div>\n {onRemove && (\n <Button type=\"button\" variant=\"destructive\" size=\"icon\" aria-label={removeLabel ?? `Remove ${name}`} onClick={onRemove}>\n <Trash size={16} aria-hidden />\n </Button>\n )}\n </div>\n );\n}\n\nexport interface ImagePreviewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** The image (an `<img>`). The preview area is as tall as the image at full width, up to 336px. Leave empty for the fixed-height placeholder fill. */\n children?: React.ReactNode;\n name: string;\n details?: string[];\n onRemove?: () => void;\n}\n\n// Figma: File upload › Image preview — a 12px-radius card: preview area over a name / size / count bar.\nexport const ImagePreview = React.forwardRef<HTMLDivElement, ImagePreviewProps>(\n ({ className, children, name, details, onRemove, ...props }, ref) => (\n <div ref={ref} className={cn('flex w-full flex-col overflow-hidden rounded-lg border border-border', className)} {...props}>\n <div\n className={cn(\n 'flex w-full items-center justify-center bg-accent-soft',\n // With an image the area hugs it (full width, its own height, at most 336px tall); the empty placeholder keeps the fixed height.\n children ? '[&>img]:block [&>img]:h-auto [&>img]:max-h-84 [&>img]:w-full [&>img]:object-contain' : 'h-84',\n )}\n >\n {children}\n </div>\n <MediaInfo name={name} details={details} onRemove={onRemove} large />\n </div>\n ),\n);\nImagePreview.displayName = 'ImagePreview';\n\nexport interface ImageThumbnailsProps\n extends Omit<React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root>, 'type' | 'value' | 'defaultValue' | 'onValueChange'> {\n /** Slots shown, e.g. 5. Slots past `images.length` render as empty dashed placeholders. */\n max: number;\n images: { id: string; src?: string; alt: string }[];\n value?: string;\n onValueChange?: (id: string) => void;\n}\n\n// Figma: File upload › Image thumbnail — selected (accent-soft + accent border), default, and dashed empty slots.\nexport const ImageThumbnails = React.forwardRef<React.ElementRef<typeof ToggleGroupPrimitive.Root>, ImageThumbnailsProps>(\n ({ className, max, images, value, onValueChange, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n ref={ref}\n type=\"single\"\n value={value ?? ''}\n onValueChange={(next) => next && onValueChange?.(next)}\n className={cn('flex w-full gap-2', className)}\n {...props}\n >\n {Array.from({ length: max }, (_, index) => {\n const image = images[index];\n if (!image) {\n return (\n <span\n key={`empty-${index}`}\n aria-hidden=\"true\"\n className=\"flex h-20 min-w-0 flex-1 items-center justify-center rounded-sm border border-dashed border-border text-accent-foreground\"\n >\n <ImageIcon size={24} />\n </span>\n );\n }\n return (\n <ToggleGroupPrimitive.Item\n key={image.id}\n value={image.id}\n aria-label={image.alt}\n className={cn(\n 'flex h-20 min-w-0 flex-1 items-center justify-center overflow-hidden rounded-sm border border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 p-2 text-surface-foreground transition-colors',\n 'hover:bg-accent-soft hover:bg-none',\n 'data-[state=on]:border-accent-foreground data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-foreground',\n )}\n >\n {image.src ? <img src={image.src} alt=\"\" className=\"size-full object-cover\" /> : <ImageIcon size={24} aria-hidden />}\n </ToggleGroupPrimitive.Item>\n );\n })}\n </ToggleGroupPrimitive.Root>\n ),\n);\nImageThumbnails.displayName = 'ImageThumbnails';\n\nconst formatTime = (seconds: number) => {\n const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));\n return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, '0')}`;\n};\n\nexport interface VideoPlayerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Video source. Without one, the area shows the placeholder fill. */\n src?: string;\n name?: string;\n details?: string[];\n onRemove?: () => void;\n /** Called by the \"more\" (…) button. */\n onMore?: () => void;\n /** Initial time values for static previews (seconds). */\n initialTime?: number;\n initialDuration?: number;\n}\n\n// Figma: File upload › Video player — preview area with a dark control bar (play, seek, time, volume, full screen), then file info.\nexport const VideoPlayer = React.forwardRef<HTMLDivElement, VideoPlayerProps>(\n ({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, ...props }, ref) => {\n const video = React.useRef<HTMLVideoElement>(null);\n const [playing, setPlaying] = React.useState(false);\n const [time, setTime] = React.useState(initialTime);\n const [duration, setDuration] = React.useState(initialDuration);\n const [volume, setVolume] = React.useState(1);\n const muted = volume === 0;\n\n const toggle = () => {\n const el = video.current;\n if (!el) return setPlaying((p) => !p);\n if (el.paused) void el.play();\n else el.pause();\n };\n\n return (\n <div ref={ref} className={cn('flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface', className)} {...props}>\n <div className=\"relative flex h-60.5 w-full items-end bg-accent-soft\">\n {src && (\n <video\n ref={video}\n src={src}\n className=\"absolute inset-0 size-full object-contain\"\n onPlay={() => setPlaying(true)}\n onPause={() => setPlaying(false)}\n onTimeUpdate={(event) => setTime(event.currentTarget.currentTime)}\n onLoadedMetadata={(event) => setDuration(event.currentTarget.duration)}\n onVolumeChange={(event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)}\n />\n )}\n <div className=\"relative flex w-full flex-col gap-2 bg-surface-foreground bg-linear-to-r from-primary/30 to-primary/30 px-4 pt-3 pb-4 text-surface\">\n <SliderPrimitive.Root\n min={0}\n max={duration || 1}\n step={0.1}\n value={[Math.min(time, duration || 1)]}\n onValueChange={([next]) => {\n if (next === undefined) return;\n setTime(next);\n if (video.current) video.current.currentTime = next;\n }}\n className=\"relative flex h-4 w-full touch-none items-center select-none\"\n >\n <SliderPrimitive.Track className=\"relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20\">\n <SliderPrimitive.Range className=\"absolute h-full bg-accent-foreground\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb aria-label=\"Seek\" className=\"block size-3 rounded-full border-2 border-surface bg-surface shadow-sm\" />\n </SliderPrimitive.Root>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n aria-label={playing ? 'Pause' : 'Play'}\n onClick={toggle}\n className=\"inline-flex size-10 items-center justify-center rounded-full bg-surface/12 text-surface transition-colors hover:bg-surface/20\"\n >\n {playing ? <Pause size={16} weight=\"fill\" aria-hidden /> : <Play size={16} weight=\"fill\" aria-hidden />}\n </button>\n <span className=\"text-ui-label whitespace-nowrap text-surface/80\">\n {formatTime(time)} / {formatTime(duration)}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <VolumeControl\n volume={volume}\n onVolumeChange={(next) => {\n setVolume(next);\n if (video.current) {\n video.current.volume = next;\n video.current.muted = next === 0;\n }\n }}\n />\n <button\n type=\"button\"\n aria-label=\"Full screen\"\n onClick={() => void video.current?.requestFullscreen?.()}\n className=\"inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12\"\n >\n <CornersOut size={16} aria-hidden />\n </button>\n <button\n type=\"button\"\n aria-label=\"More\"\n onClick={onMore}\n className=\"inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12\"\n >\n <DotsThree size={16} aria-hidden />\n </button>\n </div>\n </div>\n </div>\n </div>\n {name && <MediaInfo name={name} details={details} onRemove={onRemove} />}\n <span className=\"sr-only\" aria-live=\"polite\">\n {muted ? 'Muted' : ''}\n </span>\n </div>\n );\n },\n);\nVideoPlayer.displayName = 'VideoPlayer';\n\nexport interface VolumeControlProps {\n /** 0–1. */\n volume: number;\n onVolumeChange: (volume: number) => void;\n className?: string;\n}\n\n// Figma: Volume control — a speaker button that reveals a slider on hover or focus.\nexport function VolumeControl({ volume, onVolumeChange, className }: VolumeControlProps) {\n const last = React.useRef(volume || 1);\n if (volume > 0) last.current = volume;\n return (\n <div className={cn('group/volume flex items-center', className)}>\n <div className=\"w-0 overflow-hidden opacity-0 transition-all group-focus-within/volume:w-16 group-focus-within/volume:opacity-100 group-hover/volume:w-16 group-hover/volume:opacity-100\">\n <SliderPrimitive.Root\n min={0}\n max={1}\n step={0.05}\n value={[volume]}\n onValueChange={([next]) => next !== undefined && onVolumeChange(next)}\n className=\"relative flex h-4 w-14 touch-none items-center select-none\"\n >\n <SliderPrimitive.Track className=\"relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20\">\n <SliderPrimitive.Range className=\"absolute h-full bg-surface\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb aria-label=\"Volume\" className=\"block size-3 rounded-full bg-surface shadow-sm\" />\n </SliderPrimitive.Root>\n </div>\n <button\n type=\"button\"\n aria-label={volume === 0 ? 'Unmute' : 'Mute'}\n onClick={() => onVolumeChange(volume === 0 ? last.current : 0)}\n className=\"inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12\"\n >\n {volume === 0 ? <SpeakerSimpleX size={16} aria-hidden /> : <SpeakerSimpleHigh size={16} aria-hidden />}\n </button>\n </div>\n );\n}\n","import * as React from 'react';\n\nimport { Textarea, type TextareaProps } from '../Forms & Data Entry/Textarea';\n\nexport interface OpenEndAnswerProps extends Omit<TextareaProps, 'label' | 'description' | 'message' | 'maxLength'> {\n /** Character limit shown in the counter. */\n maxLength?: number;\n}\n\n// Figma: Question input › Open end — a multi-line field with a live \"0/1000 characters\" counter.\nexport const OpenEndAnswer = React.forwardRef<HTMLTextAreaElement, OpenEndAnswerProps>(\n ({ value, defaultValue, onChange, maxLength = 1000, placeholder = 'Write your answer', ...props }, ref) => {\n const [internal, setInternal] = React.useState(String(defaultValue ?? ''));\n const text = value !== undefined ? String(value) : internal;\n return (\n <Textarea\n ref={ref}\n value={text}\n maxLength={maxLength}\n placeholder={placeholder}\n description={`${text.length}/${maxLength} characters`}\n onChange={(event) => {\n setInternal(event.target.value);\n onChange?.(event);\n }}\n {...props}\n />\n );\n },\n);\nOpenEndAnswer.displayName = 'OpenEndAnswer';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\n// Figma: Question types (282:1491) — every question type sits on a 480px white card, 24px padding, 16px gap.\nexport const QuestionCard = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex w-120 max-w-200 flex-col gap-4 rounded-lg bg-surface p-6', className)}\n {...props}\n />\n ),\n);\nQuestionCard.displayName = 'QuestionCard';\n","import * as React from \"react\";\nimport {\n Clipboard,\n Copy,\n Eye,\n Plus,\n Sparkle,\n Trash,\n Warning,\n} from \"@phosphor-icons/react\";\n\nimport { keepEditingFocus } from \"../../lib/keepEditingFocus\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../Buttons & Actions/Button\";\nimport { QuestionHeader } from \"./QuestionHeader\";\nimport type { InlineEditMark } from \"../Forms & Data Entry/InlineEdit\";\nimport type { QuestionType } from \"./QuestionTypeIcon\";\n\nexport interface QuestionEditorCardProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n \"title\" | \"onChange\"\n> {\n /** Question number shown in the drag-handle tag. */\n number: number;\n title: string;\n onTitleChange?: (title: string) => void;\n /** Shown while the title is empty. Defaults to \"Click to write the question text\". */\n titlePlaceholder?: string;\n /** `regular` shows the title placeholder in the normal text colour instead of the muted one. Default `muted`. */\n titlePlaceholderTone?: 'muted' | 'regular';\n /** Shortest title (in characters) that may be saved. Turns on the title guardrail: see `QuestionHeader`'s `titleMinLength`. */\n titleMinLength?: number;\n /** A title longer than this many characters switches to the regular 16px body style, and shows `titleRecommendedNote` under it when given. See `QuestionHeader`. */\n titleRecommendedMax?: number;\n /** Optional text shown under a title that is longer than `titleRecommendedMax`; leave it out to change only the style. */\n titleRecommendedNote?: React.ReactNode;\n /** The question is being edited: accent border, counter and footer are shown. */\n active?: boolean;\n /**\n * Shows the hover look (lifted card, revealed actions and grip) without the pointer, for mirroring a hover that happens\n * elsewhere, such as over the same question's row in an outline.\n */\n hovered?: boolean;\n maxLength?: number;\n /** Footer label, e.g. \"4/20 choices\". Shown while `active`. */\n countLabel?: React.ReactNode;\n /** Header actions. Defaults to copy, delete and preview buttons wired to the `on*` callbacks. */\n actions?: React.ReactNode;\n onDuplicate?: () => void;\n onDelete?: () => void;\n onPreview?: () => void;\n /** Sparkle button beside the card, revealed on hover, focus or while `active`. Omit to hide it. */\n onAskAi?: () => void;\n /** Footer: adds an answer choice. Omit (with `onPaste`) to hide the footer buttons. */\n onAdd?: () => void;\n /** Footer: opens paste-many-choices. */\n onPaste?: () => void;\n /** Inline error shown at the bottom of the card, e.g. \"Not available in Self-Paced\". Keep it as short as possible. */\n error?: React.ReactNode;\n /** Content right beside the \"Question N\" tag, e.g. the time allowed for the question. */\n meta?: React.ReactNode;\n /** Optional strip under the card body, e.g. an \"Inferred\" assumption note. */\n note?: React.ReactNode;\n /** Makes the \"Question N\" tag a drag handle for reordering. See `QuestionHeader`'s `dragHandleProps`. */\n dragHandleProps?: React.ComponentPropsWithRef<'span'>;\n /** Whether the grip icon shows in the \"Question N\" tag on hover. Defaults to true; set false when the card can't be moved. See `QuestionHeader`. */\n showDragHandle?: boolean;\n /** The question's type, shown as an icon in the \"Question N\" tag in its default and selected states (the grip replaces it on hover). See `QuestionHeader`. */\n questionType?: QuestionType;\n /** Ranges of the saved question text to underline in the destructive colour, such as misspelled words. See `QuestionHeader`'s `titleMarks`. */\n titleMarks?: InlineEditMark[];\n /** Makes the underlined words clickable; called with the mark and the chosen correction. See `QuestionHeader`'s `onTitleMarkApply`. */\n onTitleMarkApply?: (mark: InlineEditMark, replacement: string) => void;\n /** Called when a mark is dismissed from its card. */\n onTitleMarkDismiss?: (mark: InlineEditMark) => void;\n /** Opens the question text for editing when it turns true, for example when the card is selected by a click. See `QuestionHeader`'s `titleEditing`. */\n titleEditing?: boolean;\n}\n\n// Figma: Question editor (351:5944) — the authoring card for every question type. Idle is a flat bordered card, hover\n// lifts it and reveals the header actions, active takes the accent border and adds the counter and footer.\nexport const QuestionEditorCard = React.forwardRef<\n HTMLDivElement,\n QuestionEditorCardProps\n>(\n (\n {\n className,\n number,\n title,\n onTitleChange,\n titlePlaceholder,\n titlePlaceholderTone,\n titleMinLength,\n titleRecommendedMax,\n titleRecommendedNote,\n active,\n hovered,\n maxLength,\n countLabel,\n actions,\n onDuplicate,\n onDelete,\n onPreview,\n onAskAi,\n onAdd,\n onPaste,\n note,\n error,\n meta,\n dragHandleProps,\n showDragHandle,\n questionType,\n titleMarks,\n onTitleMarkApply,\n onTitleMarkDismiss,\n titleEditing,\n children,\n ...props\n },\n ref,\n ) => {\n const footer = active && (countLabel != null || onAdd || onPaste);\n return (\n <div\n ref={ref}\n className={cn(\"group/editor flex w-full items-start gap-2\", className)}\n data-hovered={hovered ? \"\" : undefined}\n {...props}\n // A click inside the card, outside the field, keeps a title being edited active.\n onMouseDown={(event) => {\n keepEditingFocus(event);\n props.onMouseDown?.(event);\n }}\n >\n <div\n className={cn(\n \"flex w-full max-w-200 flex-col overflow-hidden rounded-xl border bg-surface transition-shadow group-hover/editor:shadow-lg group-focus-within/editor:shadow-lg group-data-[hovered]/editor:shadow-lg\",\n active ? \"border-accent\" : \"border-border\",\n )}\n >\n <div className={cn(\"flex flex-col p-6\", footer ? \"gap-5\" : \"gap-4\")}>\n <div className=\"flex flex-col gap-4\">\n <QuestionHeader\n editor\n number={number}\n title={title}\n onTitleChange={onTitleChange}\n titlePlaceholder={titlePlaceholder}\n titlePlaceholderTone={titlePlaceholderTone}\n titleMinLength={titleMinLength}\n titleRecommendedMax={titleRecommendedMax}\n titleRecommendedNote={titleRecommendedNote}\n active={active}\n showCounter={!!active}\n dragHandleProps={dragHandleProps}\n showDragHandle={showDragHandle}\n questionType={questionType}\n titleMarks={titleMarks}\n onTitleMarkApply={onTitleMarkApply}\n onTitleMarkDismiss={onTitleMarkDismiss}\n titleEditing={titleEditing}\n meta={meta}\n maxLength={maxLength}\n actions={\n actions ?? (\n <>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Duplicate question\"\n onClick={onDuplicate}\n >\n <Copy size={16} aria-hidden />\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"icon-sm\"\n aria-label=\"Delete question\"\n onClick={onDelete}\n >\n <Trash size={16} aria-hidden />\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Preview question\"\n onClick={onPreview}\n >\n <Eye size={16} aria-hidden />\n </Button>\n </>\n )\n }\n />\n {children}\n </div>\n {error && (\n <p className=\"flex items-center gap-1 text-ui-caption text-destructive-foreground\">\n <Warning size={16} aria-hidden className=\"shrink-0\" />\n {error}\n </p>\n )}\n {footer && (\n <div className=\"flex items-center justify-between\">\n <p className=\"text-ui-caption text-secondary-muted-foreground\">\n {countLabel}\n </p>\n <div className=\"flex items-center gap-2\">\n {onAdd && (\n <Button type=\"button\" variant=\"outline\" onClick={onAdd}>\n <Plus size={16} aria-hidden />\n Add choice\n </Button>\n )}\n {onPaste && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n aria-label=\"Paste choices\"\n onClick={onPaste}\n >\n <Clipboard size={16} aria-hidden />\n </Button>\n )}\n </div>\n </div>\n )}\n </div>\n {note && (\n <div className=\"border-t border-border px-2 py-2 text-body-small text-surface-foreground\">\n {note}\n </div>\n )}\n </div>\n {onAskAi && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Ask AI\"\n onClick={onAskAi}\n className=\"shrink-0 opacity-0 transition-opacity group-hover/editor:opacity-100 group-focus-within/editor:opacity-100 group-data-[hovered]/editor:opacity-100 focus-visible:opacity-100\"\n >\n <Sparkle size={16} aria-hidden />\n </Button>\n )}\n </div>\n );\n },\n);\nQuestionEditorCard.displayName = \"QuestionEditorCard\";\n","import type * as React from 'react';\n\n/**\n * Keeps a text field that is being edited active while the reader clicks somewhere else inside the same card (its padding, its labels, the empty space\n * around the field). Put it on the card's `onMouseDown`: a click on a button, link, field or label still does its own job, anything else leaves the focus\n * where it is instead of ending the edit.\n */\nexport function keepEditingFocus(event: React.MouseEvent<HTMLElement>) {\n const target = event.target as HTMLElement;\n if (target.closest('button, a, input, textarea, select, label, [role=\"button\"], [role=\"dialog\"]')) return;\n const active = document.activeElement;\n if ((active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement) && event.currentTarget.contains(active)) event.preventDefault();\n}\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { InlineEdit, type InlineEditMark } from '../Forms & Data Entry/InlineEdit';\nimport { ToastInline } from '../Overlays & Feedback/Toast';\nimport { QuestionNumberTag } from './QuestionNumberTag';\nimport { type QuestionType } from './QuestionTypeIcon';\n\nexport interface QuestionHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'onChange'> {\n /** Question number, shown as \"QUESTION 01\". */\n number: number;\n title: React.ReactNode;\n /** Adds the red asterisk after the title. */\n required?: boolean;\n /** Shows an error banner above the header. `true` shows \"This question is mandatory.\"; pass a node for a custom message. */\n error?: boolean | React.ReactNode;\n onDismissError?: () => void;\n /** Editor mode: an editable title with a character counter and hover actions. */\n editor?: boolean;\n /** Editor mode: called as the title is typed. `title` must then be a string. */\n onTitleChange?: (title: string) => void;\n /** Editor mode: shown while the title is empty. Defaults to \"Click to write the question text\". */\n titlePlaceholder?: string;\n /** Editor mode: `regular` shows the title placeholder in the normal text colour instead of the muted one. Default `muted`. */\n titlePlaceholderTone?: 'muted' | 'regular';\n /**\n * Editor mode: shortest title (in characters) that may be saved. When set, the title's limits guardrail turns on: while the title\n * is being edited a line under it shows the allowed range and the live count (using `maxLength`), a title that is too short is not\n * saved (the field stays open and says why), and the always-on counter is replaced by that line.\n */\n titleMinLength?: number;\n /**\n * Editor mode: a title longer than this many characters (counted live while it is typed) switches to the regular 16px body style\n * instead of the heading style, and shows `titleRecommendedNote` under it when that is given.\n */\n titleRecommendedMax?: number;\n /** Editor mode: optional text shown under a title that is longer than `titleRecommendedMax`. Leave it out to change only the style (for example when the recommendation is shown elsewhere). */\n titleRecommendedNote?: React.ReactNode;\n /** Editor mode: action buttons (copy, delete, preview, AI) revealed on hover or focus. */\n actions?: React.ReactNode;\n /** Editor mode: content shown right beside the \"Question N\" tag, e.g. the time allowed for the question. */\n meta?: React.ReactNode;\n /** Editor mode: title length limit. */\n maxLength?: number;\n /** Editor mode: the question is being edited — the number tag turns accent. */\n active?: boolean;\n /** Editor mode: allow the \"n/2000 characters\" counter, which shows only when the title is over the maximum. Defaults to `true`. */\n showCounter?: boolean;\n /**\n * Editor mode: turns the \"Question N\" tag into a drag handle. Spread onto the tag, so it takes anything a drag-and-drop\n * library hands out (`ref`, `role`, `tabIndex`, pointer and keyboard listeners, aria attributes). The tag then shows a\n * grab cursor, is focusable and reveals the grip icon on keyboard focus; it is labelled \"Reorder question N\" unless you\n * pass your own `aria-label`. Omit it for the plain tag.\n */\n dragHandleProps?: React.ComponentPropsWithRef<'span'>;\n /**\n * Whether the grip icon appears in the \"Question N\" tag on hover or focus. Defaults to true. Set it to false when the question\n * can't be moved (for example while a translation is being edited), so the tag doesn't suggest dragging.\n */\n showDragHandle?: boolean;\n /**\n * Editor mode: the question's type, shown as a 16px icon at the start of the \"Question N\" tag in its default and selected states.\n * On hover or focus (when the tag can be dragged) the grip icon replaces it. Leave it out for a tag with the number only.\n */\n questionType?: QuestionType;\n /** Editor mode: ranges of the saved title to underline in the destructive colour (misspelled words, for example). See `InlineEdit`'s `marks`. */\n titleMarks?: InlineEditMark[];\n /** Editor mode: makes the underlined words clickable; called with the mark and the chosen correction. See `InlineEdit`'s `onMarkApply`. */\n onTitleMarkApply?: (mark: InlineEditMark, replacement: string) => void;\n /** Editor mode: called when a mark is dismissed from its card. See `InlineEdit`'s `onMarkDismiss`. */\n onTitleMarkDismiss?: (mark: InlineEditMark) => void;\n /** Editor mode: opens the title for editing when it turns true, for example when the question is selected. See `InlineEdit`'s `editing`. */\n titleEditing?: boolean;\n}\n\nconst eyebrow = 'text-ui-caption uppercase text-secondary-muted-foreground';\n\n// Figma: Question card components (357:4761) › Question_Header — eyebrow + display title; error and editor variants.\nexport const QuestionHeader = React.forwardRef<HTMLDivElement, QuestionHeaderProps>(\n (\n { className, number, title, required, error, onDismissError, editor, onTitleChange, titlePlaceholder = 'Click to write the question text', titlePlaceholderTone, titleMinLength, titleRecommendedMax, titleRecommendedNote, actions, meta, maxLength = 2000, active, showCounter = true, dragHandleProps, showDragHandle = true, questionType, titleMarks, onTitleMarkApply, onTitleMarkDismiss, titleEditing, ...props },\n ref,\n ) => {\n // Editor mode: live title length while typing; null once editing ends so the saved title is the source of truth.\n const [draft, setDraft] = React.useState<string | null>(null);\n const label = String(number).padStart(2, '0');\n const showError = error !== undefined && error !== false;\n\n if (editor) {\n const text = typeof title === 'string' ? title : '';\n const count = (draft ?? text).length;\n // A long title drops to the regular body style and gets a recommendation, because a long question is tiring to read.\n const long = titleRecommendedMax !== undefined && count > titleRecommendedMax;\n return (\n <div ref={ref} className={cn('group/header flex w-full flex-col gap-2', className)} {...props}>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <QuestionNumberTag number={number} active={active} questionType={questionType} showDragHandle={showDragHandle} dragHandleProps={dragHandleProps} />\n {meta}\n </div>\n {actions && (\n <div className={cn(\n 'flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100',\n // Inside a QuestionEditorCard, hovering or focusing anywhere on the card reveals them too.\n 'group-focus-within/editor:opacity-100 group-hover/editor:opacity-100 group-data-[hovered]/editor:opacity-100',\n )}>\n {actions}\n </div>\n )}\n </div>\n {/* The negative margin cancels InlineEdit's own padding so the text stays flush with the tag above. */}\n <InlineEdit\n variant=\"question\"\n multiline\n selected={active}\n editing={titleEditing}\n className=\"-mx-3 w-auto\"\n aria-label=\"Question title\"\n placeholder={titlePlaceholder}\n placeholderTone={titlePlaceholderTone}\n minLength={titleMinLength}\n showLimits={titleMinLength !== undefined}\n value={text}\n maxLength={maxLength}\n onValueChange={onTitleChange}\n onDraftChange={setDraft}\n onEditingChange={(editing) => {\n if (!editing) setDraft(null);\n }}\n marks={titleMarks}\n onMarkApply={onTitleMarkApply}\n onMarkDismiss={onTitleMarkDismiss}\n textClassName={long ? 'text-body-base' : 'text-heading-h4'}\n />\n {long && titleRecommendedNote != null && <p className=\"text-ui-caption text-secondary-muted-foreground\">{titleRecommendedNote}</p>}\n {showCounter && titleMinLength === undefined && maxLength !== undefined && count > maxLength && (\n <p className=\"text-ui-caption text-secondary-muted-foreground\">\n {count}/{maxLength} characters\n </p>\n )}\n </div>\n );\n }\n\n return (\n <div ref={ref} className={cn('flex w-full flex-col gap-2', className)} {...props}>\n {showError && (\n <ToastInline variant=\"destructive\" onClose={onDismissError} className=\"min-h-10\">\n <span className=\"text-ui-label text-destructive\">{error === true ? 'This question is mandatory.' : error}</span>\n </ToastInline>\n )}\n <p className={eyebrow}>Question {label}</p>\n <h3 className=\"text-heading-h4 text-surface-foreground\">\n {title}\n {required && (\n <span aria-hidden=\"true\" className=\"text-destructive\">\n *\n </span>\n )}\n {required && <span className=\"sr-only\"> (required)</span>}\n </h3>\n </div>\n );\n },\n);\nQuestionHeader.displayName = 'QuestionHeader';\n","import * as React from 'react';\nimport { DotsSixVertical } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { QuestionTypeIcon, type QuestionType } from './QuestionTypeIcon';\n\nexport interface QuestionNumberTagProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** The question's number, shown as \"Question N\". */\n number: number;\n /** The question is being edited: the tag turns accent. */\n active?: boolean;\n /** The question's type, shown as a 16px icon at the start of the tag (the grip takes its place on hover when the tag can be dragged). */\n questionType?: QuestionType;\n /** Whether the grip icon appears on hover or focus. Defaults to true. Set false where the question can't be moved. */\n showDragHandle?: boolean;\n /** Turns the tag into a drag handle: spread onto it, so it takes anything a drag-and-drop library gives (listeners, attributes, a ref). */\n dragHandleProps?: React.ComponentPropsWithRef<'span'>;\n}\n\n// Figma: Question card components (357:4761) › Question_Header — the \"Question N\" tag of the editor variant, on its own so a list that is not an\n// editor (a plan, a summary) can number its questions the same way.\nexport const QuestionNumberTag = React.forwardRef<HTMLSpanElement, QuestionNumberTagProps>(\n ({ number, active, questionType, showDragHandle = true, dragHandleProps, className, ...props }, ref) => (\n <span\n ref={ref}\n aria-label={dragHandleProps ? `Reorder question ${number}` : undefined}\n {...props}\n {...dragHandleProps}\n className={cn(\n 'group/handle inline-flex h-6 shrink-0 items-center gap-1 rounded-sm px-2.5 text-ui-caption',\n // The tag makes room for the grip on hover, and inside a QuestionEditorCard whenever the card is hovered. With a type icon the grip\n // takes the icon's place, so the tag keeps its padding and its width.\n showDragHandle && !questionType && 'hover:pl-1 group-hover/editor:pl-1 group-data-[hovered]/editor:pl-1',\n active ? 'bg-accent-soft text-accent-soft-foreground' : 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground',\n dragHandleProps && 'cursor-grab touch-none select-none',\n dragHandleProps && showDragHandle && !questionType && 'focus-visible:pl-1',\n className,\n dragHandleProps?.className,\n )}\n >\n {questionType && (\n <QuestionTypeIcon\n type={questionType}\n size={16}\n // The grip takes the icon's place whenever it shows; a tag that can't be dragged keeps the icon.\n className={cn('shrink-0', showDragHandle && 'group-hover/editor:hidden group-data-[hovered]/editor:hidden group-hover/handle:hidden group-focus-visible/handle:hidden')}\n />\n )}\n {showDragHandle && (\n <DotsSixVertical\n size={16}\n aria-hidden\n className=\"hidden shrink-0 group-hover/editor:block group-data-[hovered]/editor:block group-hover/handle:block group-focus-visible/handle:block\"\n />\n )}\n Question {number}\n </span>\n ),\n);\nQuestionNumberTag.displayName = 'QuestionNumberTag';\n","import * as React from 'react';\nimport { ChatsCircle, CheckSquare, FileArrowUp, FileText, Image, ListNumbers, RadioButton, StarHalf, VideoCamera, type IconProps } from '@phosphor-icons/react';\n\n/**\n * `upload` is the generic file upload; `upload-video`, `upload-photo` and `upload-document` say which kind of file the respondent sends (a video icon, an image icon, a file-with-text\n * icon for PDF/PPTX/DOCX). A video upload shares the video camera with screen recording: no method offers both,\n * so they never meet in one activity.\n */\nexport type QuestionType =\n | 'select-one'\n | 'select-multiple'\n | 'ranking'\n | 'upload'\n | 'upload-video'\n | 'upload-photo'\n | 'upload-document'\n | 'rating'\n | 'open-end'\n | 'screen-recording';\n\nconst icons: Record<QuestionType, React.ComponentType<IconProps>> = {\n 'select-one': RadioButton,\n 'select-multiple': CheckSquare,\n ranking: ListNumbers,\n upload: FileArrowUp,\n 'upload-video': VideoCamera,\n 'upload-photo': Image,\n 'upload-document': FileText,\n rating: StarHalf,\n 'open-end': ChatsCircle,\n 'screen-recording': VideoCamera,\n};\n\nexport interface QuestionTypeIconProps extends Omit<IconProps, 'weight'> {\n type: QuestionType;\n}\n\n// Figma: Question types › Question type icons — duotone glyphs in the accent colour (22.5px).\nexport function QuestionTypeIcon({ type, size = 22.5, className, ...props }: QuestionTypeIconProps) {\n const Icon = icons[type];\n return <Icon size={size} weight=\"duotone\" aria-hidden className={className ?? 'text-accent-foreground'} {...props} />;\n}\n","import * as React from 'react';\nimport { DotsSixVertical, Warning, WarningCircle } from '@phosphor-icons/react';\nimport { Slot } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\nimport { QuestionTypeIcon, type QuestionType } from './QuestionTypeIcon';\n\nexport interface QuestionNavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** The question currently open in the editor. */\n selected?: boolean;\n /** Question type, shown as the leading 16px duotone icon. */\n questionType?: QuestionType;\n /** The question has validation problems — the type icon becomes the exclamation circle, in the destructive colour. */\n error?: boolean;\n /** The question has recommendations — the type icon becomes the exclamation triangle, in the warning colour. `error` wins when both are set. */\n warning?: boolean;\n /** Render the child element instead of a `<button>` (e.g. a router link). */\n asChild?: boolean;\n /**\n * Whether hovering swaps the type icon for the drag grip. Defaults to true. Set it to false when the row can't be moved (for\n * example while a translation is being edited), so the icon stays and the row doesn't suggest dragging.\n */\n showDragHandle?: boolean;\n /**\n * Shows the hover look (soft fill, drag grip in place of the type icon) without the pointer, for mirroring a hover that\n * happens elsewhere, such as over the same question's card.\n */\n hovered?: boolean;\n}\n\n// Figma: Question navigation (357:4645) — one row per question. Question-type icon (muted; accent when selected), exclamation circle on error (destructive border when selected, soft red fill on hover), exclamation triangle on warning (warning border when selected, soft amber fill on hover), drag handle on hover. Label is 14px.\nexport const QuestionNavItem = React.forwardRef<HTMLButtonElement, QuestionNavItemProps>(\n ({ className, questionType = 'select-one', selected, error, warning, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {\n const Comp = asChild ? Slot.Root : 'button';\n // An error outranks a warning: the row shows one problem state.\n const warn = !error && !!warning;\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : 'button'}\n aria-current={selected ? 'true' : undefined}\n data-hovered={hovered ? '' : undefined}\n className={cn(\n 'group/nav flex h-9.5 w-full max-w-106.5 items-center gap-2 rounded-sm border bg-surface p-2 text-left text-body-small text-surface-foreground transition-colors focus-visible:outline-none',\n error\n ? ['hover:bg-destructive-soft focus-visible:border-destructive', selected ? 'border-destructive' : 'border-border']\n : warn\n ? ['hover:bg-warning-soft focus-visible:border-warning-foreground', selected ? 'border-warning-foreground' : 'border-border']\n : [\n // Hover only changes the fill; the border stays as it is (default grey, or accent when selected).\n 'hover:bg-accent-soft focus-visible:border-input-accent',\n selected ? 'border-input-accent' : 'border-border',\n ],\n hovered && (error ? 'bg-destructive-soft' : warn ? 'bg-warning-soft' : 'bg-accent-soft'),\n className,\n )}\n {...props}\n >\n <span aria-hidden=\"true\" className=\"relative flex size-4 shrink-0 items-center justify-center\">\n {showDragHandle && <DotsSixVertical size={16} className=\"hidden group-hover/nav:block group-data-[hovered]/nav:block\" />}\n <span className={showDragHandle ? 'group-hover/nav:hidden group-data-[hovered]/nav:hidden' : undefined}>\n {error ? (\n <WarningCircle size={16} className=\"text-destructive-foreground\" />\n ) : warn ? (\n <Warning size={16} className=\"text-warning-foreground\" />\n ) : (\n <QuestionTypeIcon\n type={questionType}\n size={16}\n className={selected ? 'text-accent-foreground' : 'text-muted-foreground'}\n />\n )}\n </span>\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n {error && <span className=\"sr-only\">, has errors</span>}\n {warn && <span className=\"sr-only\">, has warnings</span>}\n </Comp>\n );\n },\n);\nQuestionNavItem.displayName = 'QuestionNavItem';\n","import * as React from 'react';\nimport { Check, DotsSixVertical, Plus, Trash, WarningCircle } from '@phosphor-icons/react';\n\nimport { cn, lengthOutOfRange } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Checkbox } from '../Forms & Data Entry/Checkbox';\nimport { DraftMarks, MarkedText, remapMarks, splitMarks, type InlineEditMark } from '../Forms & Data Entry/MarkedText';\nimport { RadioGroupItem } from '../Forms & Data Entry/RadioGroup';\n\nconst optionClasses =\n 'flex w-full max-w-150 cursor-pointer items-center gap-2 rounded-md border border-border bg-surface px-4 py-2 text-body-base text-surface-foreground transition-colors ' +\n // Hover changes the fill and shadow only; the border changes only when the option is selected.\n 'hover:bg-accent-soft hover:shadow-md ' +\n 'has-[[data-state=checked]]:border-accent-foreground ' +\n 'has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50';\n\ninterface OptionBase {\n label: React.ReactNode;\n className?: string;\n disabled?: boolean;\n}\n\nexport interface QuestionRadioOptionProps extends OptionBase {\n kind?: 'radio';\n /** Value in the surrounding `RadioGroup`. */\n value: string;\n}\n\nexport interface QuestionCheckboxOptionProps extends OptionBase {\n kind: 'checkbox';\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport type QuestionOptionProps = QuestionRadioOptionProps | QuestionCheckboxOptionProps;\n\n// Figma: Question input (282:1490) › Radio / Checkbox — a full-width answer card; hover changes the fill only, and only a selected option gets the accent border.\nexport function QuestionOption(props: QuestionOptionProps) {\n const id = React.useId();\n return (\n <label htmlFor={id} className={cn(optionClasses, props.className)}>\n {props.kind === 'checkbox' ? (\n <Checkbox\n id={id}\n checked={props.checked}\n defaultChecked={props.defaultChecked}\n onCheckedChange={(next) => props.onCheckedChange?.(next === true)}\n disabled={props.disabled}\n />\n ) : (\n <RadioGroupItem id={id} value={props.value} disabled={props.disabled} />\n )}\n <span className=\"min-w-0 flex-1\">{props.label}</span>\n </label>\n );\n}\n\nexport interface QuestionOtherOptionProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onSubmit'> {\n /** Called with the typed text when the confirm button (or Enter) is pressed. */\n onSubmit?: (value: string) => void;\n confirmLabel?: string;\n}\n\n// Figma: Question input › Other=Yes — a free-text answer with a small confirm button.\nexport const QuestionOtherOption = React.forwardRef<HTMLInputElement, QuestionOtherOptionProps>(\n ({ className, onSubmit, confirmLabel = 'Confirm answer', placeholder = 'Type your answer', ...props }, ref) => {\n const inner = React.useRef<HTMLInputElement>(null);\n React.useImperativeHandle(ref, () => inner.current as HTMLInputElement);\n const submit = () => onSubmit?.(inner.current?.value ?? '');\n return (\n <div\n className={cn(\n 'inline-flex items-center gap-2 rounded-md border border-border bg-surface py-2 pr-2 pl-4 focus-within:border-input-accent',\n className,\n )}\n >\n <input\n ref={inner}\n type=\"text\"\n placeholder={placeholder}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n submit();\n }\n }}\n className=\"min-w-0 bg-transparent text-body-base text-surface-foreground outline-none placeholder:text-muted-foreground\"\n {...props}\n />\n <Button type=\"button\" variant=\"subtle\" size=\"icon-sm\" aria-label={confirmLabel} onClick={submit}>\n <Check size={16} aria-hidden />\n </Button>\n </div>\n );\n },\n);\nQuestionOtherOption.displayName = 'QuestionOtherOption';\n\nexport interface QuestionOptionEditorProps {\n label: string;\n onLabelChange?: (label: string) => void;\n /** Called by the trash button. */\n onRemove?: () => void;\n /** Called by the add (+) button. */\n onAdd?: () => void;\n /** Shown while the option is empty, for example \"Option 1\". */\n placeholder?: string;\n /** `regular` shows the placeholder in the normal text colour instead of the muted one. Default `muted`. */\n placeholderTone?: 'muted' | 'regular';\n /**\n * Shortest label (in characters, ignoring surrounding spaces) that may be saved. With `minLength` or `maxLength` the label is\n * guarded like an `InlineEdit`: typing only changes a draft, Enter or leaving the field saves it through `onLabelChange`, a label\n * that is too short is not saved (the field stays open and says why), Escape reverts, and while it is being edited a line under\n * the row shows the allowed range and the live count, but only while the label is too short or too long. An unchanged label is never refused. Without either, `onLabelChange` is\n * called on every keystroke as before.\n */\n minLength?: number;\n /** Longest label (in characters). See `minLength`. */\n maxLength?: number;\n /** Disables the trash button, for example when the question is already at its minimum number of options. */\n removeDisabled?: boolean;\n /** Disables the add (+) button, for example when the question is already at its maximum number of options. */\n addDisabled?: boolean;\n className?: string;\n /**\n * Answer type. When set the row is quiet at rest: its normal border, the radio or checkbox indicator in front of the\n * label, and the remove/add buttons hidden but still taking their space, so the row is the same width in every state.\n * On hover or keyboard focus it becomes the editor: the shadow lifts, the drag handle replaces the indicator and the\n * buttons appear. The border colour does not change. Omit it for an always-on editor row.\n */\n kind?: 'radio' | 'checkbox' | 'rank';\n /**\n * `kind=\"rank\"` only: the position shown in the round number tag, as in `RankList`. For a ranking question the row keeps\n * its drag handle and number at rest and, like the other kinds, becomes the editor on hover or keyboard focus.\n */\n rank?: number;\n /**\n * Makes the grip a drag handle for reordering (spread the handle props of your drag library, e.g. dnd-kit's `attributes` and\n * `listeners`, with its `setActivatorNodeRef` as `ref`). The grip gets a grab cursor and is focusable; it is labelled\n * \"Reorder option N\" (N from `rank`) unless you pass your own `aria-label`. Omit it for a plain, decorative grip.\n */\n dragHandleProps?: React.ComponentPropsWithRef<'span'>;\n /**\n * The look of the row while it is being dragged: lifted shadow and the grip showing, as on hover. Use it on the copy that follows\n * the pointer; the row left behind in the list is dimmed by the caller.\n */\n lifted?: boolean;\n /**\n * Locks the row's place in the list: the label stays editable, but there is no drag grip (hover keeps the radio or checkbox\n * indicator; a ranking row keeps its number) and no remove or add buttons. For editing a translation, where the options themselves\n * are shared with the original.\n */\n locked?: boolean;\n /**\n * Ranges of the label to underline in the destructive colour, for example misspelled words found by a spell checker. The underline shows\n * while the label is not being edited. See `InlineEdit`'s `marks`.\n */\n marks?: InlineEditMark[];\n /** Makes each mark clickable: clicking an underlined word opens a card with the corrections and a Dismiss action. See `InlineEdit`'s `onMarkApply`. */\n onMarkApply?: (mark: InlineEditMark, replacement: string) => void;\n /** Called when a mark is dismissed from its card. */\n onMarkDismiss?: (mark: InlineEditMark) => void;\n}\n\n// Figma: Question input › Editor=Yes — an option being authored: drag handle, editable label, remove and add buttons.\n/** \"1 character required\" (the maximum shows in the live count beside it), or \"Up to 100 characters\" when there is no minimum. */\nfunction limitsText(min?: number, max?: number) {\n if (min !== undefined) return `${min} ${min === 1 ? 'character' : 'characters'} required`;\n if (max !== undefined) return `Up to ${max} characters`;\n return '';\n}\n\nexport function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone = 'muted', minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked, marks, onMarkApply, onMarkDismiss }: QuestionOptionEditorProps) {\n const reveal = kind !== undefined;\n const guarded = minLength !== undefined || maxLength !== undefined;\n // Guarded mode: `draft` is the text being typed (null while not editing) and `error` why the last save was refused.\n const [draft, setDraft] = React.useState<string | null>(null);\n const [error, setError] = React.useState<string | null>(null);\n const helperId = React.useId();\n const [focused, setFocused] = React.useState(false);\n const showMarks = !!marks?.length && !focused && draft === null;\n const fieldRef = React.useRef<HTMLInputElement>(null);\n // The marks as they stand while the label is edited: carried over keystroke by keystroke (see `remapMarks`).\n const [editMarks, setEditMarks] = React.useState<InlineEditMark[]>([]);\n const [scroll, setScroll] = React.useState(0);\n const typed = guarded ? (draft ?? label) : label;\n // Set while an Escape revert or a save by Enter is pending so the blur that follows does not save again.\n const skipBlur = React.useRef(false);\n const problemWith = (text: string) =>\n minLength !== undefined && text.trim().length < minLength ? `Enter at least ${minLength} ${minLength === 1 ? 'character' : 'characters'}.` : null;\n const save = () => {\n if (draft === null) return true;\n if (draft !== label) {\n const problem = problemWith(draft);\n if (problem) {\n setError(problem);\n return false;\n }\n onLabelChange?.(draft);\n }\n setDraft(null);\n setError(null);\n return true;\n };\n // The grip: decorative unless the caller makes it a drag handle.\n const gripProps: React.ComponentPropsWithRef<'span'> = dragHandleProps\n ? {\n 'aria-label': rank ? `Reorder option ${rank}` : 'Reorder option',\n ...dragHandleProps,\n className: cn('cursor-grab touch-none select-none', dragHandleProps.className),\n }\n : { 'aria-hidden': true };\n const grip = dragHandleProps ? (\n <span {...gripProps} className={cn('shrink-0', gripProps.className)}>\n <DotsSixVertical size={20} aria-hidden className=\"text-surface-foreground\" />\n </span>\n ) : (\n <DotsSixVertical size={20} aria-hidden className=\"shrink-0 text-surface-foreground\" />\n );\n return (\n <div className={cn('group/option flex w-full items-center gap-2', className)}>\n <div\n className={cn(\n 'flex min-h-11.5 min-w-0 flex-1 flex-col justify-center gap-1 rounded-md border bg-surface px-4 py-2 focus-within:border-input-accent',\n reveal\n ? // The border is always visible and does not change on hover; only the shadow lifts the row. The field being edited keeps the accent.\n cn('border-border group-hover/option:shadow-md group-focus-within/option:shadow-md', lifted && 'shadow-md')\n : 'border-border hover:border-input-muted hover:shadow-md',\n )}\n >\n <div className=\"flex min-w-0 items-start gap-2\">\n {/* The leading grip, indicator or number is as tall as the input's line (28px), so they stay centred on the text; the helper line then sits under the input. */}\n {(kind !== undefined || !locked) && (\n <div className=\"flex h-7 shrink-0 items-center gap-2\">\n {kind === 'rank' ? (\n <>\n {!locked && grip}\n <span\n aria-hidden=\"true\"\n className=\"flex size-6 shrink-0 items-center justify-center rounded-full border border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-ui-caption text-surface-foreground\"\n >\n {rank}\n </span>\n </>\n ) : reveal && locked ? (\n <span aria-hidden=\"true\" className=\"relative flex size-5 shrink-0 items-center justify-center\">\n <span className={cn('inline-flex size-4 border-2 border-input bg-surface', kind === 'radio' ? 'rounded-full' : 'rounded-xxs')} />\n </span>\n ) : reveal ? (\n <span {...gripProps} className={cn('relative flex size-5 shrink-0 items-center justify-center', gripProps.className)}>\n <span\n aria-hidden=\"true\"\n className={cn(\n 'inline-flex size-4 border-2 border-input bg-surface group-hover/option:hidden group-focus-within/option:hidden',\n lifted && 'hidden',\n kind === 'radio' ? 'rounded-full' : 'rounded-xxs',\n )}\n />\n <DotsSixVertical\n size={20}\n aria-hidden\n className={cn(\n 'hidden shrink-0 text-surface-foreground group-hover/option:block group-focus-within/option:block',\n lifted && 'block',\n )}\n />\n </span>\n ) : locked ? null : (\n grip\n )}\n </div>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div className=\"relative min-w-0\">\n {/* Behind the field, which is transparent and painted over it: the highlight and the browser's text selection show together. */}\n {focused && editMarks.length > 0 && <DraftMarks layer=\"behind\" singleLine text={typed} marks={editMarks} scrollLeft={scroll} className=\"flex items-center whitespace-pre text-body-base\" />}\n <input\n ref={fieldRef}\n aria-label=\"Option label\"\n aria-invalid={error ? true : undefined}\n aria-describedby={guarded && draft !== null ? helperId : undefined}\n placeholder={placeholder}\n maxLength={maxLength}\n value={guarded ? (draft ?? label) : label}\n onFocus={() => {\n setFocused(true);\n setEditMarks(marks ?? []);\n if (guarded && draft === null) setDraft(label);\n }}\n onChange={(event) => {\n requestAnimationFrame(() => setScroll(fieldRef.current?.scrollLeft ?? 0));\n setEditMarks(remapMarks(typed, event.target.value, editMarks));\n if (!guarded) return onLabelChange?.(event.target.value);\n setDraft(event.target.value);\n // After a refused save the message follows what is typed and goes away once the text is acceptable.\n if (error) setError(problemWith(event.target.value));\n }}\n onScroll={(event) => setScroll(event.currentTarget.scrollLeft)}\n onKeyDown={(event) => {\n if (!guarded) return;\n if (event.key === 'Escape') {\n skipBlur.current = true;\n setDraft(null);\n setError(null);\n fieldRef.current?.blur();\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (save()) {\n skipBlur.current = true;\n fieldRef.current?.blur();\n }\n }\n }}\n onBlur={() => {\n setFocused(false);\n if (!guarded) return;\n if (skipBlur.current) {\n skipBlur.current = false;\n return;\n }\n save();\n }}\n className={cn(\n 'relative w-full min-w-0 bg-transparent text-body-base text-surface-foreground outline-none',\n placeholderTone === 'regular' ? 'placeholder:text-surface-foreground' : 'placeholder:text-muted-foreground',\n // The marked text is drawn over the field, so the field's own letters step aside until it is edited.\n showMarks && 'text-transparent',\n )}\n />\n {focused && editMarks.length > 0 && <DraftMarks layer=\"over\" singleLine text={typed} marks={editMarks} scrollLeft={scroll} className=\"flex items-center whitespace-pre text-body-base\" />}\n {showMarks && (\n <div aria-hidden className=\"pointer-events-none absolute inset-0 flex items-center overflow-hidden whitespace-pre text-body-base text-surface-foreground [&_[data-mark]]:pointer-events-auto\">\n {splitMarks(label, marks).map((piece, i) =>\n piece.mark ? <MarkedText key={`${piece.mark.start}:${piece.text}`} mark={piece.mark} text={piece.text} onApply={onMarkApply} onDismiss={onMarkDismiss} /> : <span key={i}>{piece.text}</span>,\n )}\n </div>\n )}\n </div>\n {guarded && draft !== null && (error || lengthOutOfRange(draft, minLength, maxLength)) && (\n <p\n id={helperId}\n role={error ? 'alert' : undefined}\n className={cn('flex items-start justify-between gap-2 text-ui-caption', error ? 'text-destructive' : 'text-secondary-muted-foreground')}\n >\n <span className=\"flex items-start gap-2\">\n {error && <WarningCircle size={16} aria-hidden className=\"shrink-0\" />}\n {limitsText(minLength, maxLength)}\n {error && <span className=\"sr-only\">{error}</span>}\n </span>\n <span aria-hidden className=\"shrink-0 tabular-nums\">\n {draft.length}\n {maxLength !== undefined && `/${maxLength}`}\n </span>\n </p>\n )}\n </div>\n </div>\n </div>\n {!locked && (\n <div\n className={cn(\n 'flex items-center gap-2',\n reveal && 'opacity-0 transition-opacity group-hover/option:opacity-100 group-focus-within/option:opacity-100',\n )}\n >\n <Button type=\"button\" variant=\"destructive\" size=\"icon-sm\" aria-label=\"Remove option\" disabled={removeDisabled} onClick={onRemove}>\n <Trash size={16} aria-hidden />\n </Button>\n <Button type=\"button\" variant=\"ghost\" size=\"icon-sm\" aria-label=\"Add option\" disabled={addDisabled} onClick={onAdd}>\n <Plus size={16} aria-hidden />\n </Button>\n </div>\n )}\n </div>\n );\n}\n","import * as React from 'react';\nimport { DotsSixVertical } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface RankItemData {\n id: string;\n label: React.ReactNode;\n}\n\nexport interface RankListProps extends Omit<React.HTMLAttributes<HTMLOListElement>, 'onChange'> {\n items: RankItemData[];\n /** Called with the new order after a drag or a keyboard move. */\n onItemsChange: (items: RankItemData[]) => void;\n}\n\nfunction move<T>(list: T[], from: number, to: number): T[] {\n if (from === to || to < 0 || to >= list.length) return list;\n const next = list.slice();\n const [item] = next.splice(from, 1);\n next.splice(to, 0, item as T);\n return next;\n}\n\n// Figma: Question input › Rank_choice — draggable rows with a numbered badge; hover turns the row and badge accent.\nexport const RankList = React.forwardRef<HTMLOListElement, RankListProps>(\n ({ className, items, onItemsChange, ...props }, ref) => {\n const [dragIndex, setDragIndex] = React.useState<number | null>(null);\n const [announcement, setAnnouncement] = React.useState('');\n const handles = React.useRef(new Map<string, HTMLButtonElement>());\n const refocus = React.useRef<string | null>(null);\n\n React.useEffect(() => {\n if (refocus.current) {\n handles.current.get(refocus.current)?.focus();\n refocus.current = null;\n }\n });\n\n const reorder = (from: number, to: number, id: string) => {\n const next = move(items, from, to);\n if (next === items) return;\n refocus.current = id;\n setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);\n onItemsChange(next);\n };\n\n return (\n <>\n <ol ref={ref} className={cn('flex w-full max-w-150 flex-col gap-4', className)} {...props}>\n {items.map((item, index) => (\n <li\n key={item.id}\n draggable\n onDragStart={() => setDragIndex(index)}\n onDragOver={(event) => event.preventDefault()}\n onDrop={() => {\n if (dragIndex !== null) reorder(dragIndex, index, item.id);\n setDragIndex(null);\n }}\n onDragEnd={() => setDragIndex(null)}\n className={cn(\n 'group/rank flex items-center gap-3 overflow-hidden rounded-sm border border-border bg-surface px-4 py-2.5 text-body-base text-surface-foreground transition-colors',\n 'hover:border-accent-foreground hover:shadow-md',\n dragIndex === index && 'opacity-50',\n )}\n >\n <button\n type=\"button\"\n ref={(el) => {\n if (el) handles.current.set(item.id, el);\n else handles.current.delete(item.id);\n }}\n aria-label={`Reorder, position ${index + 1} of ${items.length}. Use the up and down arrow keys to move.`}\n onKeyDown={(event) => {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n reorder(index, index - 1, item.id);\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n reorder(index, index + 1, item.id);\n }\n }}\n className=\"inline-flex shrink-0 cursor-grab rounded-xs text-surface-foreground\"\n >\n <DotsSixVertical size={16} aria-hidden />\n </button>\n <span\n aria-hidden=\"true\"\n className=\"flex size-6 shrink-0 items-center justify-center rounded-full border border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-ui-caption text-surface-foreground group-hover/rank:border-accent-foreground group-hover/rank:bg-accent-soft group-hover/rank:bg-none group-hover/rank:text-accent-soft-foreground\"\n >\n {index + 1}\n </span>\n <span className=\"min-w-0 flex-1\">{item.label}</span>\n </li>\n ))}\n </ol>\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {announcement}\n </span>\n </>\n );\n },\n);\nRankList.displayName = 'RankList';\n","import * as React from 'react';\nimport { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport interface RatingScaleProps\n extends Omit<React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root>, 'type' | 'value' | 'defaultValue' | 'onValueChange'> {\n /** Number of points on the scale. */\n max?: number;\n /** Selected rating (1-based), or `undefined` for none. */\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number | undefined) => void;\n /** Caption under the first point (e.g. \"Not likely\"). */\n lowLabel?: React.ReactNode;\n /** Caption under the last point (e.g. \"Very likely\"). */\n highLabel?: React.ReactNode;\n}\n\n// Figma: Question input (282:1490) › Rating scale item — equal-width 48px buttons; selected has a 2px accent border.\nexport const RatingScale = React.forwardRef<React.ElementRef<typeof ToggleGroupPrimitive.Root>, RatingScaleProps>(\n ({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {\n const [internal, setInternal] = React.useState<number | undefined>(defaultValue);\n const current = value !== undefined ? value : internal;\n return (\n <div className={cn('flex w-full max-w-150 flex-col gap-2', className)}>\n <ToggleGroupPrimitive.Root\n ref={ref}\n type=\"single\"\n value={current ? String(current) : ''}\n onValueChange={(next) => {\n const parsed = next ? Number(next) : undefined;\n setInternal(parsed);\n onValueChange?.(parsed);\n }}\n className=\"flex gap-2\"\n {...props}\n >\n {Array.from({ length: max }, (_, i) => i + 1).map((n) => (\n <ToggleGroupPrimitive.Item\n key={n}\n value={String(n)}\n aria-label={`${n}`}\n className={cn(\n 'flex h-12 min-w-0 flex-1 items-center justify-center rounded-sm border-2 border-border bg-surface text-ui-label-large text-surface-foreground transition-colors',\n 'hover:bg-accent-soft',\n 'data-[state=on]:border-accent-foreground data-[state=on]:text-accent-foreground',\n )}\n >\n {n}\n </ToggleGroupPrimitive.Item>\n ))}\n </ToggleGroupPrimitive.Root>\n {(lowLabel != null || highLabel != null) && (\n <div className=\"flex justify-between text-ui-caption text-secondary-muted-foreground\" aria-hidden=\"true\">\n <span>{lowLabel}</span>\n <span>{highLabel}</span>\n </div>\n )}\n </div>\n );\n },\n);\nRatingScale.displayName = 'RatingScale';\n","import * as React from 'react';\nimport { Image as ImageIcon, ImageBroken, Trash } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { InlineEdit } from '../Forms & Data Entry/InlineEdit';\n\nexport interface StimulusCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Image shown in the square thumbnail (92-240px, as tall as the text). Without one the thumbnail shows `icon` on a neutral fill. */\n thumbnail?: string;\n /** Alt text for `thumbnail`. Leave empty when the caption already describes the image. */\n thumbnailAlt?: string;\n /** Placeholder shown in the thumbnail when there is no `thumbnail` (e.g. a video camera for a video). Defaults to an image icon. */\n icon?: React.ReactNode;\n /**\n * `error` swaps the thumbnail for a broken-image icon on the destructive soft fill, for a stimulus that could not be\n * loaded. It is also applied automatically when `thumbnail` fails to load.\n */\n status?: 'default' | 'error';\n /** Small line above the caption saying who speaks it. */\n label?: React.ReactNode;\n /** What the AI moderator says when it shows the stimulus, e.g. \"Look at this image\". */\n caption?: string;\n /** Editor mode: makes the caption editable (click to edit, Enter or blur saves) and is called with the new text. */\n onCaptionChange?: (caption: string) => void;\n /** Editor mode: placeholder for an empty caption. */\n captionPlaceholder?: string;\n /** Editor mode: caption length limit. Also what the counter counts against. */\n maxLength?: number;\n /** Editor mode: allow the \"n/2000 characters\" counter under the caption, which shows only when the caption is over `maxLength`. Defaults to `true`; needs `maxLength`. */\n showCounter?: boolean;\n /** Shows the trash button. */\n onRemove?: () => void;\n /** Accessible name of the trash button. Defaults to \"Remove stimulus\". */\n removeLabel?: string;\n}\n\n// 92px = the card's 98px minimum height minus its padding and border. A one-line caption with the counter showing is exactly that tall,\n// so the card keeps the same height with or without the counter (it shows only when the caption is over the maximum).\nconst MIN_THUMBNAIL = 92;\nconst MAX_THUMBNAIL = 240;\n\n// Figma: Stimulus card (605:3462) — a stimulus (image or video) with what the AI moderator says about it, and a remove button.\nexport const StimulusCard = React.forwardRef<HTMLDivElement, StimulusCardProps>(\n (\n {\n className,\n thumbnail,\n thumbnailAlt = '',\n icon,\n status = 'default',\n label = 'AI Moderator',\n caption,\n onCaptionChange,\n captionPlaceholder = 'Click to write what the AI moderator says',\n maxLength,\n showCounter = true,\n onRemove,\n removeLabel = 'Remove stimulus',\n ...props\n },\n ref,\n ) => {\n // Remember which source failed, so a new `thumbnail` gets a fresh chance to load.\n const [failedSrc, setFailedSrc] = React.useState<string | undefined>();\n const error = status === 'error' || (thumbnail !== undefined && failedSrc === thumbnail);\n const showImage = thumbnail !== undefined && !error;\n // Live character count while the caption is being edited (the saved value otherwise).\n const [draft, setDraft] = React.useState<string | null>(null);\n const count = (draft ?? caption ?? '').length;\n\n // The thumbnail is square and as tall as the text column (92-240px), so it grows when the caption wraps. That is circular in\n // plain CSS (its width narrows the text, which changes its height), so measure the text and size the thumbnail from it.\n const textRef = React.useRef<HTMLDivElement>(null);\n const [thumbnailSize, setThumbnailSize] = React.useState(MIN_THUMBNAIL);\n React.useEffect(() => {\n const el = textRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => {\n setThumbnailSize(Math.min(MAX_THUMBNAIL, Math.max(MIN_THUMBNAIL, Math.ceil(el.getBoundingClientRect().height))));\n });\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n return (\n <div\n ref={ref}\n data-status={error ? 'error' : 'default'}\n className={cn('flex min-h-24.5 w-full items-center gap-4 rounded-md border border-border p-0.5 pr-4', className)}\n {...props}\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-4\">\n <span\n style={{ width: thumbnailSize, height: thumbnailSize }}\n className={cn(\n 'relative flex shrink-0 items-center justify-center overflow-hidden rounded-sm border',\n error\n ? 'border-destructive-soft-border bg-destructive-soft bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-destructive'\n : 'border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground',\n showImage && 'bg-none',\n )}\n >\n {showImage ? (\n // Out of flow, so the image's own size never sets the thumbnail's size.\n <img src={thumbnail} alt={thumbnailAlt} className=\"absolute inset-0 size-full object-cover\" onError={() => setFailedSrc(thumbnail)} />\n ) : error ? (\n <ImageBroken size={24} aria-hidden />\n ) : (\n (icon ?? <ImageIcon size={24} aria-hidden />)\n )}\n </span>\n <div ref={textRef} className=\"flex min-w-0 flex-1 flex-col justify-center gap-2 py-2 text-surface-foreground\">\n <p className=\"w-full text-ui-label\">{label}</p>\n {onCaptionChange ? (\n <InlineEdit\n variant=\"question\"\n multiline\n // The editor pads its text (top 4px, bottom 5px plus a 1px border); pull that back so the card is as tall as its content.\n className=\"-mx-3 -mt-1 -mb-1.5 w-auto\"\n aria-label=\"Stimulus caption\"\n value={caption ?? ''}\n placeholder={captionPlaceholder}\n maxLength={maxLength}\n onValueChange={onCaptionChange}\n onDraftChange={setDraft}\n onEditingChange={(editing) => {\n if (!editing) setDraft(null);\n }}\n textClassName=\"text-body-base\"\n />\n ) : (\n <p className=\"w-full text-body-base [word-break:break-word]\">{caption}</p>\n )}\n {onCaptionChange && showCounter && maxLength !== undefined && count > maxLength && (\n <p className=\"text-ui-caption text-secondary-muted-foreground\">\n {count}/{maxLength} characters\n </p>\n )}\n </div>\n </div>\n {onRemove && (\n <Button type=\"button\" variant=\"destructive\" size=\"icon-sm\" aria-label={removeLabel} onClick={onRemove}>\n <Trash size={16} aria-hidden />\n </Button>\n )}\n </div>\n );\n },\n);\nStimulusCard.displayName = 'StimulusCard';\n","import * as React from 'react';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/utils';\n\nexport interface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {\n /** Heading shown above the track, left-aligned (e.g. \"Project Progress\"). */\n label?: React.ReactNode;\n /** Right-aligned value above the track. Pass `true` to render `value%`. */\n valueLabel?: React.ReactNode | true;\n /** Left caption below the track (e.g. \"16 of 25 tasks completed\"). */\n detailsStart?: React.ReactNode;\n /** Right caption below the track (e.g. \"Est. 3 days remaining\"). */\n detailsEnd?: React.ReactNode;\n}\n\n// Figma: Progress Bar (36). Track is `secondary`, indicator is `accent`, both full-radius, 8px tall.\nexport const Progress = React.forwardRef<React.ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n ({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {\n const hasHeader = label != null || valueLabel != null;\n const hasDetails = detailsStart != null || detailsEnd != null;\n const clamped = Math.min(100, Math.max(0, value ?? 0));\n return (\n <div className={cn('flex w-full flex-col gap-2', className)}>\n {hasHeader && (\n <div className=\"flex items-center justify-between text-ui-label text-surface-foreground\">\n <span>{label}</span>\n <span>{valueLabel === true ? `${Math.round(clamped)}%` : valueLabel}</span>\n </div>\n )}\n <ProgressPrimitive.Root\n ref={ref}\n value={clamped}\n className=\"relative h-2 w-full overflow-hidden rounded-full bg-secondary\"\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full rounded-full bg-accent transition-[width]\"\n style={{ width: `${clamped}%` }}\n />\n </ProgressPrimitive.Root>\n {hasDetails && (\n <div className=\"flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground\">\n <span>{detailsStart}</span>\n <span>{detailsEnd}</span>\n </div>\n )}\n </div>\n );\n },\n);\nProgress.displayName = 'Progress';\n","import * as React from 'react';\nimport { CaretDown, CaretUp } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\n\nexport interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {\n /** Alternate row backgrounds (Figma: Stripe = Yes). */\n striped?: boolean;\n /** Class names for the bordered, rounded scroll container around the `<table>`. */\n containerClassName?: string;\n /** Ref to the scroll container around the `<table>`, e.g. for virtualization or infinite scrolling. */\n containerRef?: React.Ref<HTMLDivElement>;\n}\n\n// Figma: Tables (27) — 12px-radius bordered container; rows are separated by 1px `border` lines.\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n ({ className, containerClassName, containerRef, striped, ...props }, ref) => (\n <div ref={containerRef} className={cn('relative w-full overflow-auto rounded-lg border border-border bg-surface', containerClassName)}>\n <table\n ref={ref}\n data-striped={striped ? '' : undefined}\n className={cn('group/table w-full border-collapse text-body-small text-surface-foreground', className)}\n {...props}\n />\n </div>\n ),\n);\nTable.displayName = 'Table';\n\nexport const TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <thead ref={ref} className={className} {...props} />,\n);\nTableHeader.displayName = 'TableHeader';\n\nexport const TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <tfoot ref={ref} className={cn('border-t border-border bg-background text-ui-label', className)} {...props} />\n ),\n);\nTableFooter.displayName = 'TableFooter';\n\nexport const TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tbody ref={ref} className={className} {...props} />,\n);\nTableBody.displayName = 'TableBody';\n\nexport interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {\n /** Highlights the row and marks it with the accent edge (Figma: State = Selected). */\n selected?: boolean;\n}\n\n// Figma: Table Row (29) — Default / Hover (`accent-soft`) / Selected (accent left edge on the first cell).\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, selected, ...props }, ref) => (\n <tr\n ref={ref}\n data-state={selected ? 'selected' : undefined}\n aria-selected={selected || undefined}\n className={cn(\n 'group/row border-b border-border transition-colors last:border-b-0',\n 'group-data-[striped]/table:even:bg-background hover:bg-accent-soft group-data-[striped]/table:even:hover:bg-accent-soft',\n className,\n )}\n {...props}\n />\n ),\n);\nTableRow.displayName = 'TableRow';\n\ntype Align = 'left' | 'right';\n\nexport interface TableHeadProps extends Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> {\n align?: Align;\n /** Render the label as a sort button. Provide `sort` and `onSort`. */\n sortable?: boolean;\n sort?: 'none' | 'asc' | 'desc';\n onSort?: () => void;\n /** Narrow centred column for a select-all checkbox. */\n checkbox?: boolean;\n /** Drag handle rendered at the trailing edge of the header, e.g. for column resizing. Makes the cell `relative`. */\n resizer?: React.ReactNode;\n}\n\nconst ariaSort = { none: 'none', asc: 'ascending', desc: 'descending' } as const;\n\n// Figma: Table Header Row (28) › Table Header Cell — 40px, `ui/label` text; sortable cells show a caret.\nexport const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(\n ({ className, align = 'left', sortable, sort = 'none', onSort, checkbox, resizer, children, ...props }, ref) => {\n const caret =\n sort === 'asc' ? <CaretUp size={16} aria-hidden className=\"shrink-0\" /> : <CaretDown size={16} aria-hidden className=\"shrink-0\" />;\n return (\n <th\n ref={ref}\n scope=\"col\"\n aria-sort={sortable ? ariaSort[sort] : undefined}\n className={cn(\n 'h-10 border-b border-border text-ui-label whitespace-nowrap',\n checkbox ? 'w-13 px-0 text-center' : 'px-4 py-3',\n align === 'right' ? 'text-right' : 'text-left',\n resizer && 'relative',\n className,\n )}\n {...props}\n >\n {sortable ? (\n <button\n type=\"button\"\n onClick={onSort}\n className={cn('inline-flex items-center gap-1 rounded-xs', align === 'right' && 'flex-row-reverse')}\n >\n {children}\n {caret}\n </button>\n ) : checkbox ? (\n <div className=\"flex items-center justify-center\">{children}</div>\n ) : (\n children\n )}\n {resizer}\n </th>\n );\n },\n);\nTableHead.displayName = 'TableHead';\n\nexport interface TableCellProps extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> {\n align?: Align;\n /** Secondary text colour (Figma: Type = Muted). */\n muted?: boolean;\n /** Narrow centred cell for a checkbox or radio. */\n checkbox?: boolean;\n /** Right-aligned cell for row actions; lays its children out in a row with 4px gaps. */\n actions?: boolean;\n}\n\n// Figma: Table Row (29) › Table Cell — 40px tall, 16px inline padding, 14/20 value.\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ className, align = 'left', muted, checkbox, actions, children, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'h-10 text-body-small',\n 'group-data-[state=selected]/row:first:border-l-2 group-data-[state=selected]/row:first:border-l-input-accent',\n checkbox ? 'w-13 px-0 text-center' : actions ? 'px-4 py-1.5 text-right' : 'px-4 py-3',\n align === 'right' && 'text-right',\n muted ? 'text-secondary-muted-foreground' : 'text-surface-foreground',\n className,\n )}\n {...props}\n >\n {checkbox ? <div className=\"flex items-center justify-center\">{children}</div> : actions ? <div className=\"flex items-start justify-end gap-1\">{children}</div> : children}\n </td>\n ),\n);\nTableCell.displayName = 'TableCell';\n\nexport interface TableCellTwoLinesProps extends React.HTMLAttributes<HTMLDivElement> {\n primary: React.ReactNode;\n secondary?: React.ReactNode;\n /** Leading avatar / image (Figma: Two Lines Avatar). */\n avatar?: React.ReactNode;\n}\n\n/** Primary + support text stack for a `TableCell` (Figma: Type = Two Lines / Option). Set the row/cell height to `h-14`. */\nexport function TableCellTwoLines({ primary, secondary, avatar, className, ...props }: TableCellTwoLinesProps) {\n return (\n <div className={cn('flex items-center gap-2', className)} {...props}>\n {avatar}\n <div className=\"flex flex-col gap-0.5 whitespace-nowrap\">\n <span className=\"text-ui-label text-surface-foreground\">{primary}</span>\n {secondary && <span className=\"text-ui-caption text-secondary-muted-foreground\">{secondary}</span>}\n </div>\n </div>\n );\n}\n","import * as React from 'react';\nimport { CaretDown, CaretRight, PushPin, PushPinSlash, Rows, Sliders, Stack } from '@phosphor-icons/react';\nimport {\n aggregationFn_count,\n aggregationFn_extent,\n aggregationFn_max,\n aggregationFn_mean,\n aggregationFn_median,\n aggregationFn_min,\n aggregationFn_sum,\n aggregationFn_unique,\n aggregationFn_uniqueCount,\n cellSelectionFeature,\n cellSpanningFeature,\n columnFacetingFeature,\n columnFilteringFeature,\n columnGroupingFeature,\n columnOrderingFeature,\n columnPinningFeature,\n columnResizingFeature,\n columnSizingFeature,\n columnVisibilityFeature,\n createExpandedRowModel,\n createFacetedMinMaxValues,\n createFacetedRowModel,\n createFacetedUniqueValues,\n createFilteredRowModel,\n createGroupedRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n filterFn_arrIncludesSome,\n filterFn_equals,\n filterFn_equalsString,\n filterFn_inNumberRange,\n filterFn_includesString,\n flexRender,\n globalFilteringFeature,\n rowAggregationFeature,\n rowExpandingFeature,\n rowPaginationFeature,\n rowPinningFeature,\n rowSelectionFeature,\n rowSortingFeature,\n sortFn_alphanumeric,\n sortFn_basic,\n sortFn_datetime,\n sortFn_text,\n tableFeatures,\n useTable,\n type CellSelectionState,\n type Column,\n type ColumnDef,\n type ColumnFiltersState,\n type ColumnOrderState,\n type ColumnPinningState,\n type ColumnVisibilityState,\n type ExpandedState,\n type GroupingState,\n type PaginationState,\n type Row,\n type RowData,\n type RowPinningState,\n type RowSelectionState,\n type SortingState,\n} from '@tanstack/react-table';\nimport { useVirtualizer } from '@tanstack/react-virtual';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\nimport { Checkbox } from '../Forms & Data Entry/Checkbox';\nimport { Input } from '../Forms & Data Entry/Input';\nimport { SearchBar } from '../Forms & Data Entry/SearchBar';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../Forms & Data Entry/Select';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../Overlays & Feedback/DropdownMenu';\nimport { Pagination } from '../Utility/Pagination';\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n type TableProps,\n} from './Table';\n\n// Every TanStack feature DataTable can turn on. Declared once at module scope so TanStack keeps stable row models;\n// a feature only does work when the matching prop (or column option) switches it on.\nconst features = tableFeatures({\n rowSortingFeature,\n rowPaginationFeature,\n rowSelectionFeature,\n rowExpandingFeature,\n rowPinningFeature,\n rowAggregationFeature,\n columnVisibilityFeature,\n columnOrderingFeature,\n columnPinningFeature,\n columnSizingFeature,\n columnResizingFeature,\n columnFilteringFeature,\n globalFilteringFeature,\n columnFacetingFeature,\n columnGroupingFeature,\n cellSelectionFeature,\n cellSpanningFeature,\n // Row-model pipeline order: filter → group → sort → expand → paginate.\n facetedRowModel: createFacetedRowModel(),\n facetedUniqueValues: createFacetedUniqueValues(),\n facetedMinMaxValues: createFacetedMinMaxValues(),\n filteredRowModel: createFilteredRowModel(),\n groupedRowModel: createGroupedRowModel(),\n sortedRowModel: createSortedRowModel(),\n expandedRowModel: createExpandedRowModel(),\n paginatedRowModel: createPaginatedRowModel(),\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n basic: sortFn_basic,\n datetime: sortFn_datetime,\n text: sortFn_text,\n },\n filterFns: {\n arrIncludesSome: filterFn_arrIncludesSome,\n equals: filterFn_equals,\n equalsString: filterFn_equalsString,\n includesString: filterFn_includesString,\n inNumberRange: filterFn_inNumberRange,\n },\n aggregationFns: {\n count: aggregationFn_count,\n extent: aggregationFn_extent,\n max: aggregationFn_max,\n mean: aggregationFn_mean,\n median: aggregationFn_median,\n min: aggregationFn_min,\n sum: aggregationFn_sum,\n unique: aggregationFn_unique,\n uniqueCount: aggregationFn_uniqueCount,\n },\n});\n\n/**\n * A column definition for `DataTable`. Built with TanStack Table's `ColumnDef`, e.g. `{ accessorKey: 'name', header: 'Name' }`.\n * Besides the usual options it understands `aggregationFn` / `aggregatedCell` (grouping), `spanRows` / `spanColumns`\n * (cell spanning), `size` / `minSize` / `maxSize` (sizing and resizing), `footer`, and the `meta` below.\n */\nexport type DataTableColumnDef<TData extends RowData> = ColumnDef<typeof features, TData>;\n\n/** Optional `meta` on a column that `DataTable` understands. */\nexport interface DataTableColumnMeta {\n /** Right-align the header and cells, for numbers and amounts. */\n align?: 'left' | 'right';\n /** Secondary text colour for the column's cells. */\n muted?: boolean;\n /** Label shown in menus and used for accessible names. Defaults to the column id. */\n label?: string;\n /** Control shown in the filter row (`enableColumnFilters`). `select` offers the values found in the data, with counts. */\n filterVariant?: 'text' | 'select' | 'range';\n /** Render the cell as an input; pair with the table's `onCellEdit`. */\n editable?: boolean;\n /** Input type of an editable cell. */\n editType?: 'text' | 'number';\n}\n\nconst getMeta = (meta: unknown) => (meta ?? {}) as DataTableColumnMeta;\n\n/** Everything `DataTable` can start with when its state is not controlled. */\nexport interface DataTableInitialState {\n sorting?: SortingState;\n rowSelection?: RowSelectionState;\n columnVisibility?: ColumnVisibilityState;\n columnPinning?: Partial<ColumnPinningState>;\n columnOrder?: ColumnOrderState;\n columnFilters?: ColumnFiltersState;\n globalFilter?: string;\n grouping?: GroupingState;\n expanded?: ExpandedState;\n rowPinning?: Partial<RowPinningState>;\n pagination?: PaginationState;\n}\n\nexport interface DataTableProps<TData extends RowData>\n extends Omit<TableProps, 'children' | 'onSelect' | 'onChange'> {\n /** Column definitions (TanStack `ColumnDef`). Keep the array referentially stable (module scope or `useMemo`). */\n columns: DataTableColumnDef<TData>[];\n /** Row data. Keep referentially stable between renders. */\n data: TData[];\n /** Stable row id, used for selection, pinning and expansion. Defaults to the row index. */\n getRowId?: (row: TData, index: number) => string;\n /** Starting values for state the table owns. Ignored for state you control. */\n initialState?: DataTableInitialState;\n\n /** Let columns be sorted by clicking their header. Opt a single column out with `enableSorting: false`. */\n enableSorting?: boolean;\n /** Add a leading checkbox column with a select-all header checkbox. */\n enableRowSelection?: boolean;\n /** Show a \"Columns\" menu that toggles column visibility. */\n enableColumnVisibility?: boolean;\n /** Stick columns to the start or end edge. Pin with `initialState.columnPinning` or `column.pin('start' | 'end')`. */\n enableColumnPinning?: boolean;\n /** Apply each column's `size` (and `minSize` / `maxSize`) as its width. Implied by column pinning and resizing. */\n enableColumnSizing?: boolean;\n /** Drag the header edge to resize columns. Size columns with `size`, `minSize` and `maxSize` in the column definition. */\n enableColumnResizing?: boolean;\n /** `onChange` resizes live while dragging; `onEnd` applies the new width on release. */\n columnResizeMode?: 'onChange' | 'onEnd';\n /** Reorder columns by dragging their headers, or with Alt + arrow keys on a focused header. */\n enableColumnOrdering?: boolean;\n /** Show a filter row under the header. Pick each column's control with `meta.filterVariant`. */\n enableColumnFilters?: boolean;\n /** Show a search field above the table that filters across all columns. */\n enableGlobalFilter?: boolean;\n /** Placeholder of the global search field. */\n globalFilterPlaceholder?: string;\n /** Group rows by one or more columns, with a \"Group by\" menu. Aggregate with each column's `aggregationFn`. */\n enableGrouping?: boolean;\n /** Add a disclosure column to expand sub-rows (`getSubRows`) or a detail panel (`renderSubComponent`). */\n enableExpanding?: boolean;\n /** Add a column with a button that pins the row to the top of the table. */\n enableRowPinning?: boolean;\n /** Spreadsheet-style selection of cell ranges: drag, Shift-click, Ctrl/Cmd-click, arrow keys, Ctrl/Cmd + A. */\n enableCellSelection?: boolean;\n /** Render a footer row from each column's `footer`. */\n showFooter?: boolean;\n /** Show the row-density toggle in the toolbar. */\n enableDensityToggle?: boolean;\n /** Row density. `compact` uses shorter rows. */\n density?: 'default' | 'compact';\n onDensityChange?: (density: 'default' | 'compact') => void;\n\n /** Sub-rows of a row, for tree data. */\n getSubRows?: (row: TData, index: number) => TData[] | undefined;\n /** Whether a row can expand. Defaults to \"has sub-rows\", or \"always\" when `renderSubComponent` is set. */\n getRowCanExpand?: (row: Row<typeof features, TData>) => boolean;\n /** Detail panel shown under an expanded row. */\n renderSubComponent?: (row: TData) => React.ReactNode;\n\n /** Rows per page. The pagination bar is hidden when everything fits on one page. */\n pageSize?: number;\n /**\n * Sorting, filtering and pagination happen on your server: pass one page of already processed `data` plus the total `rowCount`,\n * and read the state through the controlled props below to build the request.\n */\n serverSide?: boolean;\n /** Total number of rows on the server. Required with `serverSide` for the page count. */\n rowCount?: number;\n\n /** Controlled sorting state. Pair with `onSortingChange`. */\n sorting?: SortingState;\n onSortingChange?: (sorting: SortingState) => void;\n /** Controlled selection state, keyed by row id. Pair with `onRowSelectionChange`. */\n rowSelection?: RowSelectionState;\n onRowSelectionChange?: (rowSelection: RowSelectionState) => void;\n /** Controlled pagination state. Pair with `onPaginationChange`. */\n pagination?: PaginationState;\n onPaginationChange?: (pagination: PaginationState) => void;\n /** Controlled column visibility, keyed by column id. Pair with `onColumnVisibilityChange`. */\n columnVisibility?: ColumnVisibilityState;\n onColumnVisibilityChange?: (columnVisibility: ColumnVisibilityState) => void;\n /** Controlled column pinning. Pair with `onColumnPinningChange`. */\n columnPinning?: ColumnPinningState;\n onColumnPinningChange?: (columnPinning: ColumnPinningState) => void;\n /** Controlled column order (column ids). Pair with `onColumnOrderChange`. */\n columnOrder?: ColumnOrderState;\n onColumnOrderChange?: (columnOrder: ColumnOrderState) => void;\n /** Controlled column filters. Pair with `onColumnFiltersChange`. */\n columnFilters?: ColumnFiltersState;\n onColumnFiltersChange?: (columnFilters: ColumnFiltersState) => void;\n /** Controlled global search text. Pair with `onGlobalFilterChange`. */\n globalFilter?: string;\n onGlobalFilterChange?: (globalFilter: string) => void;\n /** Controlled grouping (column ids). Pair with `onGroupingChange`. */\n grouping?: GroupingState;\n onGroupingChange?: (grouping: GroupingState) => void;\n /** Controlled expansion. Pair with `onExpandedChange`. */\n expanded?: ExpandedState;\n onExpandedChange?: (expanded: ExpandedState) => void;\n /** Controlled row pinning. Pair with `onRowPinningChange`. */\n rowPinning?: RowPinningState;\n onRowPinningChange?: (rowPinning: RowPinningState) => void;\n /** Called whenever the selected cell ranges change. */\n onCellSelectionChange?: (cellSelection: CellSelectionState) => void;\n\n /** Called when an editable cell (`meta.editable`) is committed with Enter or blur. Update your data in response. */\n onCellEdit?: (edit: { row: TData; rowId: string; columnId: string; value: string }) => void;\n\n /** Render only the visible rows. Give the table a bounded height with `containerClassName`, e.g. `max-h-96`. */\n virtualized?: boolean;\n /** Row height in pixels used before a row has been measured. Match `h-10` (40) unless rows are taller. */\n estimateRowHeight?: number;\n /** Infinite scrolling: called when the end of the table scrolls into view and `hasMore` is true. Disables pagination. Bound the height with `containerClassName` to scroll inside the table. */\n onLoadMore?: () => void;\n /** Whether more rows can be loaded. */\n hasMore?: boolean;\n /** A page of rows is loading; shows placeholder rows at the end. */\n loadingMore?: boolean;\n\n /** Keep the header in view while the table scrolls. On by default with row pinning and virtualization. */\n stickyHeader?: boolean;\n /** Show placeholder rows instead of data. */\n loading?: boolean;\n /** Content of the empty state. Defaults to \"No results.\" */\n emptyState?: React.ReactNode;\n /** Called when a row is clicked (not when its controls are). */\n onRowClick?: (row: TData) => void;\n /** Content for the left side of the toolbar, e.g. filter tabs. */\n toolbar?: React.ReactNode;\n /** Class names for the wrapper around the toolbar, table and pagination. */\n wrapperClassName?: string;\n}\n\n/** Controlled when `value` is defined, otherwise local state seeded with `initial`. */\nfunction useControllable<T>(value: T | undefined, initial: T, onChange?: (next: T) => void) {\n const [internal, setInternal] = React.useState<T>(initial);\n const current = value ?? internal;\n const update = React.useCallback(\n (updater: T | ((previous: T) => T)) => {\n const next = typeof updater === 'function' ? (updater as (previous: T) => T)(current) : updater;\n if (value === undefined) setInternal(next);\n onChange?.(next);\n },\n [current, value, onChange],\n );\n return [current, update] as const;\n}\n\nconst ALL = '__all__';\n\nconst labelOf = <TData extends RowData>(column: Column<typeof features, TData>) =>\n getMeta(column.columnDef.meta).label ?? (typeof column.columnDef.header === 'string' ? column.columnDef.header : column.id);\n\n// Sticky offsets for pinned columns. Widths come from TanStack's sizing model, so they are data, not design values.\nfunction pinning<TData extends RowData>(column: Column<typeof features, TData>, sized: boolean, header = false) {\n const side = column.getIsPinned();\n const style: React.CSSProperties = {};\n if (sized) {\n style.width = column.getSize();\n style.minWidth = column.getSize();\n style.maxWidth = column.getSize();\n }\n if (side) {\n style.position = 'sticky';\n if (side === 'start') style.insetInlineStart = column.getStart('start');\n else style.insetInlineEnd = column.getAfter('end');\n }\n const className = side\n ? cn(\n header ? 'z-30' : 'z-10',\n 'bg-surface',\n side === 'start' && column.getIsLastColumn('start') && 'border-r border-border',\n side === 'end' && column.getIsFirstColumn('end') && 'border-l border-border',\n )\n : undefined;\n return { style, className };\n}\n\ninterface ColumnFilterProps<TData extends RowData> {\n column: Column<typeof features, TData>;\n}\n\nfunction ColumnFilter<TData extends RowData>({ column }: ColumnFilterProps<TData>) {\n const variant = getMeta(column.columnDef.meta).filterVariant ?? 'text';\n const label = labelOf(column);\n const value = column.getFilterValue();\n\n if (variant === 'select') {\n const options = [...column.getFacetedUniqueValues().entries()].sort((a, b) => String(a[0]).localeCompare(String(b[0])));\n return (\n <Select\n value={typeof value === 'string' ? value : ALL}\n onValueChange={(next) => column.setFilterValue(next === ALL ? undefined : next)}\n >\n <SelectTrigger aria-label={`Filter ${label}`} className=\"h-8 text-body-small\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={ALL}>All</SelectItem>\n {options.map(([option, count]) => (\n <SelectItem key={String(option)} value={String(option)}>\n {String(option)} ({count})\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n );\n }\n\n if (variant === 'range') {\n const [min, max] = column.getFacetedMinMaxValues() ?? [];\n const range = (Array.isArray(value) ? value : []) as [number | undefined, number | undefined];\n const update = (index: 0 | 1, raw: string) => {\n const next: [number | undefined, number | undefined] = [range[0], range[1]];\n next[index] = raw === '' ? undefined : Number(raw);\n column.setFilterValue(next[0] === undefined && next[1] === undefined ? undefined : next);\n };\n return (\n <div className=\"flex gap-1\">\n <Input\n type=\"number\"\n aria-label={`${label} minimum`}\n placeholder={min !== undefined ? String(min) : 'Min'}\n value={range[0] ?? ''}\n onChange={(event) => update(0, event.target.value)}\n className=\"h-8 text-body-small\"\n />\n <Input\n type=\"number\"\n aria-label={`${label} maximum`}\n placeholder={max !== undefined ? String(max) : 'Max'}\n value={range[1] ?? ''}\n onChange={(event) => update(1, event.target.value)}\n className=\"h-8 text-body-small\"\n />\n </div>\n );\n }\n\n return (\n <Input\n aria-label={`Filter ${label}`}\n placeholder=\"Filter…\"\n value={typeof value === 'string' ? value : ''}\n onChange={(event) => column.setFilterValue(event.target.value || undefined)}\n className=\"h-8 text-body-small\"\n />\n );\n}\n\ninterface EditableCellProps {\n value: unknown;\n label: string;\n type: 'text' | 'number';\n onCommit: (value: string) => void;\n}\n\nfunction EditableCell({ value, label, type, onCommit }: EditableCellProps) {\n const initial = value == null ? '' : String(value);\n // `null` while not editing, so the input always shows the latest value from the data.\n const [draft, setDraft] = React.useState<string | null>(null);\n const cancelled = React.useRef(false);\n return (\n <Input\n type={type}\n aria-label={label}\n value={draft ?? initial}\n onChange={(event) => setDraft(event.target.value)}\n onBlur={() => {\n if (!cancelled.current && draft !== null && draft !== initial) onCommit(draft);\n cancelled.current = false;\n setDraft(null);\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') event.currentTarget.blur();\n if (event.key === 'Escape') {\n cancelled.current = true;\n event.currentTarget.blur();\n }\n }}\n className={cn('h-8 border-transparent bg-transparent text-body-small', type === 'number' && 'text-right')}\n />\n );\n}\n\n// Figma: Tables (27) — the visual layer is `Table`; TanStack Table supplies sorting, selection, paging, filtering,\n// grouping, pinning and the rest.\nfunction DataTableInner<TData extends RowData>(\n {\n columns,\n data,\n getRowId,\n initialState,\n enableSorting = false,\n enableRowSelection = false,\n enableColumnVisibility = false,\n enableColumnPinning = false,\n enableColumnSizing = false,\n enableColumnResizing = false,\n columnResizeMode = 'onChange',\n enableColumnOrdering = false,\n enableColumnFilters = false,\n enableGlobalFilter = false,\n globalFilterPlaceholder = 'Search',\n enableGrouping = false,\n enableExpanding = false,\n enableRowPinning = false,\n enableCellSelection = false,\n showFooter = false,\n enableDensityToggle = false,\n density: densityProp,\n onDensityChange,\n getSubRows,\n getRowCanExpand,\n renderSubComponent,\n pageSize = 10,\n serverSide = false,\n rowCount,\n sorting: sortingProp,\n onSortingChange,\n rowSelection: rowSelectionProp,\n onRowSelectionChange,\n pagination: paginationProp,\n onPaginationChange,\n columnVisibility: columnVisibilityProp,\n onColumnVisibilityChange,\n columnPinning: columnPinningProp,\n onColumnPinningChange,\n columnOrder: columnOrderProp,\n onColumnOrderChange,\n columnFilters: columnFiltersProp,\n onColumnFiltersChange,\n globalFilter: globalFilterProp,\n onGlobalFilterChange,\n grouping: groupingProp,\n onGroupingChange,\n expanded: expandedProp,\n onExpandedChange,\n rowPinning: rowPinningProp,\n onRowPinningChange,\n onCellSelectionChange,\n onCellEdit,\n virtualized = false,\n estimateRowHeight = 40,\n onLoadMore,\n hasMore = false,\n loadingMore = false,\n stickyHeader,\n loading = false,\n emptyState,\n onRowClick,\n toolbar,\n wrapperClassName,\n striped,\n containerClassName,\n containerRef,\n style: tableStyle,\n ...tableProps\n }: DataTableProps<TData>,\n ref: React.ForwardedRef<HTMLTableElement>,\n) {\n const [sorting, setSorting] = useControllable<SortingState>(sortingProp, initialState?.sorting ?? [], onSortingChange);\n const [rowSelection, setRowSelection] = useControllable<RowSelectionState>(\n rowSelectionProp,\n initialState?.rowSelection ?? {},\n onRowSelectionChange,\n );\n const [columnVisibility, setColumnVisibility] = useControllable<ColumnVisibilityState>(\n columnVisibilityProp,\n initialState?.columnVisibility ?? {},\n onColumnVisibilityChange,\n );\n const [columnPinning, setColumnPinning] = useControllable<ColumnPinningState>(\n columnPinningProp,\n { start: initialState?.columnPinning?.start ?? [], end: initialState?.columnPinning?.end ?? [] },\n onColumnPinningChange,\n );\n const [columnOrder, setColumnOrder] = useControllable<ColumnOrderState>(\n columnOrderProp,\n initialState?.columnOrder ?? [],\n onColumnOrderChange,\n );\n const [columnFilters, setColumnFilters] = useControllable<ColumnFiltersState>(\n columnFiltersProp,\n initialState?.columnFilters ?? [],\n onColumnFiltersChange,\n );\n const [globalFilter, setGlobalFilter] = useControllable<string>(\n globalFilterProp,\n initialState?.globalFilter ?? '',\n onGlobalFilterChange,\n );\n const [grouping, setGrouping] = useControllable<GroupingState>(groupingProp, initialState?.grouping ?? [], onGroupingChange);\n const [expanded, setExpanded] = useControllable<ExpandedState>(expandedProp, initialState?.expanded ?? {}, onExpandedChange);\n const [rowPinning, setRowPinning] = useControllable<RowPinningState>(\n rowPinningProp,\n { top: initialState?.rowPinning?.top ?? [], bottom: initialState?.rowPinning?.bottom ?? [] },\n onRowPinningChange,\n );\n const [pagination, setPagination] = useControllable<PaginationState>(\n paginationProp,\n initialState?.pagination ?? { pageIndex: 0, pageSize },\n onPaginationChange,\n );\n const [density, setDensity] = useControllable<'default' | 'compact'>(densityProp, 'default', onDensityChange);\n const [cellSelection, setCellSelection] = React.useState<CellSelectionState>([]);\n\n const infinite = Boolean(onLoadMore);\n const paginate = !virtualized && !infinite;\n const compact = density === 'compact';\n const sized = enableColumnSizing || enableColumnResizing || enableColumnPinning;\n const sticky = stickyHeader ?? (enableRowPinning || virtualized);\n\n const table = useTable({\n features,\n columns,\n data,\n getRowId,\n getSubRows,\n getRowCanExpand: getRowCanExpand ?? (renderSubComponent ? () => true : undefined),\n enableSorting,\n enableRowSelection,\n enableColumnResizing,\n enableColumnPinning,\n enableColumnFilters,\n enableGlobalFilter,\n enableGrouping,\n enableRowPinning,\n enableCellSelection,\n columnResizeMode,\n globalFilterFn: 'includesString',\n manualSorting: serverSide,\n manualFiltering: serverSide,\n manualPagination: serverSide || !paginate,\n rowCount: serverSide ? rowCount : undefined,\n autoResetPageIndex: !serverSide,\n state: {\n sorting,\n rowSelection,\n columnVisibility,\n columnPinning,\n columnOrder,\n columnFilters,\n globalFilter,\n grouping,\n expanded,\n rowPinning,\n cellSelection,\n pagination: { ...pagination, pageSize: paginationProp ? pagination.pageSize : pageSize },\n },\n onSortingChange: setSorting,\n onRowSelectionChange: setRowSelection,\n onColumnVisibilityChange: setColumnVisibility,\n onColumnPinningChange: setColumnPinning,\n onColumnOrderChange: setColumnOrder,\n onColumnFiltersChange: setColumnFilters,\n onGlobalFilterChange: setGlobalFilter,\n onGroupingChange: setGrouping,\n onExpandedChange: setExpanded,\n onRowPinningChange: setRowPinning,\n onCellSelectionChange: (updater) => {\n const next = typeof updater === 'function' ? updater(cellSelection) : updater;\n setCellSelection(next);\n onCellSelectionChange?.(next);\n },\n onPaginationChange: setPagination,\n });\n\n const headerGroups = table.getHeaderGroups();\n const leafColumns = table.getVisibleLeafColumns();\n const hasExpander = enableExpanding;\n const leadingCount = (enableRowSelection ? 1 : 0) + (hasExpander ? 1 : 0) + (enableRowPinning ? 1 : 0);\n const columnSpan = leafColumns.length + leadingCount;\n const pageCount = table.getPageCount();\n const selectedCount = Object.values(rowSelection).filter(Boolean).length;\n const hideableColumns = table.getAllLeafColumns().filter((column) => column.getCanHide());\n const groupableColumns = table.getAllLeafColumns().filter((column) => column.getCanGroup());\n const showToolbar = Boolean(toolbar) || enableColumnVisibility || enableGlobalFilter || enableGrouping || enableDensityToggle;\n const cellDensity = compact ? 'h-8 py-1.5' : undefined;\n const allSelected = table.getIsAllPageRowsSelected();\n const someSelected = table.getIsSomePageRowsSelected();\n const dragged = React.useRef<string | null>(null);\n\n const topRows = enableRowPinning ? table.getTopRows() : [];\n const bottomRows = enableRowPinning ? table.getBottomRows() : [];\n const bodyRows = enableRowPinning ? table.getCenterRows() : table.getRowModel().rows;\n\n // Virtualization of the body rows. Disabled (and cheap) unless `virtualized`.\n const scrollRef = React.useRef<HTMLDivElement | null>(null);\n const setScrollRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n scrollRef.current = node;\n if (typeof containerRef === 'function') containerRef(node);\n else if (containerRef) (containerRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [containerRef],\n );\n const virtualizer = useVirtualizer({\n count: bodyRows.length,\n getScrollElement: () => scrollRef.current,\n estimateSize: () => estimateRowHeight,\n overscan: 8,\n enabled: virtualized,\n initialRect: { width: 0, height: estimateRowHeight * 10 },\n });\n const virtualItems = virtualized ? virtualizer.getVirtualItems() : [];\n const paddingTop = virtualItems.length > 0 ? (virtualItems[0]?.start ?? 0) : 0;\n const paddingBottom = virtualItems.length > 0 ? virtualizer.getTotalSize() - (virtualItems.at(-1)?.end ?? 0) : 0;\n\n // Infinite scrolling: load more when the sentinel row scrolls into view.\n const sentinelRef = React.useRef<HTMLTableRowElement | null>(null);\n React.useEffect(() => {\n const node = sentinelRef.current;\n if (!node || !onLoadMore || !hasMore || loadingMore || typeof IntersectionObserver === 'undefined') return;\n // Watch inside the scroll container once it scrolls, otherwise against the page.\n const container = scrollRef.current;\n const root = container && container.scrollHeight > container.clientHeight ? container : null;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) onLoadMore();\n },\n { root, rootMargin: '0px 0px 160px 0px' },\n );\n observer.observe(node);\n return () => observer.disconnect();\n }, [onLoadMore, hasMore, loadingMore, bodyRows.length]);\n\n const reorder = (activeId: string, overId: string) => {\n if (activeId === overId) return;\n const ids = table.getAllLeafColumns().map((column) => column.id);\n const next = ids.filter((id) => id !== activeId);\n const at = next.indexOf(overId);\n next.splice(at === -1 ? next.length : at, 0, activeId);\n table.setColumnOrder(next);\n };\n\n const onGridKeyDown = (event: React.KeyboardEvent) => {\n const directions: Record<string, 'up' | 'down' | 'left' | 'right'> = {\n ArrowUp: 'up',\n ArrowDown: 'down',\n ArrowLeft: 'left',\n ArrowRight: 'right',\n };\n const direction = directions[event.key];\n if (direction) {\n event.preventDefault();\n if (event.shiftKey) table.extendCellSelection(direction);\n else table.moveCellSelection(direction);\n } else if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'a') {\n event.preventDefault();\n table.selectAllCells();\n } else if (event.key === 'Escape') {\n table.resetCellSelection(true);\n }\n };\n\n const skeletonRow = (rowKey: string) => (\n <TableRow key={rowKey} className=\"hover:bg-transparent\">\n {Array.from({ length: columnSpan }, (_, cell) => (\n <TableCell key={cell} checkbox={enableRowSelection && cell === 0} className={cellDensity}>\n <span aria-hidden className=\"block h-4 w-3/4 animate-pulse rounded-xs bg-border\" />\n </TableCell>\n ))}\n </TableRow>\n );\n\n const renderRow = (\n row: Row<typeof features, TData>,\n options: { pinned?: 'top' | 'bottom'; pinnedIndex?: number; pinnedCount?: number; virtualIndex?: number } = {},\n ) => {\n const { pinned, pinnedIndex = 0, pinnedCount = 1, virtualIndex } = options;\n const grouped = row.getIsGrouped();\n const rowUnits = compact ? 8 : 10;\n const pinStyle: React.CSSProperties | undefined = pinned\n ? pinned === 'top'\n ? { position: 'sticky', top: `calc(var(--spacing) * ${rowUnits * (pinnedIndex + 1)})` }\n : { position: 'sticky', bottom: `calc(var(--spacing) * ${rowUnits * (pinnedCount - 1 - pinnedIndex)})` }\n : undefined;\n const cells = row.getVisibleCells();\n\n return (\n <React.Fragment key={row.id}>\n <TableRow\n ref={virtualized && virtualIndex !== undefined ? virtualizer.measureElement : undefined}\n data-index={virtualIndex}\n selected={row.getIsSelected()}\n style={pinStyle}\n onClick={onRowClick && !grouped ? () => onRowClick(row.original) : undefined}\n className={cn(pinned && 'z-20 bg-surface', grouped && 'bg-background', onRowClick && !grouped && 'cursor-pointer')}\n >\n {enableRowSelection && (\n <TableCell checkbox className={cellDensity} onClick={(event) => event.stopPropagation()}>\n {!grouped && (\n <Checkbox\n aria-label=\"Select row\"\n checked={row.getIsSelected()}\n disabled={!row.getCanSelect()}\n onCheckedChange={(checked) => row.toggleSelected(Boolean(checked))}\n />\n )}\n </TableCell>\n )}\n {hasExpander && (\n <TableCell checkbox className={cellDensity} onClick={(event) => event.stopPropagation()}>\n {!grouped && row.getCanExpand() && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={row.getIsExpanded() ? 'Collapse row' : 'Expand row'}\n aria-expanded={row.getIsExpanded()}\n onClick={() => row.toggleExpanded()}\n >\n {row.getIsExpanded() ? <CaretDown size={16} aria-hidden /> : <CaretRight size={16} aria-hidden />}\n </Button>\n )}\n </TableCell>\n )}\n {enableRowPinning && (\n <TableCell checkbox className={cellDensity} onClick={(event) => event.stopPropagation()}>\n {!grouped && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={row.getIsPinned() ? 'Unpin row' : 'Pin row to top'}\n aria-pressed={Boolean(row.getIsPinned())}\n onClick={() => row.pin(row.getIsPinned() ? false : 'top')}\n >\n {row.getIsPinned() ? <PushPinSlash size={16} aria-hidden /> : <PushPin size={16} aria-hidden />}\n </Button>\n )}\n </TableCell>\n )}\n {cells.map((cell, index) => {\n if (cell.getIsCovered()) return null;\n const meta = getMeta(cell.column.columnDef.meta);\n const pin = pinning(cell.column, sized);\n const rowSpan = cell.getRowSpan();\n const colSpan = cell.getColSpan();\n const edges = enableCellSelection && cell.getIsSelected() ? cell.getSelectionEdges() : undefined;\n const indent = index === 0 && hasExpander && row.depth > 0 ? row.depth * 4 : 0;\n\n let content: React.ReactNode;\n if (cell.getIsGrouped()) {\n content = (\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 rounded-xs text-ui-label\"\n aria-expanded={row.getIsExpanded()}\n onClick={row.getToggleExpandedHandler()}\n >\n {row.getIsExpanded() ? <CaretDown size={16} aria-hidden /> : <CaretRight size={16} aria-hidden />}\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n <span className=\"text-secondary-muted-foreground\">({row.subRows.length})</span>\n </button>\n );\n } else if (cell.getIsAggregated()) {\n content = flexRender(cell.column.columnDef.aggregatedCell ?? cell.column.columnDef.cell, cell.getContext());\n } else if (cell.getIsPlaceholder()) {\n content = null;\n } else if (meta.editable) {\n content = (\n <EditableCell\n value={cell.getValue()}\n label={`${labelOf(cell.column)}, row ${row.index + 1}`}\n type={meta.editType ?? 'text'}\n onCommit={(value) => onCellEdit?.({ row: row.original, rowId: row.id, columnId: cell.column.id, value })}\n />\n );\n } else {\n content = flexRender(cell.column.columnDef.cell, cell.getContext());\n }\n\n return (\n <TableCell\n key={cell.id}\n align={meta.align}\n muted={meta.muted && !grouped}\n rowSpan={rowSpan > 1 ? rowSpan : undefined}\n colSpan={colSpan > 1 ? colSpan : undefined}\n style={{\n ...pin.style,\n ...(indent ? { paddingInlineStart: `calc(var(--spacing) * ${indent + 4})` } : null),\n }}\n data-selected={edges ? '' : undefined}\n onMouseDown={enableCellSelection ? cell.getSelectionStartHandler() : undefined}\n onMouseEnter={enableCellSelection ? cell.getSelectionExtendHandler() : undefined}\n className={cn(\n cellDensity,\n pin.className,\n enableCellSelection && 'select-none',\n edges && 'bg-accent-soft',\n edges?.top && 'border-t-2 border-t-input-accent',\n edges?.bottom && 'border-b-2 border-b-input-accent',\n edges?.left && 'border-l-2 border-l-input-accent',\n edges?.right && 'border-r-2 border-r-input-accent',\n meta.editable && 'py-1',\n )}\n >\n {content}\n </TableCell>\n );\n })}\n </TableRow>\n {renderSubComponent && !grouped && row.getIsExpanded() && (\n <TableRow className=\"bg-background hover:bg-background\">\n <TableCell colSpan={columnSpan}>{renderSubComponent(row.original)}</TableCell>\n </TableRow>\n )}\n </React.Fragment>\n );\n };\n\n const renderHeaderCell = (header: (typeof headerGroups)[number]['headers'][number]) => {\n const { column } = header;\n const { align } = getMeta(column.columnDef.meta);\n const leaf = header.subHeaders.length === 0;\n const sortState = column.getIsSorted();\n const pin = pinning(column, sized, true);\n const reorderable = enableColumnOrdering && leaf && !column.getIsPinned();\n const label = labelOf(column);\n\n return (\n <TableHead\n key={header.id}\n colSpan={header.colSpan > 1 ? header.colSpan : undefined}\n align={leaf ? align : undefined}\n sortable={leaf && column.getCanSort()}\n sort={sortState === false ? 'none' : sortState}\n onSort={() => column.toggleSorting(sortState === 'asc')}\n style={pin.style}\n draggable={reorderable || undefined}\n tabIndex={reorderable ? 0 : undefined}\n title={reorderable ? 'Drag, or press Alt + arrow keys, to reorder' : undefined}\n onDragStart={reorderable ? () => (dragged.current = column.id) : undefined}\n onDragOver={reorderable ? (event) => event.preventDefault() : undefined}\n onDrop={\n reorderable\n ? (event) => {\n event.preventDefault();\n if (dragged.current) reorder(dragged.current, column.id);\n dragged.current = null;\n }\n : undefined\n }\n onKeyDown={\n reorderable\n ? (event) => {\n if (!event.altKey || (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')) return;\n event.preventDefault();\n const ids = table.getAllLeafColumns().map((item) => item.id);\n const at = ids.indexOf(column.id);\n const target = ids[at + (event.key === 'ArrowLeft' ? -1 : 2)];\n if (event.key === 'ArrowLeft' && ids[at - 1]) reorder(column.id, ids[at - 1]!);\n else if (event.key === 'ArrowRight' && at < ids.length - 1) reorder(column.id, target ?? '__end__');\n }\n : undefined\n }\n className={cn(\n pin.className,\n cellDensity,\n sticky && !column.getIsPinned() && 'sticky top-0 z-20 bg-surface',\n sticky && column.getIsPinned() && 'top-0',\n reorderable && 'cursor-grab',\n !leaf && 'text-center',\n )}\n resizer={\n enableColumnResizing && column.getCanResize() ? (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={`Resize ${label}`}\n onMouseDown={header.getResizeHandler()}\n onTouchStart={header.getResizeHandler()}\n onClick={(event) => event.stopPropagation()}\n className={cn(\n 'absolute inset-y-0 end-0 w-1 cursor-col-resize touch-none select-none hover:bg-input-accent',\n column.getIsResizing() && 'bg-input-accent',\n )}\n />\n ) : undefined\n }\n >\n {header.isPlaceholder ? null : <table.FlexRender header={header} />}\n </TableHead>\n );\n };\n\n const stickyLeading = cn(cellDensity, sticky && 'sticky top-0 z-20 bg-surface');\n const leadingHeaderCells = (rowSpan: number) => (\n <>\n {enableRowSelection && (\n <TableHead checkbox rowSpan={rowSpan} className={stickyLeading}>\n <Checkbox\n aria-label=\"Select all rows\"\n checked={allSelected ? true : someSelected ? 'indeterminate' : false}\n disabled={loading}\n onCheckedChange={(checked) => table.toggleAllPageRowsSelected(Boolean(checked))}\n />\n </TableHead>\n )}\n {hasExpander && (\n <TableHead checkbox rowSpan={rowSpan} className={stickyLeading}>\n <span className=\"sr-only\">Expand</span>\n </TableHead>\n )}\n {enableRowPinning && (\n <TableHead checkbox rowSpan={rowSpan} className={stickyLeading}>\n <span className=\"sr-only\">Pin</span>\n </TableHead>\n )}\n </>\n );\n\n const rowsToRender = virtualized ? virtualItems.map((item) => ({ row: bodyRows[item.index]!, index: item.index })) : null;\n const totalRows = topRows.length + bodyRows.length + bottomRows.length;\n\n return (\n <div className={cn('flex w-full flex-col gap-2', wrapperClassName)}>\n {showToolbar && (\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex items-center gap-2\">\n {enableGlobalFilter && (\n <SearchBar\n aria-label=\"Search table\"\n placeholder={globalFilterPlaceholder}\n value={globalFilter}\n onChange={(event) => table.setGlobalFilter(event.target.value)}\n onClear={() => table.setGlobalFilter('')}\n className=\"w-64\"\n />\n )}\n {toolbar}\n </div>\n <div className=\"flex items-center gap-2\">\n {enableDensityToggle && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n aria-pressed={compact}\n onClick={() => setDensity(compact ? 'default' : 'compact')}\n >\n <Rows size={16} aria-hidden />\n Compact\n </Button>\n )}\n {enableGrouping && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\">\n <Stack size={16} aria-hidden />\n Group by\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuLabel>Group rows by</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {groupableColumns.map((column) => (\n <DropdownMenuCheckboxItem\n key={column.id}\n checked={column.getIsGrouped()}\n onCheckedChange={() => column.toggleGrouping()}\n >\n {labelOf(column)}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {enableColumnVisibility && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\">\n <Sliders size={16} aria-hidden />\n Columns\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {hideableColumns.map((column) => (\n <DropdownMenuCheckboxItem\n key={column.id}\n checked={column.getIsVisible()}\n onCheckedChange={(checked) => column.toggleVisibility(Boolean(checked))}\n >\n {labelOf(column)}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n )}\n\n <Table\n ref={ref}\n containerRef={setScrollRef}\n containerClassName={containerClassName}\n striped={striped}\n aria-busy={loading || loadingMore || undefined}\n style={sized ? { width: table.getTotalSize(), minWidth: '100%', tableLayout: 'fixed', ...tableStyle } : tableStyle}\n onKeyDown={enableCellSelection ? onGridKeyDown : undefined}\n tabIndex={enableCellSelection ? 0 : undefined}\n {...tableProps}\n >\n <TableHeader>\n {headerGroups.map((group, groupIndex) => (\n <TableRow key={group.id} className=\"hover:bg-transparent\">\n {groupIndex === 0 && leadingHeaderCells(headerGroups.length + (enableColumnFilters ? 1 : 0))}\n {group.headers.map(renderHeaderCell)}\n </TableRow>\n ))}\n {enableColumnFilters && (\n <TableRow className=\"hover:bg-transparent\">\n {leafColumns.map((column) => {\n const pin = pinning(column, sized, true);\n return (\n <TableHead\n key={column.id}\n style={pin.style}\n className={cn('h-auto py-2 font-normal', pin.className, sticky && !column.getIsPinned() && 'bg-surface')}\n >\n {column.getCanFilter() ? <ColumnFilter column={column} /> : null}\n </TableHead>\n );\n })}\n </TableRow>\n )}\n </TableHeader>\n <TableBody>\n {loading ? (\n Array.from({ length: pageSize }, (_, index) => skeletonRow(`loading-${index}`))\n ) : totalRows === 0 ? (\n <TableRow className=\"hover:bg-transparent\">\n <TableCell colSpan={columnSpan} muted className=\"h-24 text-center\">\n {emptyState ?? 'No results.'}\n </TableCell>\n </TableRow>\n ) : (\n <>\n {topRows.map((row, index) => renderRow(row, { pinned: 'top', pinnedIndex: index, pinnedCount: topRows.length }))}\n {virtualized && paddingTop > 0 && (\n <tr aria-hidden>\n <td colSpan={columnSpan} style={{ height: paddingTop }} />\n </tr>\n )}\n {rowsToRender\n ? rowsToRender.map(({ row, index }) => renderRow(row, { virtualIndex: index }))\n : bodyRows.map((row) => renderRow(row))}\n {virtualized && paddingBottom > 0 && (\n <tr aria-hidden>\n <td colSpan={columnSpan} style={{ height: paddingBottom }} />\n </tr>\n )}\n {bottomRows.map((row, index) =>\n renderRow(row, { pinned: 'bottom', pinnedIndex: index, pinnedCount: bottomRows.length }),\n )}\n </>\n )}\n {infinite && (\n <>\n {loadingMore && Array.from({ length: 3 }, (_, index) => skeletonRow(`more-${index}`))}\n <tr ref={sentinelRef} aria-hidden>\n <td colSpan={columnSpan} className=\"h-px p-0\" />\n </tr>\n </>\n )}\n </TableBody>\n {showFooter && (\n <TableFooter>\n {table.getFooterGroups().map((group) => (\n <TableRow key={group.id} className=\"hover:bg-transparent\">\n {leadingCount > 0 && <TableCell colSpan={leadingCount} className={cellDensity} />}\n {group.headers.map((header) => {\n const { align } = getMeta(header.column.columnDef.meta);\n const pin = pinning(header.column, sized);\n return (\n <TableCell\n key={header.id}\n align={align}\n colSpan={header.colSpan > 1 ? header.colSpan : undefined}\n style={pin.style}\n className={cn('text-ui-label', pin.className, cellDensity)}\n >\n {header.isPlaceholder ? null : <table.FlexRender footer={header} />}\n </TableCell>\n );\n })}\n </TableRow>\n ))}\n </TableFooter>\n )}\n </Table>\n\n {(enableRowSelection || (paginate && pageCount > 1)) && (\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"text-body-small text-secondary-muted-foreground\" aria-live=\"polite\">\n {enableRowSelection ? `${selectedCount} of ${table.getCoreRowModel().rows.length} row(s) selected` : null}\n </span>\n {paginate && pageCount > 1 && (\n <Pagination\n page={pagination.pageIndex + 1}\n pageCount={pageCount}\n onPageChange={(page) => table.setPageIndex(page - 1)}\n />\n )}\n </div>\n )}\n </div>\n );\n}\n\n/**\n * Data-driven table. Wraps `Table` with TanStack Table (`@tanstack/react-table`): sorting, row selection, pagination,\n * column visibility, pinning, sizing, resizing and ordering, column and global filtering with faceted options, grouping with\n * aggregation, row expansion and detail panels, row pinning, cell selection and spanning, grouped headers, footers,\n * inline editing, server-side data, virtualization and infinite scrolling. Every feature is off until its prop is set.\n * Pass `columns` and `data`; state is local unless you control it.\n */\nexport const DataTable = React.forwardRef(DataTableInner) as <TData extends RowData>(\n props: DataTableProps<TData> & { ref?: React.ForwardedRef<HTMLTableElement> },\n) => ReturnType<typeof DataTableInner>;\n(DataTable as { displayName?: string }).displayName = 'DataTable';\n","import * as React from 'react';\nimport { ArrowLeft, ArrowRight, DotsThree } from '@phosphor-icons/react';\n\nimport { cn } from '../../lib/utils';\nimport { Button } from '../Buttons & Actions/Button';\n\nexport type PaginationItemValue = number | 'ellipsis';\n\n/** 1-based page list with ellipses, e.g. `[1, 2, 'ellipsis', 5]`. Keeps first, last and the current page ± `siblings`. */\nexport function getPaginationItems(page: number, pageCount: number, siblings = 1): PaginationItemValue[] {\n const keep = new Set<number>([1, pageCount]);\n for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);\n // Show a neighbouring page instead of an ellipsis that would hide just one.\n const sorted = [...keep].sort((a, b) => a - b);\n const items: PaginationItemValue[] = [];\n sorted.forEach((p, index) => {\n const previous = sorted[index - 1];\n if (previous !== undefined && p - previous === 2) items.push(previous + 1);\n else if (previous !== undefined && p - previous > 2) items.push('ellipsis');\n items.push(p);\n });\n return items;\n}\n\nexport interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {\n /** Current page, 1-based. */\n page: number;\n pageCount: number;\n onPageChange: (page: number) => void;\n /** `full` lists page numbers; `compact` shows `1/5` between the arrows. */\n variant?: 'full' | 'compact';\n /** How many pages to show either side of the current one (full variant). */\n siblings?: number;\n}\n\n// Figma: Pagination (71) — 32px items; the current page is `subtle`, the rest are outlined.\nexport const Pagination = React.forwardRef<HTMLElement, PaginationProps>(\n ({ className, page, pageCount, onPageChange, variant = 'full', siblings = 1, ...props }, ref) => {\n const go = (next: number) => onPageChange(Math.min(pageCount, Math.max(1, next)));\n const previous = (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label=\"Previous page\"\n disabled={page <= 1}\n onClick={() => go(page - 1)}\n >\n <ArrowLeft size={16} aria-hidden />\n </Button>\n );\n const next = (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label=\"Next page\"\n disabled={page >= pageCount}\n onClick={() => go(page + 1)}\n >\n <ArrowRight size={16} aria-hidden />\n </Button>\n );\n\n return (\n <nav\n ref={ref}\n aria-label=\"Pagination\"\n className={cn('flex items-center', variant === 'compact' ? 'w-35 justify-between' : 'gap-2', className)}\n {...props}\n >\n {previous}\n {variant === 'compact' ? (\n <span className=\"text-body-small text-surface-foreground\" aria-live=\"polite\">\n {page}/{pageCount}\n </span>\n ) : (\n <ul className=\"flex items-center gap-2\">\n {getPaginationItems(page, pageCount, siblings).map((item, index) => (\n <li key={item === 'ellipsis' ? `ellipsis-${index}` : item}>\n {item === 'ellipsis' ? (\n <span className=\"inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground\">\n <DotsThree size={16} aria-hidden />\n <span className=\"sr-only\">More pages</span>\n </span>\n ) : (\n <Button\n type=\"button\"\n variant={item === page ? 'subtle' : 'outline'}\n size=\"sm\"\n aria-label={`Page ${item}`}\n aria-current={item === page ? 'page' : undefined}\n onClick={() => go(item)}\n >\n {item}\n </Button>\n )}\n </li>\n ))}\n </ul>\n )}\n {next}\n </nav>\n );\n },\n);\nPagination.displayName = 'Pagination';\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\nconst statCardVariants = cva('flex min-w-0 flex-col gap-2 rounded-md border p-3', {\n variants: {\n variant: {\n default: 'border-border bg-transparent',\n // A card tinted with the secondary background and no border, for stats on a white panel.\n subtle: 'border-transparent bg-secondary',\n warning: 'border-warning-soft-border bg-warning-soft',\n success: 'border-success-soft-border bg-success-soft',\n destructive: 'border-destructive-soft-border bg-destructive-soft',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport interface StatCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, VariantProps<typeof statCardVariants> {\n label: React.ReactNode;\n value: React.ReactNode;\n /** Leading icon beside the value (24px). */\n icon?: React.ReactNode;\n /** Small muted text under the value that says what it refers to or breaks it down (\"11 open-ended · 5 closed-ended\"). */\n caption?: React.ReactNode;\n}\n\n// Figma: Activity control (361:5214) › stat-card — a small bordered label/value tile; `warning` tints it yellow, `success` green and `destructive` red.\nexport const StatCard = React.forwardRef<HTMLDivElement, StatCardProps>(\n ({ className, variant, label, value, icon, caption, ...props }, ref) => (\n <div ref={ref} className={cn(statCardVariants({ variant }), className)} {...props}>\n <p className=\"truncate text-ui-caption text-secondary-muted-foreground\">{label}</p>\n <p className=\"flex items-center gap-2 text-body-base text-surface-foreground\">\n {icon && (\n <span aria-hidden=\"true\" className=\"inline-flex size-6 shrink-0 items-center justify-center\">\n {icon}\n </span>\n )}\n {value}\n </p>\n {caption && <p className=\"text-ui-caption text-secondary-muted-foreground\">{caption}</p>}\n </div>\n ),\n);\nStatCard.displayName = 'StatCard';\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { StatCard, type StatCardProps } from '../Data Display/StatCard';\nimport { EditableTag } from '../Tags & Badges/EditableTag';\n\nexport interface ActivityStat extends Pick<StatCardProps, 'label' | 'value' | 'icon' | 'variant'> {\n id: string;\n}\n\nexport interface ActivitySection {\n id: string;\n heading: React.ReactNode;\n /** Section text. May contain block elements (e.g. an `InlineEdit`), so it is rendered in a `div`. */\n body: React.ReactNode;\n /** Removable tags shown under the body. */\n tags?: string[];\n}\n\nexport interface ActivityStructureProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {\n title?: React.ReactNode;\n /** Stat tiles, laid out in a two-column grid. */\n stats: ActivityStat[];\n /** Text sections (e.g. Research Goal, Target Audience), optionally with tags. */\n sections?: ActivitySection[];\n /** Optional control (e.g. a button) shown at the right of the title. */\n action?: React.ReactNode;\n /** Called with `(sectionId, tag)` when a tag's remove button is pressed. Omit for read-only tags. */\n onRemoveTag?: (sectionId: string, tag: string) => void;\n /** Called with the section id by the dashed \"Add tag\" chip. Omit to hide it. */\n onAddTag?: (sectionId: string) => void;\n addTagLabel?: string;\n /**\n * Content shown under the stats and sections. With `stats={[]}` and `children` the card is a single-purpose widget\n * (e.g. \"Research Goal\") with the same card, title style and colour as the full summary.\n */\n children?: React.ReactNode;\n}\n\n// Figma: Activity control (361:5214) › Activity structure — summary card with stat tiles and text sections with tags; also usable as a single-purpose widget via children.\nexport const ActivityStructure = React.forwardRef<HTMLElement, ActivityStructureProps>(\n ({ className, title = 'Activity Structure', stats, sections, onRemoveTag, onAddTag, addTagLabel = 'Add tag', action, children, ...props }, ref) => (\n <section\n ref={ref}\n className={cn('flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4', className)}\n {...props}\n >\n <div className=\"flex items-center justify-between gap-2\">\n <h3 className=\"text-body-section text-surface-foreground\">{title}</h3>\n {action}\n </div>\n {stats.length > 0 && (\n <div className=\"grid grid-cols-2 gap-3\">\n {stats.map(({ id, ...stat }) => (\n <StatCard key={id} {...stat} />\n ))}\n </div>\n )}\n {sections?.map(({ id, heading, body, tags }) => (\n <div key={id} className=\"flex flex-col gap-2\">\n <h4 className=\"text-heading-h4 text-surface-foreground\">{heading}</h4>\n <div className=\"text-body-base text-surface-foreground\">{body}</div>\n {(tags?.length || onAddTag) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {tags?.map((tag) => (\n <EditableTag key={tag} type=\"editable\" onRemove={onRemoveTag && (() => onRemoveTag(id, tag))}>\n {tag}\n </EditableTag>\n ))}\n {onAddTag && (\n <EditableTag type=\"add\" onClick={() => onAddTag(id)}>\n {addTagLabel}\n </EditableTag>\n )}\n </div>\n )}\n </div>\n ))}\n {children}\n </section>\n ),\n);\nActivityStructure.displayName = 'ActivityStructure';\n","import * as React from 'react';\nimport { Crown, Plus, X } from '@phosphor-icons/react';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\n// Figma: Editable tags (41). Compact 26px chip used for removable / addable values.\nconst editableTagVariants = cva(\n 'inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors',\n {\n variants: {\n type: {\n default: 'gap-1 bg-accent-muted pl-2.5 pr-1.5 text-primary',\n editable:\n 'gap-1 bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 pl-2.5 pr-1.5 text-surface-foreground hover:bg-accent-soft hover:bg-none hover:text-accent-soft-foreground',\n add: 'gap-1 border border-dashed border-border pl-2.5 pr-1.5 text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground',\n multiple:\n 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 text-surface-foreground hover:bg-accent-soft hover:bg-none hover:text-accent-soft-foreground',\n },\n },\n defaultVariants: { type: 'default' },\n },\n);\n\nexport interface EditableTagProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onClick'> {\n /** `default` is the highlighted (primary) value, `editable` is removable, `add` adds a value, `multiple` is the \"+N more\" overflow chip. */\n type?: 'default' | 'editable' | 'add' | 'multiple';\n /** Leading icon. `default` shows a crown unless you pass `null`. */\n icon?: React.ReactNode;\n /** Renders a remove button on `editable`/`default` tags. */\n onRemove?: () => void;\n /** Click handler for `add` and `multiple` (rendered as a button when set). */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n children: React.ReactNode;\n}\n\nexport const EditableTag = React.forwardRef<HTMLElement, EditableTagProps>(\n ({ className, type = 'default', icon, onRemove, onClick, children, ...props }, ref) => {\n const classes = cn(editableTagVariants({ type }), className);\n const leading =\n type === 'add' ? (\n <Plus size={12} aria-hidden />\n ) : icon !== undefined ? (\n icon\n ) : type === 'default' ? (\n <Crown size={12} weight=\"fill\" aria-hidden />\n ) : null;\n\n if (type === 'add' || (type === 'multiple' && onClick)) {\n return (\n <button ref={ref as React.Ref<HTMLButtonElement>} type=\"button\" className={classes} onClick={onClick} {...props}>\n {leading}\n {children}\n </button>\n );\n }\n\n return (\n <span ref={ref as React.Ref<HTMLSpanElement>} className={classes} {...props}>\n {leading}\n {children}\n {onRemove && (\n <button\n type=\"button\"\n aria-label={typeof children === 'string' ? `Remove ${children}` : 'Remove'}\n onClick={onRemove}\n className=\"inline-flex size-3 items-center justify-center rounded-xs\"\n >\n <X size={12} aria-hidden />\n </button>\n )}\n </span>\n );\n },\n);\nEditableTag.displayName = 'EditableTag';\n","import * as React from 'react';\nimport { DotsSixVertical, RadioButton } from '@phosphor-icons/react';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../lib/utils';\n\n// Figma: Role Tag (41), now the system Badge. 24px chip; `interactable` reveals a drag handle on hover.\nconst roleTagVariants = cva(\n 'group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors',\n {\n variants: {\n type: {\n primary: 'bg-primary-soft px-2.5 text-primary-soft-foreground',\n secondary:\n 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 text-secondary-muted-foreground',\n question: 'gap-1 bg-primary-soft pl-1 pr-2.5 text-plum-500',\n interactable: 'gap-1 pl-2.5 pr-2.5 hover:pl-1',\n id: 'gap-1 bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 tabular-nums text-surface-foreground',\n count:\n 'min-w-6 justify-center rounded-full bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2 tabular-nums text-surface-foreground',\n },\n selected: { true: '', false: '' },\n },\n compoundVariants: [\n {\n type: 'interactable',\n selected: false,\n className:\n 'bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground',\n },\n { type: 'interactable', selected: true, className: 'bg-accent-soft text-accent-foreground' },\n ],\n defaultVariants: { type: 'primary', selected: false },\n },\n);\n\nexport interface BadgeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onClick'> {\n /**\n * `id` prefixes the content with a muted \"ID\" label (children is the identifier); `count` is a round pill for a number.\n */\n type?: 'primary' | 'secondary' | 'question' | 'interactable' | 'id' | 'count';\n /** Pressed state for `interactable` tags. */\n selected?: boolean;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n children: React.ReactNode;\n}\n\nexport const Badge = React.forwardRef<HTMLElement, BadgeProps>(\n ({ className, type = 'primary', selected = false, onClick, children, ...props }, ref) => {\n const classes = cn(roleTagVariants({ type, selected: type === 'interactable' ? selected : false }), className);\n\n if (type === 'interactable') {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n aria-pressed={selected}\n className={classes}\n onClick={onClick}\n {...props}\n >\n <DotsSixVertical size={16} aria-hidden className=\"hidden shrink-0 group-hover:block\" />\n {children}\n </button>\n );\n }\n\n return (\n <span ref={ref as React.Ref<HTMLSpanElement>} className={classes} {...props}>\n {type === 'question' && <RadioButton size={16} weight=\"fill\" aria-hidden />}\n {type === 'id' && <span className=\"text-secondary-muted-foreground\">ID</span>}\n {children}\n </span>\n );\n },\n);\nBadge.displayName = 'Badge';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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O,WAAW,WAAW,OAAO,SAAS,UAAU,GAAG,MAAM,GAAG,QAAQ;AACvF,UAAM,UAAU,GAAG,gBAAgB,EAAE,MAAM,UAAU,SAAS,iBAAiB,WAAW,MAAM,CAAC,GAAG,SAAS;AAE7G,QAAI,SAAS,gBAAgB;AAC3B,aACE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,MAAK;AAAA,UACL,gBAAc;AAAA,UACd,WAAW;AAAA,UACX;AAAA,UACC,GAAG;AAAA,UAEJ;AAAA,0DAAC,kCAAgB,MAAM,IAAI,eAAW,MAAC,WAAU,qCAAoC;AAAA,YACpF;AAAA;AAAA;AAAA,MACH;AAAA,IAEJ;AAEA,WACE,+CAAC,UAAK,KAAwC,WAAW,SAAU,GAAG,OACnE;AAAA,eAAS,cAAc,8CAAC,8BAAY,MAAM,IAAI,QAAO,QAAO,eAAW,MAAC;AAAA,MACxE,SAAS,QAAQ,8CAAC,UAAK,WAAU,mCAAkC,gBAAE;AAAA,MACrE;AAAA,OACH;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":["React","import_radix_ui","import_jsx_runtime","SwitchPrimitive","React","import_radix_ui","import_jsx_runtime","TogglePrimitive","React","import_jsx_runtime","React","import_jsx_runtime","React","import_class_variance_authority","import_radix_ui","import_jsx_runtime","TogglePrimitive","React","React","import_react","import_radix_ui","React","import_radix_ui","import_jsx_runtime","LabelPrimitive","import_jsx_runtime","CheckboxPrimitive","React","import_radix_ui","import_jsx_runtime","RadioGroupPrimitive","import_jsx_runtime","title","description","className","React","import_react","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_react","React","import_react","import_radix_ui","import_jsx_runtime","DropdownMenuPrimitive","import_jsx_runtime","React","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_jsx_runtime","import_react","import_jsx_runtime","React","import_react","import_radix_ui","React","import_react","import_jsx_runtime","React","import_radix_ui","React","import_radix_ui","React","import_radix_ui","import_class_variance_authority","import_jsx_runtime","TabsPrimitive","import_jsx_runtime","TabsPrimitive","import_jsx_runtime","ToggleGroupPrimitive","import_jsx_runtime","PopoverPrimitive","React","import_radix_ui","import_jsx_runtime","React","import_react","React","import_react","import_radix_ui","import_jsx_runtime","PopoverPrimitive","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_react","import_radix_ui","import_jsx_runtime","SelectPrimitive","React","import_radix_ui","import_jsx_runtime","SliderPrimitive","React","import_jsx_runtime","React","import_react","import_jsx_runtime","React","import_react","import_radix_ui","import_jsx_runtime","DialogPrimitive","React","import_react","import_class_variance_authority","import_radix_ui","import_jsx_runtime","ToastPrimitive","React","import_radix_ui","import_jsx_runtime","TooltipPrimitive","React","import_react","import_radix_ui","React","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","ProgressPrimitive","React","import_react","import_radix_ui","import_jsx_runtime","ToggleGroupPrimitive","ImageIcon","toggle","SliderPrimitive","React","import_jsx_runtime","React","import_jsx_runtime","React","import_react","React","React","import_react","React","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","React","import_react","import_radix_ui","import_jsx_runtime","React","import_react","import_jsx_runtime","limitsText","React","import_react","import_jsx_runtime","React","import_radix_ui","import_jsx_runtime","ToggleGroupPrimitive","React","import_react","import_jsx_runtime","ImageIcon","React","import_radix_ui","import_jsx_runtime","ProgressPrimitive","React","import_react","import_jsx_runtime","React","import_react","React","import_react","import_jsx_runtime","next","import_jsx_runtime","React","import_class_variance_authority","import_jsx_runtime","React","React","import_react","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","React","import_react","import_class_variance_authority","import_jsx_runtime"]}