@assure-one/design-system 1.47.1 → 1.48.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/primitives/brand-icons.tsx","../src/primitives/chip.tsx","../src/primitives/behavior/collection/option.ts","../src/primitives/behavior/collection/keyboard.ts","../src/primitives/behavior/nested-scroll-lock.tsx","../src/primitives/combobox.tsx","../src/primitives/client-select.tsx","../src/primitives/collapsible.tsx","../src/primitives/coming-soon.tsx","../src/lib/asset-base.ts","../src/foundation/provider/plain-adapters.tsx","../src/primitives/logo.tsx","../src/primitives/sheet.tsx","../src/primitives/tax-software-logo.tsx","../src/composites/agreement-viewer.tsx","../src/composites/proposal-pricing.tsx","../src/composites/proposal-content.tsx","../src/composites/proposal-signing.tsx","../src/composites/grid.tsx","../src/composites/questions.tsx","../src/composites/sidebar.tsx","../src/composites/sidebar-brand-switcher.tsx","../src/lib/brand-scope.tsx"],"names":["Chip","jsx","Fragment","React","useId","jsxs","React2","React3","Collapsible","CollapsibleTrigger","CollapsibleContent","forwardRef","ComingSoon","React4","React5","Logo","React6","TaxSoftwareLogo","AgreementViewer","useState","AgreementPaneHeading","ProposalServiceRow","ProposalPackageCard","ProposalBillingTerms","ProposalAddOn","ProposalPricingSummary","ProposalCustomPage","ProposalNote","ProposalSignerList","ProposalSignatureBlock","ProposalConsentGate","ProposalPaymentCapture","Grid","Questions","index","Sidebar","SidebarTrigger","SidebarPinButton","SidebarBrand","SidebarBrandText","SidebarSection","SidebarLink","SidebarLinkLabel","SidebarLinkAction","SidebarLinkBadge","SidebarLinkGroup","SidebarFooter","SidebarUser","React8","SidebarBrandSwitcher","createContext","useContext","BrandScope"],"mappings":";;;;;;;;;;;AAoCA,IAAM,eAAA,GACJ,4rDAAA;AAMF,SAAS,SAAA,CAAU;AAAA,EACjB,IAAA,GAAO,EAAA;AAAA,EACP,MAAA;AAAA,EACA,KAAA;AAAA,EACA,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A;AACA,EAAA,uBACEnD,GAAAA,CAAC,kBAAA,EAAA,EAAmB,OAAA,EAClB,QAAA,kBAAAA,GAAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAU,YAAA,EAAY,OAAA,EAAU,GAAG,KAAA,EACrC,UACH,CAAA,EACF,CAAA;AAEJ,CAAC;AAED,UAAA,CAAW,WAAA,GAAc,YAAA","file":"chunk-FO2WSYUA.js","sourcesContent":["import { cn } from \"../lib/cn\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * Assure Suite brand glyphs\n *\n * Per-product mark icons for the Assure suite. Same silhouette (the\n * outlined \"A\" of `public/brand/assure-*-mark.svg`) across all four — only\n * the fill changes, so a row of product tiles reads as a coherent family.\n *\n * Why these live separately from `icons.tsx`:\n * - intrinsic colors (the fill is part of the brand, not a\n * `currentColor`-driven theme tint), and\n * - the path is lifted directly from the mark artwork (`0 0 42 37`),\n * centred in a square viewBox to preserve its proportions.\n *\n * Sized via `size` (square px on the wire). Default 24 matches every\n * other DS primitive and the `SidebarBrandSwitcher` row tile.\n *\n * The fill pulls from the `--color-brand-{slug}` tokens rather than the\n * artwork's hex, so the same colour is reusable elsewhere (chips, banners,\n * dashboards) and dark mode tracks automatically:\n * Pro var(--color-brand-pro) (purple — Pro's existing brand)\n * Audit var(--color-brand-audit) (teal)\n * Books var(--color-brand-books) (green)\n * Tax var(--color-brand-tax) (blue)\n *\n * Consumer wiring example:\n * <SidebarBrandSwitcher\n * brand={<AssureAuditBrandIcon size={28} />}\n * items={[\n * { id: \"pro\", glyph: <AssureProBrandIcon />, ... },\n * ...\n * ]}\n * />\n * ─────────────────────────────────────────────────────────────────────── */\n\nconst BRAND_MARK_PATH =\n \"M19.4979 0.0477994C25.0944 -0.449053 26.2942 2.99863 28.6815 7.07905L33.2264 14.8398L37.9755 22.9443C39.8959 26.2291 42.4536 29.2922 40.5477 33.2138C39.7597 34.8196 38.3714 36.0514 36.6835 36.6425C35.7063 36.9779 34.9266 37.0158 33.9003 36.9677C30.1297 36.7912 29.0945 33.6327 25.9374 32.2324C22.0078 30.4889 19.1097 30.8322 15.286 32.1777C15.8816 30.971 16.5715 29.5808 17.2469 28.4345C19.1809 28.014 21.1756 27.96 23.1298 28.2753C23.4983 28.3343 25.5124 28.8271 25.6239 28.7861L25.6005 28.6142C24.145 26.1453 21.8309 22.4497 20.6454 19.9511C18.2638 24.4708 15.2744 28.91 12.826 33.4091C10.9701 36.8193 6.39898 38.0902 3.09167 35.956C1.60013 35.006 0.545264 33.5039 0.158079 31.7783C-0.121971 30.5091 -0.0285894 29.1858 0.42761 27.9687C0.758078 27.1113 1.64886 25.6607 2.13366 24.8251L5.29089 19.4326L11.5409 8.75678C12.5933 6.95877 13.6399 5.10892 14.7176 3.32807C15.8569 1.44573 17.3636 0.508595 19.4979 0.0477994ZM26.6971 9.89448C25.0824 12.6231 21.9496 16.3151 23.7782 19.4628C26.2948 23.795 28.7805 28.1655 31.3983 32.4365C32.0417 33.4916 33.507 34.0635 34.704 34.0234C36.7093 33.6402 38.2872 32.2689 38.2372 30.2001C38.2063 28.9689 36.0246 25.6235 35.3397 24.4492L30.8368 16.7695C30.3372 15.9173 27.0625 10.1439 26.6971 9.89448ZM22.3837 3.43647C21.5764 3.00964 20.8725 2.92151 19.9843 3.01753C17.7012 3.62261 17.3282 4.86253 16.205 6.78022L13.7255 11.0244L4.61609 26.58C3.70756 28.1436 2.64048 29.4565 3.11999 31.2412C3.3895 32.2177 4.0456 33.0429 4.9364 33.5253C5.71942 33.9558 6.53714 34.0817 7.41784 33.9599C9.74958 33.3164 10.1301 31.99 11.2704 30.0351L13.9364 25.4716C17.0892 20.0808 20.2499 14.6888 23.3964 9.29389C24.1294 8.03559 24.6227 7.10972 24.2098 5.66303C23.932 4.70194 23.271 3.89702 22.3837 3.43647Z\";\n\nexport interface BrandIconProps extends React.SVGAttributes<SVGElement> {\n size?: number;\n}\n\nfunction BrandIcon({\n size = 24,\n accent,\n title,\n className,\n ...props\n}: BrandIconProps & { accent: string; title: string }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 -2.5 42 42\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"ds:shrink-0\", className)}\n role=\"img\"\n aria-label={title}\n {...props}\n >\n <path d={BRAND_MARK_PATH} fill={accent} />\n </svg>\n );\n}\n\nexport function AssureProBrandIcon({ size = 24, ...props }: BrandIconProps) {\n return <BrandIcon size={size} accent=\"var(--ds-ref-brand-pro-seed, var(--color-brand-pro))\" title=\"Assure Pro\" {...props} />;\n}\n\nexport function AssureAuditBrandIcon({ size = 24, ...props }: BrandIconProps) {\n return <BrandIcon size={size} accent=\"var(--ds-ref-brand-audit-seed, var(--color-brand-audit))\" title=\"Assure Audit\" {...props} />;\n}\n\nexport function AssureBooksBrandIcon({ size = 24, ...props }: BrandIconProps) {\n return <BrandIcon size={size} accent=\"var(--ds-ref-brand-books-seed, var(--color-brand-books))\" title=\"Assure Books\" {...props} />;\n}\n\nexport function AssureTaxBrandIcon({ size = 24, ...props }: BrandIconProps) {\n return <BrandIcon size={size} accent=\"var(--ds-ref-brand-tax-seed, var(--color-brand-tax))\" title=\"Assure Tax\" {...props} />;\n}\n","\"use client\";\n\nimport { forwardRef, type ReactNode } from \"react\";\n\nimport { chipAnatomy, type ChipSlot } from \"../foundation/anatomy/slots\";\nimport { slot, stateAttributes } from \"../foundation/anatomy/slot\";\nimport type { ControlSize, Variant } from \"../foundation/vocab\";\nimport { cn } from \"../lib/cn\";\n\nimport {\n buttonBase,\n type ButtonIntent,\n type ButtonIntentAlias,\n type ButtonLook,\n} from \"./behavior/button-base\";\nimport { CONTROL_GAP_CLASSES, CONTROL_SIZE_CLASSES } from \"./behavior/control-size\";\nimport { XIcon } from \"./icons\";\nimport { Pressable } from \"./pressable\";\n\n/** The chip parts (ADR-008). See the registry for the doc comment. */\nexport type { ChipSlot };\n\n/* ────────────────────────────────────────────────────────────────────────────\n * Chip — a removable, toggleable or clickable token (W3-15; target\n * architecture §31).\n *\n * The interactive small label. `Badge` is static; a Chip does something:\n *\n * - **toggle** — `pressed` / `onPressedChange` (a filter chip); `aria-pressed`\n * and `data-pressed` on the control\n * - **click** — `onClick` (a suggestion, a recent search)\n * - **remove** — `onRemove` renders a *separate* remove button with its own\n * accessible name, `removeLabel`, which defaults to \"Remove {label}\" when the\n * label is a string\n * - `count` — a trailing number (results, selected items)\n *\n * Built on `buttonBase` (the Button family's recipe: focus ring, press\n * feedback, disabled treatment, the `variant` × `intent` colour table) through\n * `Pressable` (the behaviour: Enter/Space, disabled semantics), so a chip is\n * a small pill-shaped button in every respect that matters, and reads the\n * shared control scale for its geometry (A1: `size=\"sm\"` is the `sm` height\n * of every control).\n *\n * Structure: without `onRemove` the root *is* the pressable (`<button>`). With\n * `onRemove` the root is a `<span>` styled as the chip that holds the label\n * (a pressable when the chip toggles or clicks, plain text otherwise) and the\n * remove button — two focus stops, two names, never a button inside a button.\n *\n * Colour: `intent` defaults to `neutral`, and to `brand` while `pressed`, so a\n * selected filter is the brand tint without a prop (what `FilterChip active`\n * renders). Pass `intent` to fix the family.\n *\n * `DismissibleChip` and `FilterChip` are the chips consumers use today. They\n * keep their exact markup and classes (pinned in\n * `src/primitives/__tests__/chip-adapters-legacy.test.tsx`); new call sites\n * use `Chip`. Consolidating them onto `Chip` changes their DOM (the remove\n * button becomes its own element) and waits for a release that may.\n * ──────────────────────────────────────────────────────────────────────────── */\n\n/** The emphasis subset a chip offers. @experimental */\nexport type ChipVariant = Extract<Variant, \"solid\" | \"soft\" | \"outline\">;\n\n/** The intents a chip offers (the Button family's). @experimental */\nexport type ChipIntent = ButtonIntent;\n\n/** The chip sizes: the shared control scale (A1). @experimental */\nexport type ChipSize = ControlSize;\n\n/** @experimental */\nexport interface ChipProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\" | \"onClick\"> {\n /** The label. A string also names the remove button (\"Remove {label}\"). */\n children: ReactNode;\n /** Leading glyph, decorative. */\n icon?: ReactNode;\n /** Trailing number. */\n count?: number;\n /** Visual emphasis: `soft` (default) · `solid` · `outline`. */\n variant?: ChipVariant;\n /**\n * Meaning → colour family. Default `neutral`, or `brand` while `pressed`.\n * `destructive` is a deprecated alias of `danger` (decision D4).\n */\n intent?: ChipIntent | ButtonIntentAlias;\n /** Outer height from the shared control scale (A1). Default `sm` (32px). */\n size?: ChipSize;\n /**\n * Toggle state (a boolean prop, never a variant — ADR-007 §2). Controlled:\n * pair with `onPressedChange`. Reflected as `aria-pressed` / `data-pressed`.\n */\n pressed?: boolean;\n /** Called with the next state when a toggle chip is activated. */\n onPressedChange?: (pressed: boolean) => void;\n /** Activation of the chip itself (not of the remove button). */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /** Renders a remove button after the label and is called when it is activated. */\n onRemove?: (() => void) | undefined;\n /**\n * The remove button's accessible name. Defaults to \"Remove {label}\" when\n * `children` is a string; required otherwise (a development error).\n */\n removeLabel?: string;\n /** Disables the chip and its remove button. */\n disabled?: boolean | undefined;\n}\n\n/**\n * The chip class recipe: `buttonBase` for the resolved look (no text-button\n * size row), a pill corner, and the control-scale size. Server-safe.\n *\n * @experimental\n */\nexport function chipVariants({\n variant,\n intent,\n size,\n pressed,\n className,\n}: {\n variant?: ChipVariant | null | undefined;\n intent?: ChipIntent | ButtonIntentAlias | null | undefined;\n size?: ChipSize | null | undefined;\n pressed?: boolean | null | undefined;\n className?: string | null | undefined;\n} = {}): string {\n const { look } = resolveChipStyle({ variant, intent, pressed });\n return cn(\n buttonBase({ look, size: null }),\n \"ds:rounded-full ds:shrink-0\",\n CONTROL_SIZE_CLASSES[size ?? \"sm\"],\n className,\n );\n}\n\n/**\n * The resolved appearance of a chip: the emphasis, the colour family and the\n * row of the Button colour table they render (see the module comment on the\n * `intent` default).\n *\n * @experimental\n */\nexport interface ChipStyle {\n variant: ChipVariant;\n intent: ChipIntent;\n look: ButtonLook;\n}\n\n/** Resolves `variant` + `intent` (+ `pressed`) to the row a chip renders. */\nexport function resolveChipStyle({\n variant,\n intent,\n pressed,\n}: {\n variant?: ChipVariant | null | undefined;\n intent?: ChipIntent | ButtonIntentAlias | null | undefined;\n pressed?: boolean | null | undefined;\n}): ChipStyle {\n const emphasis = variant ?? \"soft\";\n const requested = intent === \"destructive\" ? \"danger\" : intent;\n const family: ChipIntent = requested ?? (pressed ? \"brand\" : \"neutral\");\n return { variant: emphasis, intent: family, look: `${emphasis}/${family}` };\n}\n\n/** Hover surface of the remove button, per colour family (on the chip's own tint). */\nconst REMOVE_HOVER: Readonly<Record<ChipIntent, string>> = {\n brand: \"ds:hover:bg-brand-bg-active\",\n neutral: \"ds:hover:bg-control-active-bg\",\n success: \"ds:hover:bg-success-line\",\n danger: \"ds:hover:bg-danger-line\",\n};\n\n/**\n * The removable, toggleable or clickable token, on `buttonBase` through\n * `Pressable`. See the module comment.\n *\n * @experimental\n */\nexport const Chip = forwardRef<HTMLElement, ChipProps>(function Chip(\n {\n children,\n icon,\n count,\n variant,\n intent,\n size = \"sm\",\n pressed,\n onPressedChange,\n onClick,\n onRemove,\n removeLabel,\n disabled,\n className,\n ...props\n },\n ref,\n) {\n const isToggle = pressed !== undefined || onPressedChange !== undefined;\n const pressedValue = isToggle ? Boolean(pressed) : undefined;\n const interactive = isToggle || onClick !== undefined;\n const style = resolveChipStyle({ variant, intent, pressed: pressedValue });\n\n const resolvedRemoveLabel =\n removeLabel ?? (typeof children === \"string\" ? `Remove ${children}` : undefined);\n if (process.env.NODE_ENV !== \"production\" && onRemove && resolvedRemoveLabel === undefined) {\n throw new Error(\n \"[Chip] `removeLabel` is required when `onRemove` is set and the label is not a string: the remove button needs an accessible name.\",\n );\n }\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n if (isToggle) onPressedChange?.(!pressedValue);\n };\n\n const state = stateAttributes({\n variant: style.variant,\n intent: style.intent,\n size,\n disabled,\n pressed: pressedValue,\n });\n\n const content = (\n <>\n {icon && (\n <span\n {...slot(chipAnatomy, \"icon\")}\n className=\"ds:inline-flex ds:shrink-0\"\n aria-hidden=\"true\"\n >\n {icon}\n </span>\n )}\n <span {...slot(chipAnatomy, \"label\")}>{children}</span>\n {typeof count === \"number\" && (\n <span {...slot(chipAnatomy, \"count\")} className=\"ds:font-normal ds:tabular-nums\">\n {count}\n </span>\n )}\n </>\n );\n\n if (!onRemove) {\n return (\n <Pressable\n ref={ref}\n pressed={pressedValue}\n disabled={disabled}\n onClick={handleClick}\n {...slot(chipAnatomy, \"root\")}\n {...state}\n className={chipVariants({ variant, intent, size, pressed: pressedValue, className })}\n {...(props as React.ButtonHTMLAttributes<HTMLElement>)}\n >\n {content}\n </Pressable>\n );\n }\n\n return (\n <span\n ref={ref as React.Ref<HTMLSpanElement>}\n // The group has no native `disabled`: the ARIA state says the whole chip\n // is (its parts carry the real one), and disabled text is not judged\n // for contrast.\n aria-disabled={disabled || undefined}\n {...slot(chipAnatomy, \"root\")}\n {...state}\n className={cn(\n chipVariants({ variant, intent, size, pressed: pressedValue }),\n // The remove button ends the row in its own 24px box (a hit target of\n // its own, WCAG 2.5.8), so the end padding is the box's, not the text's.\n \"ds:pe-1\",\n !interactive && \"ds:cursor-default\",\n disabled && \"ds:pointer-events-none ds:bg-bg-disabled ds:text-fg-disabled\",\n className,\n )}\n {...props}\n >\n {interactive ? (\n <Pressable\n pressed={pressedValue}\n disabled={disabled}\n onClick={handleClick}\n className={cn(\n \"ds:inline-flex ds:h-full ds:min-w-0 ds:items-center ds:rounded-full ds:bg-transparent ds:p-0 ds:text-inherit\",\n CONTROL_GAP_CLASSES[size],\n )}\n >\n {content}\n </Pressable>\n ) : (\n <span\n className={cn(\"ds:inline-flex ds:min-w-0 ds:items-center\", CONTROL_GAP_CLASSES[size])}\n >\n {content}\n </span>\n )}\n <Pressable\n {...slot(chipAnatomy, \"remove\")}\n aria-label={resolvedRemoveLabel}\n disabled={disabled}\n onClick={onRemove}\n className={cn(\n \"ds:inline-flex ds:size-6 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-full ds:bg-transparent ds:p-0 ds:text-inherit\",\n \"ds:transition-colors ds:duration-[var(--motion-duration-feedback)] ds:ease-[var(--motion-ease-enter)] ds:motion-reduce:transition-none\",\n REMOVE_HOVER[style.intent],\n )}\n >\n <XIcon aria-hidden=\"true\" />\n </Pressable>\n </span>\n );\n});\n\nChip.displayName = \"Chip\";\n","import type { ReactNode } from \"react\";\n\n/**\n * L1a behaviour primitive (private). Not exported from the package.\n *\n * The canonical option model of every list-shaped control (W4-09; target\n * architecture §32): `Select`, the coming `Combobox` (W4-10) and its\n * `MultiSelect` preset (W4-11), the `SearchSelect` adapter (W4-12) and the\n * `PeoplePicker` pattern all read one shape, in place of the six that ship\n * today (`{value,label}`, `{id,label,group…}`, `{id,label,email}`,\n * `{id,fullName}`, `{key,label,dot}`, `string[]`).\n *\n * Two halves:\n *\n * - {@link Option} and its accessors: what a row *is*. Consumers with domain\n * objects pass {@link OptionAccessors} (`getOptionValue`/`getOptionLabel`)\n * instead of remapping, and {@link toOptions} normalises everything — a\n * `string[]`, domain objects, `Option`s — into one array the list renders.\n * - The selection helpers: what a control's *value* is, discriminated by\n * `multiple` (single `TValue | null`, multi `TValue[]`; §32 \"Value\"). `\"\"`\n * keeps meaning empty in 2.x (§32 \"Compat\"), so {@link normalizeSingleValue}\n * folds it to `null` at the boundary.\n *\n * No React, no client directive, no DOM: plain functions over plain data, so\n * the same module serves a Server Component, a test and the keyboard helper.\n */\n\n/**\n * One row of a list-shaped control.\n *\n * `value` is never `\"\"`: emptiness is `value === null` on the control, not a\n * sentinel row (§32). `label` is the string typeahead, filtering and the\n * accessible name read; `description` and `icon` are rendered, never searched.\n * `keywords` widen the match without showing. `meta` carries consumer data\n * through to `renderOption` / `onValueChange` details untouched.\n *\n * @experimental\n */\nexport interface Option<TValue extends string = string, TMeta = unknown> {\n value: TValue;\n label: string;\n description?: ReactNode;\n /** Leading visual: icon, avatar, flag, colour swatch. */\n icon?: ReactNode;\n disabled?: boolean;\n group?: string | undefined;\n keywords?: readonly string[] | undefined;\n meta?: TMeta;\n}\n\n/**\n * How a list reads a consumer's own item type. Only `getOptionValue` and\n * `getOptionLabel` are required: an item with no `disabled`/`group`/`keywords`\n * accessor is enabled, ungrouped and matched on its label alone.\n *\n * @experimental\n */\nexport interface OptionAccessors<TItem, TValue extends string = string> {\n getOptionValue: (item: TItem) => TValue;\n getOptionLabel: (item: TItem) => string;\n getOptionDisabled?: ((item: TItem) => boolean) | undefined;\n getOptionGroup?: ((item: TItem) => string | undefined) | undefined;\n getOptionKeywords?: ((item: TItem) => readonly string[] | undefined) | undefined;\n}\n\n/** True for anything shaped like an {@link Option}: a string `value` and a string `label`. */\nexport function isOption(item: unknown): item is Option {\n return (\n typeof item === \"object\" &&\n item !== null &&\n typeof (item as { value?: unknown }).value === \"string\" &&\n typeof (item as { label?: unknown }).label === \"string\"\n );\n}\n\n/** The accessors of an {@link Option}: each field read as it is. */\nexport const optionAccessors: Required<OptionAccessors<Option>> = {\n getOptionValue: (option) => option.value,\n getOptionLabel: (option) => option.label,\n getOptionDisabled: (option) => option.disabled === true,\n getOptionGroup: (option) => option.group,\n getOptionKeywords: (option) => option.keywords,\n};\n\n/**\n * The accessors of a bare `string` item (`options={[\"Draft\", \"Sent\"]}`): the\n * string is both value and label.\n */\nexport const stringOptionAccessors: OptionAccessors<string> = {\n getOptionValue: (item) => item,\n getOptionLabel: (item) => item,\n};\n\n/**\n * The accessors that read `item` when the caller passed none: a `string` is\n * its own value and label, an {@link Option} reads its fields. Anything else\n * needs explicit accessors — the error names the two required ones.\n */\nfunction resolveAccessors<TItem, TValue extends string>(\n item: TItem,\n accessors: OptionAccessors<TItem, TValue> | undefined,\n): OptionAccessors<TItem, TValue> {\n if (accessors !== undefined) return accessors;\n if (typeof item === \"string\") {\n return stringOptionAccessors as unknown as OptionAccessors<TItem, TValue>;\n }\n if (isOption(item)) {\n return optionAccessors as unknown as OptionAccessors<TItem, TValue>;\n }\n throw new TypeError(\n \"collection: an item that is neither a string nor an Option needs accessors (getOptionValue/getOptionLabel)\",\n );\n}\n\n/** The value of one item: through `accessors`, or the default read of a string/`Option`. */\nexport function getOptionValue<TItem, TValue extends string = string>(\n item: TItem,\n accessors?: OptionAccessors<TItem, TValue>,\n): TValue {\n return resolveAccessors(item, accessors).getOptionValue(item);\n}\n\n/** The label of one item: through `accessors`, or the default read of a string/`Option`. */\nexport function getOptionLabel<TItem>(item: TItem, accessors?: OptionAccessors<TItem>): string {\n return resolveAccessors(item, accessors).getOptionLabel(item);\n}\n\n/**\n * One consumer item as an {@link Option}. When the item already is one, its\n * other fields (`description`, `icon`, `meta`) survive; the accessors decide\n * `value`, `label`, `disabled`, `group` and `keywords`. A `string` item needs\n * no accessors, and a domain object is kept as `meta`.\n */\nexport function toOption<TItem, TValue extends string = string>(\n item: TItem,\n accessors?: OptionAccessors<TItem, TValue>,\n): Option<TValue, unknown> {\n const read = resolveAccessors(item, accessors);\n if (accessors === undefined && isOption(item)) {\n return item as Option<TValue, unknown>;\n }\n const base: Option<TValue, unknown> = isOption(item)\n ? { ...(item as Option<TValue, unknown>) }\n : { value: read.getOptionValue(item), label: read.getOptionLabel(item) };\n base.value = read.getOptionValue(item);\n base.label = read.getOptionLabel(item);\n const disabled = read.getOptionDisabled?.(item);\n if (disabled !== undefined) base.disabled = disabled;\n const group = read.getOptionGroup?.(item);\n if (group !== undefined) base.group = group;\n const keywords = read.getOptionKeywords?.(item);\n if (keywords !== undefined) base.keywords = keywords;\n if (!isOption(item) && typeof item !== \"string\") base.meta = item;\n return base;\n}\n\n/**\n * Every consumer item as an {@link Option}, in order. Throws in development\n * on an empty `value` (§32: `\"\"` is not a row) and on a repeated `value` (two\n * rows the keyboard could not tell apart — the cmdk collision that made two\n * clients with one name highlight together).\n */\nexport function toOptions<TItem, TValue extends string = string>(\n items: readonly TItem[],\n accessors?: OptionAccessors<TItem, TValue>,\n): Option<TValue, unknown>[] {\n const options = items.map((item) => toOption(item, accessors));\n if (process.env.NODE_ENV !== \"production\") {\n const seen = new Set<string>();\n for (const option of options) {\n if (option.value === \"\") {\n throw new TypeError(\n `collection: option ${JSON.stringify(option.label)} has an empty value; emptiness is value === null on the control, not a row`,\n );\n }\n if (seen.has(option.value)) {\n throw new TypeError(\n `collection: option value ${JSON.stringify(option.value)} appears twice; values must be unique`,\n );\n }\n seen.add(option.value);\n }\n }\n return options;\n}\n\n/** The option whose `value` is `value`, or `undefined`. */\nexport function findOption<TValue extends string, TMeta>(\n options: readonly Option<TValue, TMeta>[],\n value: TValue | null | undefined,\n): Option<TValue, TMeta> | undefined {\n if (value === null || value === undefined) return undefined;\n return options.find((option) => option.value === value);\n}\n\n/** Whether the row takes no selection (rendered, announced, skipped by the keyboard). */\nexport function isOptionDisabled(option: Pick<Option, \"disabled\">): boolean {\n return option.disabled === true;\n}\n\n/**\n * A run of consecutive rows under one heading. Ungrouped rows come back with\n * `group: undefined` so a list can render them without a heading.\n *\n * @experimental\n */\nexport interface OptionGroup<TValue extends string = string, TMeta = unknown> {\n group: string | undefined;\n options: Option<TValue, TMeta>[];\n}\n\n/**\n * Rows bucketed by `group`, in order of first appearance; ungrouped rows keep\n * their place as their own bucket. A row's group is where its first sibling\n * put it, so consumers who interleave groups still get one heading per group.\n */\nexport function groupOptions<TValue extends string, TMeta>(\n options: readonly Option<TValue, TMeta>[],\n): OptionGroup<TValue, TMeta>[] {\n const buckets = new Map<string | undefined, OptionGroup<TValue, TMeta>>();\n const ordered: OptionGroup<TValue, TMeta>[] = [];\n for (const option of options) {\n let bucket = buckets.get(option.group);\n if (!bucket) {\n bucket = { group: option.group, options: [] };\n buckets.set(option.group, bucket);\n ordered.push(bucket);\n }\n bucket.options.push(option);\n }\n return ordered;\n}\n\n/**\n * Text folded for matching: lower-cased, diacritics removed, whitespace\n * collapsed. `\"Ándrea Lopez\"` and `\"andrea lopez\"` fold to the same string.\n */\nexport function foldForMatch(text: string): string {\n return text.normalize(\"NFD\").replace(/[̀-ͯ]/g, \"\").toLowerCase().replace(/\\s+/g, \" \").trim();\n}\n\n/**\n * Whether a typed query matches a row: a folded substring of the label, of\n * any keyword, or of the group name. An empty query matches every row.\n */\nexport function optionMatches(option: Option, query: string): boolean {\n const needle = foldForMatch(query);\n if (needle === \"\") return true;\n if (foldForMatch(option.label).includes(needle)) return true;\n if (option.group !== undefined && foldForMatch(option.group).includes(needle)) return true;\n return option.keywords?.some((keyword) => foldForMatch(keyword).includes(needle)) ?? false;\n}\n\n/** The rows a typed query keeps, in order. */\nexport function filterOptions<TValue extends string, TMeta>(\n options: readonly Option<TValue, TMeta>[],\n query: string,\n): Option<TValue, TMeta>[] {\n return options.filter((option) => optionMatches(option, query));\n}\n\n/* ── Selection: single `TValue | null`, multiple `TValue[]` (§32 \"Value\") ── */\n\n/**\n * The value of a list-shaped control, discriminated by `multiple`\n * (§32 \"Value\"): a single pick is `TValue | null`, a multi pick is `TValue[]`.\n *\n * @experimental\n */\nexport type SelectionValue<TValue extends string, Multiple extends boolean> = Multiple extends true\n ? TValue[]\n : TValue | null;\n\n/**\n * A single value at the boundary: `\"\"` and `undefined` both mean empty in the\n * 2.x line (§32 \"Compat\": `Select` keeps `value=\"\"`/`undefined` as empty), and\n * the control reasons about `null` from here on.\n */\nexport function normalizeSingleValue<TValue extends string>(\n value: TValue | \"\" | null | undefined,\n): TValue | null {\n return value === undefined || value === null || value === \"\" ? null : value;\n}\n\n/**\n * A multi value at the boundary: `undefined`/`null` is the empty array; empty\n * strings are dropped, so a legacy comma-joined `\"a,,b\"` split by the caller\n * cannot smuggle an empty pick in.\n */\nexport function normalizeMultipleValue<TValue extends string>(\n value: readonly (TValue | \"\")[] | null | undefined,\n): TValue[] {\n if (value === undefined || value === null) return [];\n return value.filter((entry): entry is TValue => entry !== \"\");\n}\n\n/** Whether `optionValue` is picked, for either arity of selection. */\nexport function isValueSelected<TValue extends string>(\n selection: TValue | null | readonly TValue[],\n optionValue: TValue,\n): boolean {\n if (selection === null) return false;\n if (typeof selection === \"string\") return selection === optionValue;\n return selection.includes(optionValue);\n}\n\n/** A multi selection with `optionValue` added or removed, order preserved. */\nexport function toggleValue<TValue extends string>(\n selection: readonly TValue[],\n optionValue: TValue,\n): TValue[] {\n return selection.includes(optionValue)\n ? selection.filter((entry) => entry !== optionValue)\n : [...selection, optionValue];\n}\n\n/**\n * The next selection after activating a row, for either arity: a single pick\n * replaces (or, with `clearable`, clears when the same row is activated\n * again); a multi pick toggles. `multiple` discriminates the selection type\n * in and out.\n */\nexport function selectValue<TValue extends string, Multiple extends boolean = false>(\n selection: SelectionValue<TValue, Multiple>,\n optionValue: TValue,\n options: { multiple?: Multiple; clearable?: boolean } = {},\n): SelectionValue<TValue, Multiple> {\n if (options.multiple) {\n const current = Array.isArray(selection) ? (selection as readonly TValue[]) : [];\n return toggleValue(current, optionValue) as SelectionValue<TValue, Multiple>;\n }\n const current = typeof selection === \"string\" ? selection : null;\n const next = options.clearable && current === optionValue ? null : optionValue;\n return next as SelectionValue<TValue, Multiple>;\n}\n","import { optionElementId } from \"./item-attributes\";\nimport { foldForMatch, type Option } from \"./option\";\n\n/**\n * L1a behaviour primitive (private). Not exported from the package.\n *\n * Keyboard navigation of a list-shaped control that drives its own\n * highlight (W4-09; target architecture §32 \"Keyboard/ARIA\": the combobox\n * pattern with `aria-activedescendant` intact). Radix-rendered lists\n * (`Select`, menus) bring their own; this is for the `Combobox` listbox\n * (W4-10), where focus stays in the input and the list only *marks* a row:\n *\n * - {@link nextHighlightedIndex}: ArrowDown/ArrowUp step over disabled rows,\n * Home/End jump, PageDown/PageUp move a page; wrap is opt-in.\n * - {@link typeaheadQuery} + {@link typeaheadMatch}: the WAI-ARIA listbox\n * typeahead — printable keys within a second concatenate into one query\n * matched against the start of each label; a repeated single character\n * cycles through the rows that start with it.\n * - {@link reconcileHighlight}: after the rows change (a filter, an async\n * load) the highlighted *value* is kept if it is still there, else the\n * first enabled row takes it — never a stale index.\n * - {@link activeDescendantId}: what `aria-activedescendant` names, derived\n * from the list id and the highlighted row's value (see\n * `item-attributes.ts`), or `undefined` when nothing is highlighted so the\n * attribute is dropped rather than left dangling.\n *\n * Every function is pure — index in, index out — so the same code answers a\n * unit test and a component's `onKeyDown`, and nothing here touches the DOM.\n */\n\n/** The one thing a row needs to say for navigation: whether it can be landed on. */\nexport interface NavigableRow {\n disabled?: boolean | undefined;\n}\n\n/** The index of the first enabled row at or after `from`, or `null` when none. */\nexport function firstEnabledIndex(rows: readonly NavigableRow[], from = 0): number | null {\n for (let index = Math.max(0, from); index < rows.length; index += 1) {\n if (!rows[index]?.disabled) return index;\n }\n return null;\n}\n\n/** The index of the last enabled row at or before `from`, or `null` when none. */\nexport function lastEnabledIndex(\n rows: readonly NavigableRow[],\n from = rows.length - 1,\n): number | null {\n for (let index = Math.min(rows.length - 1, from); index >= 0; index -= 1) {\n if (!rows[index]?.disabled) return index;\n }\n return null;\n}\n\n/**\n * The enabled row `steps` away from `from` in `direction`, skipping disabled\n * rows. Past either end: stays on the last enabled row in that direction, or\n * wraps to the other end with `loop`. From `null` (nothing highlighted) a step\n * down lands on the first enabled row and a step up on the last.\n */\nexport function stepEnabledIndex(\n rows: readonly NavigableRow[],\n from: number | null,\n direction: 1 | -1,\n { loop = false, steps = 1 }: { loop?: boolean; steps?: number } = {},\n): number | null {\n if (rows.length === 0) return null;\n if (from === null) {\n return direction === 1 ? firstEnabledIndex(rows) : lastEnabledIndex(rows);\n }\n let current: number = from;\n for (let taken = 0; taken < steps; taken += 1) {\n const candidate: number | null =\n direction === 1 ? firstEnabledIndex(rows, current + 1) : lastEnabledIndex(rows, current - 1);\n if (candidate === null) {\n if (loop && taken === 0) {\n const wrapped = direction === 1 ? firstEnabledIndex(rows) : lastEnabledIndex(rows);\n return wrapped ?? from;\n }\n break;\n }\n current = candidate;\n }\n return current;\n}\n\nexport interface ListNavigationOptions {\n /** Whether ArrowDown on the last row wraps to the first (and the reverse). Default off. */\n loop?: boolean | undefined;\n /** Rows a PageDown/PageUp moves. Default 10. */\n pageSize?: number | undefined;\n /** Which arrow pair navigates; `vertical` by default. */\n orientation?: \"vertical\" | \"horizontal\" | undefined;\n}\n\nconst NAVIGATION_KEYS = new Set([\n \"ArrowDown\",\n \"ArrowUp\",\n \"ArrowRight\",\n \"ArrowLeft\",\n \"Home\",\n \"End\",\n \"PageDown\",\n \"PageUp\",\n]);\n\n/** Whether `key` is one {@link nextHighlightedIndex} handles for the orientation. */\nexport function isListNavigationKey(\n key: string,\n orientation: \"vertical\" | \"horizontal\" = \"vertical\",\n): boolean {\n if (!NAVIGATION_KEYS.has(key)) return false;\n if (orientation === \"vertical\") return key !== \"ArrowRight\" && key !== \"ArrowLeft\";\n return key !== \"ArrowDown\" && key !== \"ArrowUp\";\n}\n\n/**\n * The row a navigation key moves the highlight to: the new index, `null` when\n * the list has no enabled row, or `undefined` when `key` is not a navigation\n * key for this orientation (the caller lets the event through). Only a\n * handled key should have its default prevented.\n */\nexport function nextHighlightedIndex(\n rows: readonly NavigableRow[],\n highlighted: number | null,\n key: string,\n { loop = false, pageSize = 10, orientation = \"vertical\" }: ListNavigationOptions = {},\n): number | null | undefined {\n if (!isListNavigationKey(key, orientation)) return undefined;\n switch (key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n return stepEnabledIndex(rows, highlighted, 1, { loop });\n case \"ArrowUp\":\n case \"ArrowLeft\":\n return stepEnabledIndex(rows, highlighted, -1, { loop });\n case \"Home\":\n return firstEnabledIndex(rows);\n case \"End\":\n return lastEnabledIndex(rows);\n case \"PageDown\":\n return stepEnabledIndex(rows, highlighted, 1, { steps: pageSize });\n case \"PageUp\":\n return stepEnabledIndex(rows, highlighted, -1, { steps: pageSize });\n default:\n return undefined;\n }\n}\n\n/* ── Typeahead ──────────────────────────────────────────────────────────── */\n\n/** Keys typed within this many milliseconds of each other form one query. */\nexport const TYPEAHEAD_TIMEOUT = 1000;\n\nexport interface TypeaheadState {\n query: string;\n /** When the last character arrived, in the caller's clock (`Date.now()`). */\n at: number;\n}\n\n/**\n * Whether a keyboard event is a typeahead character: one printable character\n * with no Ctrl/Meta/Alt. Space counts, so \"in review\" can be typed; a listbox\n * that selects on Space handles that first.\n */\nexport function isTypeaheadKey(event: {\n key: string;\n ctrlKey?: boolean;\n metaKey?: boolean;\n altKey?: boolean;\n}): boolean {\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;\n}\n\n/**\n * The query after one more character: appended when it arrives within\n * `timeout` of the previous one, else a fresh query of that character.\n */\nexport function typeaheadQuery(\n previous: TypeaheadState | null,\n character: string,\n now: number,\n timeout = TYPEAHEAD_TIMEOUT,\n): TypeaheadState {\n const continues = previous !== null && now - previous.at <= timeout;\n return { query: continues ? previous.query + character : character, at: now };\n}\n\n/**\n * The row a typeahead query lands on, or `null` when no label starts with it.\n * Searches forward from the row *after* `from`, wrapping, so repeating the\n * same character cycles through every row that starts with it (a query of\n * one repeated character is matched as that character). Disabled rows are\n * skipped. Matching is case- and diacritic-insensitive.\n */\nexport function typeaheadMatch(\n rows: readonly (NavigableRow & { label: string })[],\n query: string,\n from: number | null,\n): number | null {\n if (rows.length === 0 || query.length === 0) return null;\n const repeated = query.length > 1 && query.split(\"\").every((character) => character === query[0]);\n const needle = foldForMatch(repeated ? (query[0] ?? \"\") : query);\n if (needle.length === 0) return null;\n // A fresh multi-character query should still find the row it started on\n // (\"dr\" typed on \"Draft\" stays on \"Draft\"); a repeated character moves on.\n const start = from === null ? 0 : repeated || query.length === 1 ? from + 1 : from;\n for (let offset = 0; offset < rows.length; offset += 1) {\n const index = (start + offset) % rows.length;\n const row = rows[index];\n if (!row || row.disabled) continue;\n if (foldForMatch(row.label).startsWith(needle)) return index;\n }\n return null;\n}\n\n/* ── Highlight bookkeeping ──────────────────────────────────────────────── */\n\n/**\n * The highlighted value after the rows changed. Keeps `highlightedValue`\n * when an enabled row still carries it; otherwise `fallback` decides: the\n * first enabled row (`\"first\"`, what a filtering combobox does so Enter\n * always has a target) or nothing (`\"none\"`).\n */\nexport function reconcileHighlight<TValue extends string>(\n rows: readonly (NavigableRow & { value: TValue })[],\n highlightedValue: TValue | null,\n fallback: \"first\" | \"none\" = \"first\",\n): TValue | null {\n if (highlightedValue !== null) {\n const kept = rows.find((row) => row.value === highlightedValue && !row.disabled);\n if (kept) return kept.value;\n }\n if (fallback === \"none\") return null;\n const first = firstEnabledIndex(rows);\n return first === null ? null : (rows[first]?.value ?? null);\n}\n\n/** The index of `value` among the rows, or `null`. */\nexport function indexOfValue<TValue extends string>(\n rows: readonly { value: TValue }[],\n value: TValue | null,\n): number | null {\n if (value === null) return null;\n const index = rows.findIndex((row) => row.value === value);\n return index === -1 ? null : index;\n}\n\n/**\n * What the input's `aria-activedescendant` names: the id of the highlighted\n * row, or `undefined` so the attribute is omitted when nothing is\n * highlighted (a dangling reference fails axe `aria-valid-attr-value`).\n */\nexport function activeDescendantId(\n listId: string,\n rows: readonly Pick<Option, \"value\">[],\n highlighted: number | null,\n): string | undefined {\n if (highlighted === null || highlighted < 0 || highlighted >= rows.length) return undefined;\n const row = rows[highlighted];\n return row ? optionElementId(listId, row.value) : undefined;\n}\n","\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { RemoveScroll } from \"react-remove-scroll\";\n\n/**\n * L1a behaviour primitive (private). Not exported from the package.\n *\n * A scroll region that keeps scrolling while a modal overlay locks the page\n * (W4-10; target architecture §32 \"Overlay safety\").\n *\n * A Radix `Dialog` or `Sheet` locks page scroll with react-remove-scroll,\n * which swallows wheel and touch events on everything outside the dialog's\n * own subtree. A picker's listbox is portalled to `<body>`, so it *is*\n * outside: the list opens but does not scroll — the incident that made PRO\n * re-implement five pickers inline (consumer usage audit §28). Mounting a\n * second `RemoveScroll` inside the portalled surface makes that surface the\n * innermost lock while it is open: events inside it are allowed, the page\n * stays locked, and the lock pops off when the surface unmounts.\n *\n * `removeScrollBar={false}`: the outer overlay already compensated for the\n * scrollbar; a second compensation would shift the layout. `contents` adds no\n * box of its own. Rendered only while `active`, so a surface that is not\n * inside a modal overlay pays nothing.\n *\n * This is the one place the package imports `react-remove-scroll` outside\n * Radix; `SearchSelect` used to import it directly (import-hygiene baseline).\n */\nexport function NestedScrollLock({\n active = true,\n children,\n}: {\n active?: boolean;\n children: ReactNode;\n}) {\n if (!active) return <>{children}</>;\n return (\n <RemoveScroll removeScrollBar={false} className=\"ds:contents\">\n {children}\n </RemoveScroll>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { comboboxAnatomy, type ComboboxSlot } from \"../foundation/anatomy/slots\";\nimport { slot, stateAttributes } from \"../foundation/anatomy/slot\";\nimport { useId } from \"../foundation/id\";\nimport { useMergedRefs } from \"../foundation/merge-refs\";\nimport { EN_MESSAGES } from \"../foundation/messages/en\";\nimport type { ComboboxMessages } from \"../foundation/messages/types\";\nimport { useDsMessages } from \"../foundation/provider/context\";\nimport { useControllableState } from \"../foundation/use-controllable-state\";\nimport type { ControlSize } from \"../foundation/vocab\";\nimport { cn } from \"../lib/cn\";\nimport { microInteractions } from \"../lib/micro-interactions\";\n\nimport { listItemAttributes, optionElementId } from \"./behavior/collection/item-attributes\";\nimport {\n LIST_ITEM_INDICATOR_WELL,\n LIST_SEPARATOR,\n groupHeadingClasses,\n listItemClasses,\n} from \"./behavior/collection/item-recipe\";\nimport {\n activeDescendantId,\n indexOfValue,\n nextHighlightedIndex,\n reconcileHighlight,\n} from \"./behavior/collection/keyboard\";\nimport {\n filterOptions,\n findOption,\n foldForMatch,\n groupOptions,\n normalizeMultipleValue,\n normalizeSingleValue,\n toOptions,\n toggleValue,\n type Option,\n type OptionAccessors,\n} from \"./behavior/collection/option\";\nimport { FormBridge } from \"./behavior/form-bridge\";\nimport { NestedScrollLock } from \"./behavior/nested-scroll-lock\";\nimport { Chip } from \"./chip\";\nimport { useFieldControl } from \"./field/use-field-control\";\nimport { IconButton } from \"./icon-button\";\nimport { CheckIcon, ChevronDownIcon, PlusIcon, XIcon } from \"./icons\";\nimport { Popover, PopoverAnchor, PopoverContent } from \"./popover\";\nimport { Spinner } from \"./spinner\";\n\n/** The combobox parts (ADR-008). See the registry for the doc comment. */\nexport type { ComboboxSlot };\n/** The option model the combobox reads (target architecture §32). @experimental */\nexport type { Option, OptionAccessors };\n\n/* ────────────────────────────────────────────────────────────────────────────\n * Combobox — the searchable pick (W4-10; target architecture §32).\n *\n * One text input with the `combobox` role that keeps focus, a portalled\n * listbox in a `Popover` (so it is not clipped inside a `Dialog` or a `Sheet`\n * and scrolls there — `NestedScrollLock`), and the shared collection\n * internals for what a row is (`Option`, accessors), how it looks\n * (`listItemClasses`), what it carries (`listItemAttributes`) and how the\n * keyboard moves over it (`nextHighlightedIndex`, `aria-activedescendant`).\n *\n * - **Options**: `Option`s, plain strings, or domain objects with\n * `getOptionValue` / `getOptionLabel` (+ `getOptionDisabled`,\n * `getOptionGroup`, `getOptionKeywords`). Emptiness is `value === null`,\n * never a sentinel row; `\"\"` folds to `null` at the boundary (2.x compat).\n * - **Field**: `useFieldControl` names the input from the surrounding `Field`\n * (`aria-labelledby`, `aria-describedby`, invalid/required/disabled); a\n * standalone combobox takes `aria-label` — the development error of W4-02\n * fires otherwise. This is the accessible name `SearchSelect` never had.\n * - **Form**: `FormBridge` submits `name=value` (`name=\"\"` when empty, like a\n * named `Select`), blocks a `required` submission while empty, follows the\n * form's `reset` back to `defaultValue`, and submits nothing while disabled.\n * - **Async**: `loading` shows a spinner and the loading state; `onSearchChange`\n * receives every query; `shouldFilter={false}` hands the filtering to the\n * consumer (the options are the server's answer).\n * - **Create**: `onCreate(query)` renders a \"Create …\" row when the trimmed\n * query matches no label exactly.\n * - **Rendering**: `renderOption(option, state)` replaces the row's content,\n * `renderValue(option)` the closed control's text; `header` / `footer`\n * sit around the list inside the popover; `emptyState` / `loadingState`\n * replace the default messages; `messages` localises every string.\n * - **Keyboard**: ArrowDown/ArrowUp open and move the highlight (disabled\n * rows skipped), Home/End/PageUp/PageDown move it while open, typing\n * filters and highlights the first match, Enter picks the highlighted row,\n * Escape closes (and stops there, so a surrounding Dialog stays open), Tab\n * closes without picking. The input keeps focus throughout; the highlighted\n * row is `aria-activedescendant`, stamped `data-highlighted`.\n *\n * - **Multiple** (W4-11): `multiple` discriminates the value (`TValue[]`),\n * the change handler and `renderValue`. Picks toggle and the list stays\n * open; the picked rows render as `Chip`s inside the control, each with a\n * \"Remove {label}\" button; Backspace in an empty input removes the last\n * chip; `FormBridge` submits one `name` entry per value (`getAll(name)`);\n * `hideSelected` drops picked rows from the list. `MultiSelect` is this\n * preset under its own name.\n *\n * `size` reads the shared control scale (A1): `md` is the 36px / 13px field\n * of today's `SearchSelect`.\n * ──────────────────────────────────────────────────────────────────────────── */\n\n/**\n * Every string the combobox renders: prop > `DesignSystemProvider\n * messages.combobox` > English (W5-20, ADR-010). Deterministic defaults (A3).\n *\n * @experimental\n */\nexport type { ComboboxMessages };\n\n/** The English defaults (the `combobox` namespace of the catalogue). */\nexport const DEFAULT_COMBOBOX_MESSAGES: ComboboxMessages = EN_MESSAGES.combobox;\n\n/** The sizes a combobox offers: the shared control scale (A1). @experimental */\nexport type ComboboxSize = ControlSize;\n\n/** What `renderOption` is told about the row it renders. @experimental */\nexport interface ComboboxOptionState {\n selected: boolean;\n highlighted: boolean;\n disabled: boolean;\n}\n\n/**\n * Class overrides per part, for the consumer who must restyle one slot\n * without reaching into the DOM.\n *\n * @experimental\n */\nexport interface ComboboxClassNames {\n root?: string;\n control?: string;\n input?: string;\n chip?: string;\n content?: string;\n list?: string;\n item?: string;\n}\n\n/** @experimental */\nexport interface ComboboxBaseProps<TItem, TValue extends string> extends Partial<\n OptionAccessors<TItem, TValue>\n> {\n /** The rows: `Option`s, strings, or domain objects read through the accessors. */\n options: readonly TItem[];\n id?: string | undefined;\n /** The form field name. Without it nothing is submitted. */\n name?: string | undefined;\n /** The `id` of the form to submit with when the control is rendered outside it. */\n form?: string | undefined;\n required?: boolean | undefined;\n disabled?: boolean | undefined;\n readOnly?: boolean | undefined;\n invalid?: boolean | undefined;\n /** The accessible name of a combobox outside a `Field`. */\n \"aria-label\"?: string | undefined;\n \"aria-labelledby\"?: string | undefined;\n \"aria-describedby\"?: string | undefined;\n placeholder?: string | undefined;\n /** Outer height from the shared control scale. Default `md` (36px). */\n size?: ComboboxSize | undefined;\n /** A leading glyph inside the control, decorative. */\n icon?: ReactNode | undefined;\n /** Show a clear button while a value is set. Default `true`. */\n clearable?: boolean | undefined;\n /** Open the list when the input receives focus. Default `false`. */\n openOnFocus?: boolean | undefined;\n /** Whether the list surface flips to stay in the viewport. Default `true`. */\n avoidCollisions?: boolean | undefined;\n\n open?: boolean | undefined;\n defaultOpen?: boolean | undefined;\n onOpenChange?: ((open: boolean) => void) | undefined;\n\n /** The typed query (controlled). */\n search?: string | undefined;\n defaultSearch?: string | undefined;\n /** Called with every query the user types (an async source fetches here). */\n onSearchChange?: ((query: string) => void) | undefined;\n /**\n * Filter `options` by the query (`true`, the default). `false` when the\n * consumer filters — the options are already the answer to the query.\n */\n shouldFilter?: boolean | undefined;\n\n /** An async source is fetching: a spinner in the control, `loadingState` in the list. */\n loading?: boolean | undefined;\n emptyState?: ReactNode | undefined;\n loadingState?: ReactNode | undefined;\n /** Rendered above the list, inside the popover. */\n header?: ReactNode | undefined;\n /** Rendered below the list, inside the popover. */\n footer?: ReactNode | undefined;\n\n /** Offer a \"Create …\" row for a query that matches no option exactly. */\n onCreate?: ((query: string) => void) | undefined;\n\n /** Replaces the content of a row. */\n renderOption?:\n | ((option: Option<TValue, unknown>, state: ComboboxOptionState) => ReactNode)\n | undefined;\n\n messages?: Partial<ComboboxMessages> | undefined;\n className?: string | undefined;\n classNames?: ComboboxClassNames | undefined;\n /** The input element. */\n ref?: React.Ref<HTMLInputElement> | undefined;\n}\n\n/** @experimental */\nexport interface ComboboxSingleProps<TItem, TValue extends string> extends ComboboxBaseProps<\n TItem,\n TValue\n> {\n multiple?: false | undefined;\n /** The picked value, or `null`. `\"\"` means empty (2.x compat). */\n value?: TValue | \"\" | null | undefined;\n defaultValue?: TValue | \"\" | null | undefined;\n onValueChange?:\n | ((value: TValue | null, details: { option: Option<TValue, unknown> | null }) => void)\n | undefined;\n /** Replaces the closed control's text for the picked option. */\n renderValue?: ((option: Option<TValue, unknown>) => ReactNode) | undefined;\n /** Close the list after a pick. Default `true`. */\n closeOnSelect?: boolean | undefined;\n}\n\n/** What `renderValue` receives in `multiple` mode besides the picked options. @experimental */\nexport interface ComboboxSelectionControls<TValue extends string> {\n /** Removes one value from the selection. */\n remove: (value: TValue) => void;\n}\n\n/** @experimental */\nexport interface ComboboxMultipleProps<TItem, TValue extends string> extends ComboboxBaseProps<\n TItem,\n TValue\n> {\n multiple: true;\n /** The picked values, in pick order. Empty strings are dropped. */\n value?: readonly (TValue | \"\")[] | undefined;\n defaultValue?: readonly (TValue | \"\")[] | undefined;\n onValueChange?:\n | ((value: TValue[], details: { option: Option<TValue, unknown> | null }) => void)\n | undefined;\n /**\n * Replaces the chips inside the control: called with the picked options\n * and `remove`. Return `null` to render nothing there.\n */\n renderValue?:\n | ((\n options: Option<TValue, unknown>[],\n controls: ComboboxSelectionControls<TValue>,\n ) => ReactNode)\n | undefined;\n /** Close the list after a pick. Default `false`: keep picking. */\n closeOnSelect?: boolean | undefined;\n /** Drop picked rows from the list (the chips already show them). Default `false`. */\n hideSelected?: boolean | undefined;\n}\n\n/**\n * The props, discriminated by `multiple` (target architecture §32 \"Value\"):\n * a single pick is `TValue | null`, a multi pick is `TValue[]`.\n *\n * @experimental\n */\nexport type ComboboxProps<TItem = Option, TValue extends string = string> =\n | ComboboxSingleProps<TItem, TValue>\n | ComboboxMultipleProps<TItem, TValue>;\n\n/** Size rows: min height (chips may wrap), start padding, label, gap, glyph — per control size. */\nconst CONTROL_SIZE: Readonly<Record<ComboboxSize, string>> = {\n xs: \"ds:min-h-(--control-height-xs) ds:ps-(--control-padding-x-xs) ds:text-(length:--control-font-size-xs) ds:gap-(--control-gap-xs) ds:[&_svg]:size-(--control-icon-xs)\",\n sm: \"ds:min-h-(--control-height-sm) ds:ps-(--control-padding-x-sm) ds:text-(length:--control-font-size-sm) ds:gap-(--control-gap-sm) ds:[&_svg]:size-(--control-icon-sm)\",\n md: \"ds:min-h-(--control-height-md) ds:ps-(--control-padding-x-md) ds:text-(length:--control-font-size-md) ds:gap-(--control-gap-md) ds:[&_svg]:size-(--control-icon-md)\",\n lg: \"ds:min-h-(--control-height-lg) ds:ps-(--control-padding-x-lg) ds:text-(length:--control-font-size-lg) ds:gap-(--control-gap-lg) ds:[&_svg]:size-(--control-icon-lg)\",\n xl: \"ds:min-h-(--control-height-xl) ds:ps-(--control-padding-x-xl) ds:text-(length:--control-font-size-xl) ds:gap-(--control-gap-xl) ds:[&_svg]:size-(--control-icon-xl)\",\n};\n\n/** The end buttons are one size smaller than the control, so they sit inside it. */\nconst BUTTON_SIZE: Readonly<Record<ComboboxSize, ControlSize>> = {\n xs: \"xs\",\n sm: \"xs\",\n md: \"xs\",\n lg: \"sm\",\n xl: \"md\",\n};\n\n/**\n * The field chrome, on the frame around the input rather than on the input\n * itself: the same box, border, focus edge + halo, invalid and disabled\n * treatment as `controlChrome`, keyed on `focus-within` and the root's state\n * attributes because the frame is not the focusable element.\n */\nconst CONTROL_FRAME = [\n \"ds:relative ds:flex ds:w-full ds:flex-wrap ds:items-center ds:rounded-input ds:border ds:border-field-border ds:bg-surface ds:font-body ds:text-fg ds:pe-1\",\n microInteractions.control,\n \"ds:not-data-disabled:hover:border-field-border-hover\",\n \"ds:focus-within:[border-color:var(--focus-ring-border)] ds:focus-within:[box-shadow:var(--shadow-focus-ring-field)]\",\n \"ds:data-[invalid]:border-field-border-invalid ds:data-[invalid]:focus-within:border-danger-fg\",\n \"ds:data-[invalid]:focus-within:[box-shadow:0_0_0_2px_var(--color-danger-bg)]\",\n \"ds:data-[disabled]:cursor-not-allowed ds:data-[disabled]:bg-bg-disabled ds:data-[disabled]:text-fg-disabled\",\n].join(\" \");\n\n// `ds:[font:inherit]`: the input takes the control's size-scale type. Without it an\n// app's own base rule (`input { font-size: 1rem }`) wins, because the size class sits on\n// the control frame and the <input> element is the one the base rule targets.\nconst INPUT_CLASSES =\n \"ds:min-w-16 ds:flex-1 ds:self-stretch ds:bg-transparent ds:py-0 ds:[font:inherit] ds:text-inherit ds:outline-none ds:placeholder:text-fg-4 ds:disabled:cursor-not-allowed ds:read-only:cursor-default\";\n\nconst LABEL_SIZE = \"ds:text-(length:--control-font-size-md)\";\nconst SMALL_TEXT = \"ds:text-(length:--control-font-size-xs)\";\n\nconst ITEM_CLASSES = listItemClasses({\n frame: \"select\",\n labelSize: LABEL_SIZE,\n palette: \"neutral\",\n highlight: \"data-highlighted\",\n selected: \"aria-selected\",\n});\n\nconst CREATE_ITEM_CLASSES = cn(\n ITEM_CLASSES,\n \"ds:text-brand ds:data-[highlighted]:bg-brand-bg ds:data-[highlighted]:text-brand\",\n);\n\nconst GROUP_HEADING_CLASSES = groupHeadingClasses({ palette: \"neutral\", labelSize: SMALL_TEXT });\n\nconst STATE_CLASSES = cn(\"ds:text-fg-3 ds:px-3 ds:py-2\", SMALL_TEXT);\n\n/**\n * The value of the create row inside the list. A control character no\n * consumer value carries, so `optionElementId` never collides with a row.\n */\nconst CREATE_ROW = \"\\u0000create\";\n\n/**\n * C-CMDK-ATTR: a `SearchSelect` rendered through the combobox still stamps\n * `cmdk-item=\"\"` on its rows. Since 2.0 this is not guaranteed and may go in\n * any 2.x release; `[data-slot=combobox-item]` / role `option` is the\n * contract. Provided by the adapter, never public.\n */\nexport const CmdkCompatContext = React.createContext(false);\n\n/**\n * The searchable pick: one input, a portalled listbox, the option model.\n * See the module comment.\n *\n * @experimental\n */\nexport function Combobox<TItem = Option, TValue extends string = string>(\n props: ComboboxProps<TItem, TValue>,\n) {\n const {\n options: items,\n getOptionValue,\n getOptionLabel,\n getOptionDisabled,\n getOptionGroup,\n getOptionKeywords,\n id: idProp,\n name: nameProp,\n form,\n required: requiredProp,\n disabled: disabledProp,\n readOnly: readOnlyProp,\n invalid: invalidProp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n placeholder,\n size = \"md\",\n icon,\n clearable = true,\n openOnFocus = false,\n avoidCollisions = true,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n search: searchProp,\n defaultSearch = \"\",\n onSearchChange,\n shouldFilter = true,\n loading = false,\n emptyState,\n loadingState,\n header,\n footer,\n onCreate,\n renderOption,\n messages: messagesProp,\n className,\n classNames,\n ref,\n } = props;\n const multiple = props.multiple === true;\n const closeOnSelect = props.closeOnSelect ?? !multiple;\n const hideSelected = props.multiple === true && props.hideSelected === true;\n\n const messages = useDsMessages(\"combobox\", messagesProp);\n\n const accessors = React.useMemo<OptionAccessors<TItem, TValue> | undefined>(() => {\n if (!getOptionValue || !getOptionLabel) return undefined;\n return {\n getOptionValue,\n getOptionLabel,\n getOptionDisabled,\n getOptionGroup,\n getOptionKeywords,\n };\n }, [getOptionValue, getOptionLabel, getOptionDisabled, getOptionGroup, getOptionKeywords]);\n\n const options = React.useMemo(() => toOptions(items, accessors), [items, accessors]);\n\n /* ── Field wiring ──────────────────────────────────────────────────────── */\n\n // `native: false`: the input must not carry the native `required` — that\n // would validate the typed text, not the value. FormBridge's proxy does it,\n // and the wiring mirrors `aria-required` on the input.\n const wiring = useFieldControl({\n id: idProp,\n name: nameProp,\n invalid: invalidProp,\n required: requiredProp,\n disabled: disabledProp,\n readOnly: readOnlyProp,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n native: false,\n });\n const disabled = wiring.disabled ?? false;\n const readOnly = wiring.readOnly ?? false;\n const inert = disabled || readOnly;\n const listId = useId(undefined, `${wiring.id}-list`);\n\n /* ── State ─────────────────────────────────────────────────────────────── */\n\n // One internal shape for both arities: the picked values in order (a\n // single pick is zero or one). `\"\"` and `undefined` fold to empty (2.x).\n const toSelection = (raw: unknown): TValue[] | undefined => {\n if (raw === undefined) return undefined;\n if (multiple) return normalizeMultipleValue(raw as readonly (TValue | \"\")[] | null);\n const single = normalizeSingleValue(raw as TValue | \"\" | null);\n return single === null ? [] : [single];\n };\n const defaultSelection = React.useMemo(\n () => toSelection(props.defaultValue) ?? [],\n // eslint-disable-next-line react-hooks/exhaustive-deps -- read once, like a default should be\n [],\n );\n const [selection, setSelectionState] = useControllableState<TValue[]>({\n prop: toSelection(props.value),\n defaultProp: defaultSelection,\n });\n const value: TValue | null = multiple ? null : (selection[0] ?? null);\n const [openState, setOpenState] = useControllableState<boolean>({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n const open = openState && !inert;\n const [search, setSearchState] = useControllableState<string>({\n prop: searchProp,\n defaultProp: defaultSearch,\n onChange: onSearchChange,\n });\n\n const selectedOption = React.useMemo(() => findOption(options, value), [options, value]);\n const selectedOptions = React.useMemo(\n () =>\n selection\n .map((entry) => findOption(options, entry))\n .filter((option): option is Option<TValue, unknown> => option !== undefined),\n [options, selection],\n );\n\n const inputRef = React.useRef<HTMLInputElement>(null);\n const controlRef = React.useRef<HTMLDivElement>(null);\n const mergedInputRef = useMergedRefs<HTMLInputElement>(inputRef, ref, wiring.ref);\n\n // Emits through the arity's own handler; `option` is the row that was\n // activated (or `null` for a clear / reset).\n const commitSelection = React.useCallback(\n (next: TValue[], option: Option<TValue, unknown> | null) => {\n setSelectionState(next);\n const changed =\n next.length !== selection.length || next.some((entry, index) => entry !== selection[index]);\n if (!changed) return;\n if (props.multiple === true) props.onValueChange?.(next, { option });\n else props.onValueChange?.(next[0] ?? null, { option });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps -- `props` is read for the discriminant\n [setSelectionState, selection, props.multiple, props.onValueChange],\n );\n const setValue = React.useCallback(\n (next: TValue | null) =>\n commitSelection(next === null ? [] : [next], findOption(options, next) ?? null),\n [commitSelection, options],\n );\n const removeValue = React.useCallback(\n (entry: TValue) =>\n commitSelection(\n selection.filter((current) => current !== entry),\n findOption(options, entry) ?? null,\n ),\n [commitSelection, selection, options],\n );\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (next && inert) return;\n setOpenState(next);\n // A fresh query on every open; the closed control shows the value.\n if (!next) setSearchState(\"\");\n },\n [inert, setOpenState, setSearchState],\n );\n\n /* ── Rows ──────────────────────────────────────────────────────────────── */\n\n const trimmed = search.trim();\n const visibleOptions = React.useMemo(() => {\n const filtered = shouldFilter ? filterOptions(options, search) : options;\n return hideSelected ? filtered.filter((option) => !selection.includes(option.value)) : filtered;\n }, [options, search, shouldFilter, hideSelected, selection]);\n const showCreate =\n onCreate !== undefined &&\n trimmed.length > 0 &&\n !options.some((option) => foldForMatch(option.label) === foldForMatch(trimmed));\n\n // Rows render grouped (a group's rows are consecutive, in order of first\n // appearance), so the navigable order is the grouped order, then the\n // create row.\n const groups = React.useMemo(() => groupOptions(visibleOptions), [visibleOptions]);\n const hasGroups = groups.some((group) => group.group !== undefined);\n const rows = React.useMemo<Option<TValue, unknown>[]>(() => {\n const list = groups.flatMap((group) => group.options);\n if (showCreate) list.push({ value: CREATE_ROW as TValue, label: messages.create(trimmed) });\n return list;\n }, [groups, showCreate, messages, trimmed]);\n\n const [highlightedValue, setHighlightedValue] = React.useState<TValue | null>(null);\n const highlightedIndex = indexOfValue(rows, highlightedValue);\n\n // After the rows change (a keystroke, an async load) the highlight stays on\n // its row when that row is still there, else the first enabled row takes it.\n React.useEffect(() => {\n if (!open) return;\n setHighlightedValue((current) => reconcileHighlight(rows, current, \"first\"));\n }, [open, rows]);\n\n // Opening lands the highlight on the picked row, so Enter keeps it.\n const openList = React.useCallback(() => {\n if (open) return;\n setHighlightedValue(value !== null && findOption(rows, value) ? value : null);\n setOpen(true);\n }, [open, rows, setOpen, value]);\n\n const scrollHighlightedIntoView = React.useCallback(() => {\n const id = activeDescendantId(listId, rows, highlightedIndex);\n if (!id) return;\n document.getElementById(id)?.scrollIntoView({ block: \"nearest\" });\n }, [listId, rows, highlightedIndex]);\n React.useEffect(() => {\n if (open) scrollHighlightedIntoView();\n }, [open, scrollHighlightedIntoView]);\n\n /* ── Actions ───────────────────────────────────────────────────────────── */\n\n const focusInput = () => inputRef.current?.focus();\n\n const activateRow = React.useCallback(\n (option: Option<TValue, unknown>) => {\n if (option.disabled) return;\n if (option.value === CREATE_ROW) {\n onCreate?.(trimmed);\n setOpen(false);\n return;\n }\n if (multiple) commitSelection(toggleValue(selection, option.value), option);\n else setValue(clearable && option.value === value ? null : option.value);\n if (closeOnSelect) setOpen(false);\n else setSearchState(\"\");\n },\n [\n onCreate,\n trimmed,\n setOpen,\n multiple,\n commitSelection,\n selection,\n setValue,\n clearable,\n value,\n closeOnSelect,\n setSearchState,\n ],\n );\n\n const clear = () => {\n commitSelection([], null);\n setSearchState(\"\");\n focusInput();\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (inert) return;\n if (event.key === \"Escape\") {\n if (!open) return;\n // Stop here: a surrounding Dialog or Sheet must not close as well.\n event.preventDefault();\n event.stopPropagation();\n setOpen(false);\n return;\n }\n if (event.key === \"Tab\") {\n if (open) setOpen(false);\n return;\n }\n if (event.key === \"Backspace\" && multiple && event.currentTarget.value === \"\") {\n const last = selection[selection.length - 1];\n if (last !== undefined) {\n event.preventDefault();\n removeValue(last);\n }\n return;\n }\n if (event.key === \"Enter\") {\n if (!open) return;\n // Never submits the form while the list is open.\n event.preventDefault();\n const row = highlightedIndex === null ? undefined : rows[highlightedIndex];\n if (row) activateRow(row);\n return;\n }\n if (!open && (event.key === \"ArrowDown\" || event.key === \"ArrowUp\")) {\n event.preventDefault();\n openList();\n return;\n }\n if (!open) return;\n const next = nextHighlightedIndex(rows, highlightedIndex, event.key);\n if (next === undefined) return;\n event.preventDefault();\n setHighlightedValue(next === null ? null : (rows[next]?.value ?? null));\n };\n\n /* ── Render ────────────────────────────────────────────────────────────── */\n\n const displayValue = open || multiple ? search : (selectedOption?.label ?? \"\");\n const singleRenderValue = props.multiple === true ? undefined : props.renderValue;\n const showValueNode =\n !open && !multiple && selectedOption !== undefined && singleRenderValue !== undefined;\n const chips =\n props.multiple === true\n ? props.renderValue\n ? props.renderValue(selectedOptions, { remove: removeValue })\n : selectedOptions.map((option) => (\n <Chip\n key={option.value}\n size=\"xs\"\n disabled={disabled}\n className={classNames?.chip}\n removeLabel={messages.remove(option.label)}\n onRemove={readOnly ? undefined : () => removeValue(option.value)}\n >\n {option.label}\n </Chip>\n ))\n : null;\n const hasChips = props.multiple === true && selectedOptions.length > 0;\n const cmdkCompat = React.useContext(CmdkCompatContext);\n const buttonSize = BUTTON_SIZE[size];\n\n const indexByValue = new Map(rows.map((row, index) => [row.value, index] as const));\n\n const renderRow = (option: Option<TValue, unknown>) => {\n const index = indexByValue.get(option.value) ?? -1;\n const highlighted = highlightedIndex === index;\n const selected = selection.includes(option.value);\n const isDisabled = option.disabled === true;\n const attributes = listItemAttributes(comboboxAnatomy, {\n id: optionElementId(listId, option.value),\n highlighted,\n selected,\n disabled: isDisabled,\n cmdkCompat,\n });\n return (\n // The row is `role=\"option\"` (in `attributes`), operated from the input\n // through `aria-activedescendant`: it is never a focus stop of its own.\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n <div\n key={option.value}\n {...attributes}\n className={cn(ITEM_CLASSES, classNames?.item)}\n onPointerMove={() => {\n if (!isDisabled && highlightedValue !== option.value) setHighlightedValue(option.value);\n }}\n // Keep focus in the input: the row is a target, not a focus stop.\n // `mousedown`, not `pointerdown`: a prevented pointerdown also drops\n // the `click` under user-event (Storybook play, Testing Library),\n // while a prevented mousedown only keeps the focus where it is.\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => activateRow(option)}\n >\n {renderOption ? (\n renderOption(option, { selected, highlighted, disabled: isDisabled })\n ) : (\n <>\n {option.icon !== undefined && (\n <span className=\"ds:inline-flex ds:shrink-0\" aria-hidden=\"true\">\n {option.icon}\n </span>\n )}\n <span className=\"ds:min-w-0 ds:flex-1\">\n <span className=\"ds:block ds:truncate\">{option.label}</span>\n {option.description !== undefined && (\n <span className={cn(\"ds:text-fg-4 ds:block ds:truncate\", SMALL_TEXT)}>\n {option.description}\n </span>\n )}\n </span>\n </>\n )}\n {selected && (\n <span\n {...slot(comboboxAnatomy, \"item-indicator\")}\n className={LIST_ITEM_INDICATOR_WELL.end}\n >\n <CheckIcon aria-hidden=\"true\" />\n </span>\n )}\n </div>\n );\n };\n\n const createIndex = rows.length - 1;\n const createHighlighted = showCreate && highlightedIndex === createIndex;\n\n return (\n <div\n {...slot(comboboxAnatomy, \"root\")}\n {...stateAttributes({\n state: open ? \"open\" : \"closed\",\n disabled,\n invalid: wiring[\"aria-invalid\"] === true,\n size,\n })}\n className={cn(\"ds:relative ds:w-full\", className, classNames?.root)}\n >\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverAnchor asChild>\n <div\n ref={controlRef}\n {...slot(comboboxAnatomy, \"control\")}\n className={cn(CONTROL_FRAME, CONTROL_SIZE[size], classNames?.control)}\n onPointerDown={(event) => {\n // A press on the frame or the value (not on a button or the\n // input itself) is a press on the input.\n const target = event.target as Element;\n if (inert || target === inputRef.current || target.closest(\"button\")) return;\n event.preventDefault();\n focusInput();\n openList();\n }}\n >\n {icon !== undefined && (\n <span\n {...slot(comboboxAnatomy, \"icon\")}\n className=\"ds:text-fg-4 ds:inline-flex ds:shrink-0\"\n aria-hidden=\"true\"\n >\n {icon}\n </span>\n )}\n {showValueNode && (\n // The custom value takes the input's place in the row; the input\n // keeps the label as its value for assistive technology and\n // collapses to a point until the list opens.\n <span\n {...slot(comboboxAnatomy, \"value\")}\n className=\"ds:pointer-events-none ds:flex ds:min-w-0 ds:flex-1 ds:items-center ds:gap-2 ds:truncate\"\n aria-hidden=\"true\"\n >\n {singleRenderValue!(selectedOption!)}\n </span>\n )}\n {hasChips && chips !== null && (\n <span\n {...slot(comboboxAnatomy, \"chips\")}\n className=\"ds:flex ds:min-w-0 ds:flex-wrap ds:items-center ds:gap-1 ds:py-1\"\n >\n {chips}\n </span>\n )}\n <input\n {...slot(comboboxAnatomy, \"input\")}\n ref={mergedInputRef}\n id={wiring.id}\n type=\"text\"\n role=\"combobox\"\n autoComplete=\"off\"\n spellCheck={false}\n aria-autocomplete=\"list\"\n aria-expanded={open}\n aria-controls={open ? listId : undefined}\n aria-activedescendant={\n open ? activeDescendantId(listId, rows, highlightedIndex) : undefined\n }\n aria-label={ariaLabel}\n aria-labelledby={wiring[\"aria-labelledby\"]}\n aria-describedby={wiring[\"aria-describedby\"]}\n aria-invalid={wiring[\"aria-invalid\"]}\n aria-required={wiring[\"aria-required\"]}\n aria-busy={loading || undefined}\n data-invalid={wiring[\"data-invalid\"]}\n data-disabled={wiring[\"data-disabled\"]}\n disabled={disabled}\n readOnly={readOnly}\n placeholder={selectedOption || hasChips ? undefined : placeholder}\n value={displayValue}\n className={cn(\n INPUT_CLASSES,\n showValueNode && \"ds:absolute ds:size-px ds:min-w-0 ds:flex-none ds:opacity-0\",\n classNames?.input,\n )}\n onChange={(event) => {\n if (inert) return;\n setSearchState(event.target.value);\n if (!open) openList();\n }}\n onFocus={() => {\n if (openOnFocus) openList();\n }}\n onClick={() => openList()}\n onKeyDown={onKeyDown}\n />\n {loading && <Spinner size=\"xs\" intent=\"neutral\" aria-hidden=\"true\" />}\n {clearable && selection.length > 0 && !inert && (\n <IconButton\n {...slot(comboboxAnatomy, \"clear\")}\n label={messages.clear}\n tooltip={false}\n variant=\"ghost\"\n intent=\"neutral\"\n size={buttonSize}\n icon={<XIcon />}\n onClick={clear}\n />\n )}\n <IconButton\n {...slot(comboboxAnatomy, \"toggle\")}\n // The frame already shows the disabled state; the ghost button's own\n // disabled fill would draw a grey box around the chevron.\n className=\"ds:[&:disabled:not([data-loading=true])]:bg-transparent\"\n label={messages.toggle}\n tooltip={false}\n variant=\"ghost\"\n intent=\"neutral\"\n size={buttonSize}\n tabIndex={-1}\n aria-expanded={open}\n aria-controls={open ? listId : undefined}\n disabled={inert}\n icon={\n <ChevronDownIcon\n className={cn(\n \"ds:transition-transform ds:duration-[var(--motion-duration-feedback)] ds:ease-[var(--motion-ease-enter)] ds:motion-reduce:transition-none\",\n open && \"ds:rotate-180\",\n )}\n />\n }\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n focusInput();\n if (open) setOpen(false);\n else openList();\n }}\n />\n </div>\n </PopoverAnchor>\n\n <PopoverContent\n {...slot(comboboxAnatomy, \"content\")}\n // The popup of a combobox is its listbox, not a dialog: Radix's\n // `role=\"dialog\"` would need a name of its own (axe aria-dialog-name).\n role=\"presentation\"\n align=\"start\"\n sideOffset={4}\n avoidCollisions={avoidCollisions}\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onInteractOutside={(event) => {\n // A press inside the control is not \"outside\": it toggles or types.\n if (controlRef.current?.contains(event.target as Node)) event.preventDefault();\n }}\n // Inline, not classes: the width follows the anchor (the base content\n // ships `w-72`, which tailwind-merge does not reconcile with `w-(--…)`).\n style={{\n width: \"var(--radix-popover-trigger-width)\",\n maxHeight: \"var(--radix-popover-content-available-height)\",\n }}\n className={cn(\n \"ds:flex ds:min-w-48 ds:flex-col ds:overflow-hidden ds:p-0\",\n classNames?.content,\n )}\n >\n <NestedScrollLock>\n {header !== undefined && (\n <div\n {...slot(comboboxAnatomy, \"header\")}\n className=\"ds:border-rule ds:shrink-0 ds:border-b\"\n >\n {header}\n </div>\n )}\n <div\n {...slot(comboboxAnatomy, \"list\")}\n id={listId}\n role=\"listbox\"\n aria-multiselectable={multiple || undefined}\n aria-labelledby={wiring[\"aria-labelledby\"]}\n aria-label={wiring[\"aria-labelledby\"] ? undefined : ariaLabel}\n className={cn(\n \"ds:scrollbar-thin ds:min-h-0 ds:flex-1 ds:max-h-[min(20rem,60vh)] ds:overflow-y-auto ds:p-1\",\n classNames?.list,\n )}\n >\n {hasGroups\n ? groups.map((group, groupIndex) => {\n const headingId =\n group.group === undefined ? undefined : `${listId}-group-${groupIndex}`;\n return (\n <div\n key={group.group ?? `ungrouped-${groupIndex}`}\n {...slot(comboboxAnatomy, \"group\")}\n role=\"group\"\n aria-labelledby={headingId}\n >\n {group.group !== undefined && (\n <div\n {...slot(comboboxAnatomy, \"group-heading\")}\n id={headingId}\n role=\"presentation\"\n className={GROUP_HEADING_CLASSES}\n >\n {group.group}\n </div>\n )}\n {group.options.map(renderRow)}\n </div>\n );\n })\n : visibleOptions.map(renderRow)}\n {showCreate && (\n <>\n {visibleOptions.length > 0 && (\n <div className={LIST_SEPARATOR.neutral} role=\"presentation\" />\n )}\n {/* `role=\"option\"` through the attributes, operated from the input. */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n {...listItemAttributes(comboboxAnatomy, {\n id: optionElementId(listId, CREATE_ROW),\n highlighted: createHighlighted,\n selected: false,\n cmdkCompat,\n })}\n {...slot(comboboxAnatomy, \"create\")}\n className={CREATE_ITEM_CLASSES}\n onPointerMove={() => {\n if (highlightedValue !== CREATE_ROW)\n setHighlightedValue(CREATE_ROW as TValue);\n }}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n const row = rows[createIndex];\n if (row) activateRow(row);\n }}\n >\n <PlusIcon aria-hidden=\"true\" />\n <span className=\"ds:min-w-0 ds:flex-1 ds:truncate\">\n {messages.create(trimmed)}\n </span>\n </div>\n </>\n )}\n </div>\n {loading && (\n <div {...slot(comboboxAnatomy, \"loading\")} role=\"status\" className={STATE_CLASSES}>\n {loadingState ?? messages.loading}\n </div>\n )}\n {!loading && rows.length === 0 && (\n <div {...slot(comboboxAnatomy, \"empty\")} role=\"status\" className={STATE_CLASSES}>\n {emptyState ?? messages.empty}\n </div>\n )}\n {footer !== undefined && (\n <div\n {...slot(comboboxAnatomy, \"footer\")}\n className=\"ds:border-rule ds:shrink-0 ds:border-t\"\n >\n {footer}\n </div>\n )}\n </NestedScrollLock>\n </PopoverContent>\n </Popover>\n\n <FormBridge\n name={wiring.name}\n value={multiple ? selection : value}\n form={form}\n disabled={disabled}\n required={wiring[\"aria-required\"] === true}\n focusTarget={inputRef}\n onReset={() => commitSelection(defaultSelection, null)}\n />\n </div>\n );\n}\n\nCombobox.displayName = \"Combobox\";\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport { Combobox, type ComboboxSize, type Option } from \"./combobox\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * ClientSelect — single-client picker, an adapter over `Combobox` (W8-06).\n *\n * Public API preserved verbatim:\n * <ClientSelect\n * clients value onChange\n * name error className placeholder\n * />\n *\n * Behavioural notes:\n * - `value` is `string | null`; the combobox speaks the same emptiness\n * (`value === null`), so the bridge is the identity.\n * - `name` still submits inside form posts — through the combobox's\n * `FormBridge` rather than a hand-rolled hidden input.\n * - Each option shows `label` and an optional secondary `email` line; the\n * control itself shows the label only, as before.\n * - New here, and the reason PRO forked this component: the list is\n * **searchable** — typing filters on the client name and the email.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport type ClientSelectOption = {\n id: string;\n label: string;\n email?: string;\n};\n\ninterface ClientSelectProps {\n clients: ClientSelectOption[];\n value: string | null;\n onChange: (clientId: string | null) => void;\n name?: string;\n error?: string;\n className?: string;\n placeholder?: string;\n /**\n * Height, padding, font and glyph size from the shared control scale (A1,\n * ADR-013), forwarded to the underlying `Combobox`. Default `md` — today's\n * frozen 36px row, byte for byte.\n *\n * @experimental\n */\n size?: ComboboxSize | undefined;\n}\n\nexport function ClientSelect({\n clients,\n value,\n onChange,\n name = \"client_id\",\n error,\n className,\n placeholder = \"Select a client...\",\n size,\n}: ClientSelectProps) {\n const options = React.useMemo<Option<string, ClientSelectOption>[]>(\n () =>\n clients.map((client) => ({\n value: client.id,\n label: client.label,\n keywords: client.email ? [client.email] : undefined,\n meta: client,\n })),\n [clients],\n );\n\n return (\n <div className={cn(\"ds:relative ds:w-full\", className)}>\n <Combobox<Option<string, ClientSelectOption>, string>\n options={options}\n name={name}\n value={value}\n onValueChange={(next) => onChange(next)}\n aria-label={placeholder}\n placeholder={placeholder}\n invalid={Boolean(error)}\n size={size}\n // An empty source list (no clients on the account) rather than a query\n // that matched nothing — the wording the component always had.\n messages={clients.length === 0 ? { empty: \"No clients yet\" } : undefined}\n // The control shows the label only. The dropdown row keeps the email\n // for context: two `line-clamp-1` lines, so a long client name or\n // engagement label clips at a word boundary instead of mid-word —\n // \"2025 Business Tax Organizer — …\" rather than \"… Coasta…\".\n renderValue={(option) => option.label}\n renderOption={(option) => {\n const email = (option.meta as ClientSelectOption | undefined)?.email;\n return (\n <span className=\"ds:flex ds:min-w-0 ds:flex-col\">\n <span className=\"ds:text-fg ds:line-clamp-1 ds:text-(length:--control-font-size-md) ds:font-medium\">\n {option.label}\n </span>\n {email && <span className=\"ds:text-fg-3 ds:line-clamp-1 ds:text-xs\">{email}</span>}\n </span>\n );\n }}\n />\n\n {error && (\n <p role=\"alert\" className=\"ds:text-danger-fg ds:mt-1.5 ds:text-xs\">\n {error}\n </p>\n )}\n </div>\n );\n}\n\nClientSelect.displayName = \"ClientSelect\";\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nimport { cn } from \"../lib/cn\";\n\n/* -------------------------------------------------------------------------- */\n/* Collapsible */\n/* Thin wrapper over Radix's @radix-ui/react-collapsible primitives. */\n/* -------------------------------------------------------------------------- */\n\ntype CollapsibleProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>;\n\nexport const Collapsible = React.forwardRef<\n React.ElementRef<typeof CollapsiblePrimitive.Root>,\n CollapsibleProps\n>(function Collapsible({ className, ...props }, ref) {\n return <CollapsiblePrimitive.Root ref={ref} className={cn(className)} {...props} />;\n});\nCollapsible.displayName = CollapsiblePrimitive.Root.displayName;\n\ntype CollapsibleTriggerProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>;\n\nexport const CollapsibleTrigger = React.forwardRef<\n React.ElementRef<typeof CollapsiblePrimitive.Trigger>,\n CollapsibleTriggerProps\n>(function CollapsibleTrigger({ className, ...props }, ref) {\n return (\n <CollapsiblePrimitive.Trigger\n ref={ref}\n className={cn(\n \"ds:flex ds:w-full ds:cursor-pointer ds:items-center\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n \"ds:disabled:cursor-not-allowed\",\n className,\n )}\n {...props}\n />\n );\n});\nCollapsibleTrigger.displayName = CollapsiblePrimitive.Trigger.displayName;\n\ntype CollapsibleContentProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content>;\n\nexport const CollapsibleContent = React.forwardRef<\n React.ElementRef<typeof CollapsiblePrimitive.Content>,\n CollapsibleContentProps\n>(function CollapsibleContent({ className, ...props }, ref) {\n return (\n <CollapsiblePrimitive.Content\n ref={ref}\n className={cn(\n \"ds:overflow-hidden\",\n \"ds:data-[state=closed]:animate-[collapsible-up_var(--duration-overlay)_var(--ease-out-quart)]\",\n \"ds:data-[state=open]:animate-[collapsible-down_var(--duration-overlay)_var(--ease-out-quart)]\",\n \"ds:motion-reduce:animate-none\",\n className,\n )}\n {...props}\n />\n );\n});\nCollapsibleContent.displayName = CollapsiblePrimitive.Content.displayName;\n","import { forwardRef } from \"react\";\n\nimport type { ComingSoonMessages } from \"../foundation/messages/types\";\nimport { useDsMessages } from \"../foundation/provider/context\";\nimport { cn } from \"../lib/cn\";\n\nimport { CheckIcon } from \"./icons\";\n/**\n * ComingSoon — placeholder pattern for unreleased modules. Pro-tinted icon\n * halo, dashed Assure border, \"In Development\" pill.\n *\n * Public API preserved: `icon`, `title`, `description`, `features`. The two\n * strings the component owned itself — the \"Coming soon\" eyebrow and the\n * \"In Development\" pill — are injectable through `messages` (prop >\n * `DesignSystemProvider messages.comingSoon` > English, W5-20/W8-08); the\n * defaults are today's text, so nothing changes without an override.\n */\nexport interface ComingSoonProps extends React.HTMLAttributes<HTMLDivElement> {\n icon: React.ReactNode;\n title: string;\n description: string;\n features: string[];\n /** The eyebrow and pill copy. Defaults to English (\"Coming soon\" / \"In Development\"). */\n messages?: Partial<ComingSoonMessages>;\n}\n\nexport const ComingSoon = forwardRef<HTMLDivElement, ComingSoonProps>(function ComingSoon(\n { icon, title, description, features, className, messages: messagesProp, ...props },\n ref,\n) {\n const messages = useDsMessages(\"comingSoon\", messagesProp);\n return (\n <div\n ref={ref}\n className={cn(\"ds:flex ds:items-center ds:justify-center ds:px-6 ds:py-16\", className)}\n {...props}\n >\n <div\n className={cn(\n \"ds:rounded-card ds:border-rule-strong ds:w-full ds:max-w-lg ds:border ds:border-dashed\",\n \"ds:bg-surface ds:shadow-quiet ds:p-10 ds:text-center\",\n )}\n >\n {/* Eyebrow */}\n <div className=\"ds:text-brand ds:mb-5 ds:font-mono ds:text-(length:--text-overline) ds:font-normal ds:tracking-[0.14em] ds:uppercase\">\n {messages.eyebrow}\n </div>\n\n {/* Pro-tinted icon halo */}\n <div\n className={cn(\n \"ds:mx-auto ds:mb-4 ds:flex ds:size-12 ds:items-center ds:justify-center\",\n \"ds:rounded-icon ds:bg-brand-bg ds:text-brand ds:[&>svg]:size-6\",\n )}\n >\n {icon}\n </div>\n\n <h1 className=\"ds:font-display ds:text-fg ds:text-xl ds:font-medium ds:tracking-[-0.022em]\">{title}</h1>\n <p className=\"ds:text-fg-3 ds:mt-1.5 ds:text-sm\">{description}</p>\n\n <ul className=\"ds:mt-6 ds:space-y-2 ds:text-left\">\n {features.map((feature) => (\n <li key={feature} className=\"ds:text-fg-2 ds:flex ds:items-center ds:gap-2 ds:text-sm\">\n <CheckIcon\n className=\"ds:text-success-fg ds:size-3.5 ds:shrink-0\"\n strokeWidth={2.5}\n aria-hidden=\"true\"\n />\n {feature}\n </li>\n ))}\n </ul>\n\n <div className=\"ds:mt-6\">\n <span\n className={cn(\n \"ds:rounded-pill ds:inline-flex ds:items-center ds:border ds:px-2.5 ds:py-0.5\",\n \"ds:text-xs ds:font-medium\",\n \"ds:bg-brand-bg ds:text-brand ds:border-[color:var(--color-brand-bg-active)]\",\n )}\n >\n {messages.badge}\n </span>\n </div>\n </div>\n </div>\n );\n});\n\nComingSoon.displayName = \"ComingSoon\";\n","/**\n * Asset base path — where the design system's own static artwork is served from.\n *\n * Brand art ships in `public/brand/` and is addressed root-relative\n * (`/brand/assure-pro.svg`). That is correct in a consumer app served from the\n * domain root, and wrong anywhere the host serves from a subpath: this repo's\n * Storybook lives at `/design-system/` on GitHub Pages, where a root-relative\n * request leaves the site entirely and 404s.\n *\n * Consumers need do nothing. The default base is `/`, which reproduces today's\n * root-relative URLs byte for byte. A host on a subpath calls\n * `setAssetBasePath` once before first render.\n */\n\nlet basePath = \"/\";\n\n/**\n * Point brand artwork at `base`. Accepts it with or without surrounding\n * slashes; empty, nullish and `\"/\"` all mean the domain root.\n */\nexport function setAssetBasePath(base: string | null | undefined): void {\n const trimmed = (base ?? \"\").replace(/\\/+$/, \"\");\n basePath = trimmed === \"\" ? \"/\" : `${trimmed.startsWith(\"/\") ? \"\" : \"/\"}${trimmed}/`;\n}\n\n/** The configured base, always with a single trailing slash. */\nexport function getAssetBasePath(): string {\n return basePath;\n}\n\n/** Resolve a root-relative design system asset against the configured base. */\nexport function assetPath(path: string): string {\n return `${basePath}${path.replace(/^\\/+/, \"\")}`;\n}\n","import type { ImageComponentProps, LinkComponentProps } from \"./link\";\n\n/**\n * L0 foundation (W9-08, ADR-010 §6). What `LinkButton` and `Logo` render when\n * no `DesignSystemProvider` supplies a `linkComponent` / `imageComponent`: a\n * plain `<a>` and a plain `<img>`, so the root never imports `next/*`\n * (C-NEXT-PEER). A Next.js app gets client routing and `next/image` by\n * rendering `NextDesignSystemProvider` from `@assure-one/design-system/next`.\n */\n\n/** A plain anchor: full-page navigation, every attribute and the ref forwarded. */\nexport function PlainLink({ ref, children, ...props }: LinkComponentProps) {\n return (\n <a ref={ref} {...props}>\n {children}\n </a>\n );\n}\n\n/** A plain image; `priority` becomes an eager, high-priority fetch. */\nexport function PlainImage({ priority, alt, ...props }: ImageComponentProps) {\n return (\n <img\n alt={alt}\n {...(priority ? { loading: \"eager\" as const, fetchPriority: \"high\" as const } : {})}\n {...props}\n />\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { useImageComponent, useLinkComponent } from \"../foundation/provider/context\";\nimport { PlainImage, PlainLink } from \"../foundation/provider/plain-adapters\";\nimport { assetPath } from \"../lib/asset-base\";\nimport { cn } from \"../lib/cn\";\nimport {\n AssureAuditBrandIcon,\n AssureBooksBrandIcon,\n AssureProBrandIcon,\n AssureTaxBrandIcon,\n} from \"./brand-icons\";\n\n/**\n * Logo — Assure suite wordmark. Renders the official product artwork when\n * available, and falls back to a brand glyph + text lockup otherwise.\n *\n * The artwork ships in the package (`public/brand/*.svg`, W8-07) but is served\n * by the host: copy it into the app's public folder, or point\n * `setAssetBasePath` at wherever it is served from. Nothing breaks if you do\n * neither — an image that fails to load falls back to the glyph + text lockup.\n *\n * The product suffix is configurable so the same component serves every\n * Assure product. The default preserves the original \"Assure Pro\" output —\n * existing consumers do not need to change anything.\n *\n * Public API:\n * - `size`, `href`, `showText`, `inverted` (visual)\n * - `productName` (the suffix text; `null` renders just \"Assure\")\n * - `className`, `iconClassName`, `textClassName` (style overrides)\n *\n * The link and the wordmark image are the provider's `linkComponent` /\n * `imageComponent` when a `DesignSystemProvider` supplies them (W5-21,\n * ADR-010), else a plain `<a>` / `<img>`. Since 2.0 the root never imports\n * `next/*` (C-NEXT-PEER): a Next.js app renders `NextDesignSystemProvider`\n * (`@assure-one/design-system/next`) to get `next/link` / `next/image`.\n *\n * By default the lockup is a link (`href=\"/\"`). Pass `href={null}` to render a\n * non-interactive `<span>` wrapper instead — required when embedding the lockup\n * inside another interactive element (a menu trigger `<button>`, a\n * `DropdownMenuItem`) where a nested `<a>` would be invalid HTML or would race\n * the parent's click handler.\n */\n\nconst sizeStyles = {\n sm: { icon: 20, text: \"ds:text-sm\", gap: \"ds:gap-2\", assetHeight: 24 },\n // 17px: off-scale, between `text-base` (16) and `text-lg` (18); no type role\n // sits there either. Left literal — a VN/D1-track decision, not this pass.\n md: { icon: 24, text: \"ds:text-[17px]\", gap: \"ds:gap-2.5\", assetHeight: 30 },\n lg: { icon: 32, text: \"ds:text-xl\", gap: \"ds:gap-3\", assetHeight: 40 },\n xl: { icon: 40, text: \"ds:text-2xl\", gap: \"ds:gap-3.5\", assetHeight: 48 },\n} as const;\n\nconst productLogoAssets = {\n Pro: { src: \"/brand/assure-pro.svg\", width: 238, height: 55 },\n Audit: { src: \"/brand/assure-audit.svg\", width: 268, height: 55 },\n Books: { src: \"/brand/assure-books.svg\", width: 286, height: 55 },\n Tax: { src: \"/brand/assure-tax.svg\", width: 238, height: 55 },\n Teams: { src: \"/brand/mycpe-teams.svg\", width: 221, height: 49 },\n} as const;\n\nconst productMarkAssets = {\n Pro: { src: \"/brand/assure-pro-mark.svg\", width: 42, height: 37 },\n Audit: { src: \"/brand/assure-audit-mark.svg\", width: 42, height: 37 },\n Books: { src: \"/brand/assure-books-mark.svg\", width: 42, height: 37 },\n Tax: { src: \"/brand/assure-tax-mark.svg\", width: 42, height: 37 },\n Teams: { src: \"/brand/mycpe-teams-mark.svg\", width: 26, height: 31 },\n} as const;\n\nconst productGlyphs = {\n Pro: AssureProBrandIcon,\n Audit: AssureAuditBrandIcon,\n Books: AssureBooksBrandIcon,\n Tax: AssureTaxBrandIcon,\n} as const;\n\n// Products whose wordmark is a complete, standalone brand identity rather than\n// an \"Assure {suffix}\" lockup. For these the wordmark asset carries the full\n// name, so we never prepend \"Assure\" and the accessible name is the brand's own\n// name. Vendor artwork lives in `public/brand/`, keeping brand hex out of the DS.\nconst standaloneBrands: Record<string, string> = {\n Teams: \"myCPE Teams\",\n};\n\ninterface LogoProps {\n size?: keyof typeof sizeStyles;\n /** Link target for the lockup. Pass `null` to render a non-interactive `<span>` wrapper (for embedding inside another interactive element). Defaults to `\"/\"`. */\n href?: string | null;\n showText?: boolean;\n className?: string;\n iconClassName?: string;\n textClassName?: string;\n /**\n * Product suffix rendered after \"Assure\" (e.g. \"Pro\", \"Audit\"). Pass `null`\n * to render just \"Assure\". A few products are standalone brands whose\n * wordmark is the complete identity (e.g. \"Teams\" → myCPE Teams) — those\n * render their own name with no \"Assure\" prefix. Defaults to \"Pro\" for\n * backwards compatibility.\n */\n productName?: string | null;\n /** When true, render on dark/brand surfaces (white \"Assure\" + lighter suffix). */\n inverted?: boolean;\n}\n\nexport function Logo({\n size = \"md\",\n href = \"/\",\n showText = true,\n className,\n iconClassName,\n textClassName,\n productName = \"Pro\",\n inverted = false,\n}: LogoProps) {\n const RouterLink = useLinkComponent() ?? PlainLink;\n const Img = useImageComponent() ?? PlainImage;\n // The artwork ships in the package (`public/brand/`), but a consumer serves\n // it: it is a URL, not an import. When the host has not copied it (or serves\n // it from a subpath and has not called `setAssetBasePath`), the request 404s\n // — so a failed load drops the lockup back to the brand glyph + text, which\n // needs nothing hosted. Server and first client render are unchanged.\n const [artworkFailed, setArtworkFailed] = React.useState(false);\n const s = sizeStyles[size];\n const standaloneLabel = productName ? standaloneBrands[productName] : undefined;\n const isStandalone = Boolean(standaloneLabel);\n const ariaLabel = standaloneLabel ?? (productName ? `Assure ${productName}` : \"Assure\");\n const asset = productName\n ? productLogoAssets[productName as keyof typeof productLogoAssets]\n : undefined;\n const markAsset = productName\n ? productMarkAssets[productName as keyof typeof productMarkAssets]\n : undefined;\n const Glyph = productName ? productGlyphs[productName as keyof typeof productGlyphs] : undefined;\n const wordmark = artworkFailed || !showText ? undefined : asset;\n const mark = artworkFailed || wordmark ? undefined : markAsset;\n\n const wrapperClassName = cn(\"ds:inline-flex ds:items-center\", s.gap, className);\n const content = (\n <>\n {wordmark ? (\n <Img\n src={assetPath(wordmark.src)}\n alt=\"\"\n width={wordmark.width}\n height={wordmark.height}\n priority\n onError={() => setArtworkFailed(true)}\n className={cn(\n \"ds:h-auto ds:flex-shrink-0\",\n inverted && \"ds:brightness-0 ds:invert\",\n iconClassName,\n )}\n style={{ width: Math.round((wordmark.width / wordmark.height) * s.assetHeight) }}\n />\n ) : mark ? (\n <Img\n src={assetPath(mark.src)}\n alt=\"\"\n width={mark.width}\n height={mark.height}\n priority\n onError={() => setArtworkFailed(true)}\n className={cn(\n \"ds:h-auto ds:flex-shrink-0\",\n inverted && \"ds:brightness-0 ds:invert\",\n iconClassName,\n )}\n style={{ width: Math.round((mark.width / mark.height) * s.icon) }}\n />\n ) : (\n <>\n {Glyph ? (\n <Glyph size={s.icon} aria-hidden=\"true\" className={iconClassName} />\n ) : (\n <span\n aria-hidden=\"true\"\n className={cn(\n \"ds:bg-pro-fg ds:grid ds:shrink-0 ds:place-items-center ds:rounded-[5px] ds:text-(length:--text-micro) ds:font-bold ds:text-white\",\n iconClassName,\n )}\n style={{ width: s.icon, height: s.icon }}\n >\n A\n </span>\n )}\n </>\n )}\n {showText && (\n <span\n className={cn(\n \"ds:font-display ds:font-semibold ds:tracking-[-0.025em]\",\n s.text,\n inverted ? \"ds:text-white\" : \"ds:text-fg\",\n wordmark && \"ds:sr-only\",\n textClassName,\n )}\n >\n {isStandalone ? (\n <span>{standaloneLabel}</span>\n ) : (\n <>\n <span>Assure</span>\n {productName && (\n <>\n {\" \"}\n <span\n className={cn(\n \"ds:font-medium\",\n inverted ? \"ds:text-[#d8cfff]\" : \"ds:text-pro-fg\",\n )}\n >\n {productName}\n </span>\n </>\n )}\n </>\n )}\n </span>\n )}\n </>\n );\n\n // Link-less mode: a non-interactive wrapper for embedding the lockup inside\n // another interactive element (menu trigger, dropdown item). No `aria-label`\n // here — the accessible name comes from the rendered wordmark's text (visible\n // for the glyph fallback, `sr-only` alongside the wordmark image).\n if (href === null) {\n return <span className={wrapperClassName}>{content}</span>;\n }\n\n return (\n <RouterLink href={href} className={wrapperClassName} aria-label={ariaLabel}>\n {content}\n </RouterLink>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\n\nimport { sheetAnatomy, type SheetSlot } from \"../foundation/anatomy/slots\";\nimport { stateAttributes } from \"../foundation/anatomy/slot\";\nimport { deprecate } from \"../foundation/deprecate\";\n\nimport { XIcon } from \"./icons\";\nimport { withPortalContainer } from \"./behavior/portal\";\nimport {\n Backdrop,\n DEFAULT_OVERLAY_MESSAGES,\n DISMISS_GLYPH_CLASSES,\n DismissButton,\n OverlayBody,\n OverlayDescription,\n OverlayFooter,\n OverlayHeader,\n OverlaySurface,\n OverlayTitle,\n} from \"./behavior/overlay\";\n/* ───────────────────────────────────────────────────────────────────────\n * Sheet — slide-in panel on top of @radix-ui/react-dialog (shadcn pattern).\n *\n * Public API preserved:\n * Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader,\n * SheetTitle, SheetDescription, SheetFooter\n *\n * `side` lives on SheetContent (in shadcn it's a content-level prop). For\n * backwards compatibility with the prior implementation, the `Sheet` root\n * also accepts `side` and forwards it to SheetContent via context.\n *\n * NEW (additive): SheetPortal, SheetOverlay are also exported. W5-07 adds\n * `size` and the `--ds-sheet-width` hook (the replacement of `width` /\n * `customWidth`, C-SHEET-WIDTH), `SheetBody`, `closeLabel` / `messages`,\n * and safe-area padding on `side=\"bottom\"`; every legacy `width` value\n * renders the same pixels. Internals are the W5-03 overlay parts.\n * ─────────────────────────────────────────────────────────────────────── */\n\n/**\n * The edge a `Sheet` slides in from.\n *\n * @experimental\n */\nexport type SheetSide = \"top\" | \"right\" | \"bottom\" | \"left\";\n\ntype Side = SheetSide;\n\n/**\n * Width of a left/right `SheetContent`, as a step of the sheet width scale\n * (W5-07): `sm` 420px · `md` 520px · `lg` 640px · `xl` 760px from the `sm`\n * breakpoint (95vw below it) · `full` the viewport. Omitted, the panel keeps\n * its 1.x geometry (`w-3/4 max-w-sm`). Every step and the default yield to\n * `--ds-sheet-width` when a consumer sets it. Top/bottom sheets span the\n * viewport and ignore it.\n *\n * @experimental\n */\nexport type SheetSize = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n\n/**\n * What the deprecated `width` prop accepts: the size steps plus `default`.\n *\n * @deprecated Use `size` (C-SHEET-WIDTH, codemod CM-11). Removed in 3.0.\n * @experimental\n */\nexport type SheetWidth = \"default\" | SheetSize;\n\n/**\n * The copy a `Sheet` renders (target architecture §24.5). English defaults\n * until the messages contract of the provider lands (W5-20).\n *\n * @experimental\n */\nexport interface SheetMessages {\n /** The accessible name of the built-in close button. Default `\"Close\"`. */\n close: string;\n}\n\ninterface SheetSideContextValue {\n side?: Side | undefined;\n}\nconst SheetSideContext = React.createContext<SheetSideContextValue>({});\n\ninterface SheetProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Root> {\n /**\n * Default side for SheetContent if it doesn't specify its own.\n * Backwards-compat shim — prefer `<SheetContent side=\"…\" />`.\n */\n side?: Side;\n}\n\nconst Sheet = ({ side, children, ...props }: SheetProps) => (\n <SheetPrimitive.Root {...props}>\n <SheetSideContext value={{ side }}>{children}</SheetSideContext>\n </SheetPrimitive.Root>\n);\nSheet.displayName = \"Sheet\";\n\n/** The sheet parts (ADR-008). See the registry for the doc comment. */\nexport type { SheetSlot };\n\nconst SheetTrigger = SheetPrimitive.Trigger;\nconst SheetClose = SheetPrimitive.Close;\nconst SheetPortal = withPortalContainer(SheetPrimitive.Portal);\n\nconst SheetOverlay = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>((props, ref) => (\n <Backdrop\n as={SheetPrimitive.Overlay}\n anatomy={sheetAnatomy}\n motion=\"legacy\"\n ref={ref}\n {...props}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\n// Each step is a full literal with the consumer hook as the first value of\n// the breakpoint width: `width: var(--ds-sheet-width, <step>)`. Unset, the\n// step is what the 1.x `width` preset computed, pixel for pixel.\nconst SHEET_SIZES: Readonly<Record<SheetSize, string>> = {\n sm: \"ds:w-[95vw] ds:max-w-[95vw] ds:sm:w-[var(--ds-sheet-width,420px)]\",\n md: \"ds:w-[95vw] ds:max-w-[95vw] ds:sm:w-[var(--ds-sheet-width,520px)]\",\n lg: \"ds:w-[95vw] ds:max-w-[95vw] ds:sm:w-[var(--ds-sheet-width,640px)]\",\n xl: \"ds:w-[95vw] ds:max-w-[95vw] ds:sm:w-[var(--ds-sheet-width,760px)]\",\n full: \"ds:w-full ds:max-w-none\",\n};\n\n/**\n * Props of `SheetContent`: Radix's content props plus the side, the sizing\n * and the dismiss options.\n *\n * @experimental\n */\nexport interface SheetContentProps extends React.ComponentPropsWithoutRef<\n typeof SheetPrimitive.Content\n> {\n /** The edge the panel slides in from. Default `right` (or the `Sheet` root's `side`). */\n side?: SheetSide | null;\n /**\n * Width step for left/right sheets. Omit for the 1.x geometry\n * (`w-3/4 max-w-sm`). See {@link SheetSize}.\n */\n size?: SheetSize;\n /** If false, the built-in close button is hidden. Default: true. */\n showCloseButton?: boolean;\n /**\n * The accessible name of the built-in close button. Takes precedence over\n * `messages.close`. Default `\"Close\"`.\n */\n closeLabel?: string;\n /** Overrides of the copy the sheet renders (English defaults until W5-20). */\n messages?: Partial<SheetMessages>;\n /**\n * Width preset for left/right sheets — the same steps as `size`, plus\n * `default`. When both are given `size` wins.\n *\n * @deprecated Use `size` (C-SHEET-WIDTH, codemod CM-11). Removed in 3.0.\n */\n width?: SheetWidth;\n /**\n * Custom CSS width for left/right sheets, e.g. `\"520px\"`, rendered as an\n * inline `width` with `max-width: 95vw`.\n *\n * @deprecated Set the `--ds-sheet-width` custom property instead\n * (C-SHEET-WIDTH, codemod CM-11). Removed in 3.0.\n */\n customWidth?: string;\n}\n\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(\n (\n {\n side,\n size,\n width,\n customWidth,\n className,\n children,\n showCloseButton = true,\n closeLabel,\n messages,\n style,\n ...props\n },\n ref,\n ) => {\n const ctx = React.use(SheetSideContext);\n const resolvedSide: Side = side ?? ctx.side ?? \"right\";\n const supportsWidth = resolvedSide === \"left\" || resolvedSide === \"right\";\n\n if (width !== undefined) {\n deprecate(\n \"C-SHEET-WIDTH\",\n \"width\",\n \"SheetContent `width` is deprecated; pass `size` (the same steps) instead.\",\n );\n }\n if (customWidth !== undefined) {\n deprecate(\n \"C-SHEET-WIDTH\",\n \"customWidth\",\n \"SheetContent `customWidth` is deprecated; set the `--ds-sheet-width` custom property instead.\",\n );\n }\n\n // `size` wins over the alias; `width=\"default\"` is the omitted case.\n const resolvedSize: SheetSize | undefined =\n size ?? (width === undefined || width === \"default\" ? undefined : width);\n const sizeRow = supportsWidth && resolvedSize ? SHEET_SIZES[resolvedSize] : null;\n const widthStyle =\n supportsWidth && customWidth ? { width: customWidth, maxWidth: \"95vw\", ...style } : style;\n\n return (\n <SheetPortal>\n <SheetOverlay />\n <OverlaySurface\n as={SheetPrimitive.Content}\n anatomy={sheetAnatomy}\n placement={resolvedSide}\n motion=\"legacy\"\n ref={ref}\n {...stateAttributes({ size: resolvedSize ?? \"default\" })}\n rows={[sizeRow]}\n className={className}\n style={widthStyle}\n {...props}\n >\n {children}\n {/* Frozen last child of the content (plan §17.1). */}\n {showCloseButton && (\n <DismissButton\n as={SheetPrimitive.Close}\n anatomy={sheetAnatomy}\n label={closeLabel ?? messages?.close ?? DEFAULT_OVERLAY_MESSAGES.close}\n >\n <XIcon className={DISMISS_GLYPH_CLASSES} aria-hidden=\"true\" />\n </DismissButton>\n )}\n </OverlaySurface>\n </SheetPortal>\n );\n },\n);\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = (props: React.HTMLAttributes<HTMLDivElement>) => (\n <OverlayHeader anatomy={sheetAnatomy} layout=\"padded\" dismissGutter {...props} />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\n/**\n * Props of `SheetBody` (W5-07).\n *\n * @experimental\n */\nexport interface SheetBodyProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Horizontal padding, matching the header's and footer's `p-6` at `md`\n * (the default). The panel's own `gap-4` spaces the parts vertically.\n */\n padding?: \"none\" | \"sm\" | \"md\" | \"lg\";\n}\n\n/**\n * The scroll region of a sheet between `SheetHeader` and `SheetFooter`\n * (W5-07): takes the remaining height of the panel and scrolls on its own,\n * so the header and the footer stay in place.\n *\n * @experimental\n */\nconst SheetBody = React.forwardRef<HTMLDivElement, SheetBodyProps>(\n ({ padding = \"md\", ...props }, ref) => (\n <OverlayBody anatomy={sheetAnatomy} layout=\"padded\" padding={padding} ref={ref} {...props} />\n ),\n);\nSheetBody.displayName = \"SheetBody\";\n\nconst SheetFooter = (props: React.HTMLAttributes<HTMLDivElement>) => (\n <OverlayFooter anatomy={sheetAnatomy} layout=\"padded\" {...props} />\n);\nSheetFooter.displayName = \"SheetFooter\";\n\nconst SheetTitle = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>((props, ref) => (\n <OverlayTitle as={SheetPrimitive.Title} anatomy={sheetAnatomy} ref={ref} {...props} />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>((props, ref) => (\n <OverlayDescription as={SheetPrimitive.Description} anatomy={sheetAnatomy} ref={ref} {...props} />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetPortal,\n SheetOverlay,\n SheetContent,\n SheetHeader,\n SheetBody,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n","// ds-svg-content: brand — official third-party tax-software vendor marks (trademarks), not UI icons.\nimport * as React from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport { Avatar } from \"./avatar\";\n\n/* ─────────────────────────────────────────────────────────────────────────\n * TaxSoftwareLogo — the official mark of a professional tax-software vendor,\n * for \"which tax product does this firm use\" surfaces (connect / import /\n * export pickers). Narrowly scoped on purpose: eight known vendors, nothing\n * else. It is a brand asset, not an icon — the drawings are the owners'\n * trademarks, used nominatively to identify their product.\n *\n * Provenance (retrieved 2026-10-01; geometry and colours untouched except\n * where noted — no redrawing):\n * taxact TaxAct's own header wordmark, images.ctfassets.net (TaxAct's\n * Contentful space, served on taxact.com).\n * drake The Drake Software wordmark served on taxact.com/professional\n * (TaxAct and Drake are both Taxwell brands). That copy is\n * single-colour; the two brand colours (#474749 \"Drake\",\n * #1C75BB \"Software\") are sampled from the official PNG in\n * drakesoftware.com's header, which uses no SVG.\n * lacerte, Intuit's product icons from digitalasset.intuit.com, as used\n * proseries, on accountants.intuit.com/tax-software. A wrapping clipPath\n * proconnect (a no-op square clip) was dropped so no `id` is emitted and\n * the mark can render many times on one page.\n *\n * cch_axcess, ultratax and atx have no product mark: Wolters Kluwer and\n * Thomson Reuters present those products as the corporate logo plus the\n * product name in text. They — and any unknown vendor — render the\n * initials `Avatar` fallback rather than a recreated or parent mark.\n *\n * Optical sizing. Every mark sits on the same white plate (the owners'\n * artwork is drawn for a light ground, so the plate is what keeps it legible\n * in dark mode, too). The plate height is the `Avatar` size token, so a\n * fallback tile lines up with the marks around it. Inside it, square icons\n * fill most of the height while wordmarks are drawn shorter the wider they\n * are — at equal heights a 7:1 wordmark carries several times a round icon's\n * visual mass, and a row of mixed marks stops reading as one set.\n * ───────────────────────────────────────────────────────────────────────── */\n\n/** The vendor keys, matching the products' catalogue keys in consuming apps. */\nexport type TaxSoftwareVendor =\n | \"cch_axcess\"\n | \"ultratax\"\n | \"atx\"\n | \"taxact\"\n | \"proconnect\"\n | \"proseries\"\n | \"lacerte\"\n | \"drake\";\n\n/** Vendor display names — the fallback's initials and the default label. */\nconst VENDOR_NAMES: Record<TaxSoftwareVendor, string> = {\n cch_axcess: \"CCH Axcess\",\n ultratax: \"UltraTax CS\",\n atx: \"ATX\",\n taxact: \"TaxAct\",\n proconnect: \"ProConnect Tax\",\n proseries: \"ProSeries\",\n lacerte: \"Lacerte\",\n drake: \"Drake Tax\",\n};\n\ninterface Mark {\n viewBox: string;\n /** viewBox width over height. */\n aspect: number;\n /** Rendered height as a share of the plate's height (optical sizing). */\n scale: number;\n /** Square marks get a square plate; wordmarks a padded, auto-width one. */\n square: boolean;\n paths: () => React.ReactNode;\n}\n\nfunction createMarks(): Partial<Record<TaxSoftwareVendor, Mark>> {\n return {\n taxact: {\n viewBox: \"0 0 94 20\",\n aspect: 94 / 20,\n scale: 0.4,\n square: false,\n paths: () => (\n <>\n <path\n fill=\"#6651E1\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M4.64362 19.927V4.74818H0V0H15.4023V4.74818H10.9131V19.927H4.64362\"\n />\n <path\n fill=\"#6651E1\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M18.5165 19.9994C17.2519 19.9994 13.2461 19.8441 13.2461 15.5966C13.2461 11.8396 17.5306 11.3725 18.8347 11.319L22.8343 11.1504V10.5649C22.8343 9.85443 22.4225 8.66252 19.8657 8.66252C18.3062 8.66252 16.5283 9.21718 15.2941 9.83249L13.9775 6.43572C15.1973 5.91631 17.6841 5.05078 20.738 5.05078C23.6092 5.05078 25.2969 5.55738 26.6254 6.74436C27.9297 7.91212 28.4072 9.47997 28.4072 11.8281V19.9264H23.0856L22.8775 17.9762L22.2127 18.6164C21.4781 19.355 20.2878 19.9994 18.5165 19.9994ZM22.8344 16.1121V13.0047L20.7391 13.1415C19.3752 13.1972 18.5516 13.8638 18.5516 14.9699C18.5516 16.1005 19.3563 16.8026 20.7001 16.8026C21.7463 16.8026 22.5902 16.2442 22.8699 16.0388L22.8344 16.1121Z\"\n />\n <path\n fill=\"#6651E1\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M47.7637 19.7975L47.8264 19.9284H41.3522L38.613 15.443L35.9041 19.9284H29.4297C29.4297 19.9284 29.4522 19.8453 29.5 19.7874C30.067 19.0759 34.0101 14.4419 42.1901 12.5195\"\n />\n <path\n fill=\"#6651E1\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M50.2535 1.63281L43.8457 9.7043L43.7492 9.83027C41.055 10.2062 38.1655 10.9899 35.1353 12.3295L30.0156 5.44694H36.4773L38.6119 9.76322L44.0426 1.63281H50.2535\"\n />\n <path\n fill=\"#6651E1\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M62.4657 0H55.6177L52.2251 9.75915C53.9761 9.95612 55.589 10.2046 56.9987 10.6032L59.0418 3.14458L61.4288 11.844C63.213 13.029 63.8906 13.6847 63.9558 13.7303C59.2977 12.3402 55.1813 11.7281 51.5667 11.6423L48.7699 19.7969L48.7422 19.927H54.8002L55.5802 16.8133H62.1723L62.9824 19.927H69.3438L62.4657 0\"\n />\n <path\n fill=\"#6651E1\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M76.5238 19.9262C72.7006 19.9262 68.5859 17.5981 68.5859 12.487C68.5859 7.37791 72.7006 5.05078 76.5238 5.05078C79.0681 5.05078 80.7735 5.72649 81.4071 6.02773L80.5575 10.1039C79.9293 9.76125 78.8924 9.34438 77.5731 9.34438C75.6663 9.34438 74.3348 10.6009 74.3348 12.4C74.3348 14.2937 75.6011 15.4243 77.7224 15.4243C78.949 15.4243 79.9741 14.9864 80.5739 14.6554L81.5549 18.7781C80.9747 19.1196 79.3103 19.9262 76.5238 19.9262\"\n />\n <path\n fill=\"#6651E1\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M89.9925 19.9982C88.2955 19.9982 87.1047 19.5951 86.2181 18.8008C85.4015 18.0413 85.1378 16.7417 85.1378 14.717V9.80587H82.7383V5.44694H85.1378V1.63281H90.8683V5.44694H93.962V9.80587H90.8653V13.9703C90.8653 15.4642 91.9586 15.4642 92.4523 15.4642C92.8437 15.4642 93.7019 15.4132 93.999 15.3597L93.9372 19.4529C93.182 19.619 91.5794 19.9982 89.9925 19.9982\"\n />\n </>\n ),\n },\n drake: {\n viewBox: \"0 0 120 16\",\n aspect: 120 / 16,\n scale: 0.34,\n square: false,\n paths: () => (\n <>\n <path\n fill=\"#474749\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M7.49821 11.9465C7.04988 12.3497 6.50664 12.6403 5.88373 12.8111C5.25066 12.9839 4.53841 13.072 3.76649 13.072C3.46357 13.072 3.17359 13.0622 2.90459 13.0427C2.68985 13.0272 2.5079 13.0106 2.3525 12.9916V2.37657C2.54281 2.35047 2.75886 2.33436 2.99687 2.3292C3.29686 2.32275 3.5734 2.3192 3.82666 2.3192C4.58382 2.3192 5.2846 2.41653 5.90931 2.60879C6.52533 2.79781 7.06218 3.10771 7.50494 3.53007C7.94769 3.95308 8.29652 4.5084 8.54175 5.18072C8.78879 5.85882 8.91419 6.69197 8.91419 7.65595C8.91419 8.71277 8.78879 9.60263 8.54125 10.3006C8.29652 10.9906 7.94556 11.5446 7.49821 11.9465ZM9.46412 2.16468C8.1888 0.877587 6.24451 0.225098 3.68468 0.225098C3.07242 0.225098 2.43393 0.248464 1.78676 0.294391C1.14238 0.341125 0.586354 0.39092 0.13409 0.44297L0 0.458763V14.9084L0.129172 14.9273C0.57242 14.9931 1.1096 15.05 1.72628 15.0965C2.34624 15.1425 2.97832 15.1658 3.60452 15.1658C6.16205 15.1658 8.1188 14.5478 9.41986 13.329C10.7234 12.108 11.384 10.219 11.384 7.71527C11.384 5.31803 10.7381 3.4508 9.46412 2.16468Z\"\n />\n <path\n fill=\"#474749\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M18.5888 4.99647C18.5747 4.85949 18.5536 4.72767 18.5256 4.60407L18.5034 4.50594L18.4024 4.48934C18.3178 4.47564 18.2156 4.46516 18.0952 4.45791C17.1782 4.40602 16.4475 4.57297 15.8897 4.96973C15.5444 5.21579 15.245 5.49716 14.9961 5.80947C14.986 5.68731 14.9724 5.55663 14.9551 5.41771C14.9148 5.09284 14.8737 4.82694 14.8328 4.62713L14.8134 4.53156L14.7169 4.51061C14.5909 4.48322 14.4496 4.46227 14.296 4.44825C13.9942 4.42214 13.687 4.42117 13.4039 4.44857C13.2663 4.46227 13.1221 4.48273 12.9708 4.50949L12.8462 4.53156V14.9059L12.9731 14.9267C13.1351 14.9532 13.3118 14.9736 13.4988 14.9875C13.6834 15.0008 13.8509 15.0077 14.0015 15.0077C14.152 15.0077 14.3198 15.0008 14.5046 14.9875C14.6911 14.9736 14.8619 14.9532 15.0122 14.9265L15.1369 14.9041V9.74745C15.1369 9.08335 15.2116 8.53545 15.3592 8.11905C15.5044 7.7094 15.7012 7.38356 15.9441 7.1507C16.1868 6.91865 16.4632 6.7546 16.766 6.66372C17.0775 6.56961 17.4104 6.52222 17.7552 6.52222H18.0262C18.127 6.52222 18.2261 6.53382 18.3209 6.5572L18.4804 6.5962L18.5071 6.43682C18.5342 6.27664 18.5579 6.11001 18.5785 5.93613C18.5989 5.75999 18.6096 5.58836 18.6096 5.42578C18.6096 5.27848 18.6026 5.13393 18.5888 4.99647Z\"\n />\n <path\n fill=\"#474749\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M24.5522 10.1548V13.1232C24.3336 13.1733 24.0865 13.2123 23.8151 13.2394C23.2473 13.2971 22.7247 13.3082 22.1292 13.2494C21.883 13.2252 21.6561 13.1578 21.4544 13.0496C21.257 12.9441 21.0897 12.7883 20.957 12.5867C20.8266 12.3887 20.7604 12.1038 20.7604 11.74C20.7604 11.1681 20.953 10.7561 21.3488 10.4805C21.7557 10.1977 22.3644 10.0541 23.1582 10.0541C23.3667 10.0541 23.6259 10.0672 23.9279 10.0928C24.1691 10.1134 24.3773 10.1342 24.5522 10.1548ZM25.7067 5.20395C24.9852 4.58385 23.925 4.26929 22.5556 4.26929C22.0414 4.26929 21.5005 4.30958 20.9479 4.38902C20.3933 4.46879 19.8784 4.58352 19.4179 4.73033L19.3128 4.76385V4.8723C19.3128 5.50143 19.4479 6.05111 19.7144 6.5057L19.7748 6.60884L19.8906 6.57354C20.2725 6.45704 20.6683 6.36244 21.0668 6.29203C21.4654 6.22144 21.8988 6.18566 22.3548 6.18566C23.0796 6.18566 23.6364 6.32812 24.0091 6.60852C24.3693 6.88037 24.5519 7.38509 24.5519 8.10865V8.31395C24.3973 8.29622 24.2202 8.27996 24.0222 8.26561C23.7453 8.24578 23.3869 8.23563 22.9571 8.23563C22.3706 8.23563 21.8036 8.30702 21.2719 8.44819C20.735 8.59016 20.2525 8.80997 19.8376 9.10213C19.4187 9.39751 19.0827 9.77299 18.839 10.2184C18.5939 10.6661 18.4697 11.1909 18.4697 11.779C18.4697 12.3781 18.5759 12.8982 18.7857 13.3239C18.9966 13.7523 19.2995 14.1098 19.6862 14.3859C20.069 14.66 20.5402 14.8609 21.0867 14.9831C21.6247 15.1032 22.2339 15.1645 22.897 15.1645C23.596 15.1645 24.2936 15.1074 24.9698 14.9947C25.6368 14.8835 26.2136 14.7732 26.6845 14.6673L26.8025 14.6409V8.18761C26.8025 6.8338 26.4338 5.82968 25.7067 5.20395Z\"\n />\n <path\n fill=\"#474749\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M30.0513 0.105939C29.6672 0.0788663 29.404 0.0793497 29.0357 0.105939C28.8513 0.119315 28.6805 0.139941 28.5279 0.167176L28.4033 0.189254V14.9035L28.5279 14.9254C28.6775 14.9521 28.8483 14.9726 29.0359 14.9867C29.2205 14.9997 29.3878 15.0067 29.5385 15.0067C29.6886 15.0067 29.8594 14.9997 30.0514 14.9867C30.2447 14.9726 30.4189 14.9522 30.5692 14.9254L30.6939 14.9035V0.189254L30.5692 0.167176C30.4161 0.139941 30.2419 0.119315 30.0513 0.105939Z\"\n />\n <path\n fill=\"#474749\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M33.4585 9.39093L36.8083 4.54231L36.5675 4.50862C36.3765 4.48171 36.1895 4.46173 36.0053 4.44803C35.6443 4.4229 35.2401 4.42064 34.8682 4.4482C34.6905 4.4619 34.5127 4.48203 34.3352 4.50878L34.2687 4.51878L30.9023 9.53371L34.8145 14.9182L34.8788 14.9272C35.0694 14.9541 35.26 14.974 35.4516 14.9875C35.6425 15.0007 35.8331 15.0075 36.0243 15.0075C36.2092 15.0075 36.3952 15.001 36.578 14.9873C36.7549 14.974 36.9387 14.9538 37.1296 14.9272L37.3742 14.8932L33.4585 9.39093Z\"\n />\n <path\n fill=\"#474749\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M41.723 6.12814C42.1116 6.12814 42.4496 6.19889 42.7278 6.33876C43.0068 6.47913 43.2394 6.66735 43.4189 6.89795C43.601 7.13306 43.7414 7.41233 43.8357 7.72787C43.9179 8.0031 43.9654 8.29317 43.9771 8.59258H39.2243C39.3286 7.8376 39.5757 7.23797 39.96 6.80771C40.3629 6.35681 40.956 6.12814 41.723 6.12814ZM45.9639 7.18479C45.7711 6.59546 45.4841 6.08028 45.1117 5.65355C44.7378 5.22409 44.2675 4.88246 43.7141 4.63751C43.1617 4.39305 42.5127 4.26929 41.785 4.26929C40.9368 4.26929 40.189 4.41673 39.5622 4.70777C38.9355 4.99896 38.4082 5.39781 37.9943 5.8927C37.581 6.38694 37.2708 6.97594 37.0726 7.64228C36.8753 8.30412 36.7754 9.02526 36.7754 9.78588C36.7754 10.56 36.8789 11.2821 37.0834 11.9316C37.2899 12.5887 37.6219 13.1651 38.0699 13.6459C38.5181 14.1275 39.0943 14.5057 39.7829 14.7695C40.4665 15.0317 41.2957 15.1645 42.2466 15.1645C42.8936 15.1645 43.4935 15.1173 44.0296 15.0238C44.5677 14.93 45.0685 14.7877 45.5178 14.6L45.6151 14.5595L45.6098 14.4556C45.5959 14.1711 45.5542 13.8797 45.4857 13.5901C45.4158 13.296 45.3234 13.0418 45.2108 12.8337L45.1473 12.717L45.0217 12.765C44.1871 13.0854 43.2941 13.248 42.3671 13.248C41.3277 13.248 40.5352 13.0027 40.0121 12.519C39.5152 12.0602 39.2397 11.3308 39.1921 10.3494H46.1791L46.1914 10.2137C46.2047 10.0684 46.2184 9.89272 46.2322 9.68678C46.2454 9.4797 46.2525 9.28245 46.2525 9.0952C46.2525 8.41273 46.1552 7.76992 45.9639 7.18479Z\"\n />\n <path\n fill=\"#1C75BB\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M56.0496 8.14713C55.6977 7.82822 55.2684 7.54444 54.7736 7.30417C54.2765 7.06341 53.7337 6.82556 53.1596 6.59705C52.7313 6.43413 52.3294 6.26718 51.9652 6.10104C51.5941 5.93199 51.2693 5.74312 51 5.53976C50.7287 5.33446 50.5135 5.0916 50.3603 4.81765C50.2064 4.54353 50.1284 4.21672 50.1284 3.84625C50.1284 3.13558 50.3824 2.53949 50.8833 2.07475C51.3837 1.61047 52.2178 1.37503 53.3627 1.37503C53.8685 1.37503 54.387 1.41935 54.9034 1.50685C55.346 1.58259 55.7266 1.66736 56.035 1.75825L56.1361 1.78789L56.1685 1.68928C56.2156 1.54505 56.2578 1.39276 56.2939 1.23661C56.3305 1.07643 56.3618 0.913828 56.3872 0.753003L56.402 0.660021L56.3097 0.63472C56.1937 0.603296 56.0549 0.568166 55.8939 0.529974C55.6666 0.475827 55.4187 0.42845 55.157 0.388969C54.8993 0.349648 54.6093 0.315807 54.2951 0.28809C53.9873 0.261501 53.6807 0.247803 53.3834 0.247803C51.8647 0.247803 50.6938 0.584603 49.9033 1.24869C49.1146 1.91166 48.7146 2.7925 48.7146 3.86672C48.7146 4.46506 48.81 4.96913 48.9984 5.36539C49.1872 5.76326 49.4469 6.10909 49.7698 6.39303C50.0933 6.67907 50.4745 6.92546 50.9018 7.12529C51.3348 7.32769 51.7938 7.51786 52.2652 7.68995C52.9368 7.94569 53.5031 8.18807 53.9487 8.41013C54.3959 8.63349 54.7528 8.87086 55.0091 9.1158C55.2666 9.36268 55.4504 9.63727 55.555 9.93185C55.6593 10.2258 55.712 10.5813 55.712 10.9883C55.712 11.4091 55.6347 11.8059 55.4824 12.1683C55.3289 12.5309 55.0927 12.8494 54.7805 13.1153C54.4695 13.3806 54.0698 13.5944 53.5929 13.7506C53.1171 13.9063 52.5411 13.9853 51.881 13.9853C51.4676 13.9853 51.0987 13.965 50.7844 13.9244C50.4665 13.8838 50.178 13.8358 49.9265 13.7822C49.6693 13.7277 49.4359 13.6658 49.2324 13.5985C49.074 13.547 48.919 13.4988 48.7693 13.4554L48.6743 13.4273L48.6379 13.5182C48.5755 13.6758 48.5174 13.8462 48.4658 14.0247C48.4116 14.2114 48.3702 14.388 48.3426 14.5495L48.3267 14.6407L48.4167 14.6681C48.8429 14.7992 49.3056 14.9185 49.7914 15.0228C50.3221 15.1362 50.9973 15.1939 51.7986 15.1939C52.6261 15.1939 53.3838 15.0957 54.0503 14.9019C54.713 14.7095 55.2826 14.4263 55.7432 14.0603C56.2018 13.6952 56.561 13.2376 56.8112 12.7001C57.0613 12.1615 57.188 11.5377 57.188 10.8467C57.188 10.2359 57.0854 9.70769 56.8833 9.27662C56.6808 8.84587 56.4004 8.46588 56.0496 8.14713Z\"\n />\n <path\n fill=\"#1C75BB\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M66.4513 9.8329C66.4513 11.1448 66.1749 12.1947 65.6302 12.9536C65.0819 13.7177 64.2424 14.1051 63.135 14.1051C62.027 14.1051 61.1874 13.7177 60.6394 12.9536C60.0946 12.1948 59.8183 11.145 59.8183 9.8329C59.8183 8.52148 60.0946 7.47174 60.6394 6.7129C61.1877 5.94874 62.0275 5.56118 63.135 5.56118C64.2419 5.56118 65.0815 5.94874 65.6302 6.7129C66.1749 7.47191 66.4513 8.52163 66.4513 9.8329ZM66.6106 6.01534C66.2266 5.53785 65.7401 5.15722 65.1646 4.88392C64.589 4.61173 63.9064 4.47363 63.1363 4.47363C62.3647 4.47363 61.6786 4.61189 61.0969 4.88439C60.5164 5.15642 60.0267 5.53705 59.6408 6.01534C59.2553 6.49459 58.9637 7.06812 58.7743 7.72028C58.5842 8.37471 58.4878 9.08553 58.4878 9.8323C58.4878 10.5803 58.5842 11.291 58.7743 11.9446C58.9641 12.5978 59.2555 13.1712 59.6408 13.6497C60.0265 14.1282 60.5163 14.5089 61.0969 14.7809C61.6784 15.0533 62.3646 15.1913 63.1363 15.1913C63.9069 15.1913 64.5895 15.0533 65.1649 14.781C65.7386 14.509 66.2251 14.1283 66.6109 13.6497C66.9959 13.1715 67.2911 12.5978 67.4883 11.9446C67.6846 11.2904 67.7843 10.5797 67.7843 9.8323C67.7843 9.08553 67.6845 8.37471 67.4878 7.72012C67.2911 7.06731 66.9959 6.49346 66.6106 6.01534Z\"\n />\n <path\n fill=\"#1C75BB\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M74.2729 4.80947L74.2632 4.71407H71.6746V3.82115C71.6746 3.26584 71.7272 2.80575 71.8309 2.45349C71.9351 2.098 72.0836 1.8163 72.2726 1.6168C72.4633 1.41569 72.7024 1.27533 72.9829 1.19943C73.2609 1.12465 73.5834 1.08662 73.9414 1.08662C74.1737 1.08662 74.3976 1.10403 74.6072 1.13803C74.7446 1.16043 74.8639 1.1817 74.9649 1.20104L75.0641 1.22054L75.0896 1.12465C75.1277 0.984938 75.1588 0.858115 75.1849 0.73661C75.2123 0.605274 75.238 0.440257 75.2615 0.246235L75.2731 0.15019L75.1774 0.130369C75.0454 0.10249 74.8871 0.0754175 74.7067 0.0497949C74.4664 0.0167594 74.2019 0 73.9209 0C72.7047 0 71.8054 0.315045 71.2476 0.936272C70.6879 1.55911 70.4044 2.50924 70.4044 3.76024V4.71407H68.6047L68.5942 4.80802C68.5895 4.84686 68.5862 4.8894 68.5832 4.93646C68.5763 5.04169 68.5728 5.14966 68.5728 5.2573C68.5728 5.36834 68.5759 5.46647 68.5832 5.5572C68.586 5.5962 68.5888 5.63277 68.5931 5.66662L68.604 5.76041H70.4044V14.9534L70.5019 14.9625C70.5616 14.968 70.6318 14.9722 70.713 14.9764C70.8626 14.9828 70.9714 14.9863 71.0394 14.9863C71.1214 14.9863 71.2338 14.9828 71.3776 14.9764C71.4525 14.9722 71.5194 14.9681 71.5772 14.963L71.6746 14.9538V5.76041H74.2625L74.273 5.66678C74.2772 5.63246 74.2805 5.59572 74.2831 5.55737C74.29 5.46341 74.2937 5.36253 74.2937 5.2573C74.2937 5.15256 74.29 5.04475 74.2831 4.93646C74.2802 4.89005 74.2766 4.84782 74.2729 4.80947Z\"\n />\n <path\n fill=\"#1C75BB\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M80.4232 14.0234L80.3968 13.9163L80.2891 13.9464C79.9638 14.0378 79.5877 14.0841 79.171 14.0841C78.9754 14.0841 78.7823 14.0667 78.5966 14.0327C78.4053 13.9984 78.233 13.924 78.084 13.8118C77.935 13.7004 77.8128 13.5415 77.7206 13.3399C77.6281 13.1382 77.5832 12.8712 77.5832 12.5236V5.7629H80.4338L80.4435 5.6675C80.4474 5.62931 80.4509 5.58677 80.4544 5.5402C80.461 5.43142 80.4643 5.32345 80.4643 5.21935C80.4643 5.11493 80.4608 5.01389 80.4539 4.91929C80.4514 4.88094 80.448 4.84435 80.4439 4.81036L80.4329 4.71657H77.5832V1.52051L76.313 2.74942V4.71657H74.5126L74.5017 4.81019C74.4975 4.84435 74.4945 4.88078 74.4919 4.918C74.4848 5.00824 74.4814 5.10686 74.4814 5.21935C74.4814 5.33102 74.4849 5.43899 74.4917 5.5402C74.495 5.58709 74.498 5.62947 74.502 5.66831L74.5121 5.7629H76.313V12.584C76.313 13.4973 76.5536 14.1638 77.0284 14.5644C77.5049 14.9668 78.1357 15.1707 78.9032 15.1707C79.5 15.1707 80.0359 15.1084 80.496 14.9851L80.5855 14.9611L80.5745 14.8708C80.5398 14.5759 80.489 14.2909 80.4232 14.0234Z\"\n />\n <path\n fill=\"#1C75BB\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M94.3946 4.68878C94.125 4.67621 93.9208 4.67638 93.6898 4.68895C93.6195 4.69329 93.5554 4.69845 93.4977 4.70506L93.4244 4.71295L91.0659 13.4966L88.4346 4.71022L88.3683 4.6991C88.2892 4.68572 88.209 4.67896 88.1306 4.67896H87.7909C87.6454 4.67896 87.504 4.68217 87.3707 4.68878C87.2811 4.69411 87.1965 4.70039 87.1161 4.70779L87.0434 4.71473L84.4132 13.6205L82.0547 4.71312L81.9802 4.7057C81.9123 4.6991 81.8282 4.69362 81.728 4.68878C81.3625 4.67412 81.1519 4.6783 80.929 4.68878C80.881 4.69185 80.8365 4.69475 80.7951 4.69781L80.6636 4.70779L83.6688 14.9578L83.7369 14.9682C84.1258 15.0275 84.5535 15.0269 84.9723 14.9661L85.0397 14.9567L87.7305 6.30494L90.2763 14.8934L90.2956 14.9578L90.3633 14.9682C90.5545 14.9971 90.7563 15.0121 90.9629 15.0121C91.1737 15.0121 91.3874 14.9966 91.598 14.9661L91.6664 14.9563L94.6714 4.70813L94.5399 4.6983C94.4957 4.69491 94.4474 4.69153 94.3946 4.68878Z\"\n />\n <path\n fill=\"#1C75BB\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M102.015 9.93764V13.8764L101.98 13.8832C101.625 13.9501 101.257 14.0047 100.886 14.0453C100.515 14.0858 100.112 14.1062 99.6869 14.1062C99.3586 14.1062 99.0241 14.0823 98.6927 14.0355C98.3603 13.9875 98.0508 13.8906 97.773 13.747C97.4923 13.6026 97.2616 13.3898 97.0872 13.1147C96.9122 12.8406 96.8235 12.4719 96.8235 12.0195C96.8235 11.306 97.1137 10.7492 97.6861 10.3647C98.253 9.98454 99.0713 9.7918 100.118 9.7918C100.425 9.7918 100.755 9.80857 101.101 9.84176C101.451 9.87593 101.743 9.90557 101.977 9.93314L102.015 9.93764ZM99.4003 4.47363C98.8595 4.47363 98.3217 4.51101 97.8014 4.58482C97.3395 4.6504 96.9362 4.73082 96.6026 4.8238L96.5206 4.84653L96.5243 4.93C96.5318 5.09631 96.5549 5.2726 96.5928 5.45357C96.6268 5.61262 96.665 5.74525 96.7066 5.84807L96.7427 5.93702L96.8364 5.91043C97.1652 5.81776 97.5341 5.73751 97.9321 5.67274C98.3871 5.59829 98.8948 5.56058 99.4414 5.56058C100.287 5.56058 100.934 5.77233 101.366 6.19002C101.798 6.60852 102.017 7.27584 102.017 8.17344V8.84945L101.968 8.84397C101.734 8.81723 101.44 8.78645 101.083 8.7526C100.73 8.7194 100.303 8.70232 99.8121 8.70232C99.1878 8.70232 98.6068 8.77677 98.0853 8.92326C97.5646 9.06974 97.1126 9.28826 96.7417 9.57317C96.3708 9.85872 96.0773 10.2147 95.8692 10.6308C95.6605 11.0472 95.5547 11.5274 95.5547 12.0581C95.5547 13.1574 95.9189 13.9622 96.6367 14.4499C97.3597 14.942 98.3656 15.1913 99.627 15.1913C100.238 15.1913 100.894 15.1437 101.576 15.05C102.199 14.9642 102.745 14.877 103.2 14.7907L103.287 14.7743V7.9915C103.287 6.78224 102.966 5.88449 102.335 5.32272C101.701 4.75935 100.714 4.47363 99.4003 4.47363Z\"\n />\n <path\n fill=\"#1C75BB\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M110.578 4.71223L110.493 4.70514C110.445 4.70112 110.4 4.69902 110.358 4.69902H110.142C109.346 4.69902 108.696 4.86983 108.213 5.2068C107.727 5.54505 107.344 5.96548 107.073 6.45635L106.991 6.60686V6.43587C106.991 6.17449 106.984 5.88055 106.97 5.53731C106.959 5.269 106.942 5.02115 106.921 4.80038L106.913 4.71448L106.826 4.70546C106.761 4.6982 106.699 4.69306 106.64 4.68886C106.453 4.67581 106.245 4.67549 106.04 4.68886C105.98 4.69258 105.92 4.69757 105.858 4.70385L105.762 4.71368V14.9586L105.859 14.9675C105.918 14.9729 105.989 14.9772 106.07 14.9814C106.22 14.9878 106.328 14.9913 106.397 14.9913C106.479 14.9913 106.591 14.9878 106.735 14.9814C106.81 14.9772 106.876 14.9731 106.934 14.968L107.032 14.9588V9.69317C107.032 8.33936 107.32 7.35603 107.887 6.77026C108.456 6.18416 109.222 5.887 110.163 5.887H110.358C110.392 5.887 110.433 5.88894 110.482 5.89296L110.582 5.90118L110.597 5.8032C110.621 5.64609 110.633 5.48445 110.633 5.32315C110.633 5.1578 110.619 4.98022 110.591 4.79489L110.578 4.71223Z\"\n />\n <path\n fill=\"#1C75BB\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M112.44 8.96597L112.445 8.91826C112.555 7.86209 112.884 7.03025 113.424 6.44528C113.965 5.85854 114.731 5.56106 115.7 5.56106C116.225 5.56106 116.682 5.65791 117.057 5.84903C117.432 6.0408 117.742 6.29348 117.978 6.59982C118.213 6.90648 118.389 7.26906 118.5 7.67742C118.61 8.08335 118.666 8.50234 118.666 8.92278V8.96597H112.44ZM119.661 7.22544C119.479 6.6611 119.204 6.16944 118.846 5.76383C118.489 5.35951 118.041 5.03995 117.514 4.8137C116.987 4.58793 116.377 4.47351 115.7 4.47351C114.887 4.47351 114.181 4.615 113.6 4.89411C113.018 5.17321 112.536 5.56352 112.164 6.05422C111.792 6.54781 111.511 7.12843 111.328 7.77996C111.145 8.43406 111.052 9.14488 111.052 9.89293C111.052 10.6679 111.152 11.3887 111.348 12.0349C111.544 12.681 111.853 13.2441 112.265 13.7081C112.677 14.173 113.211 14.5403 113.854 14.7996C114.497 15.0594 115.278 15.1911 116.173 15.1911C116.799 15.1911 117.384 15.1436 117.915 15.0499C118.397 14.965 118.83 14.8447 119.203 14.6916L119.276 14.6615L119.268 14.5832C119.253 14.4368 119.229 14.2775 119.197 14.1088C119.168 13.9595 119.132 13.8244 119.09 13.7071L119.055 13.6085L118.954 13.6421C118.572 13.7691 118.176 13.8734 117.777 13.9518C117.332 14.0396 116.841 14.0839 116.317 14.0839C115.021 14.0839 114.034 13.7528 113.384 13.0998C112.734 12.4471 112.404 11.4158 112.404 10.0346V9.99123H119.9L119.908 9.89326C119.916 9.79028 119.922 9.67522 119.926 9.54711C119.933 9.35921 119.937 9.20451 119.937 9.08364C119.937 8.41794 119.844 7.79285 119.661 7.22544Z\"\n />\n <path\n fill=\"#474749\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M119.402 3.29493C119.368 3.27607 119.313 3.26656 119.237 3.26656H119.12V3.54228H119.244C119.301 3.54228 119.345 3.53665 119.374 3.52536C119.427 3.50458 119.454 3.46493 119.454 3.40627C119.454 3.35101 119.436 3.31378 119.402 3.29493ZM119.256 3.17401C119.352 3.17401 119.423 3.18319 119.468 3.2014C119.548 3.23411 119.587 3.29841 119.587 3.39413C119.587 3.4623 119.562 3.51225 119.512 3.54449C119.485 3.5614 119.448 3.57381 119.4 3.58138C119.461 3.59089 119.505 3.61556 119.533 3.65583C119.561 3.69612 119.575 3.73529 119.575 3.7738V3.8294C119.575 3.84712 119.576 3.86581 119.577 3.88595C119.578 3.9061 119.58 3.91931 119.584 3.9256L119.589 3.93511H119.461L119.459 3.92753C119.458 3.92495 119.458 3.92205 119.457 3.91899L119.454 3.89466V3.83439C119.454 3.74656 119.43 3.68839 119.381 3.66019C119.352 3.64391 119.302 3.63569 119.229 3.63569H119.122V3.93511H118.985V3.17401H119.256ZM118.838 3.13369C118.72 3.25004 118.661 3.39072 118.661 3.55573C118.661 3.72188 118.72 3.86353 118.837 3.98052C118.955 4.09767 119.098 4.15617 119.267 4.15617C119.435 4.15617 119.578 4.09767 119.696 3.98052C119.814 3.86353 119.873 3.72188 119.873 3.55573C119.873 3.39072 119.814 3.25004 119.696 3.13369C119.577 3.01654 119.434 2.95803 119.267 2.95803C119.099 2.95803 118.957 3.01654 118.838 3.13369ZM119.767 4.04863C119.63 4.18448 119.463 4.25249 119.268 4.25249C119.073 4.25249 118.907 4.18448 118.769 4.04863C118.633 3.91327 118.565 3.74922 118.565 3.55664C118.565 3.36584 118.634 3.20292 118.771 3.06756C118.908 2.93284 119.074 2.86548 119.268 2.86548C119.463 2.86548 119.63 2.93284 119.767 3.06756C119.905 3.20228 119.974 3.3652 119.974 3.55664C119.974 3.74858 119.905 3.91262 119.767 4.04863Z\"\n />\n </>\n ),\n },\n lacerte: {\n viewBox: \"0 0 64 64\",\n aspect: 1,\n scale: 0.72,\n square: true,\n paths: () => (\n <>\n <path\n fill=\"#A98343\"\n d=\"M32 64C49.6731 64 64 49.6731 64 32C64 14.3269 49.6731 0 32 0C14.3269 0 0 14.3269 0 32C0 49.6731 14.3269 64 32 64Z\"\n />\n <path\n fill=\"white\"\n d=\"M25 15H23C21.9 15 21 15.9 21 17V45C21 46.1 21.9 47 23 47H43C44.1 47 45 46.1 45 45V43H25V15Z\"\n />\n <path\n fill=\"white\"\n d=\"M43 36H32V17C32 15.9 31.1 15 30 15H28V36V40H32H45V38C45 36.9 44.1 36 43 36Z\"\n />\n </>\n ),\n },\n proseries: {\n viewBox: \"0 0 64 64\",\n aspect: 1,\n scale: 0.72,\n square: true,\n paths: () => (\n <>\n <path\n fill=\"#205EA3\"\n d=\"M32 64C49.6731 64 64 49.6731 64 32C64 14.3269 49.6731 0 32 0C14.3269 0 0 14.3269 0 32C0 49.6731 14.3269 64 32 64Z\"\n />\n <path\n fill=\"white\"\n d=\"M46 20.35L44.6 18.95C43.8 18.15 42.55 18.15 41.75 18.95L24.85 35.85L18.1 29.15C17.3 28.35 16.05 28.35 15.25 29.15L13.85 30.55L24.85 41.5L46 20.35Z\"\n />\n <path\n fill=\"white\"\n d=\"M48.15 22.5L26.95 43.65L28.35 45.05C29.15 45.85 30.4 45.85 31.2 45.05L49.5499 26.7C50.3499 25.9 50.3499 24.65 49.5499 23.85L48.15 22.5Z\"\n />\n </>\n ),\n },\n proconnect: {\n viewBox: \"0 0 64 64\",\n aspect: 1,\n scale: 0.72,\n square: true,\n paths: () => (\n <>\n <path\n fill=\"#3492EF\"\n d=\"M32 64C49.6731 64 64 49.6731 64 32C64 14.3269 49.6731 0 32 0C14.3269 0 0 14.3269 0 32C0 49.6731 14.3269 64 32 64Z\"\n />\n <path\n fill=\"white\"\n d=\"M22.55 46.4C23.35 47.2 24.6 47.2 25.4 46.4L43 28.8V42.9C43 44 43.9 44.9 45 44.9H47V23.95C47 22.15 44.85 21.3 43.6 22.55L21.15 45L22.55 46.4Z\"\n />\n <path\n fill=\"white\"\n d=\"M19.15 17V19C19.15 20.1 20.05 21 21.15 21H35.2L17.6 38.6C16.8 39.4 16.8 40.65 17.6 41.45L19 42.85L41.4 20.45C42.65 19.2 41.75 17.05 40 17.05H19.15V17Z\"\n />\n </>\n ),\n },\n };\n}\n\n/** Plate heights, on the `Avatar` size scale. */\nexport type TaxSoftwareLogoSize = \"sm\" | \"md\" | \"lg\";\n\nconst plateSizes: Record<TaxSoftwareLogoSize, { height: string; padding: string }> = {\n sm: { height: \"ds:h-(--avatar-size-sm)\", padding: \"ds:px-1.5\" },\n md: { height: \"ds:h-(--avatar-size-md)\", padding: \"ds:px-2\" },\n lg: { height: \"ds:h-(--avatar-size-lg)\", padding: \"ds:px-3\" },\n};\n\n/** Props of `TaxSoftwareLogo`; everything else spreads onto the outer `<span>`. */\nexport interface TaxSoftwareLogoProps extends Omit<\n React.HTMLAttributes<HTMLSpanElement>,\n \"children\" | \"aria-label\" | \"aria-hidden\" | \"role\"\n> {\n /**\n * The vendor. A key without an official mark (`cch_axcess`, `ultratax`,\n * `atx`), an unknown key or none renders the initials `Avatar` fallback.\n */\n vendor?: TaxSoftwareVendor | undefined;\n /** Plate height, from the `Avatar` size scale. Default `md`. */\n size?: TaxSoftwareLogoSize;\n /**\n * Accessible name. Omit it (the default) when the vendor's name is shown\n * beside the mark: the logo is then decorative (`aria-hidden`). Pass it when\n * the mark stands alone for the product. Also names the fallback's initials\n * for an unknown vendor.\n */\n label?: string;\n}\n\n/** Whether `vendor` is one of the known keys (tolerates untyped callers). */\nfunction isVendor(vendor: unknown): vendor is TaxSoftwareVendor {\n return typeof vendor === \"string\" && Object.prototype.hasOwnProperty.call(VENDOR_NAMES, vendor);\n}\n\n// Keep initialization pure so importing unrelated components from a shared\n// build chunk does not retain this component and its vendor artwork.\nfunction createTaxSoftwareLogo() {\n const MARKS = createMarks();\n const Logo = React.forwardRef<HTMLSpanElement, TaxSoftwareLogoProps>(function TaxSoftwareLogo(\n { vendor, size = \"md\", label, className, ...props },\n ref,\n ) {\n const known = isVendor(vendor) ? vendor : undefined;\n const mark = known ? MARKS[known] : undefined;\n const a11y =\n label !== undefined ? { role: \"img\" as const, \"aria-label\": label } : { \"aria-hidden\": true };\n\n if (!mark) {\n return (\n <span\n ref={ref}\n data-vendor={vendor}\n data-size={size}\n data-fallback=\"\"\n className={cn(\"ds:inline-flex ds:shrink-0\", className)}\n {...a11y}\n {...props}\n >\n <Avatar name={label ?? (known ? VENDOR_NAMES[known] : undefined)} size={size} />\n </span>\n );\n }\n\n const plate = plateSizes[size];\n return (\n <span\n ref={ref}\n data-vendor={known}\n data-size={size}\n className={cn(\n \"ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center ds:overflow-hidden\",\n \"ds:rounded-(--radius-input) ds:border ds:border-rule-soft ds:bg-white\",\n plate.height,\n mark.square ? \"ds:aspect-square\" : plate.padding,\n className,\n )}\n {...a11y}\n {...props}\n >\n <svg\n viewBox={mark.viewBox}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n className=\"ds:block ds:w-auto ds:shrink-0\"\n style={{ height: `${mark.scale * 100}%`, aspectRatio: mark.aspect }}\n >\n {mark.paths()}\n </svg>\n </span>\n );\n });\n Logo.displayName = \"TaxSoftwareLogo\";\n return Logo;\n}\n\n/** The official mark of a tax-software vendor, or the initials `Avatar` fallback. */\nexport const TaxSoftwareLogo = /* @__PURE__ */ createTaxSoftwareLogo();\n","\"use client\";\n\nimport { forwardRef, useId, useState, type ReactNode } from \"react\";\n\nimport {\n WHITE,\n contrastRatio,\n darkenUntilContrast,\n formatHexColor,\n parseHexColor,\n} from \"../foundation/theme/srgb\";\nimport { cn } from \"../lib/cn\";\nimport {\n CheckIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DownloadIcon,\n EyeIcon,\n GlobeIcon,\n HomeIcon,\n MailIcon,\n PhoneIcon,\n XIcon,\n} from \"../primitives/icons\";\n\n/**\n * AgreementViewer — the chrome + navigation shell for a multi-step, branded\n * agreement / proposal (the \"Signed Agreement Viewer\"). It owns the header,\n * the firm-branded cover rail, the section stepper, the signed / awaiting\n * banner, the prev·dots·next footer, and the step state. Each step's body is\n * consumer-owned `content` — the shell is deliberately content-agnostic so the\n * same frame drives a tax proposal, an engagement letter, or an NDA.\n *\n * Step 0 is the cover: it shows the gradient firm rail. Steps 1+ show the\n * light section rail with the stepper. One root attribute drives both:\n * `data-view=\"cover\" | \"inner\"`, derived from the current step.\n *\n * Branding: the whole composite themes from a single accent. Omit `accent` to\n * inherit the suite accent; pass any CSS color (`accent=\"#1f8a5b\"`) and the\n * rail gradient, tints, stepper, dots, and CTAs all retrack — every shade is\n * derived in `tokens.css` via color-mix off `--av-accent`. The accent carries\n * white text (CTAs, monogram) and reads as text on white (logo mark), so a hex\n * accent under 4.5:1 against white is darkened just enough to reach it.\n *\n * <AgreementViewer\n * title=\"Comprehensive Individual Tax Services\"\n * firm={{ name: \"Patel & Associates CPA\", initials: \"P&A\" }}\n * steps={[\n * { id: \"welcome\", label: \"Welcome\", content: <Welcome /> },\n * { id: \"package\", label: \"Select a package\", content: <Packages /> },\n * …\n * ]}\n * onDownload={downloadPdf}\n * />\n *\n * @since 1.12.0\n */\n\nexport type AgreementStatus = \"signed\" | \"awaiting\";\n\nexport interface AgreementStep {\n /** Stable key + stepper/dot identity. */\n id: string;\n /** Section label shown in the stepper rail. */\n label: string;\n /** Node glyph in the stepper; defaults to the step number (or a home glyph\n * for the cover step). */\n icon?: ReactNode;\n /** The step body — consumer-owned. */\n content: ReactNode;\n /** Render this step's body full-bleed: the content pane drops its padding so\n * a cover or hero can reach the card edges. Default false.\n * @since 1.38.0 */\n bleed?: boolean;\n}\n\nexport interface AgreementFirm {\n /** Firm name shown on both rails. */\n name: string;\n /** Logo monogram (e.g. \"P&A\"). Falls back to the first letter of `name`. */\n initials?: string;\n /** Short line under the firm name on the cover rail. */\n tagline?: string;\n /** Subtitle under the firm name on the inner rail. Default \"Your proposal\". */\n subtitle?: string;\n /** Contact rows pinned to the bottom of the cover rail. */\n contact?: {\n phone?: ReactNode;\n email?: ReactNode;\n website?: ReactNode;\n };\n}\n\nexport interface AgreementViewerProps {\n /** Header title (the agreement name). */\n title: ReactNode;\n /** Small overline above the title. Default \"Signed agreement\". */\n overline?: ReactNode;\n /** Steps rendered as panes; index 0 is the cover. */\n steps: AgreementStep[];\n /** Firm branding for the rails. */\n firm: AgreementFirm;\n /** \"signed\" (read-only, all sections complete) or \"awaiting\" (in progress).\n * Drives the banner tone + which stepper nodes read as done. Default \"signed\". */\n status?: AgreementStatus;\n /** Banner body override. Omit for the status-derived default; pass `null` to\n * hide the banner entirely. */\n banner?: ReactNode;\n /** Brand accent override — any CSS color. Defaults to the suite accent. A hex\n * color under 4.5:1 against white is darkened just enough to reach it. */\n accent?: string;\n /** Show the gradient firm rail on the cover step. Set false for a full-bleed\n * cover (e.g. a centered title page). Default true. */\n coverRail?: boolean | undefined;\n /** Controlled current step index. */\n step?: number;\n /** Initial step when uncontrolled. Default 0. */\n defaultStep?: number;\n /** Notified on every step change (controlled or not). */\n onStepChange?: (step: number) => void;\n /** \"Download PDF\" handler — hides the button when omitted. */\n onDownload?: () => void;\n /** Close handler — hides the close button when omitted. */\n onClose?: () => void;\n /** Extra header actions, placed left of Download / Close. */\n headerActions?: ReactNode;\n /** Disable the footer \"Next\" control — e.g. this step has unmet requirements.\n * Default false.\n * @since 1.38.0 */\n nextDisabled?: boolean;\n /** Why \"Next\" is disabled. Kept in a polite live region under the footer and\n * wired to the Next control with `aria-describedby`; the text only appears\n * while `nextDisabled` is true.\n * @since 1.38.0 */\n nextDisabledReason?: ReactNode;\n /** Slot under the footer nav row — a validation summary, a secondary CTA, or\n * a legal note that should sit with the navigation rather than in the step.\n * @since 1.38.0 */\n footer?: ReactNode;\n className?: string;\n}\n\nconst ICON_BTN = cn(\n \"ds:inline-flex ds:size-9 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[9px]\",\n \"ds:border-rule-strong ds:bg-surface ds:text-fg-3 ds:border\",\n \"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:hover:bg-surface-hover ds:hover:text-fg\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n);\n\n/** Minimum contrast of the accent against white (WCAG 2.2 SC 1.4.3 AA). */\nconst MIN_ACCENT_CONTRAST = 4.5;\n\n/**\n * The firm accent, clamped so white text on it and it as text on white both\n * reach 4.5:1. A hex accent that already passes is returned untouched; a\n * lighter one is darkened by the smallest mix towards black that passes (the\n * clamp `createBrandTheme` applies to fills), keeping its hue. Any other CSS\n * colour passes through as given.\n */\nfunction legibleAccent(accent: string): string {\n const rgb = parseHexColor(accent);\n if (!rgb || contrastRatio(rgb, WHITE) >= MIN_ACCENT_CONTRAST) return accent;\n return formatHexColor(darkenUntilContrast(rgb, WHITE, MIN_ACCENT_CONTRAST));\n}\n\nexport const AgreementViewer = forwardRef<HTMLDivElement, AgreementViewerProps>(\n function AgreementViewer(\n {\n title,\n overline = \"Signed agreement\",\n steps,\n firm,\n status = \"signed\",\n banner,\n accent,\n coverRail = true,\n step,\n defaultStep = 0,\n onStepChange,\n onDownload,\n onClose,\n headerActions,\n nextDisabled = false,\n nextDisabledReason,\n footer,\n className,\n },\n ref,\n ) {\n const reasonId = useId();\n const [internalStep, setInternalStep] = useState(defaultStep);\n const current = step ?? internalStep;\n const isControlled = step !== undefined;\n const lastIndex = steps.length - 1;\n\n const goTo = (n: number) => {\n if (n < 0 || n > lastIndex || n === current) return;\n if (!isControlled) setInternalStep(n);\n onStepChange?.(n);\n };\n\n const isCover = current === 0;\n const monogram = firm.initials ?? firm.name.charAt(0);\n\n const bannerContent =\n banner === undefined\n ? status === \"signed\"\n ? \"Showing the services your client accepted, at the prices locked in at signing.\"\n : \"Review each section at your pace, then sign whenever you're ready.\"\n : banner;\n\n return (\n <div\n ref={ref}\n data-slot=\"agreement-viewer\"\n data-status={status}\n data-view={isCover ? \"cover\" : \"inner\"}\n style={accent ? ({ \"--av-accent\": legibleAccent(accent) } as React.CSSProperties) : undefined}\n className={cn(\n // Fills its container's height so the content pane scrolls internally\n // while the header, rail, and footer stay fixed — give the parent a\n // height (e.g. h-screen / a fixed card height). Falls back to a 600px\n // floor so it never collapses when dropped in an unsized container.\n // Responsive via CONTAINER queries (@container/agreement), not viewport:\n // the side rails + generous padding only appear when the viewer's own\n // container is wide (≥64rem). In a phone frame or a narrow panel it\n // collapses to the single-column compact layout regardless of the\n // browser viewport.\n \"ds:group/agreement ds:@container/agreement ds:bg-bg ds:text-fg ds:flex ds:h-full ds:min-h-[600px] ds:flex-col ds:font-sans\",\n className,\n )}\n >\n {/* Header */}\n <header className=\"ds:flex ds:items-center ds:gap-2.5 ds:px-4 ds:pt-4 ds:pb-3 ds:@5xl/agreement:gap-3.5 ds:@5xl/agreement:px-7\">\n <span\n aria-hidden=\"true\"\n className=\"ds:rounded-icon ds:flex ds:size-9 ds:shrink-0 ds:items-center ds:justify-center ds:bg-[var(--av-accent-tint)] ds:text-[var(--av-accent)]\"\n >\n <EyeIcon className=\"ds:size-4.5\" />\n </span>\n <div className=\"ds:flex ds:min-w-0 ds:flex-col\">\n <span className=\"ds:text-fg-3 ds:text-[11.5px] ds:leading-tight ds:font-semibold\">{overline}</span>\n <span className=\"ds:font-display ds:text-fg ds:truncate ds:text-[17px] ds:leading-tight ds:font-semibold ds:tracking-tight\">\n {title}\n </span>\n </div>\n <div className=\"ds:ml-auto ds:flex ds:items-center ds:gap-2\">\n {!isCover && (\n <span className=\"ds:border-rule ds:bg-bg-2 ds:text-fg-2 ds:shrink-0 ds:rounded-md ds:border ds:px-2.5 ds:py-1 ds:text-xs ds:font-semibold ds:whitespace-nowrap\">\n Step {current + 1} of {steps.length}\n </span>\n )}\n {headerActions}\n {onDownload && (\n <button\n type=\"button\"\n onClick={onDownload}\n aria-label=\"Download PDF\"\n className={cn(\n \"ds:inline-flex ds:h-9 ds:shrink-0 ds:items-center ds:gap-1.5 ds:rounded-[9px] ds:px-2.5 ds:text-[13px] ds:font-medium ds:whitespace-nowrap ds:@5xl/agreement:px-3.5\",\n \"ds:border-rule-strong ds:bg-surface ds:text-fg ds:border\",\n \"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:hover:bg-surface-hover\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n )}\n >\n <DownloadIcon className=\"ds:size-4\" aria-hidden=\"true\" />\n <span className=\"ds:hidden ds:@5xl/agreement:inline\">Download PDF</span>\n </button>\n )}\n {onClose && (\n <button type=\"button\" onClick={onClose} aria-label=\"Close\" className={ICON_BTN}>\n <XIcon className=\"ds:size-4\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </header>\n\n {/* Status banner */}\n {bannerContent != null && (\n <div\n className={cn(\n \"ds:mx-4 ds:flex ds:items-center ds:gap-2.5 ds:rounded-[11px] ds:border ds:px-4 ds:py-2.5 ds:text-[13.5px] ds:font-medium ds:@5xl/agreement:mx-7\",\n status === \"signed\"\n ? \"ds:border-success-line ds:bg-success-bg ds:text-success-fg\"\n : \"ds:border-[var(--av-accent-tint2)] ds:bg-[var(--av-accent-tint)] ds:text-[var(--av-accent-soft)]\",\n )}\n >\n <CheckIcon className=\"ds:size-4 ds:shrink-0\" aria-hidden=\"true\" />\n <span>{bannerContent}</span>\n </div>\n )}\n\n {/* Stage */}\n <div className=\"ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:px-4 ds:pt-3 ds:pb-5 ds:@5xl/agreement:px-7 ds:@5xl/agreement:pb-8\">\n {/* Card: rail + content. Fills the stage (minus footer); the content\n pane inside scrolls. 18px radius is a one-off frame metric, not a\n reusable role token. */}\n <div className=\"ds:border-rule ds:bg-surface ds:shadow-card ds:flex ds:min-h-0 ds:flex-1 ds:overflow-hidden ds:rounded-[18px] ds:border\">\n {/* Cover rail (gradient, firm branding) — step 0; optional via coverRail */}\n {coverRail && (\n <aside\n className=\"ds:hidden ds:w-[340px] ds:shrink-0 ds:flex-col ds:overflow-y-auto ds:p-8 ds:text-white ds:@5xl/agreement:group-data-[view=cover]/agreement:flex\"\n style={{\n backgroundImage:\n \"linear-gradient(166deg, var(--av-rail-from) 0%, var(--av-rail-via) 50%, var(--av-rail-to) 100%)\",\n }}\n >\n <span\n aria-hidden=\"true\"\n className=\"ds:rounded-card ds:flex ds:size-[54px] ds:items-center ds:justify-center ds:bg-white ds:text-[17px] ds:font-semibold ds:text-[var(--av-accent)] ds:shadow-raised\"\n >\n {monogram}\n </span>\n <div className=\"ds:mt-4 ds:text-[21px] ds:leading-tight ds:font-semibold\">{firm.name}</div>\n {firm.tagline && (\n <div className=\"ds:mt-1.5 ds:text-[13px] ds:leading-snug ds:text-white/90\">{firm.tagline}</div>\n )}\n {firm.contact && (\n <div className=\"ds:mt-auto ds:pt-7\">\n <div className=\"ds:mb-4 ds:h-px ds:bg-white/20\" />\n <div className=\"ds:flex ds:flex-col ds:gap-3 ds:text-[12.5px] ds:text-white/90\">\n {firm.contact.phone && (\n <span className=\"ds:flex ds:items-center ds:gap-2.5\">\n <PhoneIcon className=\"ds:size-4 ds:shrink-0 ds:opacity-85\" aria-hidden=\"true\" />\n {firm.contact.phone}\n </span>\n )}\n {firm.contact.email && (\n <span className=\"ds:flex ds:items-center ds:gap-2.5\">\n <MailIcon className=\"ds:size-4 ds:shrink-0 ds:opacity-85\" aria-hidden=\"true\" />\n {firm.contact.email}\n </span>\n )}\n {firm.contact.website && (\n <span className=\"ds:flex ds:items-center ds:gap-2.5\">\n <GlobeIcon className=\"ds:size-4 ds:shrink-0 ds:opacity-85\" aria-hidden=\"true\" />\n {firm.contact.website}\n </span>\n )}\n </div>\n </div>\n )}\n </aside>\n )}\n\n {/* Inner rail (sections stepper) — steps 1+ */}\n <aside className=\"ds:border-rule ds:bg-surface-2 ds:hidden ds:w-[300px] ds:shrink-0 ds:flex-col ds:overflow-y-auto ds:border-r ds:px-6 ds:py-7 ds:@5xl/agreement:group-data-[view=inner]/agreement:flex\">\n <div className=\"ds:flex ds:items-center ds:gap-3\">\n <span\n aria-hidden=\"true\"\n className=\"ds:rounded-icon ds:flex ds:size-10 ds:shrink-0 ds:items-center ds:justify-center ds:bg-[var(--av-accent)] ds:text-[13px] ds:font-bold ds:text-[var(--av-accent-contrast)]\"\n >\n {monogram}\n </span>\n <div className=\"ds:min-w-0\">\n <div className=\"ds:text-fg ds:truncate ds:text-sm ds:font-semibold\">{firm.name}</div>\n <div className=\"ds:text-fg-4 ds:text-[11.5px]\">{firm.subtitle ?? \"Your proposal\"}</div>\n </div>\n </div>\n <div className=\"ds:text-fg-4 ds:mt-6 ds:text-[11.5px] ds:font-semibold ds:tracking-wide\">\n Sections\n </div>\n <nav aria-label=\"Agreement sections\" className=\"ds:mt-3 ds:flex ds:flex-col ds:gap-0.5\">\n {steps.map((s, i) => {\n const on = i === current;\n const done = status === \"signed\" ? i !== current && i !== 0 : i < current;\n return (\n <button\n key={s.id}\n type=\"button\"\n onClick={() => goTo(i)}\n aria-current={on ? \"step\" : undefined}\n data-on={on || undefined}\n data-done={done || undefined}\n data-first={i === 0 || undefined}\n className={cn(\n \"ds:group/step ds:text-fg-3 ds:relative ds:z-[calc(var(--z-base)+1)] ds:flex ds:w-full ds:items-center ds:gap-3.5 ds:rounded-[12px] ds:py-2.5 ds:pr-3.5 ds:pl-2 ds:text-left ds:text-[13.5px] ds:font-medium\",\n \"ds:transition-colors ds:duration-[var(--duration-normal)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:hover:bg-surface-hover\",\n \"ds:data-[on]:bg-[var(--av-accent-tint)] ds:data-[on]:font-semibold ds:data-[on]:text-[var(--av-accent-soft)]\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n \"ds:relative ds:flex ds:size-7 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-full ds:border-[1.5px] ds:text-[12.5px] ds:font-semibold\",\n \"ds:border-[var(--av-accent-tint2)] ds:bg-[var(--color-surface)] ds:text-[var(--av-accent)]\",\n \"ds:transition-colors ds:duration-[var(--duration-normal)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n // connector to the node above (skipped on the first step)\n \"ds:before:absolute ds:before:bottom-full ds:before:left-1/2 ds:before:h-[18px] ds:before:w-[2.5px] ds:before:-translate-x-1/2 ds:before:rounded-full ds:before:bg-[var(--av-accent-tint2)] ds:before:transition-colors ds:before:content-['']\",\n \"ds:group-data-[first]/step:before:hidden\",\n \"ds:group-data-[done]/step:border-[var(--av-accent)] ds:group-data-[done]/step:bg-[var(--av-accent)] ds:group-data-[done]/step:text-[var(--av-accent-contrast)] ds:group-data-[done]/step:before:bg-[var(--av-accent)]\",\n \"ds:group-data-[on]/step:border-[var(--av-accent)] ds:group-data-[on]/step:bg-[var(--av-accent)] ds:group-data-[on]/step:text-[var(--av-accent-contrast)] ds:group-data-[on]/step:before:bg-[var(--av-accent)]\",\n )}\n >\n {s.icon ?? (i === 0 ? <HomeIcon className=\"ds:size-3.5\" /> : done ? <CheckIcon className=\"ds:size-3.5\" /> : i)}\n </span>\n <span className=\"ds:truncate\">{s.label}</span>\n </button>\n );\n })}\n </nav>\n </aside>\n\n {/* Content pane — a container itself (@container/pane) so consumer\n content can reflow to the pane width, not the viewport. */}\n <section\n data-bleed={steps[current]?.bleed || undefined}\n className={cn(\n \"ds:@container/pane ds:scrollbar-thin ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:overflow-y-auto\",\n // `bleed` steps own their own padding so a cover can reach the\n // card edges — this replaces the app-side\n // `*:has(> [data-esign-cover]) { padding: 0 }` global rule.\n steps[current]?.bleed\n ? \"ds:p-0\"\n : \"ds:px-5 ds:py-7 ds:@5xl/agreement:px-[52px] ds:@5xl/agreement:py-11\",\n )}\n >\n {steps[current]?.content}\n </section>\n </div>\n\n {/* Footer nav */}\n <div className=\"ds:mt-4 ds:flex ds:items-center ds:justify-between\">\n <button\n type=\"button\"\n onClick={() => goTo(current - 1)}\n disabled={current === 0}\n className={cn(\n \"ds:inline-flex ds:h-[42px] ds:items-center ds:gap-1.5 ds:rounded-[11px] ds:px-4 ds:text-sm ds:font-medium\",\n \"ds:border-rule-strong ds:bg-surface ds:text-fg-2 ds:border\",\n \"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:hover:bg-surface-hover\",\n \"ds:disabled:border-rule ds:disabled:text-fg-disabled ds:disabled:cursor-default ds:disabled:bg-transparent\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n )}\n >\n <ChevronLeftIcon className=\"ds:size-4\" aria-hidden=\"true\" />\n Previous\n </button>\n\n <div className=\"ds:flex ds:items-center ds:gap-1.5\">\n {steps.map((s, i) => (\n <button\n key={s.id}\n type=\"button\"\n onClick={() => goTo(i)}\n aria-label={`Go to ${s.label}`}\n aria-current={i === current ? \"step\" : undefined}\n className={cn(\n \"ds:bg-rule-strong ds:h-2 ds:rounded-full\",\n \"ds:transition-[width,background-color] ds:duration-[var(--duration-normal)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n i === current ? \"ds:w-[22px] ds:bg-[var(--av-accent)]\" : \"ds:w-2\",\n )}\n />\n ))}\n </div>\n\n <button\n type=\"button\"\n onClick={() => goTo(current + 1)}\n disabled={nextDisabled}\n aria-describedby={nextDisabled && nextDisabledReason != null ? reasonId : undefined}\n style={current === lastIndex ? { visibility: \"hidden\" } : undefined}\n className={cn(\n \"ds:inline-flex ds:h-[42px] ds:items-center ds:gap-2 ds:rounded-[11px] ds:px-5 ds:text-sm ds:font-semibold\",\n \"ds:bg-[var(--av-accent)] ds:text-[var(--av-accent-contrast)]\",\n \"ds:transition-[filter] ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:hover:brightness-105\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n \"ds:disabled:border-rule ds:disabled:bg-bg-disabled ds:disabled:text-fg-disabled ds:disabled:cursor-not-allowed ds:disabled:border ds:disabled:hover:brightness-100\",\n )}\n >\n Next\n <ChevronRightIcon className=\"ds:size-4\" aria-hidden=\"true\" />\n </button>\n </div>\n\n {footer && <div className=\"ds:mt-4\">{footer}</div>}\n\n {nextDisabledReason != null && (\n <p\n id={reasonId}\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ds:text-fg-3 ds:mt-1.5 ds:min-h-5 ds:text-right ds:text-sm\"\n >\n {nextDisabled ? nextDisabledReason : null}\n </p>\n )}\n </div>\n </div>\n );\n },\n);\nAgreementViewer.displayName = \"AgreementViewer\";\n\n/* ─── Pane heading ────────────────────────────────────────────── */\n\nexport interface AgreementPaneHeadingProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Accent overline, e.g. \"Step 3 of 6\". */\n overline?: ReactNode;\n /** The pane title. */\n title: ReactNode;\n /** Supporting line under the title. */\n subtitle?: ReactNode;\n}\n\nexport const AgreementPaneHeading = forwardRef<HTMLDivElement, AgreementPaneHeadingProps>(\n function AgreementPaneHeading({ overline, title, subtitle, className, ...props }, ref) {\n return (\n <div ref={ref} className={cn(\"ds:mb-6\", className)} {...props}>\n {overline && (\n <div className=\"ds:mb-1.5 ds:text-xs ds:font-semibold ds:tracking-wide ds:text-[var(--av-accent-soft)]\">\n {overline}\n </div>\n )}\n <h2 className=\"ds:font-display ds:text-fg ds:text-[27px] ds:leading-tight ds:font-bold ds:tracking-tight\">\n {title}\n </h2>\n {subtitle && <p className=\"ds:text-fg-3 ds:mt-2 ds:text-sm ds:leading-relaxed\">{subtitle}</p>}\n </div>\n );\n },\n);\nAgreementPaneHeading.displayName = \"AgreementPaneHeading\";\n","\"use client\";\n\nimport { forwardRef, useId, type ReactNode } from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport {\n CheckIcon,\n CreditCardIcon,\n EyeIcon,\n LockIcon,\n ReceiptIcon,\n RotateCcwIcon,\n} from \"../primitives/icons\";\n\n/**\n * Proposal pricing building-blocks — the client-preview pieces a signing\n * package's \"Services & Pricing\" config renders into. They compose inside an\n * `AgreementViewer` step (where they inherit the firm `--av-accent`), or\n * standalone inside a `[data-av-scope]` wrapper. Accent classes carry a suite\n * fallback so a bare block still renders un-branded rather than transparent.\n *\n * - `ProposalServiceRow` — one line item (name · price · cadence, optional\n * struck-through original for a discount).\n * - `ProposalPackageCard` — a package the client chooses; `mode` switches the\n * builder's three choice models (pick-one / add-on /\n * always-included).\n * - `ProposalPricingSummary`— the \"review total\" block: what's included, the\n * billing schedule, discount savings, tax, total.\n *\n * @since 1.12.0\n */\n\n/* ─── Service line item ───────────────────────────────────────── */\n\nexport interface ProposalServiceRowProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Service name — the primary line. */\n name: ReactNode;\n /** Optional secondary description shown to the client. */\n description?: ReactNode;\n /** Formatted price, e.g. \"$1,300\" or \"$50/mo\". */\n price?: ReactNode;\n /** Pre-discount price, struck through before `price`. */\n originalPrice?: ReactNode;\n /** Leading marker. \"check\" (accent tick) or \"none\". Default \"check\". */\n marker?: \"check\" | \"none\";\n}\n\nexport const ProposalServiceRow = forwardRef<HTMLDivElement, ProposalServiceRowProps>(\n function ProposalServiceRow(\n { name, description, price, originalPrice, marker = \"check\", className, ...props },\n ref,\n ) {\n return (\n <div ref={ref} className={cn(\"ds:flex ds:items-start ds:gap-2.5 ds:py-1.5\", className)} {...props}>\n {marker === \"check\" && (\n <CheckIcon\n className=\"ds:mt-0.5 ds:size-3.5 ds:shrink-0 ds:text-[var(--av-accent,var(--color-accent))]\"\n aria-hidden=\"true\"\n />\n )}\n <div className=\"ds:min-w-0 ds:flex-1\">\n <div className=\"ds:text-fg-2 ds:text-[12.5px] ds:leading-snug\">{name}</div>\n {description && <div className=\"ds:text-fg-4 ds:mt-0.5 ds:text-[11.5px] ds:leading-snug\">{description}</div>}\n </div>\n {(price != null || originalPrice != null) && (\n <div className=\"ds:flex ds:shrink-0 ds:items-baseline ds:gap-1.5 ds:text-xs\">\n {originalPrice != null && (\n <span className=\"ds:text-fg-4 ds:line-through\">{originalPrice}</span>\n )}\n {price != null && <span className=\"ds:text-fg-3 ds:tabular\">{price}</span>}\n </div>\n )}\n </div>\n );\n },\n);\nProposalServiceRow.displayName = \"ProposalServiceRow\";\n\n/* ─── Package card ────────────────────────────────────────────── */\n\nexport type ProposalPackageMode = \"choice\" | \"addon\" | \"included\";\n\nexport interface ProposalPackageCardProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onSelect\"> {\n /** Package name. */\n name: ReactNode;\n /** Short count line, e.g. \"Includes 4 services\". */\n summary?: ReactNode;\n /** Formatted package price. */\n price?: ReactNode;\n /** Caption under the price, e.g. \"Package total\". */\n priceCaption?: ReactNode;\n /** Pre-discount price, struck through. */\n originalPrice?: ReactNode;\n /** Savings line, e.g. \"You save $200\". */\n savings?: ReactNode;\n /** How the client chooses this package. Default \"choice\". */\n mode?: ProposalPackageMode;\n /** Selected / added state (drives accent border + control label). */\n selected?: boolean;\n /** Corner badge, e.g. \"Most popular\". A \"Selected\"/\"Added\" badge is implied. */\n badge?: ReactNode;\n /** Label above the service rows. Default \"Included services\". */\n servicesLabel?: ReactNode;\n /** Service rows (`ProposalServiceRow`) or any content. */\n children?: ReactNode;\n /**\n * Cap the service list's height (any CSS length, e.g. `\"14rem\"`). Past it the\n * list scrolls rather than growing, so a package with many services keeps its\n * select control in view instead of pushing it below the fold — and cards\n * sitting in a row stay the same height.\n *\n * Omit for the previous behaviour: the list grows to fit.\n */\n servicesMaxHeight?: string;\n /** Select / toggle handler — makes the card interactive. */\n onSelect?: () => void;\n disabled?: boolean;\n}\n\nconst CONTROL_LABEL: Record<ProposalPackageMode, [on: string, off: string]> = {\n choice: [\"Selected\", \"Select package\"],\n addon: [\"Added\", \"Add to proposal\"],\n included: [\"Included\", \"Included\"],\n};\n\nexport const ProposalPackageCard = forwardRef<HTMLDivElement, ProposalPackageCardProps>(\n function ProposalPackageCard(\n {\n name,\n summary,\n price,\n priceCaption,\n originalPrice,\n savings,\n mode = \"choice\",\n selected = false,\n badge,\n servicesLabel = \"Included services\",\n children,\n servicesMaxHeight,\n onSelect,\n disabled = false,\n className,\n ...props\n },\n ref,\n ) {\n const interactive = mode !== \"included\" && !!onSelect;\n const [onLabel, offLabel] = CONTROL_LABEL[mode];\n const servicesLabelId = useId();\n\n return (\n <div\n ref={ref}\n data-selected={selected || undefined}\n className={cn(\n \"ds:border-rule ds:bg-surface ds:relative ds:flex ds:flex-col ds:rounded-[14px] ds:border ds:p-4\",\n // Selecting a package eases its accent edge in, as ProposalAddOn does.\n \"ds:transition-[border-color,box-shadow] ds:duration-[var(--motion-duration-feedback)] ds:ease-[var(--motion-ease-enter)] ds:motion-reduce:transition-none\",\n \"ds:data-[selected]:border-[var(--av-accent,var(--color-accent))] ds:data-[selected]:shadow-[0_0_0_1px_var(--av-accent,var(--color-accent))]\",\n className,\n )}\n {...props}\n >\n {(badge || selected) && (\n <span className=\"ds:rounded-pill ds:absolute ds:-top-2.5 ds:left-4 ds:flex ds:items-center ds:gap-1 ds:bg-[var(--av-accent,var(--color-accent))] ds:px-2 ds:py-1 ds:text-[10px] ds:font-bold ds:tracking-wide ds:text-[var(--av-accent-contrast,var(--color-fg-on-accent))]\">\n {selected && <CheckIcon className=\"ds:size-3\" aria-hidden=\"true\" />}\n {badge ?? (selected ? onLabel : null)}\n </span>\n )}\n\n <div className=\"ds:text-fg ds:text-[15px] ds:font-semibold\">{name}</div>\n {summary && <div className=\"ds:text-fg-4 ds:mt-0.5 ds:text-xs\">{summary}</div>}\n\n {price != null && (\n <div className=\"ds:mt-2.5\">\n <div className=\"ds:flex ds:items-baseline ds:gap-2\">\n {originalPrice != null && (\n <span className=\"ds:text-fg-4 ds:text-base ds:line-through\">{originalPrice}</span>\n )}\n <span className=\"ds:text-fg ds:text-[23px] ds:font-bold ds:tracking-tight ds:tabular\">{price}</span>\n </div>\n {priceCaption && <div className=\"ds:text-fg-4 ds:text-[11.5px]\">{priceCaption}</div>}\n {savings && (\n <div className=\"ds:text-success-fg ds:mt-1 ds:text-[11.5px] ds:font-semibold\">{savings}</div>\n )}\n </div>\n )}\n\n {children && (\n <>\n <div\n id={servicesLabelId}\n className=\"ds:text-fg-3 ds:mt-4 ds:mb-1 ds:text-[11.5px] ds:font-semibold ds:tracking-wide\"\n >\n {servicesLabel}\n </div>\n {/* Unbounded by default, so existing cards render as they always\n * have. Given a cap, the list scrolls instead of growing — which\n * is all it takes to keep the select control on screen, since the\n * card is already a flex column with `mt-auto` on that control.\n * `min-h-0` lets the list actually shrink inside that column. */}\n <div\n {...(servicesMaxHeight\n ? { role: \"region\", \"aria-labelledby\": servicesLabelId, tabIndex: 0 }\n : {})}\n className={cn(\n servicesMaxHeight && [\n \"ds:min-h-0 ds:overflow-y-auto\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n // pr-3 keeps the rail off the service text; -mr-1 gives that\n // padding back to the card so the rail still sits near its\n // edge rather than floating in from it.\n \"ds:-mr-1 ds:pr-3\",\n // A 2px hairline. `scrollbar-thin` is 8px, and on\n // Chrome-for-Windows an unstyled bar also carries stepper\n // arrows, which is most of what made it read as heavy.\n \"ds:[scrollbar-width:thin]\",\n \"ds:[&::-webkit-scrollbar]:w-[2px]\",\n \"ds:[&::-webkit-scrollbar-button]:hidden\",\n \"ds:[&::-webkit-scrollbar-track]:bg-transparent\",\n \"ds:[&::-webkit-scrollbar-thumb]:rounded-full\",\n \"ds:[&::-webkit-scrollbar-thumb]:bg-rule-strong\",\n ],\n )}\n style={servicesMaxHeight ? { maxHeight: servicesMaxHeight } : undefined}\n >\n {children}\n </div>\n </>\n )}\n\n <div className=\"ds:mt-auto ds:pt-4\">\n {interactive ? (\n <button\n type=\"button\"\n role={mode === \"addon\" ? \"checkbox\" : \"radio\"}\n aria-checked={selected}\n disabled={disabled}\n onClick={onSelect}\n className={cn(\n \"ds:rounded-input ds:flex ds:h-10 ds:w-full ds:items-center ds:justify-center ds:text-[13.5px] ds:font-semibold\",\n \"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n selected\n ? \"ds:bg-[var(--av-accent,var(--color-accent))] ds:text-[var(--av-accent-contrast,var(--color-fg-on-accent))]\"\n : \"ds:border-rule-strong ds:text-fg ds:hover:bg-surface-hover ds:border\",\n \"ds:disabled:cursor-not-allowed ds:disabled:opacity-60\",\n )}\n >\n {selected ? onLabel : offLabel}\n </button>\n ) : (\n <div\n className={cn(\n \"ds:rounded-input ds:flex ds:h-10 ds:w-full ds:items-center ds:justify-center ds:gap-1.5 ds:text-[13.5px] ds:font-semibold\",\n mode === \"included\"\n ? \"ds:bg-[var(--av-accent-tint,var(--color-accent-tint))] ds:text-[var(--av-accent-soft,var(--color-accent-2))]\"\n : \"ds:border-rule ds:text-fg-3 ds:border\",\n )}\n >\n {mode === \"included\" && <CheckIcon className=\"ds:size-3.5\" aria-hidden=\"true\" />}\n {selected ? onLabel : offLabel}\n </div>\n )}\n </div>\n </div>\n );\n },\n);\nProposalPackageCard.displayName = \"ProposalPackageCard\";\n\n/* ─── Billing terms (read-only arrangement) ───────────────────── */\n\nexport type ProposalBillingMode = \"now\" | \"auto\" | \"review\" | \"manual\" | \"onetime\";\n\nconst BILLING_ICON: Record<ProposalBillingMode, typeof CheckIcon> = {\n now: CreditCardIcon,\n auto: RotateCcwIcon,\n review: EyeIcon,\n manual: ReceiptIcon,\n onetime: CheckIcon,\n};\n\nexport interface ProposalBillingRow {\n /** e.g. \"Due today\", \"First payment\", \"Then, monthly\", \"Each invoice\". */\n label: ReactNode;\n /** Formatted amount, e.g. \"$2,526\". */\n amount?: ReactNode;\n /** Cadence beside the amount, e.g. \"/mo\". */\n cadence?: ReactNode;\n /** Plain-language explanation of how/when this is charged. */\n detail: ReactNode;\n /** Drives the row icon. Default \"now\". */\n mode?: ProposalBillingMode;\n}\n\nexport interface ProposalBillingTermsProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Heading. Default \"How billing works\". */\n title?: ReactNode;\n /** The billing steps the firm configured. */\n rows: ProposalBillingRow[];\n /** Show the \"set by your firm — review only\" footer. Default true. */\n locked?: boolean;\n}\n\n/**\n * ProposalBillingTerms — a read-only explanation of the payment arrangement the\n * firm configured (auto-pay, charge-after-review, manual invoicing, one-time,\n * or a mix). The client can see exactly what will be charged and when, but\n * can't change it — the `locked` footer makes that explicit.\n */\nexport const ProposalBillingTerms = forwardRef<HTMLDivElement, ProposalBillingTermsProps>(\n function ProposalBillingTerms(\n { title = \"How billing works\", rows, locked = true, className, ...props },\n ref,\n ) {\n return (\n <div\n ref={ref}\n className={cn(\"ds:border-rule ds:overflow-hidden ds:rounded-[14px] ds:border\", className)}\n {...props}\n >\n {title && (\n <div className=\"ds:border-rule ds:bg-surface-2 ds:text-fg ds:border-b ds:px-5 ds:py-3 ds:text-[13px] ds:font-semibold\">\n {title}\n </div>\n )}\n <div className=\"ds:divide-rule-soft ds:divide-y\">\n {rows.map((r, i) => {\n const Icon = BILLING_ICON[r.mode ?? \"now\"];\n return (\n <div key={i} className=\"ds:flex ds:items-start ds:gap-3.5 ds:px-5 ds:py-3.5\">\n <span\n aria-hidden=\"true\"\n className=\"ds:rounded-icon ds:mt-0.5 ds:flex ds:size-9 ds:shrink-0 ds:items-center ds:justify-center ds:bg-[var(--av-accent-tint,var(--color-accent-tint))] ds:text-[var(--av-accent,var(--color-accent))]\"\n >\n <Icon className=\"ds:size-4.5\" />\n </span>\n <div className=\"ds:min-w-0 ds:flex-1\">\n <div className=\"ds:flex ds:items-baseline ds:justify-between ds:gap-3\">\n <span className=\"ds:text-fg ds:text-sm ds:font-semibold\">{r.label}</span>\n {r.amount != null && (\n <span className=\"ds:text-fg ds:shrink-0 ds:text-sm ds:font-semibold ds:tabular\">\n {r.amount}\n {r.cadence && (\n <small className=\"ds:text-fg-4 ds:ml-0.5 ds:text-xs ds:font-medium\">{r.cadence}</small>\n )}\n </span>\n )}\n </div>\n <div className=\"ds:text-fg-3 ds:mt-0.5 ds:text-[13px] ds:leading-snug\">{r.detail}</div>\n </div>\n </div>\n );\n })}\n </div>\n {locked && (\n <div className=\"ds:border-rule ds:bg-surface-2 ds:text-fg-4 ds:flex ds:items-center ds:gap-2 ds:border-t ds:px-5 ds:py-2.5 ds:text-[12px]\">\n <LockIcon className=\"ds:size-3.5 ds:shrink-0\" aria-hidden=\"true\" />\n Set by your firm — you can review these terms, but not change them.\n </div>\n )}\n </div>\n );\n },\n);\nProposalBillingTerms.displayName = \"ProposalBillingTerms\";\n\n/* ─── Add-on toggle ───────────────────────────────────────────── */\n\nexport interface ProposalAddOnProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"onToggle\" | \"name\"> {\n /** Add-on name. */\n name: ReactNode;\n /** Short description / cadence note under the name. */\n description?: ReactNode;\n /** Formatted price, e.g. \"$150\" or \"$200\". */\n price?: ReactNode;\n /** Cadence / billing note beside the price, e.g. \"/mo\" or \"One-time\". */\n cadence?: ReactNode;\n /** Added state. */\n selected?: boolean;\n /** Toggle handler. */\n onToggle?: () => void;\n}\n\n/**\n * ProposalAddOn — a compact, checkbox-style toggle for an optional add-on.\n * Lighter than `ProposalPackageCard`: add-ons are secondary extras, so the\n * whole row is one toggle (no separate badge + button), price right-aligned.\n */\nexport const ProposalAddOn = forwardRef<HTMLButtonElement, ProposalAddOnProps>(\n function ProposalAddOn(\n { name, description, price, cadence, selected = false, onToggle, disabled, className, ...props },\n ref,\n ) {\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"checkbox\"\n aria-checked={selected}\n disabled={disabled}\n onClick={onToggle}\n data-selected={selected || undefined}\n className={cn(\n \"ds:group/addon ds:flex ds:w-full ds:items-center ds:gap-3.5 ds:rounded-[12px] ds:border ds:p-4 ds:text-left\",\n \"ds:border-rule ds:bg-surface\",\n \"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:hover:bg-surface-hover\",\n \"ds:data-[selected]:border-[var(--av-accent,var(--color-accent))] ds:data-[selected]:bg-[var(--av-accent-tint,var(--color-accent-tint))]\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n \"ds:disabled:cursor-not-allowed ds:disabled:opacity-60\",\n className,\n )}\n {...props}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n \"ds:flex ds:size-5 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-md ds:border-[1.5px] ds:text-transparent\",\n \"ds:border-rule-strong\",\n \"ds:group-data-[selected]/addon:border-[var(--av-accent,var(--color-accent))] ds:group-data-[selected]/addon:bg-[var(--av-accent,var(--color-accent))] ds:group-data-[selected]/addon:text-[var(--av-accent-contrast,var(--color-fg-on-accent))]\",\n )}\n >\n <CheckIcon className=\"ds:size-3.5\" />\n </span>\n <div className=\"ds:min-w-0 ds:flex-1\">\n <div className=\"ds:text-fg ds:text-sm ds:font-semibold\">{name}</div>\n {description && (\n <div className=\"ds:text-fg-4 ds:group-data-[selected]/addon:text-fg-3 ds:text-xs\">{description}</div>\n )}\n </div>\n {(price != null || cadence != null) && (\n <div className=\"ds:shrink-0 ds:text-right\">\n {price != null && <div className=\"ds:text-fg ds:text-[15px] ds:font-bold ds:tabular\">{price}</div>}\n {cadence != null && (\n <div className=\"ds:text-fg-4 ds:group-data-[selected]/addon:text-fg-3 ds:text-[11.5px]\">{cadence}</div>\n )}\n </div>\n )}\n </button>\n );\n },\n);\nProposalAddOn.displayName = \"ProposalAddOn\";\n\n/* ─── Pricing summary / review total ──────────────────────────── */\n\nexport interface ProposalPricingSummaryProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \"What's included\" rows (`ProposalServiceRow`) — rendered in a 2-col grid. */\n children?: ReactNode;\n /** Billing schedule callout. */\n billing?: {\n title?: ReactNode;\n caption?: ReactNode;\n rows?: { label: ReactNode; value: ReactNode }[];\n };\n /** Discount savings line, e.g. \"You save $200 (annual)\". */\n savings?: ReactNode;\n /** Tax line value, e.g. \"$192.00\". `taxLabel` defaults to \"Tax\". */\n tax?: ReactNode;\n taxLabel?: ReactNode;\n /** Pre-discount total, struck through next to `total`. */\n originalTotal?: ReactNode;\n /** Total due — used for a single-cadence engagement. Omit when `schedule` is set. */\n total?: ReactNode;\n /** Cadence suffix after the total, e.g. \"/ year\". */\n cadence?: ReactNode;\n /** Total row label. Default \"Total due\". */\n totalLabel?: ReactNode;\n /** First-payment + recurring breakdown. Use instead of `total` when billing\n * mixes cadences (e.g. a yearly package + a monthly add-on): the amount due\n * at signing reads prominently, with the ongoing charges listed below. */\n schedule?: {\n /** Amount charged at signing — the prominent figure. */\n dueToday: ReactNode;\n /** Label for the due-now figure. Default \"Due today\". */\n dueTodayLabel?: ReactNode;\n /** Caption under the due-now figure, e.g. \"First payment, on acceptance\". */\n dueTodayCaption?: ReactNode;\n /** Ongoing recurring charges, e.g. [{ label: \"Then\", amount: \"$2,400\", cadence: \"/ year\" }]. */\n then?: { label?: ReactNode; amount: ReactNode; cadence?: ReactNode }[];\n };\n}\n\nexport const ProposalPricingSummary = forwardRef<HTMLDivElement, ProposalPricingSummaryProps>(\n function ProposalPricingSummary(\n {\n children,\n billing,\n savings,\n tax,\n taxLabel = \"Tax\",\n originalTotal,\n total,\n cadence,\n totalLabel = \"Total due\",\n schedule,\n className,\n ...props\n },\n ref,\n ) {\n return (\n <div ref={ref} className={cn(\"ds:@container/summary ds:flex ds:flex-col\", className)} {...props}>\n {children && (\n <div className=\"ds:border-rule ds:grid ds:grid-cols-1 ds:gap-x-6 ds:gap-y-1 ds:rounded-[14px] ds:border ds:p-6 ds:@md/summary:grid-cols-2\">\n {children}\n </div>\n )}\n\n {billing && (\n <div className=\"ds:mt-4 ds:rounded-[14px] ds:border ds:border-[var(--av-accent-tint2,var(--color-accent-tint))] ds:bg-[var(--av-accent-tint,var(--color-accent-tint))] ds:p-5\">\n <div className=\"ds:flex ds:items-center ds:justify-between\">\n <b className=\"ds:text-[13.5px] ds:font-semibold ds:text-[var(--av-accent-soft,var(--color-accent-2))]\">\n {billing.title ?? \"Billing schedule\"}\n </b>\n {billing.caption && (\n <span className=\"ds:text-[11.5px] ds:text-[var(--av-accent-soft,var(--color-accent-2))]\">\n {billing.caption}\n </span>\n )}\n </div>\n {billing.rows?.map((r, i) => (\n <div\n key={i}\n className=\"ds:text-fg-2 ds:mt-2.5 ds:flex ds:items-center ds:justify-between ds:gap-3 ds:text-[13.5px]\"\n >\n <span>{r.label}</span>\n <b className=\"ds:font-semibold ds:tabular\">{r.value}</b>\n </div>\n ))}\n </div>\n )}\n\n {(savings || tax != null) && (\n <div className=\"ds:mt-4 ds:space-y-2\">\n {savings && (\n <div className=\"ds:text-success-fg ds:flex ds:items-center ds:justify-between ds:text-[13.5px] ds:font-medium\">\n <span>Discount</span>\n <span className=\"ds:tabular\">{savings}</span>\n </div>\n )}\n {tax != null && (\n <div className=\"ds:text-fg-3 ds:flex ds:items-center ds:justify-between ds:text-[13.5px]\">\n <span>{taxLabel}</span>\n <span className=\"ds:tabular\">{tax}</span>\n </div>\n )}\n </div>\n )}\n\n {schedule ? (\n <div className=\"ds:border-rule ds:mt-4 ds:border-t ds:pt-4\">\n <div className=\"ds:flex ds:items-baseline ds:justify-between ds:gap-3\">\n <div>\n <div className=\"ds:text-fg ds:text-[15px] ds:font-semibold\">\n {schedule.dueTodayLabel ?? \"Due today\"}\n </div>\n {schedule.dueTodayCaption && (\n <div className=\"ds:text-fg-4 ds:text-xs\">{schedule.dueTodayCaption}</div>\n )}\n </div>\n <span className=\"ds:text-fg ds:text-[26px] ds:font-bold ds:tabular\">{schedule.dueToday}</span>\n </div>\n {schedule.then && schedule.then.length > 0 && (\n <div className=\"ds:border-rule-soft ds:mt-3 ds:space-y-1.5 ds:border-t ds:pt-3\">\n {schedule.then.map((t, i) => (\n <div\n key={i}\n className=\"ds:text-fg-3 ds:flex ds:items-baseline ds:justify-between ds:gap-3 ds:text-[13.5px]\"\n >\n <span>{t.label ?? \"Then\"}</span>\n <span className=\"ds:tabular\">\n <b className=\"ds:text-fg-2 ds:font-semibold\">{t.amount}</b>\n {t.cadence && (\n <small className=\"ds:text-fg-4 ds:ml-1 ds:text-[12px] ds:font-medium\">{t.cadence}</small>\n )}\n </span>\n </div>\n ))}\n </div>\n )}\n </div>\n ) : (\n total != null && (\n <div className=\"ds:border-rule ds:mt-4 ds:flex ds:items-center ds:justify-between ds:border-t ds:pt-4\">\n <span className=\"ds:text-fg ds:text-[15px] ds:font-semibold\">{totalLabel}</span>\n <span className=\"ds:flex ds:items-baseline ds:gap-2\">\n {originalTotal != null && (\n <span className=\"ds:text-fg-4 ds:text-base ds:line-through\">{originalTotal}</span>\n )}\n <span className=\"ds:text-fg ds:text-[22px] ds:font-bold ds:tabular\">{total}</span>\n {cadence && <small className=\"ds:text-fg-4 ds:text-[13px] ds:font-medium\">{cadence}</small>}\n </span>\n </div>\n )\n )}\n </div>\n );\n },\n);\nProposalPricingSummary.displayName = \"ProposalPricingSummary\";\n","\"use client\";\n\nimport { forwardRef, type ReactNode } from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport {\n CheckIcon,\n ClockIcon,\n EyeIcon,\n FileTextIcon,\n InfoIcon,\n PlayIcon,\n} from \"../primitives/icons\";\n\n/**\n * Proposal content building-blocks — the optional pieces a signing package's\n * \"custom pages\" and recipient config render into on the client preview.\n *\n * - `ProposalCustomPage` — a titled custom page; `kind` switches the builder's\n * Video / PDF / Text page types. The body (a video\n * poster, a `PdfPreview`, or rich text) is slotted.\n * - `ProposalNote` — a short callout shown alongside the agreement.\n * - `ProposalSignerList` — the recipients/signers with role + status.\n *\n * Accent classes carry a suite fallback, so a bare block renders un-branded\n * outside an `AgreementViewer` / `[data-av-scope]`.\n *\n * @since 1.12.0\n */\n\n/* ─── Custom page (video / pdf / text) ────────────────────────── */\n\nexport type ProposalCustomPageKind = \"video\" | \"pdf\" | \"text\";\n\nconst KIND_META: Record<ProposalCustomPageKind, { label: string; icon: typeof PlayIcon }> = {\n video: { label: \"Video\", icon: PlayIcon },\n pdf: { label: \"Document\", icon: FileTextIcon },\n text: { label: \"Read\", icon: FileTextIcon },\n};\n\nexport interface ProposalCustomPageProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Builder custom-page type. */\n kind: ProposalCustomPageKind;\n /** Page title. */\n title: ReactNode;\n /** Supporting line under the title. */\n caption?: ReactNode;\n /** Overline label; defaults by kind (\"Video\" / \"Document\" / \"Read\"). */\n label?: ReactNode;\n /** Poster image for `kind=\"video\"` — shown with a play overlay when no\n * `children` are supplied. */\n poster?: string;\n /** Play handler — makes the video poster an actual button. */\n onPlay?: () => void;\n /** Body: a `PdfPreview`, rich text, or a custom embed. Replaces the built-in\n * video poster when provided. */\n children?: ReactNode;\n}\n\nexport const ProposalCustomPage = forwardRef<HTMLDivElement, ProposalCustomPageProps>(\n function ProposalCustomPage(\n { kind, title, caption, label, poster, onPlay, children, className, ...props },\n ref,\n ) {\n const meta = KIND_META[kind];\n const Icon = meta.icon;\n return (\n <div ref={ref} className={cn(\"ds:flex ds:flex-col\", className)} {...props}>\n <div className=\"ds:mb-1.5 ds:flex ds:items-center ds:gap-1.5 ds:text-xs ds:font-semibold ds:tracking-wide ds:text-[var(--av-accent-soft,var(--color-accent-2))]\">\n <Icon className=\"ds:size-3.5\" aria-hidden=\"true\" />\n {label ?? meta.label}\n </div>\n <h2 className=\"ds:font-display ds:text-fg ds:text-[27px] ds:leading-tight ds:font-bold ds:tracking-tight\">\n {title}\n </h2>\n {caption && <p className=\"ds:text-fg-3 ds:mt-2 ds:text-sm ds:leading-relaxed\">{caption}</p>}\n\n <div className=\"ds:mt-5\">\n {kind === \"video\" && !children ? (\n <PlayablePoster poster={poster} onPlay={onPlay} title={title} />\n ) : (\n children\n )}\n </div>\n </div>\n );\n },\n);\nProposalCustomPage.displayName = \"ProposalCustomPage\";\n\nfunction PlayablePoster({\n poster,\n onPlay,\n title,\n}: {\n poster?: string | undefined;\n onPlay?: (() => void) | undefined;\n title: ReactNode;\n}) {\n const inner = (\n <>\n <span\n aria-hidden=\"true\"\n className=\"ds:bg-bg-3 ds:absolute ds:inset-0 ds:bg-cover ds:bg-center\"\n style={poster ? { backgroundImage: `url(${poster})` } : undefined}\n />\n <span aria-hidden=\"true\" className=\"ds:absolute ds:inset-0 ds:bg-black/15\" />\n <span\n aria-hidden=\"true\"\n className=\"ds:rounded-full ds:relative ds:flex ds:size-16 ds:items-center ds:justify-center ds:bg-white/90 ds:text-[var(--av-accent,var(--color-accent))] ds:shadow-raised\"\n >\n <PlayIcon className=\"ds:size-7\" />\n </span>\n </>\n );\n const cls =\n \"ds:relative ds:flex ds:aspect-video ds:w-full ds:items-center ds:justify-center ds:overflow-hidden ds:rounded-[14px] ds:border-rule ds:border\";\n return onPlay ? (\n <button\n type=\"button\"\n onClick={onPlay}\n aria-label={typeof title === \"string\" ? `Play ${title}` : \"Play video\"}\n className={cn(\n cls,\n \"ds:transition-[filter] ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none ds:hover:brightness-105\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n )}\n >\n {inner}\n </button>\n ) : (\n <div className={cls}>{inner}</div>\n );\n}\n\n/* ─── Callout note ────────────────────────────────────────────── */\n\nexport interface ProposalNoteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Optional bold lead line. */\n title?: ReactNode;\n /** Note body. */\n children: ReactNode;\n /** Visual tone. Default \"accent\". */\n tone?: \"accent\" | \"info\";\n /** Leading icon; defaults to an info glyph. */\n icon?: ReactNode;\n}\n\nexport const ProposalNote = forwardRef<HTMLDivElement, ProposalNoteProps>(\n function ProposalNote({ title, children, tone = \"accent\", icon, className, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn(\n \"ds:flex ds:gap-3 ds:rounded-[12px] ds:border ds:p-4 ds:text-[13.5px] ds:leading-relaxed\",\n tone === \"accent\"\n ? \"ds:border-[var(--av-accent-tint2,var(--color-accent-tint))] ds:bg-[var(--av-accent-tint,var(--color-accent-tint))] ds:text-[var(--av-accent-soft,var(--color-accent-2))]\"\n : \"ds:border-rule ds:bg-bg-2 ds:text-fg-2\",\n className,\n )}\n {...props}\n >\n <span aria-hidden=\"true\" className=\"ds:mt-0.5 ds:shrink-0\">\n {icon ?? <InfoIcon className=\"ds:size-4\" />}\n </span>\n <div className=\"ds:min-w-0\">\n {title && <div className=\"ds:text-fg ds:font-semibold\">{title}</div>}\n <div className={cn(title && \"ds:mt-0.5\")}>{children}</div>\n </div>\n </div>\n );\n },\n);\nProposalNote.displayName = \"ProposalNote\";\n\n/* ─── Signer / recipient list ─────────────────────────────────── */\n\nexport type ProposalSignerStatus = \"signed\" | \"pending\" | \"viewed\";\n\nexport interface ProposalSigner {\n name: string;\n email?: string;\n /** Role, e.g. \"Signer\", \"Approver\", \"CC\". */\n role?: string;\n status?: ProposalSignerStatus;\n /** Status timestamp for the firm tracking view, e.g. \"Signed Jun 6, 2:14 PM\". */\n at?: ReactNode;\n}\n\nconst STATUS_META: Record<\n ProposalSignerStatus,\n { label: string; icon: typeof CheckIcon; className: string }\n> = {\n signed: {\n label: \"Signed\",\n icon: CheckIcon,\n className: \"ds:text-success-fg ds:bg-success-bg ds:border-success-line\",\n },\n viewed: {\n label: \"Viewed\",\n icon: EyeIcon,\n className:\n \"ds:text-[var(--av-accent-soft,var(--color-accent-2))] ds:bg-[var(--av-accent-tint,var(--color-accent-tint))] ds:border-[var(--av-accent-tint2,var(--color-accent-tint))]\",\n },\n pending: { label: \"Pending\", icon: ClockIcon, className: \"ds:text-fg-3 ds:bg-bg-2 ds:border-rule\" },\n};\n\nexport interface ProposalSignerListProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n signers: ProposalSigner[];\n /** Section label. Default \"Recipients\". */\n title?: ReactNode;\n}\n\nexport const ProposalSignerList = forwardRef<HTMLDivElement, ProposalSignerListProps>(\n function ProposalSignerList({ signers, title = \"Recipients\", className, ...props }, ref) {\n return (\n <div ref={ref} className={cn(\"ds:flex ds:flex-col\", className)} {...props}>\n {title && (\n <div className=\"ds:text-fg-3 ds:mb-2 ds:text-[11.5px] ds:font-semibold ds:tracking-wide\">{title}</div>\n )}\n <div className=\"ds:border-rule ds:divide-rule ds:divide-y ds:overflow-hidden ds:rounded-[12px] ds:border\">\n {signers.map((s, i) => {\n const status = s.status ? STATUS_META[s.status] : null;\n const StatusIcon = status?.icon;\n const initials = s.name\n .split(\" \")\n .map((w) => w[0])\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n return (\n <div key={i} className=\"ds:flex ds:items-center ds:gap-3 ds:px-4 ds:py-3\">\n <span\n aria-hidden=\"true\"\n className=\"ds:flex ds:size-9 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-full ds:bg-[var(--av-accent-tint,var(--color-accent-tint))] ds:text-[12.5px] ds:font-semibold ds:text-[var(--av-accent-soft,var(--color-accent-2))]\"\n >\n {initials}\n </span>\n <div className=\"ds:min-w-0 ds:flex-1\">\n <div className=\"ds:text-fg ds:truncate ds:text-sm ds:font-medium\">\n {s.name}\n {s.role && <span className=\"ds:text-fg-4 ds:ml-2 ds:text-xs ds:font-normal\">{s.role}</span>}\n </div>\n {s.email && <div className=\"ds:text-fg-4 ds:truncate ds:text-xs\">{s.email}</div>}\n </div>\n {status && StatusIcon && (\n <div className=\"ds:flex ds:shrink-0 ds:flex-col ds:items-end ds:gap-1\">\n <span\n className={cn(\n \"ds:inline-flex ds:items-center ds:gap-1 ds:rounded-full ds:border ds:px-2 ds:py-0.5 ds:text-[11px] ds:font-medium\",\n status.className,\n )}\n >\n <StatusIcon className=\"ds:size-3\" aria-hidden=\"true\" />\n {status.label}\n </span>\n {s.at != null && <span className=\"ds:text-fg-4 ds:text-[11px]\">{s.at}</span>}\n </div>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n);\nProposalSignerList.displayName = \"ProposalSignerList\";\n","\"use client\";\n\nimport { forwardRef, useState, type ReactNode } from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport { CheckIcon, CreditCardIcon, LockIcon, PenSignIcon } from \"../primitives/icons\";\n\nfunction deriveInitials(name: string): string {\n return name\n .trim()\n .split(/\\s+/)\n .filter(Boolean)\n .map((w) => w[0])\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n\n/**\n * Proposal signing building-blocks — the client-preview pieces for the\n * agreement's final step.\n *\n * - `ProposalSignatureBlock` — the type/draw signature area; `signed` flips it\n * to a read-only signed preview.\n * - `ProposalConsentGate` — the \"require explicit approval before signing\"\n * checkbox that gates the Sign CTA.\n * - `ProposalPaymentCapture` — the \"payment at signing\" card/bank capture block.\n *\n * Presentational: persistence, signature canvas, and payment tokenization stay\n * with the consumer. Accent classes carry a suite fallback.\n *\n * @since 1.12.0\n */\n\n/* ─── Signature block ─────────────────────────────────────────── */\n\nexport interface ProposalSignatureBlockProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Read-only signed preview — the recorded signer name + initials. */\n signed?: boolean;\n /** Recorded signer name (used in the `signed` read-only preview). */\n name?: string | undefined;\n /** Recorded initials; defaults to the name's initials. */\n initials?: string;\n /** Initial typed name when interactive (defaults to blank — the signer types). */\n defaultName?: string;\n /** Reports the typed name + initials as the signer types (interactive). */\n onChange?: (value: { name: string; initials: string }) => void;\n /** Placeholder shown in the signature face + name field when empty. */\n placeholder?: string;\n /** CSS font-family for the rendered signature face. Default a serif. */\n signatureFont?: string;\n /** Footer slot — typically the Sign CTA or a signed-on note. */\n footer?: ReactNode;\n /** Drop the Type / Draw tab strip — for hosts that own the mode switch\n * themselves, or that only offer one mode. Default false.\n * @since 1.38.0 */\n hideModeTabs?: boolean;\n}\n\nexport const ProposalSignatureBlock = forwardRef<HTMLDivElement, ProposalSignatureBlockProps>(\n function ProposalSignatureBlock(\n {\n signed = false,\n name = \"\",\n initials,\n defaultName = \"\",\n onChange,\n placeholder = \"Type your full name\",\n signatureFont = \"Georgia, serif\",\n footer,\n hideModeTabs = false,\n className,\n ...props\n },\n ref,\n ) {\n const [nameVal, setNameVal] = useState(defaultName);\n const [initialsVal, setInitialsVal] = useState(\"\");\n const [initialsTouched, setInitialsTouched] = useState(false);\n\n // Signed: show the recorded values read-only. Interactive: the signer types,\n // and the signature face + auto-derived initials track the input live.\n const displayName = signed ? name : nameVal;\n const displayInitials = signed\n ? (initials ?? deriveInitials(name))\n : initialsTouched\n ? initialsVal\n : deriveInitials(nameVal);\n\n const emitChange = (n: string, i: string) => onChange?.({ name: n, initials: i });\n\n const handleName = (v: string) => {\n setNameVal(v);\n emitChange(v, initialsTouched ? initialsVal : deriveInitials(v));\n };\n const handleInitials = (v: string) => {\n setInitialsTouched(true);\n setInitialsVal(v);\n emitChange(nameVal, v);\n };\n\n return (\n <div\n ref={ref}\n className={cn(\"ds:@container/signature ds:flex ds:flex-col\", className)}\n {...props}\n >\n {!hideModeTabs && (\n <div className=\"ds:border-rule ds:mb-4 ds:flex ds:gap-6 ds:border-b\">\n <span className=\"ds:border-[var(--av-accent,var(--color-accent))] ds:text-fg ds:-mb-px ds:border-b-2 ds:pb-2.5 ds:text-sm ds:font-medium\">\n Type\n </span>\n <span className=\"ds:text-fg-4 ds:pb-2.5 ds:text-sm ds:font-medium\">Draw</span>\n </div>\n )}\n {/* The block is its own container (`@container/signature`): the tiles\n and the field row reflow off the block's width, not the viewport, so\n a narrow signing column stacks instead of overflowing. Above 42rem\n the metrics are the wide ones it has always rendered. */}\n <div className=\"ds:flex ds:flex-col ds:gap-4 ds:@2xl/signature:flex-row\">\n <div className=\"ds:border-rule ds:bg-surface-2 ds:flex ds:h-[84px] ds:flex-none ds:items-center ds:overflow-hidden ds:rounded-[12px] ds:border ds:px-4 ds:@2xl/signature:h-[118px] ds:@2xl/signature:flex-1 ds:@2xl/signature:px-7\">\n <span\n className={cn(\"ds:text-3xl ds:leading-none ds:font-semibold ds:@2xl/signature:text-[46px]\", displayName ? \"ds:text-fg\" : \"ds:text-fg-4\")}\n style={{ fontFamily: signatureFont }}\n >\n {displayName || placeholder}\n </span>\n </div>\n <div className=\"ds:border-rule ds:bg-surface-2 ds:flex ds:h-[84px] ds:w-full ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[12px] ds:border ds:@2xl/signature:h-[118px] ds:@2xl/signature:w-[168px]\">\n <span\n className={cn(\"ds:text-2xl ds:leading-none ds:@2xl/signature:text-[34px]\", displayInitials ? \"ds:text-fg-3\" : \"ds:text-fg-4\")}\n style={{ fontFamily: signatureFont }}\n >\n {displayInitials || \"—\"}\n </span>\n </div>\n </div>\n <div\n className=\"ds:mt-5 ds:grid ds:grid-cols-1 ds:gap-3.5 ds:@2xl/signature:grid-cols-[1fr_120px]\"\n >\n <label className=\"ds:flex ds:flex-col ds:gap-1.5\">\n <span className=\"ds:text-fg-3 ds:text-xs ds:font-medium\">Your legal name</span>\n <input\n value={displayName}\n readOnly={signed}\n onChange={(e) => handleName(e.target.value)}\n placeholder={signed ? undefined : placeholder}\n aria-label=\"Your legal name\"\n className=\"ds:border-rule-strong ds:rounded-input ds:text-fg-2 ds:bg-surface ds:h-10 ds:border ds:px-3 ds:text-sm ds:read-only:bg-[var(--color-bg-2)]\"\n />\n </label>\n <label className=\"ds:flex ds:flex-col ds:gap-1.5\">\n <span className=\"ds:text-fg-3 ds:text-xs ds:font-medium\">Initials</span>\n <input\n value={displayInitials}\n readOnly={signed}\n onChange={(e) => handleInitials(e.target.value)}\n placeholder={signed ? undefined : \"—\"}\n aria-label=\"Initials\"\n className=\"ds:border-rule-strong ds:rounded-input ds:text-fg-2 ds:bg-surface ds:h-10 ds:border ds:px-3 ds:text-sm ds:read-only:bg-[var(--color-bg-2)]\"\n />\n </label>\n </div>\n {footer && <div className=\"ds:mt-6\">{footer}</div>}\n </div>\n );\n },\n);\nProposalSignatureBlock.displayName = \"ProposalSignatureBlock\";\n\n/* ─── Consent gate + Sign CTA ─────────────────────────────────── */\n\nexport interface ProposalConsentGateProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Consent label (the explicit-approval statement). */\n children: ReactNode;\n /** Checkbox state. */\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n /** Already-signed read-only state — shows the signed note instead of the CTA. */\n signed?: boolean;\n /** Note shown when `signed`, e.g. \"Signed on June 6, 2026\". */\n signedNote?: ReactNode;\n /** Sign CTA handler — renders the button (disabled until `checked`). */\n onSign?: (() => void) | undefined;\n /** Sign CTA label. Default \"Sign & approve\". */\n signLabel?: ReactNode;\n /** Extra disable condition for the Sign CTA, e.g. a name not yet typed. */\n disabled?: boolean;\n}\n\nexport const ProposalConsentGate = forwardRef<HTMLDivElement, ProposalConsentGateProps>(\n function ProposalConsentGate(\n { children, checked = false, onCheckedChange, signed = false, signedNote, onSign, signLabel = \"Sign & approve\", disabled = false, className, ...props },\n ref,\n ) {\n return (\n <div ref={ref} className={cn(\"ds:flex ds:flex-col ds:gap-4\", className)} {...props}>\n {!signed && (\n <label className=\"ds:flex ds:cursor-pointer ds:items-start ds:gap-2.5 ds:text-[13.5px] ds:leading-relaxed\">\n <input\n type=\"checkbox\"\n checked={checked}\n onChange={(e) => onCheckedChange?.(e.target.checked)}\n className=\"ds:mt-0.5 ds:size-4 ds:shrink-0 ds:rounded ds:accent-[var(--av-accent,var(--color-accent))]\"\n />\n <span className=\"ds:text-fg-2\">{children}</span>\n </label>\n )}\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-4\">\n {signed ? (\n <span className=\"ds:text-success-fg ds:flex ds:items-center ds:gap-2 ds:text-[13px] ds:font-medium\">\n <CheckIcon className=\"ds:size-4 ds:shrink-0\" aria-hidden=\"true\" />\n {signedNote ?? \"This agreement has been signed.\"}\n </span>\n ) : (\n <span className=\"ds:text-fg-4 ds:flex ds:items-center ds:gap-1.5 ds:text-[12.5px]\">\n <LockIcon className=\"ds:size-3.5\" aria-hidden=\"true\" /> Secure e-signature\n </span>\n )}\n {onSign && (\n <button\n type=\"button\"\n onClick={onSign}\n disabled={signed || !checked || disabled}\n className={cn(\n \"ds:inline-flex ds:h-[46px] ds:items-center ds:gap-2 ds:rounded-[12px] ds:px-5 ds:text-[14.5px] ds:font-semibold\",\n \"ds:transition-[filter] ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n \"ds:bg-[var(--av-accent,var(--color-accent))] ds:text-[var(--av-accent-contrast,var(--color-fg-on-accent))] ds:hover:brightness-105\",\n \"ds:disabled:bg-bg-disabled ds:disabled:text-fg-disabled ds:disabled:cursor-not-allowed ds:disabled:brightness-100\",\n )}\n >\n <PenSignIcon className=\"ds:size-4\" aria-hidden=\"true\" />\n {signLabel}\n </button>\n )}\n </div>\n </div>\n );\n },\n);\nProposalConsentGate.displayName = \"ProposalConsentGate\";\n\n/* ─── Payment capture ─────────────────────────────────────────── */\n\nexport interface ProposalPaymentCaptureProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Heading. Default \"Payment at signing\". */\n title?: ReactNode;\n /** Amount captured at signing, e.g. \"$2,400\". */\n amount?: ReactNode;\n /** Caption under the title, e.g. \"Billed today on acceptance\". */\n caption?: ReactNode;\n /** Method icon hint. Default \"card\". */\n method?: \"card\" | \"bank\";\n /** Saved method last-4 — renders a read-only \"•••• 4242\" line. */\n capturedLast4?: string;\n /** Custom form fields (replaces the placeholder when provided). */\n children?: ReactNode;\n}\n\nexport const ProposalPaymentCapture = forwardRef<HTMLDivElement, ProposalPaymentCaptureProps>(\n function ProposalPaymentCapture(\n { title = \"Payment at signing\", amount, caption, method = \"card\", capturedLast4, children, className, ...props },\n ref,\n ) {\n return (\n <div\n ref={ref}\n className={cn(\"ds:border-rule ds:rounded-[14px] ds:border ds:p-5\", className)}\n {...props}\n >\n <div className=\"ds:flex ds:items-center ds:gap-3\">\n <span\n aria-hidden=\"true\"\n className=\"ds:rounded-card ds:flex ds:size-10 ds:shrink-0 ds:items-center ds:justify-center ds:bg-[var(--av-accent-tint,var(--color-accent-tint))] ds:text-[var(--av-accent,var(--color-accent))]\"\n >\n <CreditCardIcon className=\"ds:size-5\" />\n </span>\n <div className=\"ds:flex-1\">\n <div className=\"ds:text-fg ds:text-sm ds:font-semibold\">{title}</div>\n {caption && <div className=\"ds:text-fg-4 ds:text-xs\">{caption}</div>}\n </div>\n {amount != null && <div className=\"ds:text-fg ds:text-lg ds:font-bold ds:tabular\">{amount}</div>}\n </div>\n\n <div className=\"ds:mt-4\">\n {children ??\n (capturedLast4 ? (\n <div className=\"ds:border-rule ds:flex ds:items-center ds:gap-2.5 ds:rounded-[10px] ds:border ds:px-3.5 ds:py-3\">\n <CreditCardIcon className=\"ds:text-fg-4 ds:size-4\" aria-hidden=\"true\" />\n <span className=\"ds:text-fg-2 ds:text-sm ds:font-medium ds:tabular\">\n {method === \"bank\" ? \"Bank account\" : \"Card\"} •••• {capturedLast4}\n </span>\n <CheckIcon className=\"ds:text-success-fg ds:ml-auto ds:size-4\" aria-hidden=\"true\" />\n </div>\n ) : (\n <div className=\"ds:border-rule ds:text-fg-4 ds:flex ds:h-11 ds:items-center ds:rounded-[10px] ds:border ds:border-dashed ds:px-3.5 ds:text-sm\">\n {method === \"bank\" ? \"Bank account details\" : \"Card number\"}\n </div>\n ))}\n </div>\n </div>\n );\n },\n);\nProposalPaymentCapture.displayName = \"ProposalPaymentCapture\";\n","\"use client\";\n\nimport { forwardRef, Fragment } from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport { Input } from \"../primitives/input\";\n\n/**\n * Grid — a labeled-rows × typed-columns matrix of editable cells.\n *\n * A fixed grid where every row has a header down the left edge and every\n * column declares the input type its cells accept (text / number / currency\n * / date). Each cell is an editable input; the whole matrix is a single\n * controlled value keyed `rowKey → columnKey → string`.\n *\n * ┌───────────────┬──────────┬──────────┬──────────┐\n * │ │ Taxpayer │ Spouse │ Notes │ ← typed columns\n * ├───────────────┼──────────┼──────────┼──────────┤\n * │ Wages (W-2) │ [ $ ___ ]│ [ $ ___ ]│ [ ___ ] │ ← labeled row\n * │ Interest │ [ $ ___ ]│ [ $ ___ ]│ [ ___ ] │\n * └───────────────┴──────────┴──────────┴──────────┘\n *\n * This is the standalone form of the `Questions` `labeled-table` type — that\n * branch renders a `Grid` internally, so the two share one implementation and\n * one value contract.\n *\n * Fully controlled: pass `columns`, `rows`, `value`, and `onChange`. The\n * component never holds cell state itself.\n */\n\n/** Input type a column's cells accept. Drives keyboard, input mode, and affix. */\nexport type GridInputType = \"text\" | \"number\" | \"currency\" | \"date\";\n\nexport interface GridColumn {\n /** Stable key; the second-level key in the value object. */\n key: string;\n /** Header text shown above the column. */\n label: string;\n /** Cell input type. Defaults to `\"text\"`. */\n inputType?: GridInputType | undefined;\n /** Relative grid weight for this column (a `fr` unit). Defaults to `1`. */\n width?: number | undefined;\n /** Placeholder for this column's empty cells. */\n placeholder?: string;\n}\n\nexport interface GridRow {\n /** Stable key; the first-level key in the value object. */\n key: string;\n /** Row header text shown down the left edge. */\n label: string;\n}\n\n/** Cell values, keyed `rowKey → columnKey → value`. */\nexport type GridValue = Record<string, Record<string, string>>;\n\nexport interface GridProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Typed columns, left-to-right. */\n columns: GridColumn[];\n /** Labeled rows, top-to-bottom. */\n rows: GridRow[];\n /** Controlled cell values (`rowKey → columnKey → value`). */\n value: GridValue;\n /** Called with the full next value object whenever any cell changes. */\n onChange: (value: GridValue) => void;\n /** Accessible name for the matrix (also prefixes each cell's aria-label). */\n ariaLabel?: string;\n /** Header text for the top-left corner cell (above the row headers). */\n rowHeaderLabel?: string;\n /** Prefix shown inside `currency` cells. Defaults to `\"$\"`. */\n currencySymbol?: string;\n /** Minimum matrix width in px before it scrolls horizontally. Defaults to `560`. */\n minWidth?: number;\n /** Disable every cell. */\n disabled?: boolean;\n}\n\nexport const Grid = forwardRef<HTMLDivElement, GridProps>(function Grid(\n {\n columns,\n rows,\n value,\n onChange,\n ariaLabel,\n rowHeaderLabel,\n currencySymbol = \"$\",\n minWidth = 560,\n disabled = false,\n className,\n ...props\n },\n ref,\n) {\n const updateCell = (rowKey: string, colKey: string, nextValue: string) => {\n onChange({\n ...value,\n [rowKey]: { ...(value[rowKey] ?? {}), [colKey]: nextValue },\n });\n };\n\n return (\n <div ref={ref} className={cn(\"ds:overflow-x-auto\", className)} {...props}>\n <div\n role=\"group\"\n aria-label={ariaLabel}\n className=\"ds:grid ds:gap-2\"\n style={{\n minWidth: `${minWidth}px`,\n gridTemplateColumns: `minmax(120px,max-content) ${columns\n .map((column) => `minmax(0, ${column.width ?? 1}fr)`)\n .join(\" \")}`,\n }}\n >\n {rowHeaderLabel ? (\n <span className=\"ds:text-fg-3 ds:flex ds:items-end ds:px-1 ds:text-[12px] ds:font-semibold\">\n {rowHeaderLabel}\n </span>\n ) : (\n <span aria-hidden=\"true\" />\n )}\n {columns.map((column) => (\n <span key={column.key} className=\"ds:text-fg-3 ds:flex ds:items-end ds:px-1 ds:text-[12px] ds:font-semibold\">\n {column.label}\n </span>\n ))}\n {rows.map((row) => (\n <Fragment key={row.key}>\n <span className=\"ds:text-fg ds:flex ds:items-center ds:text-[13px] ds:font-semibold\">{row.label}</span>\n {columns.map((column) => (\n <Input\n key={column.key}\n type={column.inputType === \"date\" ? \"date\" : \"text\"}\n value={value[row.key]?.[column.key] ?? \"\"}\n onChange={(event) => updateCell(row.key, column.key, event.target.value)}\n placeholder={column.placeholder}\n aria-label={[ariaLabel, row.label, column.label].filter(Boolean).join(\" \")}\n disabled={disabled}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n inputMode={\n column.inputType === \"number\" || column.inputType === \"currency\"\n ? \"decimal\"\n : undefined\n }\n prefixIcon={\n column.inputType === \"currency\" ? (\n <span className=\"ds:text-xs ds:font-semibold\">{currencySymbol}</span>\n ) : undefined\n }\n />\n ))}\n </Fragment>\n ))}\n </div>\n </div>\n );\n});\n\nGrid.displayName = \"Grid\";\n","\"use client\";\n\nimport { forwardRef } from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport { Button } from \"../primitives/button\";\nimport { Checkbox } from \"../primitives/checkbox\";\nimport { FileChip } from \"../primitives/file-chip\";\nimport { FileUpload } from \"../primitives/file-upload\";\nimport {\n CheckCircleSolidIcon,\n HelpCircleIcon,\n MinusIcon,\n PenSignIcon,\n PlusIcon,\n TrashIcon,\n} from \"../primitives/icons\";\nimport { Input } from \"../primitives/input\";\nimport { Select } from \"../primitives/select\";\nimport { Textarea } from \"../primitives/textarea\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../primitives/tooltip\";\nimport { Grid } from \"./grid\";\n\n/**\n * The version of the `QuestionType` contract this build ships (W8-04).\n *\n * `QuestionType` is a cross-service contract: TAX's backend persists these\n * strings and its renderer switches on them, so the union is not free to\n * change with a component refactor. Adding or removing a member means bumping\n * this constant, adding a changelog entry below, and publishing the matching\n * `docs/contracts/question-types.v<version>.json` fixture — the contract test\n * (`__tests__/question-type-contract.test.ts`) fails otherwise.\n *\n * ### Changelog\n * - **1** (1.38.0) — first versioned snapshot of the union that shipped in\n * 1.12.0: the 24 members listed in `QUESTION_TYPES`. No change to the types\n * themselves; this version records them.\n *\n * @experimental The versioning scheme is experimental until D18 (contract\n * ownership) is decided; the members themselves are stable.\n */\nexport const QUESTION_TYPE_CONTRACT_VERSION = 1;\n\n/**\n * Every `QuestionType`, in contract order — the runtime mirror of the union,\n * for iterating, validating a payload, or generating a picker.\n *\n * @experimental\n */\nexport const QUESTION_TYPES = [\n \"short-text\",\n \"long-text\",\n \"email\",\n \"phone\",\n \"ssn-sin\",\n \"date\",\n \"number\",\n \"currency\",\n \"percentage\",\n \"single-choice\",\n \"multi-choice\",\n \"yes-no\",\n \"dropdown\",\n \"multi-select\",\n \"address\",\n \"file-upload\",\n \"table\",\n \"repeater\",\n \"signature\",\n \"section-header\",\n \"consent-checkbox\",\n \"name\",\n \"labeled-table\",\n \"number-stepper\",\n] as const;\n\nexport type QuestionType =\n | \"short-text\"\n | \"long-text\"\n | \"email\"\n | \"phone\"\n | \"ssn-sin\"\n | \"date\"\n | \"number\"\n | \"currency\"\n | \"percentage\"\n | \"single-choice\"\n | \"multi-choice\"\n | \"yes-no\"\n | \"dropdown\"\n | \"multi-select\"\n | \"address\"\n | \"file-upload\"\n | \"table\"\n | \"repeater\"\n | \"signature\"\n | \"section-header\"\n | \"consent-checkbox\"\n | \"name\"\n | \"labeled-table\"\n | \"number-stepper\";\n\nexport interface QuestionOption {\n value: string;\n label: string;\n formLabel?: string;\n helpText?: string;\n disabled?: boolean;\n}\n\nexport interface QuestionAddressValue {\n line1?: string;\n line2?: string;\n city?: string;\n region?: string;\n postalCode?: string;\n country?: string;\n}\n\n/** Personal-name payload for the `name` variant. */\nexport interface QuestionNameValue {\n first?: string;\n middle?: string;\n last?: string;\n suffix?: string;\n}\n\n/** Question-level help/tip rendered as a tooltip beside the title. */\nexport interface QuestionHelp {\n title?: string;\n body: string;\n}\n\nexport interface QuestionTableColumn {\n key: string;\n label: string;\n placeholder?: string;\n inputType?: \"text\" | \"number\" | \"date\" | \"currency\";\n}\n\nexport type QuestionTableRow = Record<string, string>;\n\n/** Column of the fixed `labeled-table` matrix. `width` is a relative grid weight. */\nexport interface QuestionLabeledColumn {\n key: string;\n title: string;\n width?: number;\n inputType?: \"text\" | \"number\" | \"date\" | \"currency\";\n}\n\n/** Fixed row header (down the left edge) of the `labeled-table` matrix. */\nexport interface QuestionLabeledRow {\n key: string;\n title: string;\n}\n\n/** Cell text for the `labeled-table` matrix, keyed rowKey → colKey → value. */\nexport type QuestionLabeledValue = Record<string, Record<string, string>>;\n\nexport interface QuestionFileValue {\n name: string;\n size?: number;\n kind?: \"doc\" | \"sheet\" | \"image\" | \"generic\";\n}\n\nexport interface QuestionsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n index?: number;\n title: string;\n description?: string | undefined;\n type?: QuestionType;\n required?: boolean;\n chrome?: \"card\" | \"plain\";\n sectionLabel?: string | undefined;\n hideHeader?: boolean;\n options?: QuestionOption[];\n value?: string;\n values?: string[];\n placeholder?: string;\n help?: QuestionHelp;\n addressValue?: QuestionAddressValue;\n nameValue?: QuestionNameValue;\n showSuffix?: boolean;\n tableColumns?: QuestionTableColumn[];\n tableRows?: QuestionTableRow[];\n labeledColumns?: QuestionLabeledColumn[];\n labeledRows?: QuestionLabeledRow[];\n labeledValue?: QuestionLabeledValue;\n files?: QuestionFileValue[];\n accept?: string;\n maxSize?: number;\n multiple?: boolean;\n currencySymbol?: string;\n /** Lower bound for `number-stepper`, and for a count-driven `repeater`. */\n min?: number;\n /** Upper bound for `number-stepper`, and max item count for a count-driven `repeater`. */\n max?: number;\n step?: number;\n /** When set on a `repeater`, renders a bounded stepper that drives the number of item grids. */\n countLabel?: string;\n /**\n * Noun for each `repeater` entry card header, e.g. `\"U.S. presence period\"` →\n * \"U.S. presence period 1\". Defaults to the generic \"Item\" when unset.\n */\n itemNoun?: string;\n onValueChange?: (value: string) => void;\n onValuesChange?: (values: string[]) => void;\n onAddressChange?: (value: QuestionAddressValue) => void;\n onNameChange?: (value: QuestionNameValue) => void;\n onLabeledChange?: (value: QuestionLabeledValue) => void;\n onTableRowsChange?: (rows: QuestionTableRow[]) => void;\n onFilesSelected?: (files: File[]) => void;\n /** When set, each uploaded file chip in the `file-upload` type shows a remove\n * button that calls this with the file and its index. */\n onFileRemove?: (file: QuestionFileValue, index: number) => void;\n}\n\nconst defaultOptions: QuestionOption[] = [\n { value: \"yes\", label: \"Yes\" },\n { value: \"no\", label: \"No\" },\n { value: \"not-sure\", label: \"Not sure\" },\n];\n\nexport const Questions = forwardRef<HTMLDivElement, QuestionsProps>(function Questions(\n {\n index,\n title,\n description,\n type = \"short-text\",\n required = false,\n chrome = \"card\",\n sectionLabel,\n hideHeader = false,\n options = defaultOptions,\n value = \"\",\n values = [],\n placeholder,\n help,\n addressValue = {},\n nameValue = {},\n showSuffix = true,\n tableColumns = [],\n tableRows = [],\n labeledColumns = [],\n labeledRows = [],\n labeledValue = {},\n files = [],\n accept,\n maxSize,\n multiple,\n currencySymbol = \"$\",\n min = 0,\n max,\n step = 1,\n countLabel,\n itemNoun,\n onValueChange,\n onValuesChange,\n onAddressChange,\n onNameChange,\n onLabeledChange,\n onTableRowsChange,\n onFilesSelected,\n onFileRemove,\n className,\n ...props\n },\n ref,\n) {\n const humanIndex = typeof index === \"number\" ? index + 1 : undefined;\n const isSectionHeader = type === \"section-header\";\n const isPlain = chrome === \"plain\" || isSectionHeader;\n const showHeader = isSectionHeader || !hideHeader;\n\n const toggleOption = (optionValue: string, checked: boolean) => {\n const nextValues = checked\n ? Array.from(new Set([...values, optionValue]))\n : values.filter((item) => item !== optionValue);\n\n onValuesChange?.(nextValues);\n };\n\n const updateAddress = (key: keyof QuestionAddressValue, nextValue: string) => {\n onAddressChange?.({ ...addressValue, [key]: nextValue });\n };\n\n const updateName = (key: keyof QuestionNameValue, nextValue: string) => {\n onNameChange?.({ ...nameValue, [key]: nextValue });\n };\n\n const updateRow = (rowIndex: number, key: string, nextValue: string) => {\n onTableRowsChange?.(\n tableRows.map((row, index) => (index === rowIndex ? { ...row, [key]: nextValue } : row)),\n );\n };\n\n const emptyRow = (): QuestionTableRow =>\n tableColumns.reduce<QuestionTableRow>((row, column) => ({ ...row, [column.key]: \"\" }), {});\n\n const addRow = () => {\n onTableRowsChange?.([...tableRows, emptyRow()]);\n };\n\n const removeRow = (rowIndex: number) => {\n onTableRowsChange?.(tableRows.filter((_, index) => index !== rowIndex));\n };\n\n // Count-driven `repeater`: a bounded stepper adds empty item grids or trims trailing ones.\n const setRowCount = (nextCount: number) => {\n const clamped = Math.max(min, max != null ? Math.min(nextCount, max) : nextCount);\n if (clamped > tableRows.length) {\n const added = Array.from({ length: clamped - tableRows.length }, emptyRow);\n onTableRowsChange?.([...tableRows, ...added]);\n } else if (clamped < tableRows.length) {\n onTableRowsChange?.(tableRows.slice(0, clamped));\n }\n };\n\n return (\n <section\n ref={ref}\n className={cn(\n \"ds:font-body\",\n isPlain ? \"ds:bg-transparent\" : \"ds:border-rule ds:bg-surface ds:shadow-card ds:rounded-[18px] ds:border ds:p-5\",\n className,\n )}\n {...props}\n >\n {showHeader && (\n <div className={cn(\"ds:flex ds:items-start ds:gap-3\", !isSectionHeader && \"ds:mb-4\")}>\n {humanIndex && !isPlain && (\n <span\n aria-hidden=\"true\"\n className=\"ds:bg-brand-bg ds:text-brand ds:grid ds:size-7 ds:shrink-0 ds:place-items-center ds:rounded-full ds:text-xs ds:font-bold\"\n >\n {humanIndex}\n </span>\n )}\n\n <div className=\"ds:min-w-0 ds:flex-1\">\n {(sectionLabel || isSectionHeader) && (\n <p className=\"ds:text-brand ds:mb-1 ds:text-[11px] ds:font-bold ds:tracking-[0.12em] ds:uppercase\">\n {sectionLabel}\n </p>\n )}\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-2\">\n <h3\n className={cn(\n \"ds:text-fg\",\n isSectionHeader\n ? \"ds:text-[22px] ds:leading-7 ds:font-bold\"\n : \"ds:text-[14px] ds:leading-5 ds:font-bold\",\n )}\n >\n {title}\n </h3>\n {help && <HelpTip title={help.title ?? title} body={help.body} />}\n {required && (\n <span className=\"ds:bg-brand-bg ds:text-brand ds:rounded-full ds:px-2 ds:py-0.5 ds:text-[11px] ds:font-bold\">\n Required\n </span>\n )}\n </div>\n {description && type !== \"consent-checkbox\" && (\n <p className=\"ds:text-fg-3 ds:mt-1 ds:text-[13px] ds:leading-5\">{description}</p>\n )}\n </div>\n </div>\n )}\n\n {type === \"section-header\" && null}\n\n {type === \"short-text\" && (\n <Input\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n placeholder={placeholder ?? \"Type your answer\"}\n aria-label={title}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n )}\n\n {type === \"email\" && (\n <Input\n type=\"email\"\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n placeholder={placeholder ?? \"client@example.com\"}\n aria-label={title}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n )}\n\n {type === \"phone\" && (\n <Input\n type=\"tel\"\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n placeholder={placeholder ?? \"(555) 123-4567\"}\n aria-label={title}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n )}\n\n {type === \"ssn-sin\" && (\n <Input\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n placeholder={placeholder ?? \"Enter SSN or SIN\"}\n aria-label={title}\n inputMode=\"numeric\"\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n )}\n\n {type === \"date\" && (\n <Input\n type=\"date\"\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n aria-label={title}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n )}\n\n {type === \"number\" && (\n <Input\n type=\"number\"\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n placeholder={placeholder ?? \"0\"}\n aria-label={title}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n )}\n\n {type === \"number-stepper\" && (\n <NumberStepper\n value={Number(value) || 0}\n onValueChange={(next) => onValueChange?.(String(next))}\n min={min}\n max={max}\n step={step}\n ariaLabel={title}\n />\n )}\n\n {type === \"currency\" && (\n <Input\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n placeholder={placeholder ?? \"0.00\"}\n aria-label={title}\n inputMode=\"decimal\"\n prefixIcon={<span className=\"ds:text-xs ds:font-semibold\">{currencySymbol}</span>}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n )}\n\n {type === \"percentage\" && (\n <Input\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n placeholder={placeholder ?? \"0\"}\n aria-label={title}\n inputMode=\"decimal\"\n suffixIcon={<span className=\"ds:text-xs ds:font-semibold\">%</span>}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n )}\n\n {type === \"long-text\" && (\n <Textarea\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n placeholder={placeholder ?? \"Write a detailed answer\"}\n aria-label={title}\n autoResize\n className=\"ds:rounded-[12px] ds:text-[14px]\"\n />\n )}\n\n {(type === \"single-choice\" || type === \"yes-no\") && (\n <div\n className={cn(\n \"ds:grid ds:gap-3\",\n type === \"yes-no\" ? \"ds:grid-cols-[repeat(auto-fit,minmax(78px,max-content))]\" : \"\",\n )}\n role=\"radiogroup\"\n aria-label={title}\n >\n {(type === \"yes-no\"\n ? [\n { value: \"yes\", label: \"Yes\" },\n { value: \"no\", label: \"No\" },\n ]\n : options\n ).map((option) => (\n <QuestionOptionButton\n key={option.value}\n option={option}\n selected={value === option.value}\n compact={type === \"yes-no\"}\n role=\"radio\"\n aria-checked={value === option.value}\n onClick={() => onValueChange?.(option.value)}\n />\n ))}\n </div>\n )}\n\n {type === \"dropdown\" && (\n <Select\n options={options}\n value={value}\n onValueChange={onValueChange}\n placeholder={placeholder ?? \"Select an option\"}\n aria-label={title}\n />\n )}\n\n {(type === \"multi-choice\" || type === \"multi-select\") && (\n <div className=\"ds:grid ds:gap-3\" role=\"group\" aria-label={title}>\n {options.map((option) => (\n <QuestionOptionButton\n key={option.value}\n option={option}\n selected={values.includes(option.value)}\n role=\"checkbox\"\n aria-checked={values.includes(option.value)}\n onClick={() => toggleOption(option.value, !values.includes(option.value))}\n />\n ))}\n </div>\n )}\n\n {type === \"address\" && (\n <div className=\"ds:grid ds:gap-3 ds:sm:grid-cols-2\">\n <Input\n value={addressValue.line1 ?? \"\"}\n onChange={(event) => updateAddress(\"line1\", event.target.value)}\n placeholder=\"Street address\"\n aria-label={`${title} street address`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px] ds:sm:col-span-2\"\n />\n <Input\n value={addressValue.line2 ?? \"\"}\n onChange={(event) => updateAddress(\"line2\", event.target.value)}\n placeholder=\"Apt, suite, unit\"\n aria-label={`${title} address line 2`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px] ds:sm:col-span-2\"\n />\n <Input\n value={addressValue.city ?? \"\"}\n onChange={(event) => updateAddress(\"city\", event.target.value)}\n placeholder=\"City\"\n aria-label={`${title} city`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n <Input\n value={addressValue.region ?? \"\"}\n onChange={(event) => updateAddress(\"region\", event.target.value)}\n placeholder=\"State / Province\"\n aria-label={`${title} state or province`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n <Input\n value={addressValue.postalCode ?? \"\"}\n onChange={(event) => updateAddress(\"postalCode\", event.target.value)}\n placeholder=\"ZIP / Postal code\"\n aria-label={`${title} zip or postal code`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n <Input\n value={addressValue.country ?? \"\"}\n onChange={(event) => updateAddress(\"country\", event.target.value)}\n placeholder=\"Country\"\n aria-label={`${title} country`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n </div>\n )}\n\n {type === \"name\" && (\n <div className=\"ds:grid ds:gap-3 ds:sm:grid-cols-6\">\n <Input\n value={nameValue.first ?? \"\"}\n onChange={(event) => updateName(\"first\", event.target.value)}\n placeholder=\"First name\"\n aria-label={`${title} first name`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px] ds:sm:col-span-2\"\n />\n <Input\n value={nameValue.middle ?? \"\"}\n onChange={(event) => updateName(\"middle\", event.target.value)}\n placeholder=\"Middle\"\n aria-label={`${title} middle name`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px] ds:sm:col-span-1\"\n />\n <Input\n value={nameValue.last ?? \"\"}\n onChange={(event) => updateName(\"last\", event.target.value)}\n placeholder=\"Last name\"\n aria-label={`${title} last name`}\n className={cn(\n \"ds:h-11 ds:rounded-[12px] ds:text-[14px]\",\n showSuffix ? \"ds:sm:col-span-2\" : \"ds:sm:col-span-3\",\n )}\n />\n {showSuffix && (\n <Input\n value={nameValue.suffix ?? \"\"}\n onChange={(event) => updateName(\"suffix\", event.target.value)}\n placeholder=\"Suffix\"\n aria-label={`${title} suffix`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px] ds:sm:col-span-1\"\n />\n )}\n </div>\n )}\n\n {type === \"labeled-table\" && (\n <Grid\n ariaLabel={title}\n currencySymbol={currencySymbol}\n columns={labeledColumns.map((column) => ({\n key: column.key,\n label: column.title,\n inputType: column.inputType,\n width: column.width,\n }))}\n rows={labeledRows.map((row) => ({ key: row.key, label: row.title }))}\n value={labeledValue}\n onChange={(next) => onLabeledChange?.(next)}\n />\n )}\n\n {type === \"file-upload\" && (\n <div className=\"ds:grid ds:gap-3\">\n <FileUpload\n accept={accept}\n maxSize={maxSize}\n multiple={multiple}\n onFilesSelected={onFilesSelected}\n />\n {files.length > 0 && (\n <div className=\"ds:grid ds:gap-2\">\n {files.map((file, fileIndex) => (\n <FileChip\n key={`${file.name}-${file.size ?? \"unknown\"}`}\n name={file.name}\n meta={file.size ? formatBytes(file.size) : undefined}\n kind={file.kind ?? \"doc\"}\n action={\n onFileRemove ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() => onFileRemove(file, fileIndex)}\n aria-label={`Remove ${file.name}`}\n className=\"ds:hover:text-danger-fg\"\n >\n <TrashIcon size={14} aria-hidden=\"true\" />\n </Button>\n ) : undefined\n }\n />\n ))}\n </div>\n )}\n </div>\n )}\n\n {(type === \"table\" || type === \"repeater\") && (\n <div className=\"ds:grid ds:gap-3\">\n {countLabel && (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-3\">\n <span className=\"ds:text-fg ds:text-[13px] ds:font-semibold\">{countLabel}</span>\n <NumberStepper\n value={tableRows.length}\n onValueChange={setRowCount}\n min={min}\n max={max}\n step={step}\n ariaLabel={countLabel}\n />\n </div>\n )}\n {tableRows.map((row, rowIndex) => (\n <div key={rowIndex} className=\"ds:border-rule ds:bg-surface-2 ds:rounded-[16px] ds:border ds:p-4\">\n <div className=\"ds:mb-3 ds:flex ds:items-center ds:justify-between ds:gap-3\">\n <span className=\"ds:text-fg ds:text-[13px] ds:font-semibold\">\n {type === \"repeater\" ? (itemNoun ?? \"Item\") : \"Row\"} {rowIndex + 1}\n </span>\n {!countLabel && tableRows.length > 1 && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() => removeRow(rowIndex)}\n aria-label={`Remove row ${rowIndex + 1}`}\n >\n <TrashIcon size={14} aria-hidden=\"true\" />\n </Button>\n )}\n </div>\n <div className=\"ds:grid ds:gap-3 ds:sm:grid-cols-2\">\n {tableColumns.map((column) => (\n <Input\n key={column.key}\n type={column.inputType === \"date\" ? \"date\" : \"text\"}\n value={row[column.key] ?? \"\"}\n onChange={(event) => updateRow(rowIndex, column.key, event.target.value)}\n placeholder={column.placeholder ?? column.label}\n aria-label={`${title} ${column.label} row ${rowIndex + 1}`}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n inputMode={\n column.inputType === \"number\" || column.inputType === \"currency\"\n ? \"decimal\"\n : undefined\n }\n prefixIcon={\n column.inputType === \"currency\" ? (\n <span className=\"ds:text-xs ds:font-semibold\">{currencySymbol}</span>\n ) : undefined\n }\n />\n ))}\n </div>\n </div>\n ))}\n {!countLabel && (\n <Button\n type=\"button\"\n variant=\"dashed\"\n size=\"sm\"\n onClick={addRow}\n iconLeft={<PlusIcon size={14} />}\n >\n Add {type === \"repeater\" ? \"item\" : \"row\"}\n </Button>\n )}\n </div>\n )}\n\n {type === \"signature\" && (\n <div className=\"ds:border-rule-strong ds:bg-surface-2 ds:rounded-[16px] ds:border ds:border-dashed ds:p-5\">\n <div className=\"ds:text-fg-2 ds:mb-3 ds:flex ds:items-center ds:gap-2\">\n <PenSignIcon size={18} aria-hidden=\"true\" />\n <span className=\"ds:text-[13px] ds:font-semibold\">Signature</span>\n </div>\n <Input\n value={value}\n onChange={(event) => onValueChange?.(event.target.value)}\n placeholder={placeholder ?? \"Type full legal name\"}\n aria-label={title}\n className=\"ds:h-11 ds:rounded-[12px] ds:text-[14px]\"\n />\n </div>\n )}\n\n {type === \"consent-checkbox\" && (\n <Checkbox\n label={description ?? title}\n checked={value === \"true\"}\n onCheckedChange={(checked) => onValueChange?.(checked === true ? \"true\" : \"false\")}\n />\n )}\n </section>\n );\n});\n\nQuestions.displayName = \"Questions\";\n\ninterface QuestionOptionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n option: QuestionOption;\n selected: boolean;\n compact?: boolean;\n}\n\nfunction QuestionOptionButton({\n option,\n selected,\n compact,\n className,\n ...props\n}: QuestionOptionButtonProps) {\n return (\n <button\n type=\"button\"\n disabled={option.disabled}\n className={cn(\n \"ds:group ds:bg-surface ds:flex ds:w-full ds:items-center ds:gap-3 ds:border ds:text-left\",\n \"ds:transition-[border-color,background-color,color,box-shadow,transform] ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)]\",\n \"ds:motion-reduce:transition-none\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n \"ds:disabled:bg-bg-disabled ds:disabled:text-fg-disabled ds:disabled:cursor-not-allowed\",\n compact ? \"ds:h-10 ds:max-w-max ds:rounded-[10px] ds:px-3\" : \"ds:min-h-16 ds:rounded-[12px] ds:px-7 ds:py-4\",\n selected\n ? compact\n ? \"ds:border-brand ds:bg-brand-bg ds:text-brand ds:shadow-xs\"\n : \"ds:border-brand-line ds:bg-brand-bg ds:text-brand ds:hover:bg-brand-bg-hover ds:shadow-xs\"\n : \"ds:border-rule-strong ds:text-fg ds:hover:border-brand-line ds:hover:bg-brand-bg/40\",\n className,\n )}\n {...props}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n \"ds:grid ds:shrink-0 ds:place-items-center ds:rounded-full ds:border ds:transition-colors ds:duration-[var(--duration-fast)] ds:motion-reduce:transition-none\",\n compact ? \"ds:size-5\" : \"ds:size-4\",\n selected\n ? \"ds:border-brand ds:bg-brand ds:text-fg-on-brand\"\n : \"ds:border-rule-strong ds:bg-surface ds:group-hover:border-brand-line ds:text-transparent\",\n )}\n >\n {selected && <CheckCircleSolidIcon size={compact ? 18 : 14} />}\n </span>\n\n <span className=\"ds:flex ds:min-w-0 ds:flex-1 ds:items-center ds:gap-1.5\">\n <span className={cn(\"ds:truncate ds:font-bold\", compact ? \"ds:text-[13px]\" : \"ds:text-[15px]\")}>\n {option.label}\n </span>\n {option.helpText && <HelpTip title={option.label} body={option.helpText} />}\n </span>\n\n {option.formLabel && !compact && (\n <span\n className={cn(\n \"ds:ml-auto ds:shrink-0 ds:text-right ds:text-[13px] ds:font-semibold\",\n selected ? \"ds:text-brand\" : \"ds:text-fg-3\",\n )}\n >\n {option.formLabel}\n </span>\n )}\n </button>\n );\n}\n\nfunction formatBytes(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\n/** Shared help tooltip — used for question-level `help` and per-option `helpText`. */\nfunction HelpTip({ title, body }: { title: string; body: string }) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"ds:text-brand ds:inline-flex ds:shrink-0 ds:cursor-help\">\n <HelpCircleIcon size={14} aria-hidden=\"true\" />\n </span>\n </TooltipTrigger>\n <TooltipContent\n side=\"top\"\n align=\"center\"\n sideOffset={12}\n className={cn(\n \"ds:border-rule ds:bg-surface ds:shadow-pop ds:relative ds:max-w-[352px] ds:rounded-[7px] ds:p-5 ds:text-left\",\n \"ds:after:border-rule ds:after:bg-surface ds:after:absolute ds:after:top-full ds:after:left-1/2 ds:after:size-4 ds:after:-translate-x-1/2 ds:after:-translate-y-1/2 ds:after:rotate-45 ds:after:border-r ds:after:border-b ds:after:content-['']\",\n )}\n >\n <div className=\"ds:text-fg ds:text-[15px] ds:leading-5 ds:font-bold\">{title}</div>\n <p className=\"ds:text-fg-2 ds:mt-3 ds:text-[14px] ds:leading-6\">{body}</p>\n </TooltipContent>\n </Tooltip>\n );\n}\n\ninterface NumberStepperProps {\n value: number;\n onValueChange: (value: number) => void;\n min?: number | undefined;\n max?: number | undefined;\n step?: number | undefined;\n ariaLabel?: string | undefined;\n}\n\n/** Bounded −/+ counter. Backs the `number-stepper` variant and the count-driven `repeater`. */\nfunction NumberStepper({\n value,\n onValueChange,\n min = 0,\n max,\n step = 1,\n ariaLabel,\n}: NumberStepperProps) {\n const clamp = (next: number) => Math.max(min, max != null ? Math.min(next, max) : next);\n const current = clamp(Number.isFinite(value) ? value : min);\n const atMin = current <= min;\n const atMax = max != null && current >= max;\n\n return (\n <div\n className=\"ds:inline-flex ds:items-center ds:gap-2\"\n role=\"spinbutton\"\n aria-valuenow={current}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={ariaLabel}\n >\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"icon-sm\"\n onClick={() => onValueChange(clamp(current - step))}\n disabled={atMin}\n aria-label=\"Decrease\"\n >\n <MinusIcon size={14} aria-hidden=\"true\" />\n </Button>\n <Input\n value={String(current)}\n onChange={(event) => {\n const parsed = Number(event.target.value.replace(/[^0-9-]/g, \"\"));\n onValueChange(clamp(Number.isFinite(parsed) ? parsed : min));\n }}\n inputMode=\"numeric\"\n aria-label={ariaLabel}\n className=\"ds:h-11 ds:w-14 ds:rounded-[12px] ds:text-center ds:text-[14px] ds:tabular-nums\"\n />\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"icon-sm\"\n onClick={() => onValueChange(clamp(current + step))}\n disabled={atMax}\n aria-label=\"Increase\"\n >\n <PlusIcon size={14} aria-hidden=\"true\" />\n </Button>\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot } from \"../primitives/slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { Avatar } from \"../primitives/avatar\";\nimport { Collapsible, CollapsibleContent } from \"../primitives/collapsible\";\nimport {\n ChevronDownIcon,\n ChevronsLeftIcon,\n ChevronsRightIcon,\n PanelLeftCloseIcon,\n PanelLeftIcon,\n} from \"../primitives/icons\";\nimport { Sheet, SheetContent, SheetTitle } from \"../primitives/sheet\";\nimport { TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from \"../primitives/tooltip\";\nimport { sidebarAnatomy, type SidebarSlot } from \"../foundation/anatomy/slots\";\nimport { slot, stateAttributes } from \"../foundation/anatomy/slot\";\nimport { useMergedRefs } from \"../foundation/merge-refs\";\nimport { useDsDirection, useDsMessages } from \"../foundation/provider/context\";\nimport { cn } from \"../lib/cn\";\n\n/** The sidebar parts (ADR-008). See the registry for the doc comment. */\nexport type { SidebarSlot };\n\n/* ───────────────────────────────────────────────────────────────────────\n * State model\n *\n * Exactly two states, one source of truth (<SidebarProvider>):\n *\n * `expanded` — full column (`--shell-sidebar-w`), labels visible. The\n * default for any consumer that doesn't opt in.\n * `rail` — icon column (`--shell-sidebar-w-rail`), labels and section\n * headings hidden, every row explains itself with a tooltip.\n *\n * Only an explicit action switches between them: <SidebarTrigger>,\n * <SidebarPinButton> or the keyboard shortcut. Hovering the rail never\n * widens it — the hover-peek overlay that used to live here is gone (the\n * `peek` prop and `useSidebarPeekLock` are deprecated no-ops), because an\n * incidental mouse pass that shoves a column over the canvas is motion the\n * user did not ask for.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport type SidebarState = \"expanded\" | \"rail\";\n\ninterface SidebarContextValue {\n state: SidebarState;\n setState: (next: SidebarState) => void;\n toggle: () => void;\n collapsible: boolean;\n /**\n * The `id` of the collapsible `<aside>`, for `aria-controls` on\n * <SidebarTrigger> / <SidebarPinButton>. Generated by the provider (SSR-\n * stable via `useId`); a `<Sidebar id=\"…\">` registers its own instead.\n */\n sidebarId: string | undefined;\n /** @internal Lets <Sidebar> report a consumer-supplied `id`. */\n registerSidebarId: (id: string | undefined) => void;\n /**\n * @deprecated Always `0`. Hover-peek was removed; nothing can hold the\n * collapsed column visually expanded any more.\n */\n peekLockCount: number;\n /**\n * @deprecated No-op. Returns an inert release function so existing\n * callers keep working.\n */\n acquirePeekLock: () => () => void;\n}\n\nconst SidebarContext = React.createContext<SidebarContextValue | null>(null);\n\n// Sentinel so atoms can render outside a provider without crashing —\n// keeps the legacy \"drop a <Sidebar> into a <Shell>\" path working\n// untouched.\nconst NOOP_CONTEXT: SidebarContextValue = {\n state: \"expanded\",\n setState: () => {},\n toggle: () => {},\n collapsible: false,\n sidebarId: undefined,\n registerSidebarId: () => {},\n peekLockCount: 0,\n acquirePeekLock: () => () => {},\n};\n\nconst NOOP_RELEASE = () => {};\nconst acquireNoopPeekLock = () => NOOP_RELEASE;\n\nexport function useSidebarState(): SidebarContextValue {\n return React.useContext(SidebarContext) ?? NOOP_CONTEXT;\n}\n\n/* ───────────────────────────────────────────────────────────────────────\n * Provider\n *\n * Wraps the app shell. Owns the user's pinned intent. Controlled\n * (`state` + `onStateChange`) and uncontrolled (`defaultState`) modes\n * both supported, following the Radix pattern.\n *\n * `storageKey` opts into localStorage persistence. The stored value is\n * applied *post-mount* via `useEffect`, never in the initial render — so\n * SSR markup and the client's first render produce identical trees and\n * React's `useId` counter doesn't drift for downstream Radix primitives.\n * The trade-off is a one-frame flash from `defaultState` to the stored\n * state when a user has previously pinned a non-default. Consumers that\n * cannot tolerate the flash should persist via a cookie they read in a\n * server component and pass through `defaultState`.\n *\n * `storage=\"cookie\"` (W7-02) writes the same key as a first-party cookie\n * instead, which is what makes the flash-free path actually reachable: the\n * server reads the cookie, passes it as `defaultState`, and the first paint is\n * already correct. See `SidebarProviderProps.storage` for the recipe — this is\n * the reason PRO and TAX each wrap this provider today.\n *\n * `shortcut` defaults to `Mod+\\` — same chord as VS Code, GitHub, Linear.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport interface SidebarProviderProps {\n children?: React.ReactNode;\n state?: SidebarState;\n /**\n * The state of the first render, in uncontrolled mode. Read on the server\n * (from a cookie) and passed down, this is the hydration-safe way to restore\n * a collapsed sidebar: the server and the client's first render agree, so no\n * `data-state` mismatch and no `useId` drift (W7-02).\n */\n defaultState?: SidebarState;\n onStateChange?: (next: SidebarState) => void;\n /** Persist the user's intent across reloads under this key. See `storage`. */\n storageKey?: string;\n /**\n * Where `storageKey` persists.\n *\n * - `\"localStorage\"` (default) — 1.x behaviour. Readable only in the\n * browser, so the stored value lands one render *after* hydration and a\n * non-default state flashes for a frame.\n * - `\"cookie\"` — writes `storageKey=<state>; path=/; max-age=1y;\n * samesite=lax` on every change, so the *server* can read it back:\n *\n * ```tsx\n * // app/layout.tsx (Next.js server component)\n * const pinned = (await cookies()).get(\"sidebar\")?.value;\n * return (\n * <SidebarProvider\n * storageKey=\"sidebar\"\n * storage=\"cookie\"\n * defaultState={pinned === \"rail\" ? \"rail\" : \"expanded\"}\n * >\n * {children}\n * </SidebarProvider>\n * );\n * ```\n *\n * The first paint is already correct, nothing is read before hydration,\n * and the app needs no wrapper of its own.\n *\n * @experimental W7-02.\n */\n storage?: \"localStorage\" | \"cookie\";\n /** Global toggle shortcut. Pass `null` to disable. Defaults to `Mod+\\`. */\n shortcut?: string | null;\n}\n\nconst DEFAULT_SHORTCUT = \"Mod+\\\\\";\n\ntype SidebarStorage = NonNullable<SidebarProviderProps[\"storage\"]>;\n\nconst asState = (value: string | null | undefined): SidebarState | null =>\n value === \"rail\" || value === \"expanded\" ? value : null;\n\nfunction readStorage(key: string | undefined, storage: SidebarStorage): SidebarState | null {\n if (!key || typeof document === \"undefined\") return null;\n try {\n if (storage === \"cookie\") {\n const match = document.cookie.match(\n new RegExp(`(?:^|;\\\\s*)${key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}=([^;]*)`),\n );\n return asState(match ? decodeURIComponent(match[1] ?? \"\") : null);\n }\n return asState(window.localStorage.getItem(key));\n } catch {\n return null;\n }\n}\n\nfunction writeStorage(key: string, storage: SidebarStorage, next: SidebarState): void {\n if (typeof document === \"undefined\") return;\n try {\n if (storage === \"cookie\") {\n // A year, path=/ so every route sees it, lax so a top-level navigation\n // still carries it to the server that renders `defaultState`.\n document.cookie = `${key}=${next}; path=/; max-age=31536000; samesite=lax`;\n return;\n }\n window.localStorage.setItem(key, next);\n } catch {\n /* quota / private-mode — ignore, runtime state still works */\n }\n}\n\nfunction isEditableTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (target.isContentEditable) return true;\n return target.closest(\"input, textarea, select, [contenteditable]:not([contenteditable='false']), [role='textbox']\") !== null;\n}\n\nfunction hasOpenModal(): boolean {\n // Radix dialogs and sheets do not set `aria-modal`; an open one is a\n // `role=\"dialog\"` carrying `data-state=\"open\"`.\n return (\n document.querySelector(\n \"[role='dialog'][aria-modal='true'], [role='dialog'][data-state='open'], [role='alertdialog'], dialog[open]\",\n ) !== null\n );\n}\n\nexport function SidebarProvider({\n children,\n state: controlled,\n defaultState = \"expanded\",\n onStateChange,\n storageKey,\n storage = \"localStorage\",\n shortcut = DEFAULT_SHORTCUT,\n}: SidebarProviderProps) {\n // Initial state must be identical on SSR and the client's first render.\n // Reading localStorage here would diverge the two and shift React's\n // `useId` counter for every Radix primitive downstream — the bug that\n // broke `aria-controls` wiring in dropdowns nested inside the app shell.\n // The post-mount effect below applies the stored value on the second\n // render. The one-frame flash is the documented trade-off.\n const [uncontrolled, setUncontrolled] = React.useState<SidebarState>(\n controlled ?? defaultState,\n );\n\n React.useEffect(() => {\n if (controlled !== undefined) return;\n const stored = readStorage(storageKey, storage);\n if (stored && stored !== uncontrolled) setUncontrolled(stored);\n // Apply stored value once after hydration. Subsequent writes are\n // owned by `setState` below and persisted there.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const state = controlled ?? uncontrolled;\n\n // The latest state, readable without re-creating `toggle`. Written on every\n // render and on uncontrolled `setState`, so two toggles in the same frame (a fast\n // double-click, before React re-renders) each flip the column instead of\n // both reading the same stale value.\n const stateRef = React.useRef(state);\n stateRef.current = state;\n\n const setState = React.useCallback(\n (next: SidebarState) => {\n // A controlled parent may decline the request. Only anticipate the\n // next render when this provider owns that state transition.\n if (controlled === undefined) {\n stateRef.current = next;\n setUncontrolled(next);\n }\n onStateChange?.(next);\n if (storageKey) writeStorage(storageKey, storage, next);\n },\n [controlled, onStateChange, storageKey, storage],\n );\n\n const toggle = React.useCallback(() => {\n setState(stateRef.current === \"expanded\" ? \"rail\" : \"expanded\");\n }, [setState]);\n\n // Another tab changed the persisted state: follow it, without writing it\n // back (that tab already did). localStorage announces itself through the\n // `storage` event; a cookie has no event, so it is re-read when this tab\n // regains focus.\n React.useEffect(() => {\n if (controlled !== undefined || !storageKey) return;\n const sync = () => {\n const stored = readStorage(storageKey, storage);\n if (stored && stored !== stateRef.current) {\n stateRef.current = stored;\n setUncontrolled(stored);\n }\n };\n const onStorage = (e: StorageEvent) => {\n if (e.key === storageKey) sync();\n };\n if (storage === \"cookie\") window.addEventListener(\"focus\", sync);\n else window.addEventListener(\"storage\", onStorage);\n return () => {\n window.removeEventListener(\"focus\", sync);\n window.removeEventListener(\"storage\", onStorage);\n };\n }, [controlled, storageKey, storage]);\n\n // `useId` is identical on the server and the client's first render, so the\n // trigger's `aria-controls` survives hydration. A <Sidebar> given its own\n // `id` registers it post-mount (an effect, never during render).\n const generatedId = React.useId();\n const [customId, setCustomId] = React.useState<string | undefined>(undefined);\n const sidebarId = customId ?? `sidebar-${generatedId.replace(/:/g, \"\")}`;\n\n React.useEffect(() => {\n if (!shortcut) return;\n const parts = shortcut.split(\"+\");\n const key = parts.pop() ?? \"\";\n const wantMod = parts.includes(\"Mod\");\n const wantShift = parts.includes(\"Shift\");\n const wantAlt = parts.includes(\"Alt\");\n function onKey(e: KeyboardEvent) {\n if (e.defaultPrevented || e.isComposing) return;\n const isMac =\n typeof navigator !== \"undefined\" && /Mac|iPhone|iPad/.test(navigator.platform);\n const mod = isMac ? e.metaKey : e.ctrlKey;\n if (e.key.toLowerCase() !== key.toLowerCase()) return;\n if (wantMod !== mod) return;\n if (wantShift !== e.shiftKey) return;\n if (wantAlt !== e.altKey) return;\n // The chord belongs to whatever has focus when that is a text field\n // or an editor (Mod+B is \"bold\" in most of them), and to the dialog\n // when one is open: neither should find the page reflowing under it.\n if (isEditableTarget(e.target) || hasOpenModal()) return;\n e.preventDefault();\n // Holding the chord must not strobe the column open and shut.\n if (e.repeat) return;\n toggle();\n }\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [shortcut, toggle]);\n\n const value: SidebarContextValue = React.useMemo(\n () => ({\n state,\n setState,\n toggle,\n collapsible: true,\n sidebarId,\n registerSidebarId: setCustomId,\n peekLockCount: 0,\n acquirePeekLock: acquireNoopPeekLock,\n }),\n [state, setState, toggle, sidebarId],\n );\n\n return <SidebarContext.Provider value={value}>{children}</SidebarContext.Provider>;\n}\nSidebarProvider.displayName = \"SidebarProvider\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * Sidebar root\n *\n * Visual contract:\n * - Width is driven by inline style (the expanded or rail token), so the\n * flex Shell reflows with no coordination needed in <Main>. One\n * `width` transition, disabled under prefers-reduced-motion.\n * - Descendants style themselves off one derived attribute:\n * data-state=\"expanded\"|\"rail\" → the provider's state\n * data-labels=\"show\"|\"hide\" → \"hide\" exactly when railed. The\n * attribute every atom reads.\n * - Carries `group/sidebar` so descendants can target the parent\n * via `group-data-[labels=hide]/sidebar:…`.\n * - Clips horizontally, so nothing wraps or spills while the width\n * sweeps; labels are `nowrap` and hidden outright once railed.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport interface SidebarProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * Opt into the two-state collapse. When false (default), the sidebar\n * always renders expanded. When true, the sidebar reads its state from\n * <SidebarProvider>; with no provider mounted it still renders expanded,\n * so dropping `collapsible` alone is a no-op.\n */\n collapsible?: boolean;\n /**\n * Visual treatment.\n * - `\"classic\"` (default) — full-height column flush to the left\n * edge with a right rule.\n * - `\"floating\"` — a detached, rounded card inset from the viewport\n * with a soft shadow. Nav rows get larger hit areas and a tinted\n * active fill. Exposed as `data-variant` so descendant atoms\n * restyle via `group-data-[variant=floating]`.\n * - `\"flush\"` — the polished row anatomy (32px rows on the control\n * radius, brighter icons, a subtle active fill without an edge\n * indicator, an overline section label) on a flush full-height\n * column. An overlay scrollbar shows only while the nav scrolls,\n * and a hairline appears under the brand row once it has scrolled.\n */\n variant?: \"classic\" | \"floating\" | \"flush\";\n /**\n * @deprecated Ignored. The collapsed rail no longer widens on hover —\n * the sidebar has exactly two states, switched only by\n * <SidebarTrigger>, <SidebarPinButton> or the keyboard shortcut.\n * Collapsed rows name themselves with a tooltip instead. Kept so\n * existing `peek` / `peek={false}` call sites still compile; remove it.\n */\n peek?: boolean;\n}\n\n/**\n * Whether the sidebar is currently rendering icon-only.\n *\n * Descendants normally style themselves off the `data-labels` attribute,\n * which needs no context. This exists for what CSS cannot express: mounting\n * a tooltip is rendering a component, not applying a rule, so <SidebarLink>\n * has to know the collapsed state in JS.\n */\nconst SidebarLabelsHiddenContext = React.createContext<boolean>(false);\n\n/**\n * `data-collapsed=\"true\"` on a sidebar slot while the column renders icon-only\n * (W7-03).\n *\n * The replacement hook for `C-DOM-06`: instead of copying\n * `group-data-[labels=hide]/sidebar:*` onto every descendant, a consumer\n * targets the part and its state —\n * `[data-slot=\"sidebar-link-label\"][data-collapsed]`. The attribute is\n * *absent* when labels show, so it is additive: nothing is re-stamped over the\n * frozen `group/sidebar` / `data-labels` pair on the root, and the expanded DOM\n * is byte-identical to 1.x.\n */\nfunction useCollapsedAttribute(): { \"data-collapsed\"?: \"true\" } {\n return React.useContext(SidebarLabelsHiddenContext) ? { \"data-collapsed\": \"true\" } : {};\n}\n\n/** True inside a collapsible <Sidebar>, which mounts the rail's TooltipProvider. */\nconst SidebarTooltipScopeContext = React.createContext<boolean>(false);\n\n/**\n * The collapsed rail's tooltip: names an icon-only control on hover and on\n * keyboard focus, to the column's outer side.\n *\n * - The Radix root and trigger are always mounted, so toggling the sidebar\n * never remounts the wrapped element (a focused row keeps focus); only\n * `open` and the content depend on the state. Expanded, it can never open\n * and adds no `aria-describedby`, so visible text is not announced twice.\n * - A toggle closes it, so a tooltip open at the moment of a\n * collapse/expand never lingers or reappears on its own.\n * - Uses the sidebar's own provider (skip-delay between neighbours) rather\n * than `Tooltip`, which isolates each tooltip in a provider of its own.\n * Radix closes it on Escape and on pointer-down.\n *\n * @internal Shared with SidebarBrandSwitcher; not re-exported.\n */\nexport function SidebarRailTooltip({\n label,\n suppressed = false,\n children,\n}: {\n label: React.ReactNode;\n /** Hold the tooltip shut (e.g. while the element's own menu is open). */\n suppressed?: boolean;\n children: React.ReactElement;\n}) {\n const railed = React.useContext(SidebarLabelsHiddenContext);\n const inScope = React.useContext(SidebarTooltipScopeContext);\n const side = useDsDirection() === \"rtl\" ? \"left\" : \"right\";\n const [requestedOpen, setRequestedOpen] = React.useState(false);\n const enabled = inScope && railed && !suppressed && label != null && label !== \"\";\n // Discard the request when disabled, rather than merely hiding its content:\n // otherwise rail → expanded → rail resurrects a tooltip without a new\n // hover/focus event. Adjust during render so descendants commit only once.\n if (!enabled && requestedOpen) setRequestedOpen(false);\n if (!inScope) return children;\n const open = enabled && requestedOpen;\n return (\n <TooltipRoot\n open={open}\n onOpenChange={(next) => setRequestedOpen(enabled && next)}\n >\n <TooltipTrigger asChild>{children}</TooltipTrigger>\n {/* Mounted only while open: a closed content still mounts its portal\n and popper, which would re-render every row on each toggle. */}\n {open ? (\n // 16px clears the column's 12px inline padding, so the tooltip opens\n // outside the rail instead of over its edge.\n <TooltipContent side={side} sideOffset={16} className=\"ds:px-3 ds:py-2 ds:text-body\">\n {label}\n </TooltipContent>\n ) : null}\n </TooltipRoot>\n );\n}\n\nexport const Sidebar = React.forwardRef<HTMLElement, SidebarProps>(function Sidebar(\n {\n className,\n collapsible = false,\n variant = \"classic\",\n // Deprecated and inert; pulled out so it never reaches the DOM.\n peek: _peek,\n id: idProp,\n style,\n children,\n ...props\n },\n ref,\n) {\n const isFloating = variant === \"floating\";\n const isFlush = variant === \"flush\";\n const ctx = React.useContext(SidebarContext);\n const managed = collapsible && ctx !== null;\n const state: SidebarState = managed ? ctx.state : \"expanded\";\n const labelsHidden = state === \"rail\";\n\n // A consumer-supplied `id` becomes the trigger's `aria-controls` target;\n // otherwise the provider's SSR-stable generated id is used.\n const registerSidebarId = ctx?.registerSidebarId;\n React.useEffect(() => {\n if (!managed || !registerSidebarId || idProp === undefined) return;\n registerSidebarId(idProp);\n return () => registerSidebarId(undefined);\n }, [managed, registerSidebarId, idProp]);\n const id = idProp ?? (managed ? ctx.sidebarId : undefined);\n\n // Flush-only: the overlay scrollbar and the brand hairline are both driven\n // by the aside's own scroll position, written straight to the DOM instead\n // of React state — a scroll-frame handler that re-rendered every nav row\n // on each frame would be absurd. `data-scrolling` is transient and clears\n // itself ~800ms after the last scroll event; `data-scrolled` is a plain\n // \"not at the top\" boolean with no timer. Neither attribute is ever set\n // for `classic`/`floating`, so descendants can key off `data-scrolled`\n // alone (see `SidebarBrand`) without also checking the variant.\n const internalRef = React.useRef<HTMLElement>(null);\n const mergedRef = useMergedRefs(ref, internalRef);\n React.useEffect(() => {\n if (!isFlush) return;\n const el = internalRef.current;\n if (!el) return;\n let timer: number | undefined;\n const onScroll = () => {\n el.dataset.scrolling = \"true\";\n if (el.scrollTop > 0) el.dataset.scrolled = \"true\";\n else delete el.dataset.scrolled;\n window.clearTimeout(timer);\n timer = window.setTimeout(() => {\n delete el.dataset.scrolling;\n }, 800);\n };\n // A restored scroll position (back/forward nav) can start nonzero —\n // check once on mount so the hairline is correct before the first scroll.\n if (el.scrollTop > 0) el.dataset.scrolled = \"true\";\n el.addEventListener(\"scroll\", onScroll, { passive: true });\n return () => {\n el.removeEventListener(\"scroll\", onScroll);\n window.clearTimeout(timer);\n };\n }, [isFlush]);\n\n // Legacy name first: --ds-layout-shell-sidebar-width is always defined at\n // :root (tokens.css), so a var() fallback in the other order never fires —\n // an app that sets only --shell-sidebar-w (the documented write-compat\n // name, legacy-aliases.css) on <Shell> was silently ignored. Reading\n // --shell-sidebar-w first still resolves to the ds default when nothing\n // overrides it, since legacy-aliases.css aliases it to the ds var.\n // Transitions arm only after the first painted frame. The state can change\n // between hydration and that frame (a stored rail applied by the provider's\n // post-mount effect, or a controlled parent settling), and that change is a\n // restore, not a user action: it must land instantly instead of sweeping the\n // column across the page. Written to the DOM, not state, so arming costs no\n // re-render.\n React.useEffect(() => {\n const el = internalRef.current;\n if (!el) return;\n let second = 0;\n const first = window.requestAnimationFrame(() => {\n second = window.requestAnimationFrame(() => {\n el.dataset.ready = \"true\";\n });\n });\n return () => {\n window.cancelAnimationFrame(first);\n window.cancelAnimationFrame(second);\n };\n }, []);\n\n const railWidth = \"var(--shell-sidebar-w-rail, var(--ds-layout-shell-sidebar-rail-width))\";\n const fullWidth = \"var(--shell-sidebar-w, var(--ds-layout-shell-sidebar-width))\";\n\n return (\n <aside\n ref={mergedRef}\n id={id}\n data-state={state}\n data-labels={labelsHidden ? \"hide\" : \"show\"}\n data-collapsible={collapsible ? \"true\" : undefined}\n data-variant={variant}\n {...slot(sidebarAnatomy, \"root\")}\n // `state` initializes identically on SSR and the client's first render\n // (see <SidebarProvider>), so every attribute here matches across the\n // hydration boundary and no suppression is needed.\n style={{\n width: labelsHidden ? railWidth : fullWidth,\n ...style,\n }}\n className={cn(\n \"ds:group/sidebar group/sidebar ds:scrollbar-thin ds:flex ds:shrink-0 ds:flex-col ds:overflow-x-hidden ds:overflow-y-auto ds:px-3 ds:pt-4 ds:pb-4\",\n // Classic: full-height column flush to the left edge with a right\n // rule. The legacy look.\n // `border-e`: the rule sits on the canvas side in either direction.\n !isFloating && \"ds:h-dvh ds:border-rule ds:border-e\",\n !isFloating && (isFlush ? \"ds:bg-surface\" : \"ds:bg-bg-2\"),\n // Flush against a `bg-bg` canvas (Shell's own background) `bg-bg-2`\n // sits only ~1.06:1 off the page — the two regions read as one grey\n // field. `surface` against the same canvas is the ~2–3x luminance\n // step the classic sidebar convention reads on, and it is the token\n // every card in the product already sits on. `classic` and\n // `floating` are unchanged.\n // Floating: a detached, rounded card inset from the viewport with a\n // soft shadow.\n isFloating &&\n \"ds:border-rule ds:bg-surface ds:shadow-card ds:m-2.5 ds:h-[calc(100dvh-1.25rem)] ds:rounded-2xl ds:border\",\n // The spatial motion token (~220ms) suits a ~150px width sweep:\n // `--duration-fast` reads as a snap at this size, `--duration-slow`\n // as sluggish. Width is the only animated property, armed by\n // `data-ready` (see above) and never under reduced motion.\n \"ds:motion-safe:data-[ready=true]:transition-[width] ds:duration-[var(--motion-duration-spatial)] ds:ease-[var(--motion-ease-move)]\",\n // Railed, the scrollbar is hidden (the nav still scrolls by wheel,\n // touch and keyboard): a classic scrollbar would take its width out\n // of a 56px column and push every icon off centre the moment the\n // list overflows.\n \"ds:data-[labels=hide]:[scrollbar-width:none] ds:data-[labels=hide]:[&::-webkit-scrollbar]:hidden\",\n isFlush &&\n // Overlay scrollbar: hidden at rest, revealed while `data-scrolling`\n // is set by the effect above and faded back out ~800ms after the\n // last scroll event. `scrollbar-color` is the standard property\n // modern engines read; the `::-webkit-scrollbar-thumb` rule is the\n // older-Safari fallback, kept in lockstep with it rather than\n // relying on either alone.\n cn(\n \"ds:[scrollbar-color:transparent_transparent] ds:data-[scrolling=true]:[scrollbar-color:var(--color-rule-strong)_transparent]\",\n \"ds:[&::-webkit-scrollbar-thumb]:bg-transparent ds:data-[scrolling=true]:[&::-webkit-scrollbar-thumb]:bg-[var(--color-rule-strong)]\",\n \"ds:[&::-webkit-scrollbar-thumb]:transition-colors ds:[&::-webkit-scrollbar-thumb]:duration-[var(--duration-normal)] ds:motion-reduce:[&::-webkit-scrollbar-thumb]:transition-none\",\n ),\n className,\n )}\n {...props}\n >\n <SidebarLabelsHiddenContext.Provider value={labelsHidden}>\n {/* Collapsed controls raise a tooltip each (SidebarRailTooltip); one\n provider makes them a group: after the first, moving along the\n rail opens each one immediately. Hoverable content keeps the label readable when\n the pointer moves onto it. No DOM. */}\n {collapsible ? (\n <SidebarTooltipScopeContext.Provider value>\n <TooltipProvider delayDuration={200} skipDelayDuration={400}>\n {children}\n </TooltipProvider>\n </SidebarTooltipScopeContext.Provider>\n ) : (\n children\n )}\n </SidebarLabelsHiddenContext.Provider>\n </aside>\n );\n});\nSidebar.displayName = \"Sidebar\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * Trigger\n *\n * Toggle button. Designed to live in either the brand row (inside\n * <Sidebar>) or an app header (outside <Sidebar>, but inside the\n * provider tree). Renders `null` when no provider is mounted so apps\n * can drop it in without conditionals.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport interface SidebarTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n expandLabel?: string;\n collapseLabel?: string;\n}\n\nexport const SidebarTrigger = React.forwardRef<HTMLButtonElement, SidebarTriggerProps>(\n function SidebarTrigger(\n {\n className,\n expandLabel,\n collapseLabel,\n onClick,\n ...props\n },\n ref,\n ) {\n const messages = useDsMessages(\"sidebar\");\n const ctx = React.useContext(SidebarContext);\n if (!ctx) return null;\n const { state, toggle, sidebarId } = ctx;\n const label =\n state === \"expanded\" ? (collapseLabel ?? messages.collapse) : (expandLabel ?? messages.expand);\n return (\n <SidebarRailTooltip label={label}>\n <button\n ref={ref}\n type=\"button\"\n aria-label={label}\n aria-expanded={state === \"expanded\"}\n aria-controls={sidebarId}\n onClick={(e) => {\n onClick?.(e);\n if (!e.defaultPrevented) toggle();\n }}\n {...slot(sidebarAnatomy, \"trigger\")}\n className={cn(\n \"ds:inline-flex ds:size-7 ds:shrink-0 ds:cursor-pointer ds:items-center ds:justify-center ds:rounded-control\",\n \"ds:text-fg-3 ds:hover:bg-bg-3 ds:hover:text-fg\",\n \"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n FORCED_COLORS_FOCUS,\n \"ds:[&_svg]:size-4\",\n className,\n )}\n {...props}\n >\n {state === \"expanded\" ? <PanelLeftCloseIcon /> : <PanelLeftIcon />}\n </button>\n </SidebarRailTooltip>\n );\n },\n);\nSidebarTrigger.displayName = \"SidebarTrigger\";\n\n/**\n * @deprecated No-op. Hover-peek was removed, so the collapsed rail never\n * auto-expands and there is nothing to hold open: a menu anchored in the\n * rail now simply opens beside it. Kept so existing callers compile.\n */\nexport function useSidebarPeekLock(active: boolean): void {\n void active;\n}\n\n/* ───────────────────────────────────────────────────────────────────────\n * SidebarPinButton\n *\n * The in-column collapse control: « while expanded, » while railed. It\n * stays mounted (and visible) in both states, so a click or Enter keeps\n * focus on the same button across the toggle and the way back out of the\n * rail is always one press away.\n *\n * Renders null when no provider is mounted or when collapsible is false,\n * mirroring <SidebarTrigger>'s drop-in safety.\n *\n * Coexists with <SidebarTrigger>. Pick one per product based on voice:\n * pin/unpin (this) for products where the user mental model is \"this stays\n * where I left it,\" collapse/expand (SidebarTrigger) for products where the\n * action language is more about visibility than commitment.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport interface SidebarPinButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** aria-label when state=\"rail\" (default: the `sidebar.expand` message, \"Expand sidebar\"). */\n pinLabel?: string;\n /** aria-label when state=\"expanded\" (default: the `sidebar.collapse` message, \"Collapse sidebar\"). */\n unpinLabel?: string;\n}\n\nexport const SidebarPinButton = React.forwardRef<HTMLButtonElement, SidebarPinButtonProps>(\n function SidebarPinButton(\n {\n pinLabel,\n unpinLabel,\n className,\n onClick,\n ...props\n },\n ref,\n ) {\n const messages = useDsMessages(\"sidebar\");\n const ctx = React.useContext(SidebarContext);\n // No-op outside a provider OR when the sidebar is not collapsible —\n // pin has no meaning when the column never collapses.\n if (!ctx || !ctx.collapsible) return null;\n const { state, setState, sidebarId } = ctx;\n const isPinned = state === \"expanded\";\n const label = isPinned ? (unpinLabel ?? messages.collapse) : (pinLabel ?? messages.expand);\n return (\n <SidebarRailTooltip label={label}>\n <button\n ref={ref}\n type=\"button\"\n aria-label={label}\n // `aria-pressed` is the 1.x contract (C-STATE); `aria-expanded` +\n // `aria-controls` are what a disclosure for the column should say.\n aria-pressed={isPinned}\n aria-expanded={isPinned}\n aria-controls={sidebarId}\n onClick={(e) => {\n onClick?.(e);\n if (!e.defaultPrevented) setState(isPinned ? \"rail\" : \"expanded\");\n }}\n {...slot(sidebarAnatomy, \"pin\")}\n {...stateAttributes({ selected: isPinned })}\n className={cn(\n \"ds:inline-flex ds:size-7 ds:shrink-0 ds:cursor-pointer ds:items-center ds:justify-center ds:rounded-control\",\n \"ds:text-fg-4 ds:hover:bg-bg-3 ds:hover:text-fg ds:aria-pressed:text-fg\",\n \"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:focus-visible:outline-none ds:focus-visible:[box-shadow:var(--shadow-focus-ring)]\",\n FORCED_COLORS_FOCUS,\n className,\n )}\n {...props}\n >\n {/* A direction, not a thumbtack: « folds the pinned column to the rail,\n » brings it back, so the glyph says what the click will do. */}\n {isPinned ? <ChevronsLeftIcon size={16} /> : <ChevronsRightIcon size={16} />}\n </button>\n </SidebarRailTooltip>\n );\n },\n);\nSidebarPinButton.displayName = \"SidebarPinButton\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * Brand\n *\n * Plain flex row. Children that should disappear in rail (e.g. the\n * wordmark text) should be wrapped in <SidebarBrandText>;\n * a bare logo glyph passed as a sibling stays put.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport type SidebarBrandProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const SidebarBrand = React.forwardRef<HTMLDivElement, SidebarBrandProps>(\n function SidebarBrand({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n {...slot(sidebarAnatomy, \"brand\")}\n className={cn(\n \"ds:flex ds:min-w-0 ds:items-center ds:gap-2 ds:px-2.5 ds:pt-1 ds:pb-4\",\n // Railed, the row stacks: the mark on top, a trigger/pin below it,\n // both centred in the icon column — side by side they would not fit.\n \"ds:group-data-[labels=hide]/sidebar:flex-col ds:group-data-[labels=hide]/sidebar:justify-center ds:group-data-[labels=hide]/sidebar:gap-1 ds:group-data-[labels=hide]/sidebar:px-0\",\n // Flush: pinned to the top of the scrolling column so the nav rows\n // pass behind it instead of over it. `data-scrolled` is only ever\n // set while flush (see <Sidebar>), so the hairline needs no variant\n // check of its own — one derived attribute, one rule.\n // Sticky row's fill matches the aside's own flush background\n // (`bg-surface`, W-cursor-sidebar-tooltips) so scrolled nav rows\n // disappear behind it rather than showing through.\n \"ds:group-data-[variant=flush]/sidebar:bg-surface ds:group-data-[variant=flush]/sidebar:sticky ds:group-data-[variant=flush]/sidebar:top-0 ds:group-data-[variant=flush]/sidebar:z-[var(--z-sticky)]\",\n \"ds:group-data-[variant=flush]/sidebar:border-b ds:group-data-[variant=flush]/sidebar:border-transparent ds:group-data-[variant=flush]/sidebar:transition-colors ds:group-data-[variant=flush]/sidebar:duration-[var(--duration-normal)] ds:group-data-[variant=flush]/sidebar:ease-[var(--ease-out-quart)] ds:group-data-[variant=flush]/sidebar:motion-reduce:transition-none\",\n \"ds:group-data-[scrolled=true]/sidebar:border-rule\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nSidebarBrand.displayName = \"SidebarBrand\";\n\n/**\n * Text portion of the brand row. Hides itself when the sidebar\n * collapses to a rail. Use to wrap product names / wordmarks so the\n * logo glyph alone remains visible at 64px.\n */\nexport type SidebarBrandTextProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const SidebarBrandText = React.forwardRef<HTMLSpanElement, SidebarBrandTextProps>(\n function SidebarBrandText({ className, ...props }, ref) {\n const collapsed = useCollapsedAttribute();\n return (\n <span\n ref={ref}\n aria-hidden=\"false\"\n {...slot(sidebarAnatomy, \"brand-text\")}\n {...collapsed}\n className={cn(\n // line-clamp-1 (not `truncate`) so multi-word wordmarks clip at a\n // word boundary instead of mid-word when the rail is narrow.\n \"ds:min-w-0 ds:line-clamp-1\",\n \"ds:max-w-[160px]\",\n // Railed: removed from layout, not faded in place — a zero-width\n // ghost would still claim the row's gap and break centring. The\n // column clips during the sweep, so the wordmark never wraps.\n \"ds:group-data-[labels=hide]/sidebar:hidden\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nSidebarBrandText.displayName = \"SidebarBrandText\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * Section\n *\n * Label hides in rail (the section keeps its vertical rhythm via the\n * existing `mb-4`, so grouping reads even without the text). Stays in\n * the DOM as `aria-label` on the group when collapsed — screen readers\n * announce the group regardless of visual state.\n *\n * Also: provides an *exclusive-open scope* to descendant <SidebarLinkGroup>s.\n * When a group's body row is clicked it claims exclusivity within its\n * containing section; siblings collapse. Chevron clicks bypass this and\n * toggle in place. See `SidebarLinkGroup` for the rule.\n * ─────────────────────────────────────────────────────────────────────── */\n\ninterface SidebarGroupScopeValue {\n exclusiveId: string | null;\n setExclusive: (id: string) => void;\n}\n\nconst SidebarGroupScopeContext = React.createContext<SidebarGroupScopeValue | null>(null);\n\nexport interface SidebarSectionProps extends React.HTMLAttributes<HTMLDivElement> {\n label?: React.ReactNode;\n /**\n * Label color tone. Encodes the *meaning* of the section's\n * priority in the scan path:\n * - `\"pro\"` (default) — Pro-purple, for primary day-to-day work.\n * - `\"muted\"` — `text-fg-3`, for system-level or settings groups\n * that should sit lower in the visual hierarchy.\n *\n * Mirrors the `tone` API on `<SidebarLinkBadge>`.\n */\n tone?: \"pro\" | \"muted\";\n /**\n * Trailing slot in the section's header row, beside the label — an \"add\"\n * icon button, a count, a disclosure. The header row is already a\n * `justify-between` flex row, so this lands at its right edge, and it hides\n * with the rest of the header in rail mode.\n *\n * Rendered bare, with no wrapper of ours, and only when a header row exists\n * (`label` or `headerActions` present) — so a section without it keeps the\n * exact 1.x DOM `C-DOM-06` freezes (the header row stays the section's first\n * child div).\n *\n * @experimental W7-03.\n */\n headerActions?: React.ReactNode;\n}\n\nexport const SidebarSection = React.forwardRef<HTMLDivElement, SidebarSectionProps>(\n function SidebarSection(\n { label, tone = \"pro\", headerActions, className, children, ...props },\n ref,\n ) {\n const collapsed = useCollapsedAttribute();\n const ariaLabel =\n typeof label === \"string\" ? label : typeof label === \"number\" ? String(label) : undefined;\n\n const [exclusiveId, setExclusiveIdState] = React.useState<string | null>(null);\n const setExclusive = React.useCallback(\n (id: string) => setExclusiveIdState(id),\n [],\n );\n const scope = React.useMemo<SidebarGroupScopeValue>(\n () => ({ exclusiveId, setExclusive }),\n [exclusiveId, setExclusive],\n );\n\n return (\n <SidebarGroupScopeContext.Provider value={scope}>\n <div\n ref={ref}\n role={ariaLabel ? \"group\" : undefined}\n aria-label={ariaLabel}\n {...slot(sidebarAnatomy, \"section\")}\n {...collapsed}\n className={cn(\n \"ds:mb-4\",\n // Railed, the heading collapses away and a hairline between\n // consecutive sections takes over as the grouping cue. Keyed on\n // the preceding sibling, so no trailing rule lands above a\n // footer. `mb-2` + `pt-2` spend the same 16px the expanded `mb-4`\n // does, so rows don't jump vertically.\n \"ds:group-data-[labels=hide]/sidebar:mb-2\",\n \"ds:group-data-[labels=hide]/sidebar:[[data-slot=sidebar-section]+&]:border-t ds:group-data-[labels=hide]/sidebar:[[data-slot=sidebar-section]+&]:border-rule ds:group-data-[labels=hide]/sidebar:[[data-slot=sidebar-section]+&]:pt-2\",\n className,\n )}\n {...props}\n >\n {(label != null || headerActions != null) && (\n <div\n {...slot(sidebarAnatomy, \"section-header\")}\n {...collapsed}\n className={cn(\n \"ds:mb-1 ds:flex ds:max-h-10 ds:items-center ds:justify-between ds:overflow-hidden ds:px-2.5 ds:py-1 ds:whitespace-nowrap\",\n // Railed, the heading folds to zero height instead of leaving\n // an invisible gap; `invisible` drops it from the a11y tree\n // (the group keeps its `aria-label`). Height, spacing and\n // opacity move together with the column's width.\n \"ds:motion-safe:group-data-[ready=true]/sidebar:transition-[max-height,margin,padding,opacity] ds:duration-[var(--motion-duration-spatial)] ds:ease-[var(--motion-ease-move)]\",\n \"ds:opacity-100\",\n \"ds:group-data-[labels=hide]/sidebar:invisible ds:group-data-[labels=hide]/sidebar:mb-0 ds:group-data-[labels=hide]/sidebar:max-h-0 ds:group-data-[labels=hide]/sidebar:py-0 ds:group-data-[labels=hide]/sidebar:opacity-0\",\n )}\n >\n {label != null && (\n <span\n {...slot(sidebarAnatomy, \"section-label\")}\n className={cn(\n \"ds:font-mono ds:text-[11px] ds:tracking-[0.14em] ds:uppercase\",\n tone === \"muted\" ? \"ds:text-fg-3\" : \"ds:text-brand\",\n // Flush: the `overline` type role (size/leading/tracking/\n // weight together) at a flat fg-4 — grouping reads as\n // quiet structural chrome, not a tone-coded eyebrow.\n \"ds:group-data-[variant=flush]/sidebar:font-sans ds:group-data-[variant=flush]/sidebar:text-overline ds:group-data-[variant=flush]/sidebar:text-fg-4\",\n )}\n >\n {label}\n </span>\n )}\n {headerActions}\n </div>\n )}\n {children}\n </div>\n </SidebarGroupScopeContext.Provider>\n );\n },\n);\nSidebarSection.displayName = \"SidebarSection\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * Link\n *\n * In rail (no peek):\n * - Icon centers (justify-center, no gap consumption)\n * - Label, badge, and any other text children are hidden\n *\n * The active rail indicator already anchors to `before:left-0` of the\n * link itself, so it stays visually correct without changes.\n * ─────────────────────────────────────────────────────────────────────── */\n\n/**\n * Forced-colors (Windows high contrast) replaces backgrounds and drops\n * box-shadows, which is how the sidebar paints both its focus ring and its\n * active tint. These restore each as an outline in the system colours.\n */\nconst FORCED_COLORS_FOCUS =\n \"ds:forced-colors:focus-visible:outline-solid ds:forced-colors:focus-visible:outline-2 ds:forced-colors:focus-visible:-outline-offset-2\";\nconst FORCED_COLORS_ACTIVE =\n \"ds:forced-colors:data-[active=true]:outline-solid ds:forced-colors:data-[active=true]:outline-1 ds:forced-colors:data-[active=true]:-outline-offset-1\";\n\n// The icon brightens and the small edge mark grows; the row stays stationary.\nconst SIDEBAR_ROW_MOTION = cn(\n \"ds:[&_svg]:transition-opacity ds:[&_svg]:duration-[var(--duration-fast)] ds:[&_svg]:ease-[var(--ease-out-quart)]\",\n \"ds:hover:[&_svg]:opacity-100 ds:data-[active=true]:[&_svg]:opacity-100 ds:motion-reduce:[&_svg]:transition-none\",\n \"ds:before:pointer-events-none ds:before:absolute ds:before:content-[''] ds:before:top-1/2 ds:before:start-0\",\n \"ds:before:h-4 ds:before:w-[2px] ds:before:-translate-y-1/2 ds:before:bg-brand ds:before:rounded-e-full\",\n \"ds:before:origin-center ds:before:scale-y-0 ds:before:opacity-0\",\n \"ds:before:transition-[opacity,scale] ds:before:duration-[var(--duration-normal)] ds:before:ease-[var(--ease-out-quart)]\",\n \"ds:hover:before:scale-y-100 ds:hover:before:opacity-40 ds:data-[active=true]:before:scale-y-100 ds:data-[active=true]:before:opacity-100\",\n \"ds:motion-reduce:before:transition-none\",\n // White surface variants show state through tint and text, without an edge marker.\n \"ds:group-data-[variant=floating]/sidebar:before:hidden ds:group-data-[variant=flush]/sidebar:before:hidden\",\n);\n\n/**\n * Railed, a row's badge (hidden with its label) becomes a dot on the icon's\n * top-end corner, coloured by the badge's tone, so \"something is waiting\n * here\" survives the collapse. The count itself is in the row's tooltip.\n */\nconst RAIL_BADGE_DOT = cn(\n \"ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge]]:after:absolute ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge]]:after:content-['']\",\n \"ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge]]:after:top-1 ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge]]:after:end-1\",\n \"ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge]]:after:size-1.5 ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge]]:after:rounded-full\",\n \"ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge]]:after:bg-brand\",\n \"ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge][data-tone=danger]]:after:bg-danger-fg\",\n \"ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge][data-tone=warning]]:after:bg-warning-fg\",\n \"ds:group-data-[labels=hide]/sidebar:has-[[data-slot=sidebar-link-badge][data-tone=neutral]]:after:bg-fg-3\",\n);\n\nexport interface SidebarLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /** Required when rendered as `<a>`; ignored when `asChild` is true. */\n href?: string;\n icon?: React.ReactNode;\n active?: boolean;\n /**\n * Render via Radix `<Slot>` so the consumer can wrap a router-aware\n * component (e.g. Next.js `<Link>`, React Router `<NavLink>`) that\n * owns `href` and prefetch behavior. Without this, sidebar clicks\n * bypass client-side routing and trigger full page loads.\n */\n asChild?: boolean;\n}\n\nfunction getTextContent(node: React.ReactNode): string {\n if (node == null || typeof node === \"boolean\") return \"\";\n if (typeof node === \"string\" || typeof node === \"number\") return String(node);\n if (Array.isArray(node)) return node.map(getTextContent).filter(Boolean).join(\" \");\n if (React.isValidElement<{ children?: React.ReactNode }>(node)) {\n return getTextContent(node.props.children);\n }\n return \"\";\n}\n\nexport const SidebarLink = React.forwardRef<HTMLAnchorElement, SidebarLinkProps>(\n function SidebarLink(\n { href, icon, active = false, asChild, className, children, \"aria-label\": ariaLabel, ...props },\n ref,\n ) {\n const Comp = asChild ? Slot : \"a\";\n const accessibleLabel = ariaLabel ?? (asChild ? undefined : getTextContent(children) || undefined);\n\n const labelsHidden = React.useContext(SidebarLabelsHiddenContext);\n\n // Derived even for `asChild`, unlike `accessibleLabel` above: this is\n // display text for a tooltip, not an accessibility override on someone\n // else's element, so reaching into the wrapped router link for its label\n // is safe and is exactly what the collapsed row needs to name itself.\n const childAriaLabel =\n asChild && React.isValidElement<{ \"aria-label\"?: string }>(children)\n ? children.props[\"aria-label\"]\n : undefined;\n const tooltipLabel = ariaLabel ?? childAriaLabel ?? (getTextContent(children) || undefined);\n\n const link = (\n <Comp\n ref={ref}\n {...(asChild ? {} : { href })}\n data-active={active ? \"true\" : undefined}\n aria-current={active ? \"page\" : undefined}\n aria-label={accessibleLabel}\n {...slot(sidebarAnatomy, \"link\")}\n className={cn(\n \"ds:group/link ds:relative ds:mb-px ds:flex ds:cursor-pointer ds:items-center ds:gap-2.5 ds:rounded-control ds:px-2.5 ds:py-1.5\",\n // Railed: the row becomes the icon column's own square-ish target,\n // the icon centred in it (labels and badges are display:none, so\n // the gap collapses with them).\n \"ds:group-data-[labels=hide]/sidebar:justify-center ds:group-data-[labels=hide]/sidebar:px-0\",\n \"ds:text-fg-2 ds:text-[13px] ds:font-normal ds:no-underline\",\n \"ds:transition-colors ds:duration-[var(--duration-normal)] ds:ease-[var(--ease-out-quart)]\",\n \"ds:motion-reduce:transition-none\",\n \"ds:hover:bg-bg-3 ds:hover:text-fg\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n \"ds:data-[active=true]:bg-brand-bg ds:data-[active=true]:text-brand ds:data-[active=true]:font-medium\",\n // Flush: icons read fg-3 at rest and lift to fg on hover/active —\n // the row's own bg-brand-bg tint (above) already carries\n // \"active\", so the icon doesn't\n // also need brand-colored ink. Placed before the rail rule below\n // so a collapsed rail keeps winning on the combined flush+rail\n // case (equal specificity, source order decides).\n \"ds:group-data-[variant=flush]/sidebar:[&_svg]:text-fg-3 ds:group-data-[variant=flush]/sidebar:hover:[&_svg]:text-fg ds:group-data-[variant=flush]/sidebar:data-[active=true]:[&_svg]:text-fg\",\n // In rail, the icon itself carries the active state rather\n // than just the rule bar — color is more legible than a 2px\n // vertical mark at the column's left edge when labels are\n // hidden. The full-opacity icon override (`opacity-100`)\n // counters the default `[&_svg]:opacity-85` so the active\n // icon doesn't read as \"still inactive but darker\".\n \"ds:group-data-[labels=hide]/sidebar:data-[active=true]:[&_svg]:text-brand ds:group-data-[labels=hide]/sidebar:data-[active=true]:[&_svg]:opacity-100\",\n // Classic rail: 2px wide, 16px tall, anchored to the link's\n // own left edge — no parent-padding dependency. Continues\n // working unchanged when the aside narrows to a rail.\n SIDEBAR_ROW_MOTION,\n RAIL_BADGE_DOT,\n FORCED_COLORS_FOCUS,\n FORCED_COLORS_ACTIVE,\n \"ds:[&_svg]:size-3.5 ds:[&_svg]:shrink-0 ds:[&_svg]:opacity-85\",\n // Floating variant: taller hit areas, with the same control corners\n // and quiet tint/icon feedback.\n \"ds:group-data-[variant=floating]/sidebar:gap-3 ds:group-data-[variant=floating]/sidebar:py-2\",\n // Flush row anatomy: 32px rows on the control radius (this already\n // matches the base py-1.5 at the body-sm role's leading — only the\n // radius and icon geometry actually move), 16px icons at full\n // opacity (the fg-3→fg color lift above already carries the\n // dimming, so the base opacity-85 would double it up), and labels\n // on the body-sm role instead of a hardcoded pixel size.\n \"ds:group-data-[variant=flush]/sidebar:rounded-control ds:group-data-[variant=flush]/sidebar:[&_svg]:size-4 ds:group-data-[variant=flush]/sidebar:[&_svg]:opacity-100 ds:group-data-[variant=flush]/sidebar:text-body-sm\",\n className,\n )}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {icon}\n <span\n {...slot(sidebarAnatomy, \"link-label\")}\n {...(labelsHidden ? { \"data-collapsed\": \"true\" as const } : {})}\n className={cn(\n // Flex row so a trailing <SidebarLinkBadge> (ml-auto) aligns\n // to the right edge with a gap from the label, instead of\n // butting against it. A line-clamp box swallows the badge's\n // auto margin, which is why \"Billing$48k\" rendered glued.\n // Single-line label clips via overflow; badge stays put.\n \"ds:flex ds:min-w-0 ds:flex-1 ds:items-center ds:gap-1.5 ds:overflow-hidden ds:whitespace-nowrap\",\n \"ds:group-data-[labels=hide]/sidebar:hidden\",\n )}\n >\n {children}\n </span>\n </>\n )}\n </Comp>\n );\n\n return <SidebarRailTooltip label={tooltipLabel}>{link}</SidebarRailTooltip>;\n },\n);\nSidebarLink.displayName = \"SidebarLink\";\n\n/**\n * Label slot for `<SidebarLink asChild>` consumers.\n *\n * The default (non-`asChild`) `SidebarLink` already hides its label in rail\n * mode. When consumers opt into `asChild` to wrap a router-aware element,\n * the design system can't reach inside to apply that rule — so consumers\n * compose this atom around their label text. Removes the leaky requirement\n * that every consumer re-stamp `group-data-[labels=hide]/sidebar:hidden`\n * on their inner spans.\n */\nexport type SidebarLinkLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const SidebarLinkLabel = React.forwardRef<HTMLSpanElement, SidebarLinkLabelProps>(\n function SidebarLinkLabel({ className, ...props }, ref) {\n const collapsed = useCollapsedAttribute();\n return (\n <span\n ref={ref}\n {...slot(sidebarAnatomy, \"link-label\")}\n {...collapsed}\n className={cn(\n // line-clamp-1 (not `truncate`) so multi-word labels clip at a\n // word boundary; collapses cleanly with the rail-mode max-width\n // animation since both rules only constrain visible content.\n \"ds:min-w-0 ds:flex-1 ds:line-clamp-1\",\n // Railed: removed outright (not a zero-width ghost that would keep\n // the row's gap and push the icon off centre). The aside clips\n // while it sweeps, so the label never wraps on the way.\n \"ds:group-data-[labels=hide]/sidebar:hidden\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nSidebarLinkLabel.displayName = \"SidebarLinkLabel\";\n\n/**\n * Optional trailing action inside a `<SidebarLink asChild>` (e.g. an\n * expand/collapse chevron for a nested section). Hides in rail because the\n * action is not meaningful when labels themselves are hidden.\n */\nexport type SidebarLinkActionProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const SidebarLinkAction = React.forwardRef<HTMLSpanElement, SidebarLinkActionProps>(\n function SidebarLinkAction({ className, ...props }, ref) {\n const collapsed = useCollapsedAttribute();\n return (\n <span\n ref={ref}\n {...slot(sidebarAnatomy, \"link-action\")}\n {...collapsed}\n className={cn(\n \"ds:group-data-[labels=hide]/sidebar:hidden\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nSidebarLinkAction.displayName = \"SidebarLinkAction\";\n\nexport const sidebarLinkBadgeVariants = cva(\n \"ds:ms-auto ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center ds:font-mono ds:tabular-nums ds:group-data-[labels=hide]/sidebar:hidden\",\n {\n variants: {\n tone: {\n default: \"ds:text-[10.5px] ds:text-fg-4 ds:group-data-[active=true]/link:text-brand\",\n danger: \"ds:rounded-pill ds:bg-danger-bg ds:px-1.5 ds:py-0.5 ds:text-[10.5px] ds:text-danger-fg\",\n warning: \"ds:rounded-pill ds:bg-warning-bg ds:px-1.5 ds:py-0.5 ds:text-[10.5px] ds:text-warning-fg\",\n neutral: \"ds:rounded-pill ds:bg-bg-3 ds:px-1.5 ds:py-0.5 ds:text-[10.5px] ds:text-fg-2\",\n },\n },\n defaultVariants: { tone: \"default\" },\n },\n);\n\nexport type SidebarLinkBadgeVariants = VariantProps<typeof sidebarLinkBadgeVariants>;\n\nexport interface SidebarLinkBadgeProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n SidebarLinkBadgeVariants {}\n\nexport const SidebarLinkBadge = React.forwardRef<HTMLSpanElement, SidebarLinkBadgeProps>(\n function SidebarLinkBadge({ tone, className, ...props }, ref) {\n return (\n <span\n ref={ref}\n {...slot(sidebarAnatomy, \"link-badge\")}\n data-tone={tone ?? \"default\"}\n className={cn(sidebarLinkBadgeVariants({ tone }), className)}\n {...props}\n />\n );\n },\n);\nSidebarLinkBadge.displayName = \"SidebarLinkBadge\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * LinkGroup\n *\n * Expandable nav row with split-click semantics:\n * - Body click (icon + label area): \"I'm activating this section.\"\n * Fires `onActivate` (and follows `href` if no consumer prevents\n * default), opens this group, and *closes any other open group in\n * the same SidebarSection*. The accordion behavior matches user\n * mental model: \"I want to focus on this branch.\"\n * - Chevron click: \"Just let me peek at this.\" Toggles open/closed\n * on this group only — siblings are untouched. Lets users keep\n * two branches open side-by-side for cross-reference work.\n *\n * Exclusive coordination lives in the enclosing `<SidebarSection>` via\n * a small registry context. Outside a section, exclusive becomes a\n * no-op and groups behave as pure independent disclosures.\n *\n * Routing: the body renders as an `<a href>`. For client-side routing\n * frameworks that hijack anchor clicks (Next.js Link, React Router),\n * the standard pattern works as-is. A future `asChild` flag can opt\n * the body into Radix `Slot` for direct router-component wrapping.\n *\n * In rail mode the chevron and the collapsible content hide; the body\n * row collapses to icon-only and a body click still navigates without\n * trying to expand the (hidden) tree.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport interface SidebarLinkGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onClick\"> {\n /**\n * Stable id used for exclusive-mode coordination. Defaults to a\n * generated React id, which is stable across renders within a\n * single tree.\n */\n id?: string;\n icon?: React.ReactNode;\n label: React.ReactNode;\n /** Body href — the body row renders as `<a href>`. */\n href?: string;\n /** Highlights the body row. Independent of the open state. */\n active?: boolean;\n /**\n * One of the group's descendants is the current page. Railed, the\n * children are hidden, so the group's own row then wears the active\n * treatment (tint, brand icon, classic edge bar) to say where you are; expanded,\n * nothing changes. `aria-current` stays on the real active link.\n */\n activeDescendant?: boolean;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * Called when the body row is clicked, before the open state is\n * updated and before the section's exclusive lock is claimed. Call\n * `e.preventDefault()` to opt out of both. Use for navigation that\n * needs to run *before* the accordion behavior (rare).\n */\n onActivate?: (e: React.MouseEvent<HTMLAnchorElement>) => void;\n /**\n * Classes for the body row: `row` is the div holding the link and the\n * chevron, `link` the activating `<a>` (`group-link`). Replaces descendant\n * `div:has(> button[aria-expanded])` overrides on the group (C-DOM-06).\n * Style the active row from the same `active` you pass here.\n */\n classNames?: { row?: string; link?: string };\n children?: React.ReactNode;\n}\n\nexport const SidebarLinkGroup = React.forwardRef<HTMLDivElement, SidebarLinkGroupProps>(\n function SidebarLinkGroup(\n {\n id: idProp,\n icon,\n label,\n href,\n active = false,\n activeDescendant = false,\n defaultOpen = false,\n open: controlled,\n onOpenChange,\n onActivate,\n classNames,\n className,\n children,\n ...props\n },\n ref,\n ) {\n const messages = useDsMessages(\"sidebar\");\n const collapsed = useCollapsedAttribute();\n const labelsHidden = React.useContext(SidebarLabelsHiddenContext);\n const reactId = React.useId();\n const id = idProp ?? reactId;\n const scope = React.useContext(SidebarGroupScopeContext);\n\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);\n const open = controlled ?? uncontrolledOpen;\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (controlled === undefined) setUncontrolledOpen(next);\n onOpenChange?.(next);\n },\n [controlled, onOpenChange],\n );\n\n // When another group in the same section claims exclusivity, close.\n // We watch `exclusiveId` rather than reading it in handlers so a\n // group that's already open closes promptly when a sibling activates.\n React.useEffect(() => {\n if (scope?.exclusiveId && scope.exclusiveId !== id && open) {\n setOpen(false);\n }\n }, [scope?.exclusiveId, id, open, setOpen]);\n\n const handleBodyClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n onActivate?.(e);\n if (e.defaultPrevented) return;\n scope?.setExclusive(id);\n setOpen(true);\n };\n\n const handleChevronClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n // Stop propagation so the body row doesn't also activate.\n e.preventDefault();\n e.stopPropagation();\n setOpen(!open);\n };\n\n const contentId = `${id}-content`;\n\n const bodyClassName = cn(\n \"ds:group/link ds:relative ds:flex ds:flex-1 ds:cursor-pointer ds:items-center ds:gap-2.5 ds:rounded-control ds:px-2.5 ds:py-1.5\",\n \"ds:group-data-[labels=hide]/sidebar:justify-center ds:group-data-[labels=hide]/sidebar:px-0\",\n \"ds:text-fg-2 ds:text-[13px] ds:font-normal ds:no-underline\",\n \"ds:transition-colors ds:duration-[var(--duration-normal)] ds:ease-[var(--ease-out-quart)]\",\n \"ds:motion-reduce:transition-none\",\n \"ds:hover:bg-bg-3 ds:hover:text-fg\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n \"ds:data-[active=true]:bg-brand-bg ds:data-[active=true]:text-brand ds:data-[active=true]:font-medium\",\n // Flush — match SidebarLink: icon fg-3 lifting to fg on hover/active.\n \"ds:group-data-[variant=flush]/sidebar:[&_svg]:text-fg-3 ds:group-data-[variant=flush]/sidebar:hover:[&_svg]:text-fg ds:group-data-[variant=flush]/sidebar:data-[active=true]:[&_svg]:text-fg\",\n // In rail, color carries active state since the chevron is hidden.\n \"ds:group-data-[labels=hide]/sidebar:data-[active=true]:[&_svg]:text-brand ds:group-data-[labels=hide]/sidebar:data-[active=true]:[&_svg]:opacity-100\",\n // Active rail mark — anchored to body row's left edge.\n SIDEBAR_ROW_MOTION,\n RAIL_BADGE_DOT,\n FORCED_COLORS_FOCUS,\n FORCED_COLORS_ACTIVE,\n \"ds:[&_svg]:size-3.5 ds:[&_svg]:shrink-0 ds:[&_svg]:opacity-85\",\n // Floating variant — match SidebarLink: taller hit area, same feedback.\n \"ds:group-data-[variant=floating]/sidebar:gap-3 ds:group-data-[variant=floating]/sidebar:py-2\",\n // Flush — match SidebarLink: 32px row on the control radius, 16px\n // full-opacity icons, body-sm label instead of a hardcoded pixel size.\n \"ds:group-data-[variant=flush]/sidebar:rounded-control ds:group-data-[variant=flush]/sidebar:[&_svg]:size-4 ds:group-data-[variant=flush]/sidebar:[&_svg]:opacity-100 ds:group-data-[variant=flush]/sidebar:text-body-sm\",\n classNames?.link,\n );\n\n const labelSpan = (\n <span\n {...slot(sidebarAnatomy, \"link-label\")}\n {...collapsed}\n className={cn(\n // line-clamp-1 (not `truncate`) so multi-word labels clip at a\n // word boundary; collapses cleanly with the rail-mode max-width\n // animation since both rules only constrain visible content.\n \"ds:min-w-0 ds:flex-1 ds:line-clamp-1\",\n \"ds:group-data-[labels=hide]/sidebar:hidden\",\n )}\n >\n {label}\n </span>\n );\n\n const groupText = getTextContent(label) || undefined;\n const bodyLink = (\n <a\n href={href}\n data-active={active || (labelsHidden && activeDescendant) ? \"true\" : undefined}\n aria-current={active ? \"page\" : undefined}\n aria-label={groupText}\n onClick={handleBodyClick}\n {...slot(sidebarAnatomy, \"group-link\")}\n className={bodyClassName}\n >\n {icon}\n {labelSpan}\n </a>\n );\n\n return (\n <div\n ref={ref}\n {...slot(sidebarAnatomy, \"group\")}\n {...stateAttributes({ state: open ? \"open\" : \"closed\" })}\n className={cn(\"ds:mb-px\", className)}\n {...props}\n >\n <Collapsible open={open} onOpenChange={setOpen}>\n <div className={cn(\"ds:flex ds:items-stretch\", classNames?.row)}>\n <SidebarRailTooltip label={groupText}>{bodyLink}</SidebarRailTooltip>\n <button\n type=\"button\"\n aria-expanded={open}\n aria-controls={contentId}\n aria-label={open ? messages.collapseSection : messages.expandSection}\n onClick={handleChevronClick}\n {...slot(sidebarAnatomy, \"group-trigger\")}\n className={cn(\n \"ds:ml-px ds:inline-flex ds:size-7 ds:shrink-0 ds:cursor-pointer ds:items-center ds:justify-center ds:rounded-control\",\n \"ds:text-fg-4 ds:hover:bg-bg-3 ds:hover:text-fg-2\",\n \"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none\",\n FORCED_COLORS_FOCUS,\n \"ds:[&_svg]:size-3.5 ds:[&_svg]:shrink-0 ds:[&_svg]:transition-transform ds:[&_svg]:duration-[var(--duration-fast)] ds:[&_svg]:ease-[var(--ease-out-quart)] ds:motion-reduce:[&_svg]:transition-none\",\n // Hide in rail — content tree is hidden too, so the\n // affordance has nothing to control.\n \"ds:group-data-[labels=hide]/sidebar:hidden\",\n )}\n >\n <ChevronDownIcon className={open ? \"\" : \"ds:-rotate-90\"} />\n </button>\n </div>\n <CollapsibleContent\n id={contentId}\n {...slot(sidebarAnatomy, \"group-content\")}\n className={cn(\n // Indent column + connecting rule. Children render as\n // standard <SidebarLink>s and keep their own active-rail\n // indicator, which lands flush at the indented column's\n // left edge.\n \"ds:group-data-[labels=hide]/sidebar:hidden\",\n )}\n >\n <div className=\"ds:border-rule ds:mt-px ds:ml-[18px] ds:border-l ds:pl-2\">{children}</div>\n </CollapsibleContent>\n </Collapsible>\n </div>\n );\n },\n);\nSidebarLinkGroup.displayName = \"SidebarLinkGroup\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * Footer\n *\n * Stays at the bottom via `mt-auto`. In rail, centers content (avatar\n * only — see <SidebarUser>).\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport type SidebarFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const SidebarFooter = React.forwardRef<HTMLDivElement, SidebarFooterProps>(\n function SidebarFooter({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n {...slot(sidebarAnatomy, \"footer\")}\n className={cn(\n \"ds:border-rule ds:mt-auto ds:flex ds:items-center ds:gap-2.5 ds:border-t ds:px-2 ds:pt-2.5 ds:pb-1\",\n \"ds:group-data-[labels=hide]/sidebar:justify-center ds:group-data-[labels=hide]/sidebar:px-0\",\n \"ds:text-fg-3 ds:text-xs\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nSidebarFooter.displayName = \"SidebarFooter\";\n\nexport interface SidebarUserProps extends React.HTMLAttributes<HTMLDivElement> {\n name: string;\n subtitle?: React.ReactNode;\n avatarSrc?: string | null;\n}\n\nexport const SidebarUser = React.forwardRef<HTMLDivElement, SidebarUserProps>(function SidebarUser(\n { name, subtitle, avatarSrc, className, ...props },\n ref,\n) {\n const collapsed = useCollapsedAttribute();\n return (\n <div\n ref={ref}\n {...slot(sidebarAnatomy, \"user\")}\n {...collapsed}\n className={cn(\n \"ds:flex ds:min-w-0 ds:items-center ds:gap-2.5\",\n \"ds:group-data-[labels=hide]/sidebar:justify-center ds:group-data-[labels=hide]/sidebar:gap-0\",\n className,\n )}\n {...props}\n >\n {/* Railed, the avatar is all that shows: hovering it names the user.\n It is not a control, so it takes no tab stop; the name and subtitle\n stay in the accessibility tree (`sr-only`) for screen readers. */}\n <SidebarRailTooltip\n label={typeof subtitle === \"string\" && subtitle ? `${name} · ${subtitle}` : name}\n >\n <Avatar size=\"sm\" variant=\"branded\" name={name} src={avatarSrc ?? undefined} />\n </SidebarRailTooltip>\n <div\n className={cn(\n \"ds:min-w-0 ds:leading-tight\",\n // Railed, the avatar stands alone; the name stays readable to\n // screen readers (`sr-only`) since the avatar carries no text.\n \"ds:group-data-[labels=hide]/sidebar:sr-only\",\n )}\n >\n {/* line-clamp-1 (not `truncate`) so long firm names / role lines clip\n at a word boundary instead of mid-word — e.g. \"Pinecrest Tax\n Advisors · …\" rather than \"Pinecrest Tax Advisors · Ow…\". */}\n <div\n {...slot(sidebarAnatomy, \"user-name\")}\n className=\"ds:text-fg ds:line-clamp-1 ds:text-[13px] ds:font-medium\"\n >\n {name}\n </div>\n {subtitle != null && (\n <div\n {...slot(sidebarAnatomy, \"user-subtitle\")}\n className=\"ds:text-fg-4 ds:line-clamp-1 ds:font-mono ds:text-[10.5px]\"\n >\n {subtitle}\n </div>\n )}\n </div>\n </div>\n );\n});\nSidebarUser.displayName = \"SidebarUser\";\n\n/* ───────────────────────────────────────────────────────────────────────\n * SidebarDrawer (W7-04)\n *\n * The same sidebar tree, off-canvas, for small viewports. Built on the\n * Sheet internals (W5-07) so the focus trap, scroll lock, dismissable\n * layer, escape/outside-click handling and the reduced-motion-aware slide\n * all come from the overlay parts rather than being re-implemented here —\n * which is what PORTAL had to do in its own mobile shell.\n *\n * The desktop <Sidebar> is untouched: this is a *second* mount point, not a\n * mode of the first. An app renders the drawer below its mobile breakpoint and\n * the column above it, hiding each with its own responsive utility, and passes\n * the same nav tree to both.\n *\n * Inside the panel the tree renders at full width with labels shown, so the\n * nav atoms behave exactly as they do in an expanded column — the drawer\n * carries `group/sidebar` plus `data-labels=\"show\"` itself, which is the\n * contract those atoms read. `data-mode=\"mobile\"` distinguishes it from the\n * column for anything that needs to.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport interface SidebarDrawerProps {\n /** Controlled open state. */\n open?: boolean;\n /** Initial open state when uncontrolled. */\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * Accessible name of the drawer. Defaults to `sidebar.navigation`\n * (\"Navigation\") from the provider's messages.\n */\n label?: string;\n /** Extra classes on the sliding panel. */\n className?: string;\n children?: React.ReactNode;\n}\n\n/**\n * Off-canvas sidebar for small viewports.\n *\n * @experimental W7-04. The desktop `Sidebar` is unchanged; this is an\n * additional mount point whose panel geometry may still change.\n */\nexport function SidebarDrawer({\n open,\n defaultOpen,\n onOpenChange,\n label,\n className,\n children,\n}: SidebarDrawerProps) {\n const messages = useDsMessages(\"sidebar\");\n return (\n <Sheet\n {...(open !== undefined && { open })}\n {...(defaultOpen !== undefined && { defaultOpen })}\n {...(onOpenChange !== undefined && { onOpenChange })}\n >\n <SheetContent\n side=\"left\"\n data-mode=\"mobile\"\n data-labels=\"show\"\n // Legacy name first — see the comment on `effectiveWidth` above.\n style={{ width: \"var(--shell-sidebar-w, var(--ds-layout-shell-sidebar-width))\" }}\n className={cn(\n \"ds:group/sidebar group/sidebar ds:scrollbar-thin ds:bg-bg-2 ds:flex ds:flex-col ds:overflow-y-auto ds:px-3 ds:pt-4 ds:pb-4\",\n className,\n )}\n >\n {/* Radix requires a title for the dialog's accessible name; the\n drawer's chrome is the nav itself, so it is visually hidden. */}\n <SheetTitle className=\"ds:sr-only\">{label ?? messages.navigation}</SheetTitle>\n {children}\n </SheetContent>\n </Sheet>\n );\n}\nSidebarDrawer.displayName = \"SidebarDrawer\";\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport { ChevronDownIcon } from \"../primitives/icons\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../primitives/dropdown-menu\";\nimport {\n sidebarBrandSwitcherAnatomy,\n type SidebarBrandSwitcherSlot,\n} from \"../foundation/anatomy/slots\";\nimport { slot } from \"../foundation/anatomy/slot\";\nimport { SidebarBrandText, SidebarRailTooltip } from \"./sidebar\";\n\n/** The brand-switcher parts (ADR-008). See the registry for the doc comment. */\nexport type { SidebarBrandSwitcherSlot };\n\n/* ───────────────────────────────────────────────────────────────────────\n * SidebarBrandSwitcher\n *\n * Brand-row dropdown for switching between sibling products / workspaces\n * (Notion / Linear pattern). The whole brand row is the trigger: a\n * consumer-supplied glyph + wordmark + chevron. Collapses to icon-only\n * in rail mode via the standard `data-[labels=hide]/sidebar` group.\n *\n * Named for its slot: it sits where <SidebarBrand> would, alongside\n * <SidebarBrandText> and <SidebarPinButton> in the brand-row family. The\n * Sidebar prefix groups it with its neighbors in autocomplete and signals\n * the coupling — this composite reads sidebar state (rail)\n * and is not designed to be mounted outside the sidebar shell.\n *\n * **Replaces <SidebarBrand>, do not nest inside it.** The switcher renders\n * its own brand row with the same `px-2.5 pt-1 pb-4 gap-2` geometry, so the\n * brand glyph aligns with link icons below. Wrapping in <SidebarBrand>\n * doubles the padding and shifts the glyph right of the icon column.\n *\n * <Sidebar collapsible>\n * <SidebarBrandSwitcher\n * brand={<img src=\"/brand/mark.svg\" alt=\"\" width={24} height={24} />}\n * label={<>Assure <span className=\"text-pro-fg font-medium\">Pro</span></>}\n * current={items[0]}\n * items={items}\n * onLaunch={launch}\n * trailing={<SidebarPinButton className=\"ml-0.5\" />}\n * />\n * <SidebarSection label=\"MAIN\" tone=\"muted\">…</SidebarSection>\n * </Sidebar>\n *\n * Token discipline: this composite owns layout, motion, and the row\n * affordances, but never owns *product brand colors*. The accent swatch\n * for each item is supplied by the consumer via `tone` (a Tailwind class\n * string or a fully-rendered glyph), keeping vendor-specific hex out of\n * the DS.\n *\n * Framework neutrality: the brand image is a consumer slot. The DS does\n * not import `next/image` or any framework primitive — pass whatever\n * element your stack uses.\n *\n * Sidebar coordination: railed, the menu opens to the right of the mark\n * and the column stays railed — opening a menu never changes the\n * sidebar's state; that remains the job of <SidebarPinButton>.\n * ─────────────────────────────────────────────────────────────────────── */\n\nexport interface SidebarBrandSwitcherItem {\n /** Stable id used as React key and for `data-item` on each row. */\n id: string;\n /** Primary display name, e.g. \"Assure Audit\". */\n name: string;\n /** Sub-line under the name, e.g. \"Audit fieldwork\". */\n tagline?: string;\n /**\n * Short label rendered inside the default tile glyph (first character\n * is used, à la \"A\" for \"Audit\"). Ignored when `glyph` is supplied.\n */\n short?: string;\n /**\n * Accent for the default tile background. A Tailwind class string\n * (e.g. `\"bg-[#5b3bc4]\"`) — the consumer owns brand color values, the\n * DS just composes them. The tile's initial is white 11px text, so pick\n * a background with at least 4.5:1 against white (WCAG AA), or pass a\n * `glyph`. Ignored when `glyph` is supplied.\n */\n tone?: string;\n /**\n * Pre-rendered tile glyph. When provided, replaces the default\n * \"first letter on `tone` swatch\" tile entirely. Use for items that\n * have a real mark instead of a letter.\n */\n glyph?: React.ReactNode;\n /**\n * Full-width identity node rendered in place of the tile + `name`\n * — e.g. a product wordmark lockup (`<Logo href={null} …>`). When present\n * the row omits the tile and the `name` text; `tagline` still renders\n * beneath it. When absent the row falls back to tile + `name`.\n *\n * Framework-neutral like the rest of this composite: pass whatever element\n * your stack renders (a DS `Logo`, a plain `<img>`, an inline SVG). The DS\n * does not bind to it.\n */\n identity?: React.ReactNode;\n /**\n * False marks the item as not-yet-available; rendered disabled with\n * a \"Soon\" badge by default (override via `unavailableBadge`).\n */\n available?: boolean;\n /** Pass-through onto the row's `data-item` for analytics / e2e hooks. */\n dataAttr?: string;\n}\n\n/**\n * An external launcher row appended after the \"Switch to\" list — a non-suite\n * entry with no availability / \"Soon\" semantics (e.g. a partner product reached\n * by its own autologin URL rather than the suite's switch model). Vendor color\n * lives in the consumer-owned `glyph`, keeping brand hex out of the DS.\n */\nexport interface SidebarBrandSwitcherExtra {\n /** Stable id — React key and default `data-item`. */\n id: string;\n /** Left glyph (a consumer-owned mark/tile). Vendor color belongs here. */\n glyph?: React.ReactNode;\n /**\n * Full-width identity node rendered in place of the `glyph` + `name` — e.g. a\n * product wordmark lockup (`<Logo href={null} …>`) — mirroring\n * `SidebarBrandSwitcherItem.identity`. Use it so an external launcher row\n * reads at the same size and on the same line as the suite product rows.\n * When present, `tagline` still renders beneath it and `glyph`/`name` are\n * omitted. Consumer-owned and framework-neutral like the rest of this slot.\n */\n identity?: React.ReactNode;\n /** Primary display name, e.g. \"myCPE One\". */\n name: React.ReactNode;\n /** Sub-line under the name. */\n tagline?: React.ReactNode;\n /** Invoked when the row is selected. The DS holds no opinion on what it does. */\n onSelect: () => void;\n /** Pass-through onto the row's `data-item` for analytics / e2e hooks. */\n dataAttr?: string;\n}\n\nexport interface SidebarBrandSwitcherProps {\n /**\n * Brand glyph rendered at the left edge of the trigger (e.g. an\n * `<img>` of the product mark). Consumer-supplied so the DS does\n * not bind to a framework-specific image element.\n */\n brand?: React.ReactNode;\n /**\n * The collapsed rail's glyph: rendered only while the sidebar is railed,\n * centred in the icon column, in place of `brand` (which then shows only\n * expanded). Pass the product mark here and the wordmark as `label`, and\n * the brand row needs no state classes of its own — the usual cause of a\n * rail with no logo at all is a hand-written `hidden …:block` toggle whose\n * group selector matches nothing.\n */\n mark?: React.ReactNode;\n /** Wordmark / label rendered next to the brand glyph in the trigger. */\n label: React.ReactNode;\n /**\n * The currently-active item. Pinned at the top of the menu and\n * excluded from the \"Switch to\" list automatically.\n */\n current: SidebarBrandSwitcherItem;\n /**\n * Full item list including `current`. Order is preserved in the\n * \"Switch to\" section; the current entry is filtered out.\n */\n items: SidebarBrandSwitcherItem[];\n /**\n * Called when a non-current, available item is selected. Receives the\n * full item so consumers can route, open a new window, or trigger an\n * SSO handoff — the DS holds no opinion on what \"switch\" means.\n */\n onLaunch?: (item: SidebarBrandSwitcherItem) => void | Promise<void>;\n /**\n * External launcher rows appended after the \"Switch to\" list — non-suite\n * entries with no availability / \"Soon\" semantics. Each renders a consumer\n * `glyph` + name + tagline and calls its own `onSelect`.\n */\n extras?: SidebarBrandSwitcherExtra[];\n /**\n * Optional predicate reporting whether an item is mid-launch from an\n * external source (e.g. a suite-focus provider that drives the launch itself).\n * ORed with the row's internal launching state to show the \"Opening…\" badge\n * and to guard against a double launch. Absent → only internal state applies.\n */\n isLaunching?: (item: SidebarBrandSwitcherItem) => boolean;\n /** Label above the current row. Defaults to \"Currently using\". */\n currentSectionLabel?: React.ReactNode;\n /** Label above the others list. Defaults to \"Switch to\". */\n switchSectionLabel?: React.ReactNode;\n /** Label at the very top of the menu. Defaults to \"Suite\". */\n menuLabel?: React.ReactNode;\n /** Badge text next to the current item. Defaults to \"Current\". */\n currentBadge?: React.ReactNode;\n /** Badge text on unavailable items. Defaults to \"Soon\". */\n unavailableBadge?: React.ReactNode;\n /** Accessible label on the trigger button. Defaults to \"Switch product\". */\n triggerLabel?: string;\n /** Extra classes applied to the outer brand-row wrapper. */\n className?: string;\n /** Extra classes applied to the trigger button. */\n triggerClassName?: string;\n /** Extra classes applied to the dropdown content panel. */\n contentClassName?: string;\n /** Extra classes applied to the chevron icon. */\n iconClassName?: string;\n /**\n * Extra classes applied to the current row, each \"Switch to\" product row, and\n * each `extras` launcher row. Lets a consumer reproduce bespoke row\n * padding/height via tailwind-merge without the DS owning that geometry, and\n * keeps launcher rows aligned with the product rows.\n */\n rowClassName?: string;\n /**\n * Slot rendered to the right of the trigger inside the brand row.\n * Typical use: drop a `<SidebarPinButton/>` here.\n */\n trailing?: React.ReactNode;\n}\n\nexport const SidebarBrandSwitcher = React.forwardRef<HTMLDivElement, SidebarBrandSwitcherProps>(\n function SidebarBrandSwitcher(\n {\n brand,\n mark,\n label,\n current,\n items,\n onLaunch,\n extras,\n isLaunching,\n currentSectionLabel = \"Currently using\",\n switchSectionLabel = \"Switch to\",\n menuLabel = \"Suite\",\n currentBadge = \"Current\",\n unavailableBadge = \"Soon\",\n triggerLabel = \"Switch product\",\n className,\n triggerClassName,\n contentClassName,\n iconClassName,\n rowClassName,\n trailing,\n },\n ref,\n ) {\n const [open, setOpen] = React.useState(false);\n // The menu hands focus back to the trigger when it closes, which would\n // otherwise pop the rail tooltip open over the column on its own. Held\n // shut until the pointer leaves or focus moves on.\n const [tooltipHeld, setTooltipHeld] = React.useState(false);\n\n const others = items.filter((p) => p.id !== current.id);\n\n return (\n // Geometry mirrors <SidebarBrand>: `px-2.5 pt-1 pb-4 gap-2`. This is\n // deliberate — the switcher replaces SidebarBrand, so the brand\n // glyph must land at the same column x-position that direct children\n // of <SidebarBrand> sit at, which in turn matches the 10px left\n // padding of <SidebarLink> icons below.\n <div\n ref={ref}\n {...slot(sidebarBrandSwitcherAnatomy, \"root\")}\n className={cn(\n \"ds:flex ds:min-w-0 ds:items-center ds:gap-2 ds:px-2.5 ds:pt-1 ds:pb-4\",\n // Railed, mirrors <SidebarBrand>: the mark and the `trailing` control\n // stack, centred in the icon column, so the way back out of the\n // rail (a <SidebarPinButton>) stays visible and reachable.\n \"ds:group-data-[labels=hide]/sidebar:flex-col ds:group-data-[labels=hide]/sidebar:justify-center ds:group-data-[labels=hide]/sidebar:gap-0 ds:group-data-[labels=hide]/sidebar:px-0\",\n // Flush — mirrors <SidebarBrand>: pinned to the top of the\n // scrolling column, with a hairline that appears once the list\n // has scrolled. `data-scrolled` is only ever set while flush, so\n // the hairline rule needs no variant check of its own. Fill\n // matches the aside's own flush background (`bg-surface`).\n \"ds:group-data-[variant=flush]/sidebar:bg-surface ds:group-data-[variant=flush]/sidebar:sticky ds:group-data-[variant=flush]/sidebar:top-0 ds:group-data-[variant=flush]/sidebar:z-[var(--z-sticky)]\",\n \"ds:group-data-[variant=flush]/sidebar:border-b ds:group-data-[variant=flush]/sidebar:border-transparent ds:group-data-[variant=flush]/sidebar:transition-colors ds:group-data-[variant=flush]/sidebar:duration-[var(--duration-normal)] ds:group-data-[variant=flush]/sidebar:ease-[var(--ease-out-quart)] ds:group-data-[variant=flush]/sidebar:motion-reduce:transition-none\",\n \"ds:group-data-[scrolled=true]/sidebar:border-rule\",\n className,\n )}\n >\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <SidebarRailTooltip label={current.name} suppressed={open || tooltipHeld}>\n <DropdownMenuTrigger\n aria-label={triggerLabel}\n onPointerLeave={() => setTooltipHeld(false)}\n onBlur={() => setTooltipHeld(false)}\n {...slot(sidebarBrandSwitcherAnatomy, \"trigger\")}\n className={cn(\n // Negative left margin pulls the trigger's hover-bg toward\n // the column edge while the inner padding holds the brand\n // glyph at the same x-position as direct <SidebarBrand>\n // children — same hover affordance, no glyph drift.\n \"ds:group/brand-trigger ds:-ml-2 ds:flex ds:min-w-0 ds:flex-1 ds:cursor-pointer ds:items-center ds:gap-2 ds:rounded-control ds:py-1.5 ds:pr-1.5 ds:pl-2\",\n // Railed: the trigger is the centred mark alone. The space to\n // the `trailing` control below is the trigger's own margin, not\n // the row's gap, so a consumer `gap-0` on `className` (which\n // outranks ours by cascade layer) cannot butt » against the mark.\n \"ds:group-data-[labels=hide]/sidebar:ml-0 ds:group-data-[labels=hide]/sidebar:w-full ds:group-data-[labels=hide]/sidebar:flex-none ds:group-data-[labels=hide]/sidebar:justify-center ds:group-data-[labels=hide]/sidebar:gap-0 ds:group-data-[labels=hide]/sidebar:px-0\",\n \"ds:group-data-[labels=hide]/sidebar:not-last:mb-1\",\n \"ds:text-fg ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n // `aria-expanded` twin: a TooltipTrigger asChild ancestor can\n // clobber this trigger's own `data-state` with the tooltip's\n // (see toggle-group.tsx's note on the same bug), but never\n // sets `aria-expanded`.\n \"ds:hover:bg-bg-3 ds:data-[state=open]:bg-bg-3 ds:aria-expanded:bg-bg-3\",\n \"ds:focus-visible:outline-none ds:focus-visible:[box-shadow:var(--shadow-focus-ring)]\",\n \"ds:forced-colors:focus-visible:outline-solid ds:forced-colors:focus-visible:outline-2 ds:forced-colors:focus-visible:-outline-offset-2\",\n triggerClassName,\n )}\n >\n {mark != null ? (\n <>\n <span className=\"ds:inline-flex ds:shrink-0 ds:items-center ds:group-data-[labels=hide]/sidebar:hidden\">\n {brand}\n </span>\n <span\n {...slot(sidebarBrandSwitcherAnatomy, \"mark\")}\n className=\"ds:hidden ds:shrink-0 ds:items-center ds:justify-center ds:group-data-[labels=hide]/sidebar:inline-flex\"\n >\n {mark}\n </span>\n </>\n ) : (\n brand\n )}\n <SidebarBrandText className=\"ds:font-display ds:text-fg ds:text-[17px] ds:font-semibold ds:tracking-tight\">\n {label}\n </SidebarBrandText>\n <ChevronDownIcon\n {...slot(sidebarBrandSwitcherAnatomy, \"icon\")}\n className={cn(\n \"ds:ml-auto ds:size-3.5 ds:shrink-0 ds:text-fg-4\",\n \"ds:transition-transform ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none\",\n \"ds:group-data-[state=open]/brand-trigger:rotate-180\",\n \"ds:group-aria-expanded/brand-trigger:rotate-180\",\n \"ds:group-data-[labels=hide]/sidebar:hidden\",\n iconClassName,\n )}\n />\n </DropdownMenuTrigger>\n </SidebarRailTooltip>\n <DropdownMenuContent\n onCloseAutoFocus={() => setTooltipHeld(true)}\n side=\"right\"\n align=\"start\"\n sideOffset={12}\n className={cn(\"ds:w-72 ds:p-1\", contentClassName)}\n >\n <DropdownMenuLabel className=\"ds:px-2 ds:pt-1 ds:pb-1.5\">{menuLabel}</DropdownMenuLabel>\n <SidebarBrandSwitcherSectionLabel>\n {currentSectionLabel}\n </SidebarBrandSwitcherSectionLabel>\n <SidebarBrandSwitcherCurrentRow\n item={current}\n badge={currentBadge}\n rowClassName={rowClassName}\n />\n <DropdownMenuSeparator className=\"ds:my-1.5\" />\n <SidebarBrandSwitcherSectionLabel>\n {switchSectionLabel}\n </SidebarBrandSwitcherSectionLabel>\n {others.map((p) => (\n <SidebarBrandSwitcherOtherRow\n key={p.id}\n item={p}\n onLaunch={onLaunch}\n unavailableBadge={unavailableBadge}\n rowClassName={rowClassName}\n isLaunching={isLaunching}\n />\n ))}\n {extras?.map((extra) => (\n <SidebarBrandSwitcherExtraRow\n key={extra.id}\n extra={extra}\n rowClassName={rowClassName}\n />\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n {trailing}\n </div>\n );\n },\n);\nSidebarBrandSwitcher.displayName = \"SidebarBrandSwitcher\";\n\nfunction SidebarBrandSwitcherSectionLabel({ children }: { children: React.ReactNode }) {\n return (\n <div className=\"ds:px-2 ds:pt-1 ds:pb-0.5 ds:text-[10px] ds:tracking-wider ds:uppercase ds:text-fg-4\">\n {children}\n </div>\n );\n}\n\ninterface SidebarBrandSwitcherTileProps {\n item: SidebarBrandSwitcherItem;\n}\n\nexport function SidebarBrandSwitcherTile({ item }: SidebarBrandSwitcherTileProps) {\n if (item.glyph) return <>{item.glyph}</>;\n const initial = (item.short ?? item.name).charAt(0).toUpperCase();\n return (\n <span\n aria-hidden\n className={cn(\n \"ds:inline-flex ds:size-6 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-md\",\n \"ds:text-[11px] ds:font-semibold ds:text-white\",\n item.tone,\n )}\n >\n {initial}\n </span>\n );\n}\n\n// The left identity block shared by the current and \"Switch to\" rows. When the\n// item supplies an `identity` node (e.g. a wordmark lockup) it renders that\n// full-width, with the tagline beneath and no tile/name text. Otherwise it\n// falls back to the default tile + name + tagline — unchanged from before.\nfunction SidebarBrandSwitcherIdentity({ item }: { item: SidebarBrandSwitcherItem }) {\n if (item.identity) {\n return (\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-0.5\">\n {item.identity}\n {item.tagline && (\n <span className=\"ds:text-fg-3 ds:text-[11px] ds:leading-tight\">{item.tagline}</span>\n )}\n </div>\n );\n }\n return (\n <>\n <SidebarBrandSwitcherTile item={item} />\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col\">\n <span className=\"ds:text-fg ds:text-[13px] ds:font-medium\">{item.name}</span>\n {item.tagline && <span className=\"ds:text-fg-3 ds:text-[11px]\">{item.tagline}</span>}\n </div>\n </>\n );\n}\n\nfunction SidebarBrandSwitcherCurrentRow({\n item,\n badge,\n rowClassName,\n}: {\n item: SidebarBrandSwitcherItem;\n badge: React.ReactNode;\n rowClassName?: string | undefined;\n}) {\n return (\n <div\n className={cn(\n \"ds:mx-0 ds:flex ds:cursor-default ds:items-center ds:gap-2.5 ds:rounded-md ds:bg-bg-2 ds:px-2 ds:py-1.5\",\n rowClassName,\n )}\n >\n <SidebarBrandSwitcherIdentity item={item} />\n {badge && (\n <span className=\"ds:rounded-sm ds:px-1.5 ds:py-0.5 ds:text-[10px] ds:font-medium ds:tracking-wider ds:uppercase ds:text-pro-fg ds:ring-1 ds:ring-pro-fg/30\">\n {badge}\n </span>\n )}\n </div>\n );\n}\n\nfunction SidebarBrandSwitcherOtherRow({\n item,\n onLaunch,\n unavailableBadge,\n rowClassName,\n isLaunching,\n}: {\n item: SidebarBrandSwitcherItem;\n onLaunch?: ((item: SidebarBrandSwitcherItem) => void | Promise<void>) | undefined;\n unavailableBadge: React.ReactNode;\n rowClassName?: string | undefined;\n isLaunching?: ((item: SidebarBrandSwitcherItem) => boolean) | undefined;\n}) {\n const reachable = item.available !== false;\n const [launching, setLaunching] = React.useState(false);\n // A launch may also be driven from outside (e.g. a suite-focus provider that\n // owns the transition). OR that in so the row reflects it and can't double-fire.\n const externalLaunching = isLaunching?.(item) ?? false;\n const busy = launching || externalLaunching;\n\n const handleSelect = async () => {\n if (!reachable || busy || !onLaunch) return;\n setLaunching(true);\n try {\n await onLaunch(item);\n } finally {\n setLaunching(false);\n }\n };\n\n return (\n <DropdownMenuItem\n disabled={!reachable}\n onSelect={(e) => {\n if (!reachable) {\n e.preventDefault();\n return;\n }\n void handleSelect();\n }}\n data-item={item.dataAttr ?? item.id}\n className={cn(\"ds:flex ds:items-center ds:gap-2.5 ds:rounded-md ds:px-2 ds:py-1.5\", rowClassName)}\n >\n <SidebarBrandSwitcherIdentity item={item} />\n {!reachable && unavailableBadge && (\n <span className=\"ds:rounded-sm ds:bg-bg-3 ds:px-1.5 ds:py-0.5 ds:text-[10px] ds:font-medium ds:tracking-wider ds:uppercase ds:text-fg-4\">\n {unavailableBadge}\n </span>\n )}\n {reachable && busy && (\n <span className=\"ds:rounded-sm ds:bg-bg-3 ds:px-1.5 ds:py-0.5 ds:text-[10px] ds:font-medium ds:tracking-wider ds:uppercase ds:text-fg-4\">\n Opening…\n </span>\n )}\n </DropdownMenuItem>\n );\n}\n\n// An external launcher row (see `SidebarBrandSwitcherExtra`). No availability /\n// \"Soon\" or launching semantics — it just renders the consumer identity/glyph +\n// text and calls `onSelect` on selection. When the extra supplies an `identity`\n// it renders the same full-width lockup layout as the product rows (and honors\n// `rowClassName`) so the launcher reads at the same size and line; otherwise it\n// falls back to the default glyph + name + tagline.\nfunction SidebarBrandSwitcherExtraRow({\n extra,\n rowClassName,\n}: {\n extra: SidebarBrandSwitcherExtra;\n rowClassName?: string | undefined;\n}) {\n return (\n <DropdownMenuItem\n onSelect={() => extra.onSelect()}\n data-item={extra.dataAttr ?? extra.id}\n className={cn(\"ds:flex ds:items-center ds:gap-2.5 ds:rounded-md ds:px-2 ds:py-1.5\", rowClassName)}\n >\n {extra.identity ? (\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-0.5\">\n {extra.identity}\n {extra.tagline && (\n <span className=\"ds:text-fg-3 ds:text-[11px] ds:leading-tight\">{extra.tagline}</span>\n )}\n </div>\n ) : (\n <>\n {extra.glyph}\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col\">\n <span className=\"ds:text-fg ds:text-[13px] ds:font-medium\">{extra.name}</span>\n {extra.tagline && <span className=\"ds:text-fg-3 ds:text-[11px]\">{extra.tagline}</span>}\n </div>\n </>\n )}\n </DropdownMenuItem>\n );\n}\n","import { createContext, forwardRef, useContext } from \"react\";\n\n/**\n * Brand scope — ambient product theming.\n *\n * The `brand` color family (bg-brand, hover:bg-brand-hover, bg-brand-bg,\n * border-brand-line, text-fg-on-brand, plus the accent/focus/primary\n * interaction tokens) follows the nearest `[data-brand]` scope and defaults to\n * Pro. Authors type the STATE only; the product comes from the scope. Set it\n * once high in the tree — ideally on the same root as the `.dark` class\n * (`<html>`/`<body>`) — so Radix-portalled surfaces inherit it through the DOM.\n *\n * <html data-brand=\"tax\"> // whole shell renders teal\n * <div {...brandScope(\"audit\")}> // a subtree renders blue\n *\n * For the rarer case of multiple scopes on one page WITH portalled content\n * (a Dialog/Popover that escapes its scoped subtree to document.body), wrap the\n * region in <BrandScope> / <BrandScopeProvider> and have the portalled\n * `*Content` re-stamp `data-brand={useBrandScope()}` on its own element.\n */\nexport type BrandProduct = \"pro\" | \"audit\" | \"books\" | \"tax\";\n\n/**\n * `data-brand` attribute object to spread on any element (mirrors\n * `serviceToneStyle`). This is the primary API for opting a subtree into a\n * product without naming the product in a utility class.\n */\nexport function brandScope(product: BrandProduct): { \"data-brand\": BrandProduct } {\n return { \"data-brand\": product };\n}\n\n/** Every product, in suite order — for switchers and story matrices. */\nexport const BRAND_PRODUCTS: BrandProduct[] = [\"pro\", \"audit\", \"books\", \"tax\"];\n\n/** Human label for a product, for switchers and headings. */\nexport const brandLabel: Record<BrandProduct, string> = {\n pro: \"Pro\",\n audit: \"Audit\",\n books: \"Books\",\n tax: \"Tax\",\n};\n\nconst BrandScopeContext = createContext<BrandProduct>(\"pro\");\n\n/**\n * Provides the active product to descendants so portalled surfaces can\n * re-stamp `data-brand` on themselves via {@link useBrandScope}. Purely a\n * structural carrier — the visual theming still comes from the `[data-brand]`\n * attribute in the DOM, not from this context.\n */\nexport function BrandScopeProvider({\n product,\n children,\n}: {\n product: BrandProduct;\n children: React.ReactNode;\n}) {\n return (\n <BrandScopeContext.Provider value={product}>{children}</BrandScopeContext.Provider>\n );\n}\n\n/** Read the ambient product from the nearest provider (defaults to Pro). */\nexport function useBrandScope(): BrandProduct {\n return useContext(BrandScopeContext);\n}\n\nexport interface BrandScopeProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The product this subtree renders as. */\n product: BrandProduct;\n}\n\n/**\n * Convenience wrapper that stamps `data-brand` on a `<div>` AND provides the\n * product via context, so a portalled descendant can re-stamp itself. Use\n * `brandScope()` directly when you want the attribute on your own element.\n */\nexport const BrandScope = forwardRef<HTMLDivElement, BrandScopeProps>(function BrandScope(\n { product, children, ...props },\n ref,\n) {\n return (\n <BrandScopeProvider product={product}>\n <div ref={ref} data-brand={product} {...props}>\n {children}\n </div>\n </BrandScopeProvider>\n );\n});\n\nBrandScope.displayName = \"BrandScope\";\n"]}