trc-ui 0.1.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/cx.ts","../src/components/typography.tsx","../src/components/pill.tsx","../src/utils/icons.tsx","../src/components/surfaces.tsx","../src/components/field.tsx","../src/components/toggle.tsx","../src/components/site-header.tsx","../src/hooks/use-modal.ts","../src/components/site-footer.tsx","../src/components/hero.tsx","../src/components/back-to-top.tsx"],"sourcesContent":["/** Joins CSS class names, skipping empty values. */\nexport function cx(...classes: (string | false | null | undefined)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n","import type { ComponentPropsWithoutRef, ElementType, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\n/**\n * Colors the words between asterisks with the accent: \"How it *works*\".\n * Without asterisks, `accentLast` colors the last words (titles coming from a CMS).\n */\nexport function AccentText({ text, accentLast = 0 }: { text: string; accentLast?: number }) {\n if (text.includes(\"*\")) {\n return (\n <>\n {text.split(\"*\").map((part, i) =>\n i % 2 === 1 ? (\n <span key={i} className=\"trc-accent\">\n {part}\n </span>\n ) : (\n part\n ),\n )}\n </>\n );\n }\n const words = text.split(\" \");\n if (!accentLast || words.length < 2) return <>{text}</>;\n const n = Math.min(accentLast, words.length - 1);\n return (\n <>\n {words.slice(0, -n).join(\" \")} <span className=\"trc-accent\">{words.slice(-n).join(\" \")}</span>\n </>\n );\n}\n\n/** Plain text of a marked-up title, for attributes (`alt`, `title`, metadata). */\nexport const plainText = (text: string) => text.replaceAll(\"*\", \"\");\n\nexport type HeadingSize = \"display\" | \"xl\" | \"lg\" | \"md\" | \"sm\";\n\nexport type HeadingProps = Omit<ComponentPropsWithoutRef<\"h2\">, \"children\"> & {\n /** Rendered tag; the visual size is set separately with `size`. */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"span\";\n size?: HeadingSize;\n /** When `children` is a string without asterisks, number of trailing words in the accent color. */\n accentLast?: number;\n children: ReactNode;\n};\n\n/** Thin Montserrat 400 heading; a string may contain an *accent word* between asterisks. */\nexport function Heading({ as: Tag = \"h2\", size = \"xl\", accentLast, className, children, ...props }: HeadingProps) {\n return (\n <Tag className={cx(\"trc-display\", `trc-heading--${size}`, className)} {...props}>\n {typeof children === \"string\" ? <AccentText text={children} accentLast={accentLast} /> : children}\n </Tag>\n );\n}\n\nexport type TextProps<C extends ElementType = \"p\"> = {\n as?: C;\n size?: \"lg\" | \"md\" | \"sm\";\n tone?: \"default\" | \"muted\" | \"subtle\";\n} & Omit<ComponentPropsWithoutRef<C>, \"as\" | \"size\">;\n\n/** Body text; `tone=\"muted\"` (default) so that it does not compete with headings. */\nexport function Text<C extends ElementType = \"p\">({ as, size = \"md\", tone = \"muted\", className, ...props }: TextProps<C>) {\n const Tag: ElementType = as ?? \"p\";\n return <Tag className={cx(\"trc-text\", `trc-text--${size}`, `trc-text--${tone}`, className)} {...props} />;\n}\n\n/** Large thin number in the accent color (\"01\", \"02\"…), reserved for steps in a real order. */\nexport function StepNumber({ n, size = \"md\", className }: { n: number; size?: \"md\" | \"sm\"; className?: string }) {\n return (\n <span aria-hidden className={cx(\"trc-step-number\", size === \"sm\" && \"trc-step-number--sm\", className)}>\n {String(n).padStart(2, \"0\")}\n </span>\n );\n}\n","import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementType,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ArrowRight, Spinner } from \"../utils/icons\";\n\ntype PillStyle = {\n /** White background: the main action of a screen. */\n solid?: boolean;\n /** Compact version (header, toolbars). */\n size?: \"md\" | \"sm\";\n /** Replaces the dot's arrow (for instance a left arrow for \"Back\"). */\n icon?: ReactNode;\n};\n\nconst pillClass = ({ solid, size }: PillStyle, className?: string) =>\n cx(\"trc-pill\", size === \"sm\" && \"trc-pill--sm\", solid && \"trc-pill--solid\", className);\n\n/** The dot and the fill are one shape: it stretches on hover without a visible circle. */\nfunction PillInner({ icon, children }: { icon?: ReactNode; children: ReactNode }) {\n return (\n <>\n <span aria-hidden className=\"trc-pill__fill\" />\n <span aria-hidden className=\"trc-pill__icon\">\n {icon ?? <ArrowRight />}\n </span>\n <span className=\"trc-pill__label\">{children}</span>\n </>\n );\n}\n\nexport type PillButtonProps = ComponentPropsWithoutRef<\"button\"> &\n PillStyle & {\n /** Replaces the icon with a spinner and disables the button. */\n loading?: boolean;\n };\n\n/** Pill button: thin border, accent dot with an arrow that stretches on hover. */\nexport const PillButton = forwardRef<HTMLButtonElement, PillButtonProps>(function PillButton(\n { solid, size = \"md\", icon, loading = false, disabled, type = \"button\", className, children, ...props },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={pillClass({ solid, size }, className)}\n {...props}\n >\n <PillInner icon={loading ? <Spinner className=\"trc-spin\" /> : icon}>{children}</PillInner>\n </button>\n );\n});\n\nexport type PillLinkProps<C extends ElementType = \"a\"> = PillStyle & {\n /** Router link component (Next.js or React Router `Link`…); `<a>` by default. */\n as?: C;\n} & Omit<ComponentPropsWithoutRef<C>, \"as\" | keyof PillStyle>;\n\n/** Same pill as a link. With a router: `<PillLink as={Link} href=\"/\">`. */\nexport const PillLink = forwardRef(function PillLink(\n { as, solid, size = \"md\", icon, className, children, ...props }: PillLinkProps<ElementType>,\n ref: Ref<HTMLAnchorElement>,\n) {\n const Tag: ElementType = as ?? \"a\";\n return (\n <Tag ref={ref} className={pillClass({ solid, size }, className)} {...props}>\n <PillInner icon={icon}>{children}</PillInner>\n </Tag>\n );\n}) as <C extends ElementType = \"a\">(props: PillLinkProps<C> & { ref?: Ref<HTMLAnchorElement> }) => ReactNode;\n","import type { SVGProps } from \"react\";\n\ntype IconProps = SVGProps<SVGSVGElement>;\n\nconst base = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"aria-hidden\": true,\n} as const;\n\nexport const ArrowRight = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M5 12h14M13 6l6 6-6 6\" />\n </svg>\n);\n\nexport const ArrowLeft = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M19 12H5M11 18l-6-6 6-6\" />\n </svg>\n);\n\nexport const Spinner = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M21 12a9 9 0 1 1-6.22-8.56\" />\n </svg>\n);\n\nexport const ChevronDown = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n);\n\nexport const Check = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n);\n\nexport const Menu = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n);\n\nexport const Close = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n);\n\nexport const ArrowUp = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M12 19V5M6 11l6-6 6 6\" />\n </svg>\n);\n","import type { ComponentPropsWithoutRef, ElementType, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\ntype Polymorphic<C extends ElementType, P> = P & { as?: C } & Omit<ComponentPropsWithoutRef<C>, \"as\" | keyof P>;\n\nexport type ContainerProps<C extends ElementType = \"div\"> = Polymorphic<\n C,\n {\n /** `default`: 1280 px, for text and grids; `wide`: 1600 px, for full-width cards; `narrow`: 768 px. */\n size?: \"default\" | \"wide\" | \"narrow\";\n }\n>;\n\n/** Centered max width, with side gutters that grow with the screen. */\nexport function Container<C extends ElementType = \"div\">({ as, size = \"default\", className, ...props }: ContainerProps<C>) {\n const Tag: ElementType = as ?? \"div\";\n return <Tag className={cx(\"trc-container\", size !== \"default\" && `trc-container--${size}`, className)} {...props} />;\n}\n\nexport type SectionProps<C extends ElementType = \"section\"> = Polymorphic<\n C,\n {\n /** Vertical spacing. */\n spacing?: \"sm\" | \"md\" | \"lg\" | \"none\";\n /**\n * Card inset from the screen edges (\"magazine\" effect): graphite background and rounded corners,\n * for banners, calls to action and heroes.\n */\n inset?: boolean;\n }\n>;\n\n/** Vertical block of a page. With `inset`, it becomes a large rounded card a few pixels from the edges. */\nexport function Section<C extends ElementType = \"section\">({\n as,\n spacing = \"md\",\n inset = false,\n className,\n children,\n ...props\n}: SectionProps<C>) {\n const Tag: ElementType = as ?? \"section\";\n if (inset) {\n return (\n <Tag className={cx(\"trc-section-inset\", className)} {...props}>\n <div className={cx(\"trc-section-inset__card\", spacing !== \"none\" && `trc-section--${spacing}`)}>{children}</div>\n </Tag>\n );\n }\n return (\n <Tag className={cx(spacing !== \"none\" && `trc-section--${spacing}`, className)} {...props}>\n {children}\n </Tag>\n );\n}\n\nexport type CardProps<C extends ElementType = \"div\"> = Polymorphic<\n C,\n {\n /** `alt`: a slightly lighter grey, to tell two side-by-side blocks apart. */\n tone?: \"default\" | \"alt\";\n padding?: \"none\" | \"sm\" | \"md\" | \"lg\";\n /** Lightens on hover (clickable cards: links, buttons). */\n interactive?: boolean;\n /** Decorative watermark icon: very large, thin stroke, half out of the corner; wakes up on hover. */\n watermark?: ReactNode;\n }\n>;\n\n/** Graphite card, rounded corners, no shadow: depth comes from shades of grey. */\nexport function Card<C extends ElementType = \"div\">({\n as,\n tone = \"default\",\n padding = \"md\",\n interactive = false,\n watermark,\n className,\n children,\n ...props\n}: CardProps<C>) {\n const Tag: ElementType = as ?? \"div\";\n return (\n <Tag\n className={cx(\n \"trc-card\",\n tone === \"alt\" && \"trc-card--alt\",\n padding !== \"none\" && `trc-card--pad-${padding}`,\n interactive && \"trc-card--interactive\",\n !!watermark && \"trc-card--watermark\",\n className,\n )}\n {...props}\n >\n {!!watermark && (\n <span aria-hidden className=\"trc-card__watermark\">\n {watermark}\n </span>\n )}\n {children}\n </Tag>\n );\n}\n","\"use client\";\n\nimport { createContext, forwardRef, useContext, useId, type ComponentPropsWithoutRef, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ChevronDown } from \"../utils/icons\";\n\ntype FieldContextValue = { id: string; describedBy?: string; invalid: boolean; required: boolean };\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\nexport type FieldProps = {\n label: ReactNode;\n /** Hint shown under the control. */\n hint?: ReactNode;\n /** Error message: replaces the hint and marks the control as invalid. */\n error?: ReactNode;\n required?: boolean;\n /** Control id; generated when omitted. */\n id?: string;\n className?: string;\n children: ReactNode;\n};\n\n/**\n * Label, hint and error of a form control. The control placed inside (`Input`, `Textarea`, `Select`)\n * automatically receives its `id`, `aria-describedby` and `aria-invalid`.\n */\nexport function Field({ label, hint, error, required = false, id, className, children }: FieldProps) {\n const generated = useId();\n const fieldId = id ?? generated;\n const messageId = `${fieldId}-message`;\n const message = error ?? hint;\n return (\n <FieldContext.Provider\n value={{ id: fieldId, describedBy: message ? messageId : undefined, invalid: error != null, required }}\n >\n <div className={cx(\"trc-field\", className)}>\n <label htmlFor={fieldId} className=\"trc-field__label\">\n {label}\n {required && (\n <span aria-hidden className=\"trc-field__required\">\n {\" \"}\n *\n </span>\n )}\n </label>\n {children}\n {message != null && (\n <p id={messageId} className={cx(\"trc-field__message\", error != null && \"trc-field__message--error\")}>\n {message}\n </p>\n )}\n </div>\n </FieldContext.Provider>\n );\n}\n\n/** Accessibility attributes from the parent `Field`, without overriding those passed to the control. */\nfunction useFieldProps(props: { id?: string; required?: boolean; invalid?: boolean; \"aria-describedby\"?: string }) {\n const field = useContext(FieldContext);\n const invalid = props.invalid ?? field?.invalid ?? false;\n return {\n id: props.id ?? field?.id,\n required: props.required ?? field?.required,\n \"aria-describedby\": cx(field?.describedBy, props[\"aria-describedby\"]) || undefined,\n \"aria-invalid\": invalid || undefined,\n };\n}\n\ntype ControlProps = { invalid?: boolean };\n\nexport type InputProps = ComponentPropsWithoutRef<\"input\"> & ControlProps;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input({ invalid, className, ...props }, ref) {\n const a11y = useFieldProps({ ...props, invalid });\n return <input ref={ref} className={cx(\"trc-control\", className)} {...props} {...a11y} />;\n});\n\nexport type TextareaProps = ComponentPropsWithoutRef<\"textarea\"> & ControlProps;\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { invalid, rows = 4, className, ...props },\n ref,\n) {\n const a11y = useFieldProps({ ...props, invalid });\n return (\n <textarea\n ref={ref}\n rows={rows}\n className={cx(\"trc-control\", \"trc-control--textarea\", className)}\n {...props}\n {...a11y}\n />\n );\n});\n\nexport type SelectProps = ComponentPropsWithoutRef<\"select\"> &\n ControlProps & {\n /** Empty option shown until something is chosen. */\n placeholder?: string;\n };\n\n/** Native select (accessible and mobile friendly), dressed with a thin chevron. */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { invalid, placeholder, defaultValue, className, children, ...props },\n ref,\n) {\n const a11y = useFieldProps({ ...props, invalid });\n // Without a given value, keep the empty option shown (otherwise the browser picks the first enabled option).\n const initial = defaultValue ?? (props.value === undefined && placeholder != null ? \"\" : undefined);\n return (\n <span className={cx(\"trc-select\", className)}>\n <select ref={ref} className=\"trc-control trc-control--select\" defaultValue={initial} {...props} {...a11y}>\n {placeholder != null && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {children}\n </select>\n <ChevronDown className=\"trc-select__chevron\" />\n </span>\n );\n});\n","import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { Check } from \"../utils/icons\";\n\ntype ToggleProps = Omit<ComponentPropsWithoutRef<\"input\">, \"type\"> & {\n label: ReactNode;\n /** Extra detail under the label. */\n description?: ReactNode;\n};\n\n/** The label wraps the control: the whole block is clickable. */\nfunction ToggleLabel({\n kind,\n label,\n description,\n className,\n children,\n}: {\n kind: \"checkbox\" | \"switch\";\n label: ReactNode;\n description?: ReactNode;\n className?: string;\n children: ReactNode;\n}) {\n return (\n <label className={cx(\"trc-toggle\", `trc-toggle--${kind}`, className)}>\n {children}\n <span className=\"trc-toggle__text\">\n <span className=\"trc-toggle__label\">{label}</span>\n {description != null && <span className=\"trc-toggle__description\">{description}</span>}\n </span>\n </label>\n );\n}\n\nexport type CheckboxProps = ToggleProps;\n\n/** Native checkbox, filled with the accent color once checked. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, description, className, ...props },\n ref,\n) {\n return (\n <ToggleLabel kind=\"checkbox\" label={label} description={description} className={className}>\n <span className=\"trc-checkbox\">\n <input ref={ref} type=\"checkbox\" className=\"trc-checkbox__input\" {...props} />\n <Check className=\"trc-checkbox__check\" />\n </span>\n </ToggleLabel>\n );\n});\n\nexport type SwitchProps = ToggleProps;\n\n/** Switch: a native checkbox announced as a `switch` to screen readers. */\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n { label, description, className, ...props },\n ref,\n) {\n return (\n <ToggleLabel kind=\"switch\" label={label} description={description} className={className}>\n <span className=\"trc-switch\">\n <input ref={ref} type=\"checkbox\" role=\"switch\" className=\"trc-switch__input\" {...props} />\n <span aria-hidden className=\"trc-switch__thumb\" />\n </span>\n </ToggleLabel>\n );\n});\n","\"use client\";\n\nimport { useEffect, useId, useRef, useState, type ElementType, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useModal } from \"../hooks/use-modal\";\nimport { cx } from \"../utils/cx\";\nimport { ChevronDown, Close, Menu } from \"../utils/icons\";\nimport { PillLink } from \"./pill\";\n\nexport type NavLink = {\n label: ReactNode;\n href: string;\n /** Current page: marked with an accent dot. */\n active?: boolean;\n};\n\nexport type NavMenu = {\n label: ReactNode;\n /** Dropdown items, with an optional short description (no numbers). */\n items: (NavLink & { description?: ReactNode })[];\n};\n\nexport type NavItem = NavLink | NavMenu;\n\nexport type SiteHeaderProps = {\n /** Logo (white), wrapped in a link to `homeHref`. */\n logo: ReactNode;\n /** Accessible name of the logo link, usually the brand name. */\n logoLabel: string;\n homeHref?: string;\n nav?: NavItem[];\n /** Main action, shown as a compact pill (and a large one in the mobile menu). */\n cta?: { label: ReactNode; href: string };\n /** Extra elements on the right on large screens (language switcher…). */\n actions?: ReactNode;\n /** Content added at the bottom of the mobile menu. */\n mobileFooter?: ReactNode;\n /** Router link component (Next.js `Link`…); `<a>` by default. */\n linkAs?: ElementType;\n /** Scroll offset (px) from which the bar becomes blurred graphite. */\n scrollThreshold?: number;\n menuLabel?: string;\n closeLabel?: string;\n className?: string;\n};\n\nconst isMenu = (item: NavItem): item is NavMenu => \"items\" in item;\n\n/**\n * Floating header: transparent over the hero at the top of the page, it becomes a blurred\n * graphite bar as soon as the page scrolls. Dropdowns on large screens, side panel on mobile.\n */\nexport function SiteHeader({\n logo,\n logoLabel,\n homeHref = \"/\",\n nav = [],\n cta,\n actions,\n mobileFooter,\n linkAs: LinkTag = \"a\",\n scrollThreshold = 24,\n menuLabel = \"Menu\",\n closeLabel = \"Close\",\n className,\n}: SiteHeaderProps) {\n const [scrolled, setScrolled] = useState(false);\n const [open, setOpen] = useState(false);\n\n // Read after hydration: same render on the server and on the client.\n useEffect(() => {\n const update = () => setScrolled(window.scrollY > scrollThreshold);\n update();\n window.addEventListener(\"scroll\", update, { passive: true });\n return () => window.removeEventListener(\"scroll\", update);\n }, [scrollThreshold]);\n\n return (\n <header className={cx(\"trc-header\", className)}>\n <div className={cx(\"trc-header__bar\", scrolled && \"trc-header__bar--scrolled\")}>\n <LinkTag href={homeHref} aria-label={logoLabel} className=\"trc-header__logo\">\n {logo}\n </LinkTag>\n\n {nav.length > 0 && (\n <nav className=\"trc-header__nav\">\n {nav.map((item, i) =>\n isMenu(item) ? (\n <NavDropdown key={i} menu={item} linkAs={LinkTag} />\n ) : (\n <LinkTag\n key={i}\n href={item.href}\n aria-current={item.active ? \"page\" : undefined}\n className={cx(\"trc-header__link\", item.active && \"trc-header__link--active\")}\n >\n {item.label}\n </LinkTag>\n ),\n )}\n </nav>\n )}\n\n <div className=\"trc-header__end\">\n {actions && <div className=\"trc-header__actions\">{actions}</div>}\n {cta && (\n <PillLink as={LinkTag} href={cta.href} size=\"sm\" className=\"trc-header__cta\">\n {cta.label}\n </PillLink>\n )}\n {(nav.length > 0 || cta || mobileFooter) && (\n <button\n type=\"button\"\n className=\"trc-header__burger\"\n aria-label={menuLabel}\n aria-expanded={open}\n onClick={() => setOpen(true)}\n >\n <Menu />\n </button>\n )}\n </div>\n </div>\n\n <MobileMenu\n open={open}\n onClose={() => setOpen(false)}\n nav={nav}\n cta={cta}\n footer={mobileFooter}\n linkAs={LinkTag}\n title={menuLabel}\n closeLabel={closeLabel}\n />\n </header>\n );\n}\n\n/**\n * Dropdown menu (large screens): opens on hover or click, closes on leave, with Escape,\n * when keyboard focus leaves the menu, or after a choice.\n */\nfunction NavDropdown({ menu, linkAs: LinkTag }: { menu: NavMenu; linkAs: ElementType }) {\n const id = useId();\n const [open, setOpen] = useState(false);\n const closeTimer = useRef<number | undefined>(undefined);\n const button = useRef<HTMLButtonElement>(null);\n\n const show = () => {\n window.clearTimeout(closeTimer.current);\n setOpen(true);\n };\n // Short delay: the pointer may cross the gap between the button and the panel.\n const hide = () => {\n closeTimer.current = window.setTimeout(() => setOpen(false), 120);\n };\n useEffect(() => () => window.clearTimeout(closeTimer.current), []);\n\n return (\n <div\n className=\"trc-dropdown\"\n onMouseEnter={show}\n onMouseLeave={hide}\n onKeyDown={(e) => {\n if (e.key === \"Escape\" && open) {\n setOpen(false);\n button.current?.focus();\n }\n }}\n onBlur={(e) => !e.currentTarget.contains(e.relatedTarget) && setOpen(false)}\n >\n <button\n ref={button}\n type=\"button\"\n aria-expanded={open}\n aria-controls={id}\n onClick={() => setOpen((o) => !o)}\n className={cx(\"trc-header__link\", \"trc-dropdown__trigger\", open && \"trc-dropdown__trigger--open\")}\n >\n {menu.label}\n <ChevronDown className=\"trc-dropdown__chevron\" />\n </button>\n <div id={id} className={cx(\"trc-dropdown__panel\", open && \"trc-dropdown__panel--open\")}>\n <ul className=\"trc-dropdown__list\">\n {menu.items.map((item, i) => (\n <li key={i}>\n <LinkTag\n href={item.href}\n aria-current={item.active ? \"page\" : undefined}\n onClick={() => setOpen(false)}\n className=\"trc-dropdown__item\"\n >\n <span className=\"trc-dropdown__label\">{item.label}</span>\n {item.description != null && <span className=\"trc-dropdown__description\">{item.description}</span>}\n </LinkTag>\n </li>\n ))}\n </ul>\n </div>\n </div>\n );\n}\n\n/**\n * Side panel of the mobile menu, rendered into `document.body`: otherwise the header's blurred bar\n * (`backdrop-filter`) would trap a `fixed` element within its own bounds.\n */\nfunction MobileMenu({\n open,\n onClose,\n nav,\n cta,\n footer,\n linkAs: LinkTag,\n title,\n closeLabel,\n}: {\n open: boolean;\n onClose: () => void;\n nav: NavItem[];\n cta?: SiteHeaderProps[\"cta\"];\n footer?: ReactNode;\n linkAs: ElementType;\n title: string;\n closeLabel: string;\n}) {\n const titleId = useId();\n const panel = useRef<HTMLDivElement>(null);\n const [mounted, setMounted] = useState(false);\n useEffect(() => setMounted(true), []);\n useModal(open, panel, onClose);\n\n if (!mounted) return null;\n return createPortal(\n <div className={cx(\"trc-drawer\", open && \"trc-drawer--open\")} aria-hidden={!open}>\n <div className=\"trc-drawer__overlay\" onClick={onClose} />\n <div\n ref={panel}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n tabIndex={-1}\n className=\"trc-drawer__panel\"\n >\n <div className=\"trc-drawer__head\">\n <p id={titleId} className=\"trc-drawer__title\">\n {title}\n </p>\n <button type=\"button\" className=\"trc-drawer__close\" aria-label={closeLabel} onClick={onClose}>\n <Close />\n </button>\n </div>\n <nav className=\"trc-mobile-nav\">\n {nav.map((item, i) =>\n isMenu(item) ? (\n <div key={i} className=\"trc-mobile-nav__group\">\n <p className=\"trc-mobile-nav__heading\">{item.label}</p>\n <ul className=\"trc-mobile-nav__sub\">\n {item.items.map((sub, j) => (\n <li key={j}>\n <LinkTag\n href={sub.href}\n aria-current={sub.active ? \"page\" : undefined}\n onClick={onClose}\n className=\"trc-mobile-nav__sublink\"\n >\n {sub.label}\n </LinkTag>\n </li>\n ))}\n </ul>\n </div>\n ) : (\n <LinkTag\n key={i}\n href={item.href}\n aria-current={item.active ? \"page\" : undefined}\n onClick={onClose}\n className={cx(\"trc-mobile-nav__link\", item.active && \"trc-mobile-nav__link--active\")}\n >\n {item.label}\n </LinkTag>\n ),\n )}\n </nav>\n {cta && (\n <PillLink as={LinkTag} href={cta.href} onClick={onClose} className=\"trc-drawer__cta\">\n {cta.label}\n </PillLink>\n )}\n {footer != null && <div className=\"trc-drawer__footer\">{footer}</div>}\n </div>\n </div>,\n document.body,\n );\n}\n","import { useEffect, useRef, type RefObject } from \"react\";\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Behavior of an open modal panel: focus moved inside and kept there (Tab / Shift+Tab),\n * closes with Escape, page scroll locked, focus returned to the original element on close.\n */\nexport function useModal(open: boolean, panelRef: RefObject<HTMLElement | null>, onClose: () => void) {\n // Latest close callback, without re-running the effect on every render.\n const close = useRef(onClose);\n close.current = onClose;\n\n useEffect(() => {\n const panel = panelRef.current;\n if (!open || !panel) return;\n\n const previous = document.activeElement as HTMLElement | null;\n const overflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n (\n panel.querySelector<HTMLElement>(\"[data-autofocus]\") ??\n panel.querySelector<HTMLElement>(FOCUSABLE) ??\n panel\n ).focus();\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n e.stopPropagation();\n close.current();\n return;\n }\n if (e.key !== \"Tab\") return;\n const items = [...panel.querySelectorAll<HTMLElement>(FOCUSABLE)].filter((el) => el.offsetParent !== null);\n const first = items[0];\n const last = items[items.length - 1];\n if (!first || !last) {\n e.preventDefault();\n return;\n }\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.body.style.overflow = overflow;\n previous?.focus();\n };\n }, [open, panelRef]);\n}\n","import type { ElementType, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\nexport type FooterLink = { label: ReactNode; href: string };\n\nexport type SiteFooterProps = {\n /** Logo (white), wrapped in a link to `homeHref`. */\n logo?: ReactNode;\n logoLabel?: string;\n homeHref?: string;\n /** Short sentence under the logo. */\n tagline?: ReactNode;\n /** Under the sentence: a pill, a contact… */\n children?: ReactNode;\n /** Site map in columns, each with a spaced small-caps title. */\n columns?: { title: ReactNode; links: FooterLink[] }[];\n /** Accessible name of the site map. */\n columnsLabel?: string;\n /** Bottom line (copyright, credits…). */\n copyright?: ReactNode;\n /** Legal links, aligned right on large screens. */\n legal?: FooterLink[];\n legalLabel?: string;\n /** Router link component (Next.js `Link`…); `<a>` by default. */\n linkAs?: ElementType;\n className?: string;\n};\n\n/** Graphite card footer: brand and call to action, site map in columns, legal links. */\nexport function SiteFooter({\n logo,\n logoLabel,\n homeHref = \"/\",\n tagline,\n children,\n columns = [],\n columnsLabel = \"Site map\",\n copyright,\n legal = [],\n legalLabel = \"Legal\",\n linkAs: LinkTag = \"a\",\n className,\n}: SiteFooterProps) {\n return (\n <footer className={cx(\"trc-footer\", className)}>\n <div className=\"trc-footer__card\">\n <div className=\"trc-footer__main\">\n <div className=\"trc-footer__brand\">\n {logo != null && (\n <LinkTag href={homeHref} aria-label={logoLabel} className=\"trc-footer__logo\">\n {logo}\n </LinkTag>\n )}\n {tagline != null && <p className=\"trc-footer__tagline\">{tagline}</p>}\n {children != null && <div className=\"trc-footer__extra\">{children}</div>}\n </div>\n\n {columns.length > 0 && (\n <nav className=\"trc-footer__columns\" aria-label={columnsLabel}>\n {columns.map((col, i) => (\n <div key={i}>\n <p className=\"trc-footer__heading\">{col.title}</p>\n <ul className=\"trc-footer__list\">\n {col.links.map((link, j) => (\n <li key={j}>\n <LinkTag href={link.href} className=\"trc-footer__link\">\n {link.label}\n </LinkTag>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </nav>\n )}\n </div>\n\n {(copyright != null || legal.length > 0) && (\n <div className=\"trc-footer__bottom\">\n {copyright != null && <p className=\"trc-footer__copyright\">{copyright}</p>}\n {legal.length > 0 && (\n <nav aria-label={legalLabel} className=\"trc-footer__legal\">\n {legal.map((link, i) => (\n <LinkTag key={i} href={link.href} className=\"trc-footer__legal-link\">\n {link.label}\n </LinkTag>\n ))}\n </nav>\n )}\n </div>\n )}\n </div>\n </footer>\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef, useState, type CSSProperties, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { AccentText } from \"./typography\";\n\n/** Delay of an entrance (`.trc-enter`) in milliseconds. */\nconst delay = (ms: number) => ({ \"--trc-delay\": `${ms}ms` }) as CSSProperties;\n\nexport type PageHeroProps = {\n /** Title; the words between *asterisks* take the accent, otherwise the last words (`accentLast`). */\n title: string;\n /** Number of trailing words in the accent color when the title has no asterisks (2 for a long title, 1 otherwise). */\n accentLast?: number;\n description?: ReactNode;\n /** Discreet line under the description (last updated date, breadcrumb…). */\n meta?: ReactNode;\n /**\n * Background photo, heavily darkened: a URL, or a ready-made element (Next.js `<Image fill />`…).\n * Without a photo, a subtle accent glow on a graphite background.\n */\n image?: string | ReactNode;\n /** Photo position (`object-position`). */\n imagePosition?: string;\n /** Content under the text (pills…). */\n children?: ReactNode;\n className?: string;\n};\n\n/**\n * Header of inner pages: rounded card inset from the edges, darkened background photo,\n * thin title whose last words take the accent. Leaves room for the floating header above.\n */\nexport function PageHero({\n title,\n accentLast,\n description,\n meta,\n image,\n imagePosition = \"50% 50%\",\n children,\n className,\n}: PageHeroProps) {\n const words = title.split(\" \").length;\n return (\n <section className={cx(\"trc-hero-inset\", className)}>\n <div className=\"trc-page-hero\">\n <div aria-hidden className=\"trc-hero__media\">\n {typeof image === \"string\" ? (\n <img src={image} alt=\"\" className=\"trc-hero__image\" style={{ objectPosition: imagePosition }} />\n ) : image != null ? (\n image\n ) : (\n <div className=\"trc-page-hero__glow\" />\n )}\n </div>\n <div aria-hidden className=\"trc-page-hero__veil\" />\n <div className=\"trc-page-hero__content\">\n <h1 className=\"trc-display trc-page-hero__title trc-enter\" style={delay(150)}>\n <AccentText text={title} accentLast={accentLast ?? (words > 3 ? 2 : 1)} />\n </h1>\n {description != null && (\n <p className=\"trc-page-hero__description trc-enter\" style={delay(250)}>\n {description}\n </p>\n )}\n {meta != null && (\n <div className=\"trc-page-hero__meta trc-enter\" style={delay(350)}>\n {meta}\n </div>\n )}\n {children != null && (\n <div className=\"trc-page-hero__actions trc-enter\" style={delay(450)}>\n {children}\n </div>\n )}\n </div>\n </div>\n </section>\n );\n}\n\nexport type HeroClip = {\n /** Muted video, 1280 px, without an audio track. Provide WebM and/or MP4. */\n webm?: string;\n mp4?: string;\n /** Image shown before playback, and alone when the user prefers reduced motion. */\n poster?: string;\n};\n\nexport type HeroVideoProps = {\n /** Videos played one after another with a crossfade; the first one is picked at random. */\n clips: HeroClip[];\n /** Hero text (title, description, pills), pinned to the bottom left. */\n children: ReactNode;\n /** Optional block pinned to the bottom right on large screens. */\n aside?: ReactNode;\n /** Crossfade duration, in seconds. */\n fade?: number;\n /** Soft parallax: the video moves down slower than the page. */\n parallax?: boolean;\n className?: string;\n};\n\nconst prefersReducedMotion = () => window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n\n/**\n * Home page hero: rounded card inset from the edges, muted background videos that alternate with\n * a crossfade, dark veils for legibility. No video in the server render: the pick happens\n * after hydration, then the video fades in. Reduced motion: the still image only.\n */\nexport function HeroVideo({ clips, children, aside, fade = 1.2, parallax = true, className }: HeroVideoProps) {\n const videos = useRef<(HTMLVideoElement | null)[]>([]);\n const section = useRef<HTMLElement>(null);\n const media = useRef<HTMLDivElement>(null);\n // -1 until the pick is made: same render on the server and on the client.\n const [active, setActive] = useState(-1);\n\n useEffect(() => {\n if (clips.length === 0) return;\n const start = Math.floor(Math.random() * clips.length);\n // Element captured here: in strict mode, React detaches refs before the cleanup runs.\n const video = videos.current[start];\n if (!prefersReducedMotion()) void video?.play().catch(() => {});\n const frame = requestAnimationFrame(() => setActive(start));\n return () => {\n cancelAnimationFrame(frame);\n video?.pause();\n };\n }, [clips.length]);\n\n useEffect(() => {\n const el = section.current;\n const layer = media.current;\n if (!parallax || !el || !layer || prefersReducedMotion()) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n const rect = el.getBoundingClientRect();\n const progress = Math.min(Math.max(-rect.top / rect.height, 0), 1);\n layer.style.transform = `translate3d(0, ${progress * 120}px, 0)`;\n };\n const onScroll = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n update();\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n return () => {\n window.removeEventListener(\"scroll\", onScroll);\n cancelAnimationFrame(frame);\n };\n }, [parallax]);\n\n const playNext = (i: number) => {\n const next = videos.current[(i + 1) % clips.length];\n if (!next) return;\n next.currentTime = 0;\n void next.play().catch(() => {});\n setActive((i + 1) % clips.length);\n };\n\n return (\n <section ref={section} className={cx(\"trc-hero-inset\", className)}>\n <div className=\"trc-hero-video\">\n <div ref={media} aria-hidden className=\"trc-hero__media trc-hero-video__media\">\n {clips.map((clip, i) => (\n <video\n key={i}\n ref={(el) => {\n videos.current[i] = el;\n }}\n className={cx(\"trc-hero__image\", \"trc-hero-video__clip\", i === active && \"trc-hero-video__clip--active\")}\n style={{ transitionDuration: `${fade}s` }}\n muted\n playsInline\n preload=\"metadata\"\n poster={clip.poster}\n // Shortly before the active video ends, the next one restarts and comes to the front.\n onTimeUpdate={(e) => {\n const v = e.currentTarget;\n if (i === active && v.duration && v.duration - v.currentTime <= fade) playNext(i);\n }}\n // Safety net when `timeupdate` did not trigger the switch (background tab…).\n onEnded={() => i === active && playNext(i)}\n >\n {clip.webm && <source src={clip.webm} type=\"video/webm\" />}\n {clip.mp4 && <source src={clip.mp4} type=\"video/mp4\" />}\n </video>\n ))}\n </div>\n <div aria-hidden className=\"trc-hero-video__veil\" />\n <div className=\"trc-hero-video__content\">\n <div className=\"trc-hero-video__main\">{children}</div>\n {aside != null && <div className=\"trc-hero-video__aside\">{aside}</div>}\n </div>\n </div>\n </section>\n );\n}\n","\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ArrowUp } from \"../utils/icons\";\n\nexport type BackToTopProps = {\n label?: string;\n /** Scroll offset, in viewport heights, from which the button appears. */\n threshold?: number;\n className?: string;\n};\n\n/** Floating accent \"Back to top\" button: appears once the first screen is scrolled past. */\nexport function BackToTop({ label = \"Back to top\", threshold = 0.8, className }: BackToTopProps) {\n const [visible, setVisible] = useState(false);\n\n useEffect(() => {\n const update = () => setVisible(window.scrollY > window.innerHeight * threshold);\n update();\n window.addEventListener(\"scroll\", update, { passive: true });\n return () => window.removeEventListener(\"scroll\", update);\n }, [threshold]);\n\n return (\n <button\n type=\"button\"\n onClick={() =>\n window.scrollTo({\n top: 0,\n behavior: window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches ? \"auto\" : \"smooth\",\n })\n }\n aria-label={label}\n aria-hidden={!visible}\n tabIndex={visible ? 0 : -1}\n className={cx(\"trc-back-to-top\", visible && \"trc-back-to-top--visible\", className)}\n >\n <ArrowUp />\n </button>\n );\n}\n"],"mappings":";;;AACO,SAAS,MAAM,SAAwD;AAC5E,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;;;ACOM,mBAGM,KAcR,YAjBE;AAHC,SAAS,WAAW,EAAE,MAAM,aAAa,EAAE,GAA0C;AAC1F,MAAI,KAAK,SAAS,GAAG,GAAG;AACtB,WACE,gC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D;AAAA,IAoBP,CACD,GACH;AAAA,IACA,gBAAAA,KAAC,SAAI,eAAW,MAAC,WAAU,wBAAuB;AAAA,IAClD,gBAAAC,MAAC,SAAI,WAAU,2BACb;AAAA,sBAAAD,KAAC,SAAI,WAAU,wBAAwB,UAAS;AAAA,MAC/C,SAAS,QAAQ,gBAAAA,KAAC,SAAI,WAAU,yBAAyB,iBAAM;AAAA,OAClE;AAAA,KACF,GACF;AAEJ;;;ACpMA,SAAS,aAAAK,YAAW,YAAAC,iBAAgB;AAoC9B,gBAAAC,aAAA;AAxBC,SAAS,UAAU,EAAE,QAAQ,eAAe,YAAY,KAAK,UAAU,GAAmB;AAC/F,QAAM,CAAC,SAAS,UAAU,IAAIC,UAAS,KAAK;AAE5C,EAAAC,WAAU,MAAM;AACd,UAAM,SAAS,MAAM,WAAW,OAAO,UAAU,OAAO,cAAc,SAAS;AAC/E,WAAO;AACP,WAAO,iBAAiB,UAAU,QAAQ,EAAE,SAAS,KAAK,CAAC;AAC3D,WAAO,MAAM,OAAO,oBAAoB,UAAU,MAAM;AAAA,EAC1D,GAAG,CAAC,SAAS,CAAC;AAEd,SACE,gBAAAF;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS,MACP,OAAO,SAAS;AAAA,QACd,KAAK;AAAA,QACL,UAAU,OAAO,WAAW,kCAAkC,EAAE,UAAU,SAAS;AAAA,MACrF,CAAC;AAAA,MAEH,cAAY;AAAA,MACZ,eAAa,CAAC;AAAA,MACd,UAAU,UAAU,IAAI;AAAA,MACxB,WAAW,GAAG,mBAAmB,WAAW,4BAA4B,SAAS;AAAA,MAEjF,0BAAAA,MAAC,WAAQ;AAAA;AAAA,EACX;AAEJ;","names":["jsx","Fragment","jsx","jsxs","PillButton","PillLink","jsx","jsxs","forwardRef","jsx","jsxs","forwardRef","Input","Textarea","Select","forwardRef","jsx","jsxs","forwardRef","Checkbox","Switch","useEffect","useId","useRef","jsx","jsxs","useEffect","useId","useRef","jsx","jsxs","useEffect","useRef","useState","jsx","jsxs","useRef","useState","useEffect","useEffect","useState","jsx","useState","useEffect"]}
1
+ {"version":3,"sources":["../src/utils/cx.ts","../src/components/typography.tsx","../src/components/pill.tsx","../src/utils/icons.tsx","../src/components/surfaces.tsx","../src/components/field.tsx","../src/components/toggle.tsx","../src/components/site-header.tsx","../src/components/layer.tsx","../src/hooks/use-modal.ts","../src/utils/portal.tsx","../src/components/drawer.tsx","../src/components/site-footer.tsx","../src/components/hero.tsx","../src/components/back-to-top.tsx","../src/components/dialog.tsx","../src/components/dropdown-menu.tsx","../src/hooks/use-floating.ts","../src/utils/compose.ts","../src/components/popover.tsx","../src/components/tooltip.tsx","../src/components/toast.tsx","../src/components/alert.tsx","../src/components/tabs.tsx","../src/hooks/use-controllable.ts","../src/components/segmented-control.tsx","../src/components/accordion.tsx","../src/components/steps.tsx","../src/components/breadcrumbs.tsx","../src/utils/label.ts","../src/components/pagination.tsx","../src/components/language-switcher.tsx","../src/components/radio-group.tsx","../src/components/password-input.tsx","../src/components/pin-input.tsx","../src/components/combobox.tsx","../src/components/file-input.tsx","../src/components/slider.tsx","../src/components/date-picker.tsx","../src/utils/dates.ts","../src/components/avatar.tsx","../src/components/tag.tsx","../src/components/stat.tsx","../src/components/table.tsx","../src/components/loading.tsx","../src/components/kbd.tsx","../src/components/code-block.tsx"],"sourcesContent":["/** Joins CSS class names, skipping empty values. */\nexport function cx(...classes: (string | false | null | undefined)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n","import type { ComponentPropsWithoutRef, ElementType, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\n/**\n * Colors the words between asterisks with the accent: \"How it *works*\".\n * Without asterisks, `accentLast` colors the last words (titles coming from a CMS).\n */\nexport function AccentText({ text, accentLast = 0 }: { text: string; accentLast?: number }) {\n if (text.includes(\"*\")) {\n return (\n <>\n {text.split(\"*\").map((part, i) =>\n i % 2 === 1 ? (\n <span key={i} className=\"trc-accent\">\n {part}\n </span>\n ) : (\n part\n ),\n )}\n </>\n );\n }\n const words = text.split(\" \");\n if (!accentLast || words.length < 2) return <>{text}</>;\n const n = Math.min(accentLast, words.length - 1);\n return (\n <>\n {words.slice(0, -n).join(\" \")} <span className=\"trc-accent\">{words.slice(-n).join(\" \")}</span>\n </>\n );\n}\n\n/** Plain text of a marked-up title, for attributes (`alt`, `title`, metadata). */\nexport const plainText = (text: string) => text.replaceAll(\"*\", \"\");\n\nexport type HeadingSize = \"display\" | \"xl\" | \"lg\" | \"md\" | \"sm\";\n\nexport type HeadingProps = Omit<ComponentPropsWithoutRef<\"h2\">, \"children\"> & {\n /** Rendered tag; the visual size is set separately with `size`. */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"span\";\n size?: HeadingSize;\n /** When `children` is a string without asterisks, number of trailing words in the accent color. */\n accentLast?: number;\n children: ReactNode;\n};\n\n/** Thin Montserrat 400 heading; a string may contain an *accent word* between asterisks. */\nexport function Heading({ as: Tag = \"h2\", size = \"xl\", accentLast, className, children, ...props }: HeadingProps) {\n return (\n <Tag className={cx(\"trc-display\", `trc-heading--${size}`, className)} {...props}>\n {typeof children === \"string\" ? <AccentText text={children} accentLast={accentLast} /> : children}\n </Tag>\n );\n}\n\nexport type TextProps<C extends ElementType = \"p\"> = {\n as?: C;\n size?: \"lg\" | \"md\" | \"sm\";\n tone?: \"default\" | \"muted\" | \"subtle\";\n} & Omit<ComponentPropsWithoutRef<C>, \"as\" | \"size\">;\n\n/** Body text; `tone=\"muted\"` (default) so that it does not compete with headings. */\nexport function Text<C extends ElementType = \"p\">({\n as,\n size = \"md\",\n tone = \"muted\",\n className,\n ...props\n}: TextProps<C>) {\n const Tag: ElementType = as ?? \"p\";\n return <Tag className={cx(\"trc-text\", `trc-text--${size}`, `trc-text--${tone}`, className)} {...props} />;\n}\n\n/** Large thin number in the accent color (\"01\", \"02\"…), reserved for steps in a real order. */\nexport function StepNumber({ n, size = \"md\", className }: { n: number; size?: \"md\" | \"sm\"; className?: string }) {\n return (\n <span aria-hidden className={cx(\"trc-step-number\", size === \"sm\" && \"trc-step-number--sm\", className)}>\n {String(n).padStart(2, \"0\")}\n </span>\n );\n}\n","import { forwardRef, type ComponentPropsWithoutRef, type ElementType, type ReactNode, type Ref } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ArrowRight, Spinner } from \"../utils/icons\";\n\ntype PillStyle = {\n /** White background: the main action of a screen. */\n solid?: boolean;\n /** Compact version (header, toolbars). */\n size?: \"md\" | \"sm\";\n /** Replaces the dot's arrow (for instance a left arrow for \"Back\"). */\n icon?: ReactNode;\n};\n\nconst pillClass = ({ solid, size }: PillStyle, className?: string) =>\n cx(\"trc-pill\", size === \"sm\" && \"trc-pill--sm\", solid && \"trc-pill--solid\", className);\n\n/** The dot and the fill are one shape: it stretches on hover without a visible circle. */\nfunction PillInner({ icon, children }: { icon?: ReactNode; children: ReactNode }) {\n return (\n <>\n <span aria-hidden className=\"trc-pill__fill\" />\n <span aria-hidden className=\"trc-pill__icon\">\n {icon ?? <ArrowRight />}\n </span>\n <span className=\"trc-pill__label\">{children}</span>\n </>\n );\n}\n\nexport type PillButtonProps = ComponentPropsWithoutRef<\"button\"> &\n PillStyle & {\n /** Replaces the icon with a spinner and disables the button. */\n loading?: boolean;\n };\n\n/** Pill button: thin border, accent dot with an arrow that stretches on hover. */\nexport const PillButton = forwardRef<HTMLButtonElement, PillButtonProps>(function PillButton(\n { solid, size = \"md\", icon, loading = false, disabled, type = \"button\", className, children, ...props },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={pillClass({ solid, size }, className)}\n {...props}\n >\n <PillInner icon={loading ? <Spinner className=\"trc-spin\" /> : icon}>{children}</PillInner>\n </button>\n );\n});\n\nexport type PillLinkProps<C extends ElementType = \"a\"> = PillStyle & {\n /** Router link component (Next.js or React Router `Link`…); `<a>` by default. */\n as?: C;\n} & Omit<ComponentPropsWithoutRef<C>, \"as\" | keyof PillStyle>;\n\n/** Same pill as a link. With a router: `<PillLink as={Link} href=\"/\">`. */\nexport const PillLink = forwardRef(function PillLink(\n { as, solid, size = \"md\", icon, className, children, ...props }: PillLinkProps<ElementType>,\n ref: Ref<HTMLAnchorElement>,\n) {\n const Tag: ElementType = as ?? \"a\";\n return (\n <Tag ref={ref} className={pillClass({ solid, size }, className)} {...props}>\n <PillInner icon={icon}>{children}</PillInner>\n </Tag>\n );\n}) as <C extends ElementType = \"a\">(props: PillLinkProps<C> & { ref?: Ref<HTMLAnchorElement> }) => ReactNode;\n","import type { SVGProps } from \"react\";\n\ntype IconProps = SVGProps<SVGSVGElement>;\n\nconst base = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"aria-hidden\": true,\n} as const;\n\nexport const ArrowRight = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M5 12h14M13 6l6 6-6 6\" />\n </svg>\n);\n\nexport const ArrowLeft = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M19 12H5M11 18l-6-6 6-6\" />\n </svg>\n);\n\nexport const Spinner = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M21 12a9 9 0 1 1-6.22-8.56\" />\n </svg>\n);\n\nexport const ChevronDown = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n);\n\nexport const Check = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n);\n\nexport const Menu = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n);\n\nexport const Close = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n);\n\nexport const ArrowUp = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"M12 19V5M6 11l6-6 6 6\" />\n </svg>\n);\n\nexport const Calendar = (props: IconProps) => (\n <svg {...base} {...props}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"3\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </svg>\n);\n\nexport const ChevronLeft = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"m15 6-6 6 6 6\" />\n </svg>\n);\n\nexport const ChevronRight = (props: IconProps) => (\n <svg {...base} {...props}>\n <path d=\"m9 6 6 6-6 6\" />\n </svg>\n);\n","import type { ComponentPropsWithoutRef, ElementType, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\ntype Polymorphic<C extends ElementType, P> = P & { as?: C } & Omit<ComponentPropsWithoutRef<C>, \"as\" | keyof P>;\n\nexport type ContainerProps<C extends ElementType = \"div\"> = Polymorphic<\n C,\n {\n /** `default`: 1280 px, for text and grids; `wide`: 1600 px, for full-width cards; `narrow`: 768 px. */\n size?: \"default\" | \"wide\" | \"narrow\";\n }\n>;\n\n/** Centered max width, with side gutters that grow with the screen. */\nexport function Container<C extends ElementType = \"div\">({\n as,\n size = \"default\",\n className,\n ...props\n}: ContainerProps<C>) {\n const Tag: ElementType = as ?? \"div\";\n return <Tag className={cx(\"trc-container\", size !== \"default\" && `trc-container--${size}`, className)} {...props} />;\n}\n\nexport type SectionProps<C extends ElementType = \"section\"> = Polymorphic<\n C,\n {\n /** Vertical spacing. */\n spacing?: \"sm\" | \"md\" | \"lg\" | \"none\";\n /**\n * Card inset from the screen edges (\"magazine\" effect): graphite background and rounded corners,\n * for banners, calls to action and heroes.\n */\n inset?: boolean;\n }\n>;\n\n/** Vertical block of a page. With `inset`, it becomes a large rounded card a few pixels from the edges. */\nexport function Section<C extends ElementType = \"section\">({\n as,\n spacing = \"md\",\n inset = false,\n className,\n children,\n ...props\n}: SectionProps<C>) {\n const Tag: ElementType = as ?? \"section\";\n if (inset) {\n return (\n <Tag className={cx(\"trc-section-inset\", className)} {...props}>\n <div className={cx(\"trc-section-inset__card\", spacing !== \"none\" && `trc-section--${spacing}`)}>{children}</div>\n </Tag>\n );\n }\n return (\n <Tag className={cx(spacing !== \"none\" && `trc-section--${spacing}`, className)} {...props}>\n {children}\n </Tag>\n );\n}\n\nexport type CardProps<C extends ElementType = \"div\"> = Polymorphic<\n C,\n {\n /** `alt`: a slightly lighter grey, to tell two side-by-side blocks apart. */\n tone?: \"default\" | \"alt\";\n padding?: \"none\" | \"sm\" | \"md\" | \"lg\";\n /** Lightens on hover (clickable cards: links, buttons). */\n interactive?: boolean;\n /** Decorative watermark icon: very large, thin stroke, half out of the corner; wakes up on hover. */\n watermark?: ReactNode;\n }\n>;\n\n/** Graphite card, rounded corners, no shadow: depth comes from shades of grey. */\nexport function Card<C extends ElementType = \"div\">({\n as,\n tone = \"default\",\n padding = \"md\",\n interactive = false,\n watermark,\n className,\n children,\n ...props\n}: CardProps<C>) {\n const Tag: ElementType = as ?? \"div\";\n return (\n <Tag\n className={cx(\n \"trc-card\",\n tone === \"alt\" && \"trc-card--alt\",\n padding !== \"none\" && `trc-card--pad-${padding}`,\n interactive && \"trc-card--interactive\",\n !!watermark && \"trc-card--watermark\",\n className,\n )}\n {...props}\n >\n {!!watermark && (\n <span aria-hidden className=\"trc-card__watermark\">\n {watermark}\n </span>\n )}\n {children}\n </Tag>\n );\n}\n","\"use client\";\n\nimport { createContext, forwardRef, useContext, useId, type ComponentPropsWithoutRef, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ChevronDown } from \"../utils/icons\";\n\ntype FieldContextValue = { id: string; describedBy?: string; invalid: boolean; required: boolean };\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\nexport type FieldProps = {\n label: ReactNode;\n /** Hint shown under the control. */\n hint?: ReactNode;\n /** Error message: replaces the hint and marks the control as invalid. */\n error?: ReactNode;\n required?: boolean;\n /** Control id; generated when omitted. */\n id?: string;\n className?: string;\n children: ReactNode;\n};\n\n/**\n * Label, hint and error of a form control. The control placed inside (`Input`, `Textarea`, `Select`)\n * automatically receives its `id`, `aria-describedby` and `aria-invalid`.\n */\nexport function Field({ label, hint, error, required = false, id, className, children }: FieldProps) {\n const generated = useId();\n const fieldId = id ?? generated;\n const messageId = `${fieldId}-message`;\n const message = error ?? hint;\n return (\n <FieldContext.Provider\n value={{ id: fieldId, describedBy: message ? messageId : undefined, invalid: error != null, required }}\n >\n <div className={cx(\"trc-field\", className)}>\n <label htmlFor={fieldId} className=\"trc-field__label\">\n {label}\n {required && (\n <span aria-hidden className=\"trc-field__required\">\n {\" \"}\n *\n </span>\n )}\n </label>\n {children}\n {message != null && (\n <p id={messageId} className={cx(\"trc-field__message\", error != null && \"trc-field__message--error\")}>\n {message}\n </p>\n )}\n </div>\n </FieldContext.Provider>\n );\n}\n\n/** Accessibility attributes from the parent `Field`, without overriding those passed to the control. Internal: shared by every control. */\nexport function useFieldProps(props: {\n id?: string;\n required?: boolean;\n invalid?: boolean;\n \"aria-describedby\"?: string;\n}) {\n const field = useContext(FieldContext);\n const invalid = props.invalid ?? field?.invalid ?? false;\n return {\n id: props.id ?? field?.id,\n required: props.required ?? field?.required,\n \"aria-describedby\": cx(field?.describedBy, props[\"aria-describedby\"]) || undefined,\n \"aria-invalid\": invalid || undefined,\n };\n}\n\ntype ControlProps = { invalid?: boolean };\n\nexport type InputProps = ComponentPropsWithoutRef<\"input\"> & ControlProps;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input({ invalid, className, ...props }, ref) {\n const a11y = useFieldProps({ ...props, invalid });\n return <input ref={ref} className={cx(\"trc-control\", className)} {...props} {...a11y} />;\n});\n\nexport type TextareaProps = ComponentPropsWithoutRef<\"textarea\"> & ControlProps;\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { invalid, rows = 4, className, ...props },\n ref,\n) {\n const a11y = useFieldProps({ ...props, invalid });\n return (\n <textarea\n ref={ref}\n rows={rows}\n className={cx(\"trc-control\", \"trc-control--textarea\", className)}\n {...props}\n {...a11y}\n />\n );\n});\n\nexport type SelectProps = ComponentPropsWithoutRef<\"select\"> &\n ControlProps & {\n /** Empty option shown until something is chosen. */\n placeholder?: string;\n };\n\n/** Native select (accessible and mobile friendly), dressed with a thin chevron. */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { invalid, placeholder, defaultValue, className, children, ...props },\n ref,\n) {\n const a11y = useFieldProps({ ...props, invalid });\n // Without a given value, keep the empty option shown (otherwise the browser picks the first enabled option).\n const initial = defaultValue ?? (props.value === undefined && placeholder != null ? \"\" : undefined);\n return (\n <span className={cx(\"trc-select\", className)}>\n <select ref={ref} className=\"trc-control trc-control--select\" defaultValue={initial} {...props} {...a11y}>\n {placeholder != null && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {children}\n </select>\n <ChevronDown className=\"trc-select__chevron\" />\n </span>\n );\n});\n","import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { Check } from \"../utils/icons\";\n\ntype ToggleProps = Omit<ComponentPropsWithoutRef<\"input\">, \"type\"> & {\n label: ReactNode;\n /** Extra detail under the label. */\n description?: ReactNode;\n};\n\n/** The label wraps the control: the whole block is clickable. */\nfunction ToggleLabel({\n kind,\n label,\n description,\n className,\n children,\n}: {\n kind: \"checkbox\" | \"switch\";\n label: ReactNode;\n description?: ReactNode;\n className?: string;\n children: ReactNode;\n}) {\n return (\n <label className={cx(\"trc-toggle\", `trc-toggle--${kind}`, className)}>\n {children}\n <span className=\"trc-toggle__text\">\n <span className=\"trc-toggle__label\">{label}</span>\n {description != null && <span className=\"trc-toggle__description\">{description}</span>}\n </span>\n </label>\n );\n}\n\nexport type CheckboxProps = ToggleProps;\n\n/** Native checkbox, filled with the accent color once checked. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, description, className, ...props },\n ref,\n) {\n return (\n <ToggleLabel kind=\"checkbox\" label={label} description={description} className={className}>\n <span className=\"trc-checkbox\">\n <input ref={ref} type=\"checkbox\" className=\"trc-checkbox__input\" {...props} />\n <Check className=\"trc-checkbox__check\" />\n </span>\n </ToggleLabel>\n );\n});\n\nexport type SwitchProps = ToggleProps;\n\n/** Switch: a native checkbox announced as a `switch` to screen readers. */\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n { label, description, className, ...props },\n ref,\n) {\n return (\n <ToggleLabel kind=\"switch\" label={label} description={description} className={className}>\n <span className=\"trc-switch\">\n <input ref={ref} type=\"checkbox\" role=\"switch\" className=\"trc-switch__input\" {...props} />\n <span aria-hidden className=\"trc-switch__thumb\" />\n </span>\n </ToggleLabel>\n );\n});\n","\"use client\";\n\nimport { useEffect, useId, useRef, useState, type ElementType, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ChevronDown, Menu } from \"../utils/icons\";\nimport { Drawer } from \"./drawer\";\nimport { PillLink } from \"./pill\";\n\nexport type NavLink = {\n label: ReactNode;\n href: string;\n /** Current page: marked with an accent dot. */\n active?: boolean;\n};\n\nexport type NavMenu = {\n label: ReactNode;\n /** Dropdown items, with an optional short description (no numbers). */\n items: (NavLink & { description?: ReactNode })[];\n};\n\nexport type NavItem = NavLink | NavMenu;\n\nexport type SiteHeaderProps = {\n /** Logo (white), wrapped in a link to `homeHref`. */\n logo: ReactNode;\n /** Accessible name of the logo link, usually the brand name. */\n logoLabel: string;\n homeHref?: string;\n nav?: NavItem[];\n /** Main action, shown as a compact pill (and a large one in the mobile menu). */\n cta?: { label: ReactNode; href: string };\n /** Extra elements on the right on large screens (language switcher…). */\n actions?: ReactNode;\n /** Content added at the bottom of the mobile menu. */\n mobileFooter?: ReactNode;\n /** Router link component (Next.js `Link`…); `<a>` by default. */\n linkAs?: ElementType;\n /** Scroll offset (px) from which the bar becomes blurred graphite. */\n scrollThreshold?: number;\n menuLabel?: string;\n closeLabel?: string;\n className?: string;\n};\n\nconst isMenu = (item: NavItem): item is NavMenu => \"items\" in item;\n\n/**\n * Floating header: transparent over the hero at the top of the page, it becomes a blurred\n * graphite bar as soon as the page scrolls. Dropdowns on large screens, side panel on mobile.\n */\nexport function SiteHeader({\n logo,\n logoLabel,\n homeHref = \"/\",\n nav = [],\n cta,\n actions,\n mobileFooter,\n linkAs: LinkTag = \"a\",\n scrollThreshold = 24,\n menuLabel = \"Menu\",\n closeLabel = \"Close\",\n className,\n}: SiteHeaderProps) {\n const [scrolled, setScrolled] = useState(false);\n const [open, setOpen] = useState(false);\n\n // Read after hydration: same render on the server and on the client.\n useEffect(() => {\n const update = () => setScrolled(window.scrollY > scrollThreshold);\n update();\n window.addEventListener(\"scroll\", update, { passive: true });\n return () => window.removeEventListener(\"scroll\", update);\n }, [scrollThreshold]);\n\n return (\n <header className={cx(\"trc-header\", className)}>\n <div className={cx(\"trc-header__bar\", scrolled && \"trc-header__bar--scrolled\")}>\n <LinkTag href={homeHref} aria-label={logoLabel} className=\"trc-header__logo\">\n {logo}\n </LinkTag>\n\n {nav.length > 0 && (\n <nav className=\"trc-header__nav\">\n {nav.map((item, i) =>\n isMenu(item) ? (\n <NavDropdown key={i} menu={item} linkAs={LinkTag} />\n ) : (\n <LinkTag\n key={i}\n href={item.href}\n aria-current={item.active ? \"page\" : undefined}\n className={cx(\"trc-header__link\", item.active && \"trc-header__link--active\")}\n >\n {item.label}\n </LinkTag>\n ),\n )}\n </nav>\n )}\n\n <div className=\"trc-header__end\">\n {actions && <div className=\"trc-header__actions\">{actions}</div>}\n {cta && (\n <PillLink as={LinkTag} href={cta.href} size=\"sm\" className=\"trc-header__cta\">\n {cta.label}\n </PillLink>\n )}\n {(nav.length > 0 || cta || mobileFooter) && (\n <button\n type=\"button\"\n className=\"trc-header__burger\"\n aria-label={menuLabel}\n aria-expanded={open}\n onClick={() => setOpen(true)}\n >\n <Menu />\n </button>\n )}\n </div>\n </div>\n\n <MobileMenu\n open={open}\n onClose={() => setOpen(false)}\n nav={nav}\n cta={cta}\n footer={mobileFooter}\n linkAs={LinkTag}\n title={menuLabel}\n closeLabel={closeLabel}\n />\n </header>\n );\n}\n\n/**\n * Dropdown menu (large screens): opens on hover or click, closes on leave, with Escape,\n * when keyboard focus leaves the menu, or after a choice.\n */\nfunction NavDropdown({ menu, linkAs: LinkTag }: { menu: NavMenu; linkAs: ElementType }) {\n const id = useId();\n const [open, setOpen] = useState(false);\n const closeTimer = useRef<number | undefined>(undefined);\n const button = useRef<HTMLButtonElement>(null);\n // Opened by hovering: the click that usually follows must not close it right away.\n const openedByHover = useRef(false);\n\n const show = () => {\n window.clearTimeout(closeTimer.current);\n if (!open) openedByHover.current = true;\n setOpen(true);\n };\n // Short delay: the pointer may cross the gap between the button and the panel.\n const hide = () => {\n closeTimer.current = window.setTimeout(() => setOpen(false), 120);\n };\n useEffect(() => () => window.clearTimeout(closeTimer.current), []);\n\n return (\n <div\n className=\"trc-dropdown\"\n onMouseEnter={show}\n onMouseLeave={hide}\n onKeyDown={(e) => {\n if (e.key === \"Escape\" && open) {\n setOpen(false);\n button.current?.focus();\n }\n }}\n onBlur={(e) => !e.currentTarget.contains(e.relatedTarget) && setOpen(false)}\n >\n <button\n ref={button}\n type=\"button\"\n aria-expanded={open}\n aria-controls={id}\n onClick={() => {\n if (open && openedByHover.current) openedByHover.current = false;\n else setOpen((o) => !o);\n }}\n className={cx(\"trc-header__link\", \"trc-dropdown__trigger\", open && \"trc-dropdown__trigger--open\")}\n >\n {menu.label}\n <ChevronDown className=\"trc-dropdown__chevron\" />\n </button>\n <div id={id} className={cx(\"trc-dropdown__panel\", open && \"trc-dropdown__panel--open\")}>\n <ul className=\"trc-dropdown__list\">\n {menu.items.map((item, i) => (\n <li key={i}>\n <LinkTag\n href={item.href}\n aria-current={item.active ? \"page\" : undefined}\n onClick={() => setOpen(false)}\n className=\"trc-dropdown__item\"\n >\n <span className=\"trc-dropdown__label\">{item.label}</span>\n {item.description != null && <span className=\"trc-dropdown__description\">{item.description}</span>}\n </LinkTag>\n </li>\n ))}\n </ul>\n </div>\n </div>\n );\n}\n\n/** Mobile menu: a `Drawer` holding the navigation, the main action and the extra content. */\nfunction MobileMenu({\n open,\n onClose,\n nav,\n cta,\n footer,\n linkAs: LinkTag,\n title,\n closeLabel,\n}: {\n open: boolean;\n onClose: () => void;\n nav: NavItem[];\n cta?: SiteHeaderProps[\"cta\"];\n footer?: ReactNode;\n linkAs: ElementType;\n title: string;\n closeLabel: string;\n}) {\n return (\n <Drawer open={open} onClose={onClose} title={title} closeLabel={closeLabel} className=\"trc-mobile-menu\">\n <nav className=\"trc-mobile-nav\">\n {nav.map((item, i) =>\n isMenu(item) ? (\n <div key={i} className=\"trc-mobile-nav__group\">\n <p className=\"trc-mobile-nav__heading\">{item.label}</p>\n <ul className=\"trc-mobile-nav__sub\">\n {item.items.map((sub, j) => (\n <li key={j}>\n <LinkTag\n href={sub.href}\n aria-current={sub.active ? \"page\" : undefined}\n onClick={onClose}\n className=\"trc-mobile-nav__sublink\"\n >\n {sub.label}\n </LinkTag>\n </li>\n ))}\n </ul>\n </div>\n ) : (\n <LinkTag\n key={i}\n href={item.href}\n aria-current={item.active ? \"page\" : undefined}\n onClick={onClose}\n className={cx(\"trc-mobile-nav__link\", item.active && \"trc-mobile-nav__link--active\")}\n >\n {item.label}\n </LinkTag>\n ),\n )}\n </nav>\n {cta && (\n <PillLink as={LinkTag} href={cta.href} onClick={onClose} className=\"trc-mobile-menu__cta\">\n {cta.label}\n </PillLink>\n )}\n {footer != null && <div className=\"trc-mobile-menu__footer\">{footer}</div>}\n </Drawer>\n );\n}\n","\"use client\";\n\nimport { useId, useRef, type ReactNode } from \"react\";\nimport { useModal } from \"../hooks/use-modal\";\nimport { cx } from \"../utils/cx\";\nimport { Close } from \"../utils/icons\";\nimport { Portal } from \"../utils/portal\";\n\nexport type ModalLayerProps = {\n open: boolean;\n onClose: () => void;\n title: ReactNode;\n description?: ReactNode;\n children?: ReactNode;\n footer?: ReactNode;\n closeLabel: string;\n /** Closes when the dark overlay is clicked. */\n closeOnOverlay: boolean;\n /** Classes of the root (`trc-layer--…`) and of the panel. */\n rootClassName: string;\n panelClassName: string;\n};\n\n/**\n * Shared modal layer for Dialog, Drawer and the mobile menu: portal, overlay, labelled `dialog`\n * role, focus kept inside, Escape to close and page scroll locked (see `useModal`).\n * It stays in the DOM when closed, hidden, so that it can animate out.\n */\nexport function ModalLayer({\n open,\n onClose,\n title,\n description,\n children,\n footer,\n closeLabel,\n closeOnOverlay,\n rootClassName,\n panelClassName,\n}: ModalLayerProps) {\n const titleId = useId();\n const descriptionId = useId();\n const panel = useRef<HTMLDivElement>(null);\n useModal(open, panel, onClose);\n\n return (\n <Portal>\n <div className={cx(\"trc-layer\", rootClassName, open && \"trc-layer--open\")} aria-hidden={!open}>\n <div className=\"trc-layer__overlay\" onClick={closeOnOverlay ? onClose : undefined} />\n <div\n ref={panel}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={description != null ? descriptionId : undefined}\n tabIndex={-1}\n className={panelClassName}\n >\n <div className=\"trc-layer__head\">\n <h2 id={titleId} className=\"trc-layer__title\">\n {title}\n </h2>\n <button type=\"button\" className=\"trc-layer__close\" aria-label={closeLabel} onClick={onClose}>\n <Close />\n </button>\n </div>\n {description != null && (\n <p id={descriptionId} className=\"trc-layer__description\">\n {description}\n </p>\n )}\n {children != null && <div className=\"trc-layer__body\">{children}</div>}\n {footer != null && <div className=\"trc-layer__footer\">{footer}</div>}\n </div>\n </div>\n </Portal>\n );\n}\n","import { useEffect, useRef, type RefObject } from \"react\";\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Behavior of an open modal panel: focus moved inside and kept there (Tab / Shift+Tab),\n * closes with Escape, page scroll locked, focus returned to the original element on close.\n */\nexport function useModal(open: boolean, panelRef: RefObject<HTMLElement | null>, onClose: () => void) {\n // Latest close callback, without re-running the effect on every render.\n const close = useRef(onClose);\n close.current = onClose;\n\n useEffect(() => {\n const panel = panelRef.current;\n if (!open || !panel) return;\n\n const previous = document.activeElement as HTMLElement | null;\n const overflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n (\n panel.querySelector<HTMLElement>(\"[data-autofocus]\") ??\n panel.querySelector<HTMLElement>(FOCUSABLE) ??\n panel\n ).focus();\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n e.stopPropagation();\n close.current();\n return;\n }\n if (e.key !== \"Tab\") return;\n const items = [...panel.querySelectorAll<HTMLElement>(FOCUSABLE)].filter((el) => el.offsetParent !== null);\n const first = items[0];\n const last = items[items.length - 1];\n if (!first || !last) {\n e.preventDefault();\n return;\n }\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.body.style.overflow = overflow;\n previous?.focus();\n };\n }, [open, panelRef]);\n}\n","import { useSyncExternalStore, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nconst noop = () => () => {};\n\n/** `false` on the server and during hydration, `true` afterwards: client-only rendering without a mismatch. */\nexport const useIsClient = () =>\n useSyncExternalStore(\n noop,\n () => true,\n () => false,\n );\n\n/**\n * Renders its children into `document.body` on the client: nothing in the server render, so server\n * and client agree. After hydration it renders right away, in the same commit as its parent, so the\n * parent's layout effects can measure it. Keeps layers out of `overflow: hidden` and `transform` parents.\n */\nexport function Portal({ children }: { children: ReactNode }) {\n return useIsClient() ? createPortal(children, document.body) : null;\n}\n","\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ModalLayer } from \"./layer\";\n\nexport type DrawerProps = {\n open: boolean;\n onClose: () => void;\n title: ReactNode;\n description?: ReactNode;\n children?: ReactNode;\n /** Actions pinned to the bottom of the panel. */\n footer?: ReactNode;\n /** Edge the panel slides from. */\n side?: \"right\" | \"left\";\n size?: \"sm\" | \"md\";\n closeLabel?: string;\n closeOnOverlay?: boolean;\n className?: string;\n};\n\n/** Side panel that slides over the page: filters, cart, settings, mobile navigation. Modal, like `Dialog`. */\nexport function Drawer({\n side = \"right\",\n size = \"sm\",\n closeLabel = \"Close\",\n closeOnOverlay = true,\n className,\n ...props\n}: DrawerProps) {\n return (\n <ModalLayer\n {...props}\n closeLabel={closeLabel}\n closeOnOverlay={closeOnOverlay}\n rootClassName={`trc-layer--drawer trc-layer--${side}`}\n panelClassName={cx(\"trc-drawer\", `trc-drawer--${size}`, className)}\n />\n );\n}\n","import type { ElementType, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\nexport type FooterLink = { label: ReactNode; href: string };\n\nexport type SiteFooterProps = {\n /** Logo (white), wrapped in a link to `homeHref`. */\n logo?: ReactNode;\n logoLabel?: string;\n homeHref?: string;\n /** Short sentence under the logo. */\n tagline?: ReactNode;\n /** Under the sentence: a pill, a contact… */\n children?: ReactNode;\n /** Site map in columns, each with a spaced small-caps title. */\n columns?: { title: ReactNode; links: FooterLink[] }[];\n /** Accessible name of the site map. */\n columnsLabel?: string;\n /** Bottom line (copyright, credits…). */\n copyright?: ReactNode;\n /** Legal links, aligned right on large screens. */\n legal?: FooterLink[];\n legalLabel?: string;\n /** Router link component (Next.js `Link`…); `<a>` by default. */\n linkAs?: ElementType;\n className?: string;\n};\n\n/** Graphite card footer: brand and call to action, site map in columns, legal links. */\nexport function SiteFooter({\n logo,\n logoLabel,\n homeHref = \"/\",\n tagline,\n children,\n columns = [],\n columnsLabel = \"Site map\",\n copyright,\n legal = [],\n legalLabel = \"Legal\",\n linkAs: LinkTag = \"a\",\n className,\n}: SiteFooterProps) {\n return (\n <footer className={cx(\"trc-footer\", className)}>\n <div className=\"trc-footer__card\">\n <div className=\"trc-footer__main\">\n <div className=\"trc-footer__brand\">\n {logo != null && (\n <LinkTag href={homeHref} aria-label={logoLabel} className=\"trc-footer__logo\">\n {logo}\n </LinkTag>\n )}\n {tagline != null && <p className=\"trc-footer__tagline\">{tagline}</p>}\n {children != null && <div className=\"trc-footer__extra\">{children}</div>}\n </div>\n\n {columns.length > 0 && (\n <nav className=\"trc-footer__columns\" aria-label={columnsLabel}>\n {columns.map((col, i) => (\n <div key={i}>\n <p className=\"trc-footer__heading\">{col.title}</p>\n <ul className=\"trc-footer__list\">\n {col.links.map((link, j) => (\n <li key={j}>\n <LinkTag href={link.href} className=\"trc-footer__link\">\n {link.label}\n </LinkTag>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </nav>\n )}\n </div>\n\n {(copyright != null || legal.length > 0) && (\n <div className=\"trc-footer__bottom\">\n {copyright != null && <p className=\"trc-footer__copyright\">{copyright}</p>}\n {legal.length > 0 && (\n <nav aria-label={legalLabel} className=\"trc-footer__legal\">\n {legal.map((link, i) => (\n <LinkTag key={i} href={link.href} className=\"trc-footer__legal-link\">\n {link.label}\n </LinkTag>\n ))}\n </nav>\n )}\n </div>\n )}\n </div>\n </footer>\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef, useState, type CSSProperties, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { AccentText } from \"./typography\";\n\n/** Delay of an entrance (`.trc-enter`) in milliseconds. */\nconst delay = (ms: number) => ({ \"--trc-delay\": `${ms}ms` }) as CSSProperties;\n\nexport type PageHeroProps = {\n /** Title; the words between *asterisks* take the accent, otherwise the last words (`accentLast`). */\n title: string;\n /** Number of trailing words in the accent color when the title has no asterisks (2 for a long title, 1 otherwise). */\n accentLast?: number;\n description?: ReactNode;\n /** Discreet line under the description (last updated date, breadcrumb…). */\n meta?: ReactNode;\n /**\n * Background photo, heavily darkened: a URL, or a ready-made element (Next.js `<Image fill />`…).\n * Without a photo, a subtle accent glow on a graphite background.\n */\n image?: string | ReactNode;\n /** Photo position (`object-position`). */\n imagePosition?: string;\n /** Content under the text (pills…). */\n children?: ReactNode;\n className?: string;\n};\n\n/**\n * Header of inner pages: rounded card inset from the edges, darkened background photo,\n * thin title whose last words take the accent. Leaves room for the floating header above.\n */\nexport function PageHero({\n title,\n accentLast,\n description,\n meta,\n image,\n imagePosition = \"50% 50%\",\n children,\n className,\n}: PageHeroProps) {\n const words = title.split(\" \").length;\n return (\n <section className={cx(\"trc-hero-inset\", className)}>\n <div className=\"trc-page-hero\">\n <div aria-hidden className=\"trc-hero__media\">\n {typeof image === \"string\" ? (\n <img src={image} alt=\"\" className=\"trc-hero__image\" style={{ objectPosition: imagePosition }} />\n ) : image != null ? (\n image\n ) : (\n <div className=\"trc-page-hero__glow\" />\n )}\n </div>\n <div aria-hidden className=\"trc-page-hero__veil\" />\n <div className=\"trc-page-hero__content\">\n <h1 className=\"trc-display trc-page-hero__title trc-enter\" style={delay(150)}>\n <AccentText text={title} accentLast={accentLast ?? (words > 3 ? 2 : 1)} />\n </h1>\n {description != null && (\n <p className=\"trc-page-hero__description trc-enter\" style={delay(250)}>\n {description}\n </p>\n )}\n {meta != null && (\n <div className=\"trc-page-hero__meta trc-enter\" style={delay(350)}>\n {meta}\n </div>\n )}\n {children != null && (\n <div className=\"trc-page-hero__actions trc-enter\" style={delay(450)}>\n {children}\n </div>\n )}\n </div>\n </div>\n </section>\n );\n}\n\nexport type HeroClip = {\n /** Muted video, 1280 px, without an audio track. Provide WebM and/or MP4. */\n webm?: string;\n mp4?: string;\n /** Image shown before playback, and alone when the user prefers reduced motion. */\n poster?: string;\n};\n\nexport type HeroVideoProps = {\n /** Videos played one after another with a crossfade; the first one is picked at random. */\n clips: HeroClip[];\n /** Hero text (title, description, pills), pinned to the bottom left. */\n children: ReactNode;\n /** Optional block pinned to the bottom right on large screens. */\n aside?: ReactNode;\n /** Crossfade duration, in seconds. */\n fade?: number;\n /** Soft parallax: the video moves down slower than the page. */\n parallax?: boolean;\n className?: string;\n};\n\nconst prefersReducedMotion = () => window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n\n/**\n * Home page hero: rounded card inset from the edges, muted background videos that alternate with\n * a crossfade, dark veils for legibility. No video in the server render: the pick happens\n * after hydration, then the video fades in. Reduced motion: the still image only.\n */\nexport function HeroVideo({ clips, children, aside, fade = 1.2, parallax = true, className }: HeroVideoProps) {\n const videos = useRef<(HTMLVideoElement | null)[]>([]);\n const section = useRef<HTMLElement>(null);\n const media = useRef<HTMLDivElement>(null);\n // -1 until the pick is made: same render on the server and on the client.\n const [active, setActive] = useState(-1);\n\n useEffect(() => {\n if (clips.length === 0) return;\n const start = Math.floor(Math.random() * clips.length);\n // Element captured here: in strict mode, React detaches refs before the cleanup runs.\n const video = videos.current[start];\n if (!prefersReducedMotion()) void video?.play().catch(() => {});\n const frame = requestAnimationFrame(() => setActive(start));\n return () => {\n cancelAnimationFrame(frame);\n video?.pause();\n };\n }, [clips.length]);\n\n useEffect(() => {\n const el = section.current;\n const layer = media.current;\n if (!parallax || !el || !layer || prefersReducedMotion()) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n const rect = el.getBoundingClientRect();\n const progress = Math.min(Math.max(-rect.top / rect.height, 0), 1);\n layer.style.transform = `translate3d(0, ${progress * 120}px, 0)`;\n };\n const onScroll = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n update();\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n return () => {\n window.removeEventListener(\"scroll\", onScroll);\n cancelAnimationFrame(frame);\n };\n }, [parallax]);\n\n const playNext = (i: number) => {\n const next = videos.current[(i + 1) % clips.length];\n if (!next) return;\n next.currentTime = 0;\n void next.play().catch(() => {});\n setActive((i + 1) % clips.length);\n };\n\n return (\n <section ref={section} className={cx(\"trc-hero-inset\", className)}>\n <div className=\"trc-hero-video\">\n <div ref={media} aria-hidden className=\"trc-hero__media trc-hero-video__media\">\n {clips.map((clip, i) => (\n <video\n key={i}\n ref={(el) => {\n videos.current[i] = el;\n }}\n className={cx(\"trc-hero__image\", \"trc-hero-video__clip\", i === active && \"trc-hero-video__clip--active\")}\n style={{ transitionDuration: `${fade}s` }}\n muted\n playsInline\n preload=\"metadata\"\n poster={clip.poster}\n // Shortly before the active video ends, the next one restarts and comes to the front.\n onTimeUpdate={(e) => {\n const v = e.currentTarget;\n if (i === active && v.duration && v.duration - v.currentTime <= fade) playNext(i);\n }}\n // Safety net when `timeupdate` did not trigger the switch (background tab…).\n onEnded={() => i === active && playNext(i)}\n >\n {clip.webm && <source src={clip.webm} type=\"video/webm\" />}\n {clip.mp4 && <source src={clip.mp4} type=\"video/mp4\" />}\n </video>\n ))}\n </div>\n <div aria-hidden className=\"trc-hero-video__veil\" />\n <div className=\"trc-hero-video__content\">\n <div className=\"trc-hero-video__main\">{children}</div>\n {aside != null && <div className=\"trc-hero-video__aside\">{aside}</div>}\n </div>\n </div>\n </section>\n );\n}\n","\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ArrowUp } from \"../utils/icons\";\n\nexport type BackToTopProps = {\n label?: string;\n /** Scroll offset, in viewport heights, from which the button appears. */\n threshold?: number;\n className?: string;\n};\n\n/** Floating accent \"Back to top\" button: appears once the first screen is scrolled past. */\nexport function BackToTop({ label = \"Back to top\", threshold = 0.8, className }: BackToTopProps) {\n const [visible, setVisible] = useState(false);\n\n useEffect(() => {\n const update = () => setVisible(window.scrollY > window.innerHeight * threshold);\n update();\n window.addEventListener(\"scroll\", update, { passive: true });\n return () => window.removeEventListener(\"scroll\", update);\n }, [threshold]);\n\n return (\n <button\n type=\"button\"\n onClick={() =>\n window.scrollTo({\n top: 0,\n behavior: window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches ? \"auto\" : \"smooth\",\n })\n }\n aria-label={label}\n aria-hidden={!visible}\n tabIndex={visible ? 0 : -1}\n className={cx(\"trc-back-to-top\", visible && \"trc-back-to-top--visible\", className)}\n >\n <ArrowUp />\n </button>\n );\n}\n","\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ModalLayer } from \"./layer\";\n\nexport type DialogProps = {\n open: boolean;\n /** Called on Escape, on the close button and on the overlay. */\n onClose: () => void;\n /** Title of the window, also its accessible name. */\n title: ReactNode;\n /** Short text under the title, announced with it. */\n description?: ReactNode;\n children?: ReactNode;\n /** Actions at the bottom, usually pills: the main one solid, on the right. */\n footer?: ReactNode;\n size?: \"sm\" | \"md\" | \"lg\";\n closeLabel?: string;\n closeOnOverlay?: boolean;\n className?: string;\n};\n\n/**\n * Modal window: a graphite card centered over a dark overlay. Focus moves inside and stays there;\n * Escape, the close button or the overlay close it, and focus returns to where it was.\n * Put `data-autofocus` on the element that should receive focus first.\n */\nexport function Dialog({ size = \"md\", closeLabel = \"Close\", closeOnOverlay = true, className, ...props }: DialogProps) {\n return (\n <ModalLayer\n {...props}\n closeLabel={closeLabel}\n closeOnOverlay={closeOnOverlay}\n rootClassName=\"trc-layer--dialog\"\n panelClassName={cx(\"trc-dialog\", `trc-dialog--${size}`, className)}\n />\n );\n}\n","\"use client\";\n\nimport {\n cloneElement,\n useId,\n useRef,\n useState,\n type ElementType,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { useAnchoredPosition, useDismiss, type Align } from \"../hooks/use-floating\";\nimport { callAll, getElementRef, mergeRefs } from \"../utils/compose\";\nimport { cx } from \"../utils/cx\";\nimport { Portal } from \"../utils/portal\";\n\nexport type MenuAction = {\n label: ReactNode;\n /** Called when the item is chosen with a click, Enter or Space. */\n onSelect?: () => void;\n /** Turns the item into a link. */\n href?: string;\n /** Hint shown on the right, such as a keyboard shortcut. */\n hint?: ReactNode;\n disabled?: boolean;\n /** Destructive action (delete, leave…), in the error color. */\n danger?: boolean;\n /** Text used for typeahead when the label is not a string. */\n textValue?: string;\n};\n\nexport type MenuItem = MenuAction | \"separator\";\n\ntype TriggerProps = {\n ref?: Ref<HTMLElement>;\n id?: string;\n onClick?: (e: unknown) => void;\n onKeyDown?: (e: KeyboardEvent) => void;\n};\n\nexport type DropdownMenuProps = {\n /** Element that opens the menu, usually a pill or an icon button. */\n trigger: ReactElement<TriggerProps>;\n items: MenuItem[];\n align?: Align;\n /** Link component of your router, for items with an `href`. */\n linkAs?: ElementType;\n className?: string;\n};\n\nconst isAction = (item: MenuItem): item is MenuAction => item !== \"separator\";\nconst textOf = (item: MenuAction) =>\n (item.textValue ?? (typeof item.label === \"string\" ? item.label : \"\")).toLowerCase();\n\n/**\n * Menu of actions opened from a trigger. Keyboard: Enter, Space or the arrows open it; the arrows,\n * Home and End move between items; typing a letter jumps to the next item starting with it;\n * Escape closes and returns focus to the trigger; Tab closes and moves on.\n */\nexport function DropdownMenu({ trigger, items, align = \"start\", linkAs: LinkTag = \"a\", className }: DropdownMenuProps) {\n const [open, setOpen] = useState(false);\n const triggerRef = useRef<HTMLElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const itemRefs = useRef<(HTMLElement | null)[]>([]);\n const generatedId = useId();\n const triggerId = trigger.props.id ?? `${generatedId}-trigger`;\n const menuId = `${generatedId}-menu`;\n\n const enabled = items.map((item, i) => (isAction(item) && !item.disabled ? i : -1)).filter((i) => i >= 0);\n const focusItem = (index: number | undefined) => index !== undefined && itemRefs.current[index]?.focus();\n\n const openMenu = (focus: \"first\" | \"last\") => {\n setOpen(true);\n // The items exist once the menu is rendered.\n requestAnimationFrame(() => focusItem(focus === \"first\" ? enabled[0] : enabled[enabled.length - 1]));\n };\n const close = (returnFocus = true) => {\n setOpen(false);\n if (returnFocus) triggerRef.current?.focus();\n };\n\n useAnchoredPosition(open, triggerRef, menuRef, { side: \"bottom\", align });\n useDismiss(open, [triggerRef, menuRef], (reason) => close(reason === \"escape\"));\n\n const select = (item: MenuAction) => {\n item.onSelect?.();\n close();\n };\n\n const onMenuKeyDown = (e: KeyboardEvent) => {\n const current = itemRefs.current.findIndex((el) => el === document.activeElement);\n const position = enabled.indexOf(current);\n const move = (to: number) => {\n e.preventDefault();\n focusItem(enabled[(to + enabled.length) % enabled.length]);\n };\n if (e.key === \"ArrowDown\") move(position + 1);\n else if (e.key === \"ArrowUp\") move(position - 1);\n else if (e.key === \"Home\") move(0);\n else if (e.key === \"End\") move(enabled.length - 1);\n else if (e.key === \"Tab\") close(false);\n else if (e.key.length === 1 && /\\S/.test(e.key)) {\n // Typeahead: next enabled item whose text starts with the typed letter.\n const letter = e.key.toLowerCase();\n const order = [...enabled.slice(position + 1), ...enabled.slice(0, position + 1)];\n const match = order.find((i) => textOf(items[i] as MenuAction).startsWith(letter));\n if (match !== undefined) focusItem(match);\n }\n };\n\n const triggerElement = cloneElement(trigger, {\n ref: mergeRefs(triggerRef, getElementRef(trigger)),\n id: triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open,\n \"aria-controls\": open ? menuId : undefined,\n onClick: callAll(trigger.props.onClick, () => (open ? close() : openMenu(\"first\"))),\n onKeyDown: callAll(trigger.props.onKeyDown, (e: KeyboardEvent) => {\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n openMenu(e.key === \"ArrowDown\" ? \"first\" : \"last\");\n }\n }),\n } as TriggerProps);\n\n return (\n <>\n {triggerElement}\n {open && (\n <Portal>\n <div\n ref={menuRef}\n id={menuId}\n role=\"menu\"\n aria-labelledby={triggerId}\n className={cx(\"trc-floating\", \"trc-menu\", className)}\n onKeyDown={onMenuKeyDown}\n >\n {items.map((item, i) => {\n if (!isAction(item)) return <div key={i} role=\"separator\" className=\"trc-menu__separator\" />;\n const shared = {\n ref: (el: HTMLElement | null) => {\n itemRefs.current[i] = el;\n },\n role: \"menuitem\",\n tabIndex: -1,\n \"aria-disabled\": item.disabled || undefined,\n className: cx(\"trc-menu__item\", item.danger && \"trc-menu__item--danger\"),\n onMouseMove: (e: { currentTarget: HTMLElement }) => !item.disabled && e.currentTarget.focus(),\n children: (\n <>\n <span className=\"trc-menu__label\">{item.label}</span>\n {item.hint != null && <span className=\"trc-menu__hint\">{item.hint}</span>}\n </>\n ),\n };\n return item.href && !item.disabled ? (\n <LinkTag key={i} href={item.href} {...shared} onClick={() => select(item)} />\n ) : (\n <div\n key={i}\n {...shared}\n onClick={() => !item.disabled && select(item)}\n onKeyDown={(e: KeyboardEvent) => {\n if ((e.key === \"Enter\" || e.key === \" \") && !item.disabled) {\n e.preventDefault();\n select(item);\n }\n }}\n />\n );\n })}\n </div>\n </Portal>\n )}\n </>\n );\n}\n","import { useEffect, useLayoutEffect, useRef, type RefObject } from \"react\";\n\n/** `useLayoutEffect` in the browser, `useEffect` on the server (no warning during server rendering). */\nexport const useIsomorphicLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\nexport type Side = \"top\" | \"bottom\";\nexport type Align = \"start\" | \"center\" | \"end\";\n\nconst MARGIN = 8;\n\n/**\n * Places a floating element (menu, popover, tooltip) in `position: fixed` against its anchor.\n * It flips to the other side when there is not enough room, stays inside the viewport and follows\n * scrolling and resizing. The resolved side is written to `data-side`, for the entrance animation.\n */\nexport function useAnchoredPosition(\n open: boolean,\n anchorRef: RefObject<HTMLElement | null>,\n floatingRef: RefObject<HTMLElement | null>,\n { side = \"bottom\", align = \"start\", offset = 8 }: { side?: Side; align?: Align; offset?: number } = {},\n) {\n useIsomorphicLayoutEffect(() => {\n if (!open) return;\n const update = () => {\n const anchor = anchorRef.current;\n const floating = floatingRef.current;\n if (!anchor || !floating) return;\n const a = anchor.getBoundingClientRect();\n const f = floating.getBoundingClientRect();\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n const below = a.bottom + offset;\n const above = a.top - offset - f.height;\n const fitsBelow = below + f.height <= vh - MARGIN;\n const fitsAbove = above >= MARGIN;\n const resolved: Side = side === \"bottom\" ? (fitsBelow || !fitsAbove ? \"bottom\" : \"top\") : fitsAbove || !fitsBelow ? \"top\" : \"bottom\";\n const top = resolved === \"bottom\" ? below : above;\n\n let left = align === \"start\" ? a.left : align === \"end\" ? a.right - f.width : a.left + a.width / 2 - f.width / 2;\n left = Math.min(Math.max(left, MARGIN), Math.max(MARGIN, vw - f.width - MARGIN));\n\n floating.style.top = `${Math.round(top)}px`;\n floating.style.left = `${Math.round(left)}px`;\n floating.dataset.side = resolved;\n };\n update();\n window.addEventListener(\"resize\", update);\n window.addEventListener(\"scroll\", update, true);\n return () => {\n window.removeEventListener(\"resize\", update);\n window.removeEventListener(\"scroll\", update, true);\n };\n }, [open, side, align, offset]);\n}\n\n/** Calls `onDismiss` on a press outside every given element, or on Escape. */\nexport function useDismiss(open: boolean, refs: RefObject<HTMLElement | null>[], onDismiss: (reason: \"outside\" | \"escape\") => void) {\n const dismiss = useRef(onDismiss);\n dismiss.current = onDismiss;\n\n useEffect(() => {\n if (!open) return;\n const onPointerDown = (e: PointerEvent) => {\n const target = e.target as Node;\n if (!refs.some((ref) => ref.current?.contains(target))) dismiss.current(\"outside\");\n };\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") dismiss.current(\"escape\");\n };\n document.addEventListener(\"pointerdown\", onPointerDown);\n document.addEventListener(\"keydown\", onKeyDown);\n return () => {\n document.removeEventListener(\"pointerdown\", onPointerDown);\n document.removeEventListener(\"keydown\", onKeyDown);\n };\n // The refs are stable objects: only the open state matters.\n }, [open]);\n}\n","import { version, type ReactElement, type Ref, type RefCallback } from \"react\";\n\n/** Calls every handler in turn, skipping the empty ones: the trigger keeps its own handlers. */\nexport function callAll<A extends unknown[]>(...fns: (((...args: A) => void) | undefined)[]) {\n return (...args: A) => fns.forEach((fn) => fn?.(...args));\n}\n\n/** One ref callback feeding several refs (object or function). */\nexport function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): RefCallback<T> {\n return (value) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") ref(value);\n else if (ref) (ref as { current: T | null }).current = value;\n }\n };\n}\n\n/** Ref of a React element: a prop in React 19, a field of the element in React 18. */\nexport function getElementRef<T>(element: ReactElement): Ref<T> | undefined {\n const fromProps = (element.props as { ref?: Ref<T> }).ref;\n if (Number.parseInt(version, 10) >= 19) return fromProps;\n return (element as unknown as { ref?: Ref<T> }).ref;\n}\n","\"use client\";\n\nimport { cloneElement, useEffect, useId, useRef, useState, type ReactElement, type ReactNode, type Ref } from \"react\";\nimport { useAnchoredPosition, useDismiss, type Align, type Side } from \"../hooks/use-floating\";\nimport { callAll, getElementRef, mergeRefs } from \"../utils/compose\";\nimport { cx } from \"../utils/cx\";\nimport { Portal } from \"../utils/portal\";\n\ntype TriggerProps = { ref?: Ref<HTMLElement>; onClick?: (e: unknown) => void };\n\nexport type PopoverProps = {\n /** Element that opens the panel. */\n trigger: ReactElement<TriggerProps>;\n /** Title of the panel, also its accessible name. */\n title?: ReactNode;\n /** Accessible name when there is no visible title. */\n label?: string;\n children: ReactNode;\n side?: Side;\n align?: Align;\n /** Controlled state; leave out to let the popover manage itself. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n className?: string;\n};\n\n/**\n * Floating panel anchored to a trigger, for short content and small forms. Not modal: the page stays\n * usable. Focus moves into the panel when it opens; Escape or a click outside closes it.\n */\nexport function Popover({\n trigger,\n title,\n label,\n children,\n side = \"bottom\",\n align = \"start\",\n open: controlled,\n onOpenChange,\n className,\n}: PopoverProps) {\n const [uncontrolled, setUncontrolled] = useState(false);\n const open = controlled ?? uncontrolled;\n const setOpen = (value: boolean) => {\n if (controlled === undefined) setUncontrolled(value);\n onOpenChange?.(value);\n };\n const triggerRef = useRef<HTMLElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const id = useId();\n\n useAnchoredPosition(open, triggerRef, panelRef, { side, align });\n useDismiss(open, [triggerRef, panelRef], (reason) => {\n setOpen(false);\n if (reason === \"escape\") triggerRef.current?.focus();\n });\n\n // Focus the first field or button of the panel, or the panel itself.\n useEffect(() => {\n if (!open) return;\n const panel = panelRef.current;\n const first = panel?.querySelector<HTMLElement>(\n \"[data-autofocus], input, select, textarea, button, a[href], [tabindex]:not([tabindex='-1'])\",\n );\n (first ?? panel)?.focus();\n }, [open]);\n\n const triggerElement = cloneElement(trigger, {\n ref: mergeRefs(triggerRef, getElementRef(trigger)),\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": open,\n \"aria-controls\": open ? `${id}-panel` : undefined,\n onClick: callAll(trigger.props.onClick, () => setOpen(!open)),\n } as TriggerProps);\n\n return (\n <>\n {triggerElement}\n {open && (\n <Portal>\n <div\n ref={panelRef}\n id={`${id}-panel`}\n role=\"dialog\"\n aria-labelledby={title != null ? `${id}-title` : undefined}\n aria-label={title == null ? label : undefined}\n tabIndex={-1}\n className={cx(\"trc-floating\", \"trc-popover\", className)}\n >\n {title != null && (\n <p id={`${id}-title`} className=\"trc-popover__title\">\n {title}\n </p>\n )}\n <div className=\"trc-popover__body\">{children}</div>\n </div>\n </Portal>\n )}\n </>\n );\n}\n","\"use client\";\n\nimport { cloneElement, useEffect, useId, useRef, useState, type ReactElement, type ReactNode, type Ref } from \"react\";\nimport { useAnchoredPosition, type Side } from \"../hooks/use-floating\";\nimport { callAll, getElementRef, mergeRefs } from \"../utils/compose\";\nimport { cx } from \"../utils/cx\";\nimport { Portal } from \"../utils/portal\";\n\ntype ChildProps = {\n ref?: Ref<HTMLElement>;\n \"aria-describedby\"?: string;\n onMouseEnter?: (e: unknown) => void;\n onMouseLeave?: (e: unknown) => void;\n onFocus?: (e: unknown) => void;\n onBlur?: (e: unknown) => void;\n};\n\nexport type TooltipProps = {\n /** Short text describing the element; never the only way to get the information. */\n label: ReactNode;\n /** A single focusable element: a button, a link, an input. */\n children: ReactElement<ChildProps>;\n side?: Side;\n /** Delay before showing on hover, in milliseconds. Keyboard focus shows it right away. */\n delay?: number;\n className?: string;\n};\n\n/**\n * Small label shown on hover and keyboard focus, tied to its element with `aria-describedby`.\n * It stays open while the pointer moves onto it, and Escape hides it (WCAG 1.4.13).\n */\nexport function Tooltip({ label, children, side = \"top\", delay = 300, className }: TooltipProps) {\n const [open, setOpen] = useState(false);\n const anchorRef = useRef<HTMLElement>(null);\n const tipRef = useRef<HTMLDivElement>(null);\n const timer = useRef<number | undefined>(undefined);\n const id = useId();\n\n const show = (wait: number) => {\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => setOpen(true), wait);\n };\n // A short grace period lets the pointer travel from the element onto the tooltip.\n const hide = () => {\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => setOpen(false), 100);\n };\n useEffect(() => () => window.clearTimeout(timer.current), []);\n\n useEffect(() => {\n if (!open) return;\n const onKeyDown = (e: KeyboardEvent) => e.key === \"Escape\" && setOpen(false);\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [open]);\n\n useAnchoredPosition(open, anchorRef, tipRef, { side, align: \"center\", offset: 8 });\n\n const child = cloneElement(children, {\n ref: mergeRefs(anchorRef, getElementRef(children)),\n \"aria-describedby\": [children.props[\"aria-describedby\"], id].filter(Boolean).join(\" \"),\n onMouseEnter: callAll(children.props.onMouseEnter, () => show(delay)),\n onMouseLeave: callAll(children.props.onMouseLeave, hide),\n onFocus: callAll(children.props.onFocus, () => show(0)),\n onBlur: callAll(children.props.onBlur, () => {\n window.clearTimeout(timer.current);\n setOpen(false);\n }),\n } as ChildProps);\n\n return (\n <>\n {child}\n {/* Always in the DOM (hidden when closed) so that aria-describedby points to real text. */}\n <Portal>\n <div\n ref={tipRef}\n id={id}\n role=\"tooltip\"\n className={cx(\"trc-floating\", \"trc-tooltip\", open && \"trc-tooltip--open\", className)}\n onMouseEnter={() => window.clearTimeout(timer.current)}\n onMouseLeave={hide}\n >\n {label}\n </div>\n </Portal>\n </>\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef, useState, useSyncExternalStore, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { Close } from \"../utils/icons\";\nimport { Portal } from \"../utils/portal\";\n\nexport type ToastTone = \"default\" | \"success\" | \"error\";\n\nexport type ToastOptions = {\n description?: ReactNode;\n tone?: ToastTone;\n /** Time on screen in milliseconds; `Infinity` keeps it until dismissed. */\n duration?: number;\n /** One action, such as \"Undo\"; choosing it also dismisses the toast. */\n action?: { label: ReactNode; onClick: () => void };\n};\n\ntype ToastItem = ToastOptions & { id: number; title: ReactNode; leaving: boolean };\n\n// A tiny store shared by `toast()` and every `<Toaster />`: toasts can be raised from anywhere.\nlet items: ToastItem[] = [];\nlet nextId = 1;\nconst listeners = new Set<() => void>();\nconst emit = () => listeners.forEach((listener) => listener());\nconst subscribe = (listener: () => void) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n};\nconst EMPTY: ToastItem[] = [];\n\n/** Leaves time for the exit animation before removing the toast. */\nconst LEAVE_MS = 200;\n\nfunction dismiss(id?: number) {\n items = items.map((t) => (id === undefined || t.id === id ? { ...t, leaving: true } : t));\n emit();\n window.setTimeout(() => {\n items = items.filter((t) => !(t.leaving && (id === undefined || t.id === id)));\n emit();\n }, LEAVE_MS);\n}\n\n/**\n * Shows a short message in the `<Toaster />`. Returns its id, for `toast.dismiss(id)`.\n * `toast.success()` and `toast.error()` set the tone.\n */\nexport function toast(title: ReactNode, options: ToastOptions = {}) {\n const id = nextId++;\n items = [...items, { ...options, id, title, leaving: false }];\n emit();\n return id;\n}\ntoast.success = (title: ReactNode, options: Omit<ToastOptions, \"tone\"> = {}) =>\n toast(title, { ...options, tone: \"success\" });\ntoast.error = (title: ReactNode, options: Omit<ToastOptions, \"tone\"> = {}) =>\n toast(title, { ...options, tone: \"error\" });\n/** Dismisses one toast, or all of them without an id. */\ntoast.dismiss = dismiss;\n\nexport type ToasterProps = {\n position?: \"bottom-right\" | \"bottom-center\" | \"top-right\";\n /** Default time on screen, in milliseconds. */\n duration?: number;\n /** Accessible name of the notification area. */\n label?: string;\n closeLabel?: string;\n};\n\n/**\n * Notification area, placed once near the root of the app. New toasts are announced to screen\n * readers (errors right away); timers pause while the pointer or the keyboard focus is inside.\n */\nexport function Toaster({\n position = \"bottom-right\",\n duration = 5000,\n label = \"Notifications\",\n closeLabel = \"Close\",\n}: ToasterProps) {\n const toasts = useSyncExternalStore(\n subscribe,\n () => items,\n () => EMPTY,\n );\n const [paused, setPaused] = useState(false);\n\n return (\n <Portal>\n <section\n aria-label={label}\n className={cx(\"trc-toaster\", `trc-toaster--${position}`)}\n onMouseEnter={() => setPaused(true)}\n onMouseLeave={() => setPaused(false)}\n onFocus={() => setPaused(true)}\n onBlur={(e) => !e.currentTarget.contains(e.relatedTarget) && setPaused(false)}\n >\n <ol aria-live=\"polite\" aria-relevant=\"additions\" className=\"trc-toaster__list\">\n {toasts.map((t) => (\n <ToastCard key={t.id} toast={t} duration={t.duration ?? duration} paused={paused} closeLabel={closeLabel} />\n ))}\n </ol>\n </section>\n </Portal>\n );\n}\n\nfunction ToastCard({\n toast: t,\n duration,\n paused,\n closeLabel,\n}: {\n toast: ToastItem;\n duration: number;\n paused: boolean;\n closeLabel: string;\n}) {\n // Time left, kept across pauses.\n const remaining = useRef(duration);\n\n useEffect(() => {\n if (paused || t.leaving || !Number.isFinite(remaining.current)) return;\n const started = Date.now();\n const timer = window.setTimeout(() => dismiss(t.id), remaining.current);\n return () => {\n window.clearTimeout(timer);\n remaining.current -= Date.now() - started;\n };\n }, [paused, t.leaving, t.id]);\n\n const tone = t.tone ?? \"default\";\n return (\n <li className={cx(\"trc-toast\", `trc-toast--${tone}`, t.leaving && \"trc-toast--leaving\")}>\n {/* The list is a polite live region; errors are announced right away. */}\n <div className=\"trc-toast__text\" role={tone === \"error\" ? \"alert\" : undefined}>\n <p className=\"trc-toast__title\">{t.title}</p>\n {t.description != null && <p className=\"trc-toast__description\">{t.description}</p>}\n </div>\n {t.action && (\n <button\n type=\"button\"\n className=\"trc-toast__action\"\n onClick={() => {\n t.action?.onClick();\n dismiss(t.id);\n }}\n >\n {t.action.label}\n </button>\n )}\n <button type=\"button\" className=\"trc-toast__close\" aria-label={closeLabel} onClick={() => dismiss(t.id)}>\n <Close />\n </button>\n </li>\n );\n}\n","import type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\nexport type AlertProps = Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> & {\n title?: ReactNode;\n /** `info` and `success` use the accent, `error` the error color. */\n tone?: \"info\" | \"success\" | \"error\";\n /** Actions under the text, such as a small pill. */\n actions?: ReactNode;\n};\n\n/**\n * Inline message in a graphite card, marked by a thin colored edge rather than an icon badge.\n * Static by default; pass `role=\"alert\"` (urgent) or `role=\"status\"` when it appears after an action.\n */\nexport function Alert({ title, tone = \"info\", actions, className, children, ...props }: AlertProps) {\n return (\n <div className={cx(\"trc-alert\", `trc-alert--${tone}`, className)} {...props}>\n {title != null && <p className=\"trc-alert__title\">{title}</p>}\n {children != null && <div className=\"trc-alert__body\">{children}</div>}\n {actions != null && <div className=\"trc-alert__actions\">{actions}</div>}\n </div>\n );\n}\n","\"use client\";\n\nimport { useId, useRef, type KeyboardEvent, type ReactNode } from \"react\";\nimport { useControllable } from \"../hooks/use-controllable\";\nimport { cx } from \"../utils/cx\";\n\nexport type TabItem = {\n value: string;\n label: ReactNode;\n content: ReactNode;\n disabled?: boolean;\n};\n\nexport type TabsProps = {\n items: TabItem[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Accessible name of the tab list. */\n label?: string;\n /**\n * `automatic`: the arrows select the tab they move to. `manual`: they only move the focus,\n * Enter or Space selects (for panels that are slow to render).\n */\n activation?: \"automatic\" | \"manual\";\n className?: string;\n};\n\n/**\n * Tabs: thin labels, the selected one underlined with the accent. Keyboard: Left and Right arrows,\n * Home and End; only the selected tab is in the Tab order (roving tabindex).\n */\nexport function Tabs({\n items,\n value,\n defaultValue,\n onValueChange,\n label,\n activation = \"automatic\",\n className,\n}: TabsProps) {\n const firstEnabled = items.find((item) => !item.disabled)?.value ?? \"\";\n const [selected, setSelected] = useControllable(value, defaultValue ?? firstEnabled, onValueChange);\n const id = useId();\n const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);\n const enabled = items.map((item, i) => (item.disabled ? -1 : i)).filter((i) => i >= 0);\n\n const onKeyDown = (e: KeyboardEvent, index: number) => {\n const position = enabled.indexOf(index);\n let target: number | undefined;\n if (e.key === \"ArrowRight\") target = enabled[(position + 1) % enabled.length];\n else if (e.key === \"ArrowLeft\") target = enabled[(position - 1 + enabled.length) % enabled.length];\n else if (e.key === \"Home\") target = enabled[0];\n else if (e.key === \"End\") target = enabled[enabled.length - 1];\n if (target === undefined) return;\n e.preventDefault();\n tabRefs.current[target]?.focus();\n if (activation === \"automatic\") setSelected(items[target]!.value);\n };\n\n return (\n <div className={cx(\"trc-tabs\", className)}>\n <div role=\"tablist\" aria-label={label} className=\"trc-tabs__list\">\n {items.map((item, i) => {\n const isSelected = item.value === selected;\n return (\n <button\n key={item.value}\n ref={(el) => {\n tabRefs.current[i] = el;\n }}\n type=\"button\"\n role=\"tab\"\n id={`${id}-tab-${i}`}\n aria-selected={isSelected}\n aria-controls={`${id}-panel-${i}`}\n disabled={item.disabled}\n tabIndex={isSelected ? 0 : -1}\n className=\"trc-tabs__tab\"\n onClick={() => setSelected(item.value)}\n onKeyDown={(e) => onKeyDown(e, i)}\n >\n {item.label}\n </button>\n );\n })}\n </div>\n {items.map((item, i) => (\n <div\n key={item.value}\n role=\"tabpanel\"\n id={`${id}-panel-${i}`}\n aria-labelledby={`${id}-tab-${i}`}\n hidden={item.value !== selected}\n tabIndex={0}\n className=\"trc-tabs__panel\"\n >\n {item.content}\n </div>\n ))}\n </div>\n );\n}\n","import { useRef, useState } from \"react\";\n\n/**\n * State that can be controlled (`value` given) or not (`defaultValue` only).\n * `onChange` is called in both cases.\n */\nexport function useControllable<T>(value: T | undefined, defaultValue: T, onChange?: (value: T) => void) {\n const [internal, setInternal] = useState(defaultValue);\n const controlled = useRef(value !== undefined).current;\n const current = controlled ? (value as T) : internal;\n const set = (next: T) => {\n if (!controlled) setInternal(next);\n onChange?.(next);\n };\n return [current, set] as const;\n}\n","\"use client\";\n\nimport { useId, type ReactNode } from \"react\";\nimport { useControllable } from \"../hooks/use-controllable\";\nimport { cx } from \"../utils/cx\";\n\nexport type SegmentedOption = { value: string; label: ReactNode; disabled?: boolean };\n\nexport type SegmentedControlProps = {\n options: SegmentedOption[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Accessible name of the group. */\n label: string;\n /** Form field name; generated when omitted. */\n name?: string;\n size?: \"md\" | \"sm\";\n className?: string;\n};\n\n/**\n * Pill switch between a few options, built on native radio buttons: the arrows move the choice,\n * forms and screen readers work as usual. For views of the same content; use Tabs to switch panels.\n */\nexport function SegmentedControl({\n options,\n value,\n defaultValue,\n onValueChange,\n label,\n name,\n size = \"md\",\n className,\n}: SegmentedControlProps) {\n const [selected, setSelected] = useControllable(value, defaultValue ?? options[0]?.value ?? \"\", onValueChange);\n const generated = useId();\n return (\n <div\n role=\"radiogroup\"\n aria-label={label}\n className={cx(\"trc-segmented\", size === \"sm\" && \"trc-segmented--sm\", className)}\n >\n {options.map((option) => (\n <label key={option.value} className=\"trc-segmented__option\">\n <input\n type=\"radio\"\n name={name ?? generated}\n value={option.value}\n checked={option.value === selected}\n disabled={option.disabled}\n onChange={() => setSelected(option.value)}\n className=\"trc-segmented__input\"\n />\n <span className=\"trc-segmented__label\">{option.label}</span>\n </label>\n ))}\n </div>\n );\n}\n","\"use client\";\n\nimport { useId, useRef, type KeyboardEvent, type ReactNode } from \"react\";\nimport { useControllable } from \"../hooks/use-controllable\";\nimport { cx } from \"../utils/cx\";\nimport { ChevronDown } from \"../utils/icons\";\n\nexport type AccordionItem = {\n value: string;\n title: ReactNode;\n content: ReactNode;\n disabled?: boolean;\n};\n\nexport type AccordionProps = {\n items: AccordionItem[];\n /** `single`: one item open at a time. `multiple`: any number. */\n type?: \"single\" | \"multiple\";\n /** Open items. */\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[]) => void;\n /** Level of the heading wrapping each button, to fit the page outline. */\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n className?: string;\n};\n\n/**\n * Items that open and close, for FAQs and details. Each title is a button inside a heading; the\n * height animates; closed content is out of the accessibility tree. Up and Down arrows, Home and\n * End move between titles.\n */\nexport function Accordion({\n items,\n type = \"single\",\n value,\n defaultValue = [],\n onValueChange,\n headingLevel = 3,\n className,\n}: AccordionProps) {\n const [open, setOpen] = useControllable(value, defaultValue, onValueChange);\n const id = useId();\n const buttons = useRef<(HTMLButtonElement | null)[]>([]);\n const Heading = `h${headingLevel}` as const;\n const enabled = items.map((item, i) => (item.disabled ? -1 : i)).filter((i) => i >= 0);\n\n const toggle = (itemValue: string) => {\n const isOpen = open.includes(itemValue);\n if (type === \"single\") setOpen(isOpen ? [] : [itemValue]);\n else setOpen(isOpen ? open.filter((v) => v !== itemValue) : [...open, itemValue]);\n };\n\n const onKeyDown = (e: KeyboardEvent, index: number) => {\n const position = enabled.indexOf(index);\n let target: number | undefined;\n if (e.key === \"ArrowDown\") target = enabled[(position + 1) % enabled.length];\n else if (e.key === \"ArrowUp\") target = enabled[(position - 1 + enabled.length) % enabled.length];\n else if (e.key === \"Home\") target = enabled[0];\n else if (e.key === \"End\") target = enabled[enabled.length - 1];\n if (target === undefined) return;\n e.preventDefault();\n buttons.current[target]?.focus();\n };\n\n return (\n <div className={cx(\"trc-accordion\", className)}>\n {items.map((item, i) => {\n const isOpen = open.includes(item.value);\n return (\n <div key={item.value} className={cx(\"trc-accordion__item\", isOpen && \"trc-accordion__item--open\")}>\n <Heading className=\"trc-accordion__heading\">\n <button\n ref={(el) => {\n buttons.current[i] = el;\n }}\n type=\"button\"\n id={`${id}-trigger-${i}`}\n aria-expanded={isOpen}\n aria-controls={`${id}-panel-${i}`}\n disabled={item.disabled}\n className=\"trc-accordion__trigger\"\n onClick={() => toggle(item.value)}\n onKeyDown={(e) => onKeyDown(e, i)}\n >\n <span>{item.title}</span>\n <ChevronDown className=\"trc-accordion__chevron\" />\n </button>\n </Heading>\n <div\n id={`${id}-panel-${i}`}\n role=\"region\"\n aria-labelledby={`${id}-trigger-${i}`}\n className=\"trc-accordion__panel\"\n >\n <div className=\"trc-accordion__inner\">\n <div className=\"trc-accordion__content\">{item.content}</div>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\nexport type StepItem = { title: ReactNode; description?: ReactNode };\n\nexport type StepsProps = {\n items: StepItem[];\n /**\n * Index of the step in progress (from 0): earlier steps are complete, later ones upcoming.\n * Leave out for a plain list of steps, all alike.\n */\n current?: number;\n className?: string;\n};\n\n/**\n * Vertical timeline of steps in a real order: large thin numbers in the accent, joined by a hairline.\n * With `current`, the step in progress carries `aria-current=\"step\"` and the upcoming ones fade.\n */\nexport function Steps({ items, current, className }: StepsProps) {\n return (\n <ol className={cx(\"trc-steps\", className)}>\n {items.map((item, i) => {\n const state =\n current === undefined ? \"default\" : i < current ? \"complete\" : i === current ? \"current\" : \"upcoming\";\n return (\n <li\n key={i}\n className={cx(\"trc-steps__item\", `trc-steps__item--${state}`)}\n aria-current={state === \"current\" ? \"step\" : undefined}\n >\n <span aria-hidden className=\"trc-steps__number\">\n {String(i + 1).padStart(2, \"0\")}\n </span>\n <div className=\"trc-steps__text\">\n <p className=\"trc-steps__title\">{item.title}</p>\n {item.description != null && <div className=\"trc-steps__description\">{item.description}</div>}\n </div>\n </li>\n );\n })}\n </ol>\n );\n}\n","import type { ElementType, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\nexport type BreadcrumbItem = { label: ReactNode; href?: string };\n\nexport type BreadcrumbsProps = {\n /** From the home page to the current page; the last item is the current page and has no link. */\n items: BreadcrumbItem[];\n label?: string;\n linkAs?: ElementType;\n className?: string;\n};\n\n/** Trail from the home page to the current page, separated by thin slashes. */\nexport function Breadcrumbs({ items, label = \"Breadcrumb\", linkAs: LinkTag = \"a\", className }: BreadcrumbsProps) {\n return (\n <nav aria-label={label} className={cx(\"trc-breadcrumbs\", className)}>\n <ol className=\"trc-breadcrumbs__list\">\n {items.map((item, i) => {\n const last = i === items.length - 1;\n return (\n <li key={i} className=\"trc-breadcrumbs__item\">\n {last || !item.href ? (\n <span aria-current={last ? \"page\" : undefined} className=\"trc-breadcrumbs__current\">\n {item.label}\n </span>\n ) : (\n <LinkTag href={item.href} className=\"trc-breadcrumbs__link\">\n {item.label}\n </LinkTag>\n )}\n {!last && (\n <span aria-hidden className=\"trc-breadcrumbs__separator\">\n /\n </span>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n}\n","/**\n * Fills a label template: \"{count} more\" with { count: 3 } gives \"3 more\".\n * Label props accept such a template (usable from a server component) or a function.\n */\nexport function fill(template: string, values: Record<string, string | number>) {\n return template.replace(/\\{(\\w+)\\}/g, (match, key: string) => (key in values ? String(values[key]) : match));\n}\n","import type { ElementType, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ArrowLeft, ArrowRight } from \"../utils/icons\";\nimport { fill } from \"../utils/label\";\n\ntype Entry = number | \"ellipsis\";\n\n/**\n * Pages to show: always the first and the last, the current one with `siblings` on each side, and\n * ellipses in between. The number of entries stays constant, so the controls do not jump around.\n */\nexport function paginationRange(page: number, total: number, siblings = 1): Entry[] {\n const slots = siblings * 2 + 5;\n if (total <= slots) return Array.from({ length: total }, (_, i) => i + 1);\n const range = (from: number, to: number) => Array.from({ length: to - from + 1 }, (_, i) => from + i);\n if (page <= siblings + 3) return [...range(1, slots - 2), \"ellipsis\", total];\n if (page >= total - siblings - 2) return [1, \"ellipsis\", ...range(total - slots + 3, total)];\n return [1, \"ellipsis\", ...range(page - siblings, page + siblings), \"ellipsis\", total];\n}\n\nexport type PaginationProps = {\n /** Current page, from 1. */\n page: number;\n /** Number of pages. */\n total: number;\n /** Buttons mode: called with the new page. */\n onPageChange?: (page: number) => void;\n /**\n * Links mode (better for search engines): the address of each page, as a function or as a\n * pattern with `{page}`, such as `\"/blog/page/{page}\"`. The pattern also works from a server component.\n */\n href?: string | ((page: number) => string);\n siblings?: number;\n linkAs?: ElementType;\n label?: string;\n previousLabel?: string;\n nextLabel?: string;\n /** Accessible name of a page number: a template such as \"Page {page}\", or a function. */\n pageLabel?: string | ((page: number) => string);\n className?: string;\n};\n\n/** Page navigation: numbers with ellipses, previous and next. As buttons or as links. */\nexport function Pagination({\n page,\n total,\n onPageChange,\n href,\n siblings = 1,\n linkAs: LinkTag = \"a\",\n label = \"Pagination\",\n previousLabel = \"Previous\",\n nextLabel = \"Next\",\n pageLabel = \"Page {page}\",\n className,\n}: PaginationProps) {\n if (total <= 1) return null;\n const getHref =\n href === undefined ? undefined : typeof href === \"string\" ? (p: number) => href.replace(\"{page}\", String(p)) : href;\n\n const control = (\n target: number,\n content: ReactNode,\n extra: { className: string; ariaLabel: string; current?: boolean },\n ) => {\n const disabled = target < 1 || target > total;\n const common = {\n className: cx(\"trc-pagination__control\", extra.className),\n \"aria-label\": extra.ariaLabel,\n \"aria-current\": extra.current ? (\"page\" as const) : undefined,\n };\n if (getHref) {\n return disabled ? (\n <span {...common} aria-disabled=\"true\">\n {content}\n </span>\n ) : (\n <LinkTag href={getHref(target)} {...common}>\n {content}\n </LinkTag>\n );\n }\n return (\n <button type=\"button\" {...common} disabled={disabled} onClick={() => !extra.current && onPageChange?.(target)}>\n {content}\n </button>\n );\n };\n\n return (\n <nav aria-label={label} className={cx(\"trc-pagination\", className)}>\n <ul className=\"trc-pagination__list\">\n <li>{control(page - 1, <ArrowLeft />, { className: \"trc-pagination__step\", ariaLabel: previousLabel })}</li>\n {paginationRange(page, total, siblings).map((entry, i) =>\n entry === \"ellipsis\" ? (\n <li key={`e${i}`} aria-hidden className=\"trc-pagination__ellipsis\">\n …\n </li>\n ) : (\n <li key={entry}>\n {control(entry, entry, {\n className: \"trc-pagination__page\",\n ariaLabel: typeof pageLabel === \"string\" ? fill(pageLabel, { page: entry }) : pageLabel(entry),\n current: entry === page,\n })}\n </li>\n ),\n )}\n <li>{control(page + 1, <ArrowRight />, { className: \"trc-pagination__step\", ariaLabel: nextLabel })}</li>\n </ul>\n </nav>\n );\n}\n","import type { ElementType } from \"react\";\nimport { cx } from \"../utils/cx\";\n\nexport type Language = {\n /** Language code, shown in capitals: \"en\", \"fr\"… */\n code: string;\n /** Full name in that language (\"English\", \"Français\"), for screen readers. */\n name: string;\n /** Same page in that language; without it, the switch calls `onChange`. */\n href?: string;\n};\n\nexport type LanguageSwitcherProps = {\n languages: Language[];\n /** Code of the current language. */\n value: string;\n onChange?: (code: string) => void;\n label?: string;\n linkAs?: ElementType;\n className?: string;\n};\n\n/** EN | FR pill: links to the same page in each language (or buttons), the current one in the accent. */\nexport function LanguageSwitcher({\n languages,\n value,\n onChange,\n label = \"Language\",\n linkAs: LinkTag = \"a\",\n className,\n}: LanguageSwitcherProps) {\n return (\n <nav aria-label={label} className={cx(\"trc-languages\", className)}>\n {languages.map((language) => {\n const common = {\n lang: language.code,\n \"aria-label\": language.name,\n \"aria-current\": language.code === value ? (\"true\" as const) : undefined,\n className: \"trc-languages__item\",\n children: language.code.toUpperCase(),\n };\n return language.href ? (\n <LinkTag key={language.code} href={language.href} hrefLang={language.code} {...common} />\n ) : (\n <button key={language.code} type=\"button\" onClick={() => onChange?.(language.code)} {...common} />\n );\n })}\n </nav>\n );\n}\n","\"use client\";\n\nimport { useId, type ReactNode } from \"react\";\nimport { useControllable } from \"../hooks/use-controllable\";\nimport { cx } from \"../utils/cx\";\n\nexport type RadioOption = { value: string; label: ReactNode; description?: ReactNode; disabled?: boolean };\n\nexport type RadioGroupProps = {\n /** Question of the group, rendered as its legend. */\n label: ReactNode;\n options: RadioOption[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n name?: string;\n hint?: ReactNode;\n error?: ReactNode;\n required?: boolean;\n orientation?: \"vertical\" | \"horizontal\";\n className?: string;\n};\n\n/**\n * A choice among a few options, as native radio buttons in a fieldset: the legend is read with\n * each option, the arrows move the choice, and the hint or error is tied to the group.\n */\nexport function RadioGroup({\n label,\n options,\n value,\n defaultValue,\n onValueChange,\n name,\n hint,\n error,\n required = false,\n orientation = \"vertical\",\n className,\n}: RadioGroupProps) {\n const [selected, setSelected] = useControllable<string | undefined>(\n value,\n defaultValue,\n (v) => v && onValueChange?.(v),\n );\n const id = useId();\n const message = error ?? hint;\n return (\n <fieldset\n className={cx(\"trc-radio-group\", className)}\n aria-describedby={message != null ? `${id}-message` : undefined}\n aria-invalid={error != null || undefined}\n aria-required={required || undefined}\n >\n <legend className=\"trc-field__label\">\n {label}\n {required && (\n <span aria-hidden className=\"trc-field__required\">\n {\" \"}\n *\n </span>\n )}\n </legend>\n <div className={cx(\"trc-radio-group__options\", orientation === \"horizontal\" && \"trc-radio-group__options--row\")}>\n {options.map((option) => (\n <label key={option.value} className=\"trc-toggle trc-toggle--radio\">\n <span className=\"trc-radio\">\n <input\n type=\"radio\"\n name={name ?? id}\n value={option.value}\n checked={selected === option.value}\n disabled={option.disabled}\n required={required}\n onChange={() => setSelected(option.value)}\n className=\"trc-radio__input\"\n />\n </span>\n <span className=\"trc-toggle__text\">\n <span className=\"trc-toggle__label\">{option.label}</span>\n {option.description != null && <span className=\"trc-toggle__description\">{option.description}</span>}\n </span>\n </label>\n ))}\n </div>\n {message != null && (\n <p id={`${id}-message`} className={cx(\"trc-field__message\", error != null && \"trc-field__message--error\")}>\n {message}\n </p>\n )}\n </fieldset>\n );\n}\n","\"use client\";\n\nimport { forwardRef, useState } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { Input, useFieldProps, type InputProps } from \"./field\";\n\nexport type PasswordInputProps = Omit<InputProps, \"type\"> & {\n /** Visible text of the button: \"Show\", \"Afficher\"… */\n showLabel?: string;\n hideLabel?: string;\n /** Completes the button's name for screen readers: \"Show password\". */\n noun?: string;\n};\n\n/**\n * Password field with a Show / Hide button. Works inside `Field` like `Input`. The button's\n * accessible name includes its visible text (\"Show password\"), as WCAG 2.5.3 asks.\n */\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(function PasswordInput(\n { showLabel = \"Show\", hideLabel = \"Hide\", noun = \"password\", className, autoComplete = \"current-password\", ...props },\n ref,\n) {\n const [visible, setVisible] = useState(false);\n // The id the input will get, from the props or from the parent Field.\n const { id } = useFieldProps(props);\n return (\n <span className={cx(\"trc-password\", className)}>\n <Input ref={ref} {...props} id={id} type={visible ? \"text\" : \"password\"} autoComplete={autoComplete} />\n <button type=\"button\" className=\"trc-password__toggle\" aria-controls={id} onClick={() => setVisible((v) => !v)}>\n {visible ? hideLabel : showLabel} <span className=\"trc-visually-hidden\">{noun}</span>\n </button>\n </span>\n );\n});\n","\"use client\";\n\nimport { useRef, type ClipboardEvent, type KeyboardEvent } from \"react\";\nimport { useControllable } from \"../hooks/use-controllable\";\nimport { cx } from \"../utils/cx\";\nimport { fill } from \"../utils/label\";\nimport { useFieldProps } from \"./field\";\n\nexport type PinInputProps = {\n /** Number of characters. */\n length?: number;\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n /** Called once every box is filled. */\n onComplete?: (value: string) => void;\n /** `numeric` opens the number keyboard on phones and accepts digits only. */\n type?: \"numeric\" | \"alphanumeric\";\n /** Hides the characters, like a password. */\n mask?: boolean;\n /** Accessible name of the group: \"Verification code\". */\n label?: string;\n /**\n * Accessible name of each box: a template such as \"Character {index} of {length}\" ({index} starts\n * at 1), or a function receiving the 0-based index.\n */\n charLabel?: string | ((index: number, length: number) => string);\n invalid?: boolean;\n disabled?: boolean;\n id?: string;\n name?: string;\n className?: string;\n};\n\n/**\n * One box per character for one-time codes. Typing moves forward, Backspace moves back, pasting a code\n * fills every box, and phones can fill it from a text message (`autocomplete=\"one-time-code\"`).\n * Inside a `Field`, the label focuses the first box and the hint or error describes the group.\n */\nexport function PinInput({\n length = 6,\n value,\n defaultValue = \"\",\n onChange,\n onComplete,\n type = \"numeric\",\n mask = false,\n label = \"Verification code\",\n charLabel = \"Character {index} of {length}\",\n invalid,\n disabled,\n id,\n name,\n className,\n}: PinInputProps) {\n const [code, setCode] = useControllable(value, defaultValue, onChange);\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n const field = useFieldProps({ id, invalid });\n const accepted = type === \"numeric\" ? /[0-9]/ : /[0-9a-z]/i;\n const clean = (text: string) => [...text].filter((c) => accepted.test(c)).join(\"\");\n\n const update = (next: string) => {\n const trimmed = next.slice(0, length);\n setCode(trimmed);\n if (trimmed.length === length && !trimmed.includes(\" \")) onComplete?.(trimmed);\n };\n const focus = (index: number) => {\n const target = inputs.current[Math.max(0, Math.min(index, length - 1))];\n target?.focus();\n target?.select();\n };\n // Characters are stored left to right; an empty box is a space while later boxes are filled.\n const charAt = (i: number) => (code[i] && code[i] !== \" \" ? code[i] : \"\");\n const setCharAt = (i: number, char: string) => {\n const chars = Array.from({ length }, (_, k) => code[k] ?? \" \");\n chars[i] = char || \" \";\n return chars.join(\"\").replace(/\\s+$/, \"\");\n };\n\n const onInput = (i: number, raw: string) => {\n const typed = clean(raw);\n if (!typed) return;\n if (typed.length > 1) {\n // Several characters at once (autofill from a message): fill from this box.\n const merged = (code.slice(0, i).padEnd(i, \" \") + typed).slice(0, length);\n update(merged);\n focus(Math.min(i + typed.length, length - 1));\n return;\n }\n update(setCharAt(i, typed.slice(-1)));\n focus(i + 1);\n };\n\n const onKeyDown = (i: number, e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Backspace\") {\n e.preventDefault();\n if (charAt(i)) update(setCharAt(i, \"\"));\n else if (i > 0) {\n update(setCharAt(i - 1, \"\"));\n focus(i - 1);\n }\n } else if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n focus(i - 1);\n } else if (e.key === \"ArrowRight\") {\n e.preventDefault();\n focus(i + 1);\n } else if (e.key === \"Home\") {\n e.preventDefault();\n focus(0);\n } else if (e.key === \"End\") {\n e.preventDefault();\n focus(length - 1);\n }\n };\n\n const onPaste = (i: number, e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n onInput(i, e.clipboardData.getData(\"text\"));\n };\n\n return (\n <div\n role=\"group\"\n aria-label={label}\n aria-describedby={field[\"aria-describedby\"]}\n className={cx(\"trc-pin\", className)}\n >\n {Array.from({ length }, (_, i) => (\n <input\n key={i}\n ref={(el) => {\n inputs.current[i] = el;\n }}\n id={i === 0 ? field.id : undefined}\n type={mask ? \"password\" : \"text\"}\n inputMode={type === \"numeric\" ? \"numeric\" : \"text\"}\n autoComplete={i === 0 ? \"one-time-code\" : \"off\"}\n maxLength={length}\n aria-label={typeof charLabel === \"string\" ? fill(charLabel, { index: i + 1, length }) : charLabel(i, length)}\n aria-invalid={field[\"aria-invalid\"]}\n disabled={disabled}\n value={charAt(i)}\n onChange={(e) => onInput(i, e.target.value.replace(charAt(i), \"\") || e.target.value)}\n onKeyDown={(e) => onKeyDown(i, e)}\n onPaste={(e) => onPaste(i, e)}\n onFocus={(e) => e.target.select()}\n className=\"trc-control trc-pin__box\"\n />\n ))}\n {name && <input type=\"hidden\" name={name} value={code.replace(/\\s/g, \"\")} />}\n </div>\n );\n}\n","\"use client\";\n\nimport { useEffect, useId, useRef, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { useAnchoredPosition, useDismiss, useIsomorphicLayoutEffect } from \"../hooks/use-floating\";\nimport { useControllable } from \"../hooks/use-controllable\";\nimport { cx } from \"../utils/cx\";\nimport { ChevronDown } from \"../utils/icons\";\nimport { Portal } from \"../utils/portal\";\nimport { useFieldProps } from \"./field\";\n\nexport type ComboboxOption = { value: string; label: string; description?: ReactNode; disabled?: boolean };\n\nexport type ComboboxProps = {\n options: ComboboxOption[];\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string | null) => void;\n placeholder?: string;\n /** Shown when nothing matches the search. */\n emptyText?: ReactNode;\n invalid?: boolean;\n disabled?: boolean;\n required?: boolean;\n id?: string;\n /** Form field name: the chosen value is submitted. */\n name?: string;\n className?: string;\n};\n\n/** Case and accent insensitive text, for matching \"Bénin\" with \"benin\". */\nconst normalize = (text: string) => text.normalize(\"NFD\").replace(/[̀-ͯ]/g, \"\").toLowerCase();\n\n/**\n * Search field with a list of suggestions. Typing filters (ignoring case and accents); the arrows\n * move the active option while focus stays in the field; Enter chooses; Escape closes; leaving the\n * field restores the chosen label. Works inside `Field` like `Input`.\n */\nexport function Combobox({\n options,\n value,\n defaultValue = null,\n onValueChange,\n placeholder,\n emptyText = \"No results\",\n invalid,\n disabled,\n required,\n id,\n name,\n className,\n}: ComboboxProps) {\n const [selected, setSelected] = useControllable<string | null>(value, defaultValue, onValueChange);\n const selectedOption = options.find((o) => o.value === selected) ?? null;\n const [query, setQuery] = useState(selectedOption?.label ?? \"\");\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState(-1);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const listRef = useRef<HTMLUListElement>(null);\n const listId = useId();\n const a11y = useFieldProps({ id, invalid, required });\n\n // While the field shows the chosen label, the list shows every option.\n const searching = query !== (selectedOption?.label ?? \"\");\n const visible = searching ? options.filter((o) => normalize(o.label).includes(normalize(query))) : options;\n const enabled = visible.map((o, i) => (o.disabled ? -1 : i)).filter((i) => i >= 0);\n\n // Keep the field in sync when the value changes from outside.\n useEffect(() => {\n if (!open) setQuery(selectedOption?.label ?? \"\");\n }, [selectedOption?.label, open]);\n\n useAnchoredPosition(open, wrapperRef, listRef, { side: \"bottom\", align: \"start\", offset: 6 });\n // The list is as wide as the field.\n useIsomorphicLayoutEffect(() => {\n if (open && listRef.current && wrapperRef.current)\n listRef.current.style.width = `${wrapperRef.current.offsetWidth}px`;\n }, [open]);\n useDismiss(open, [wrapperRef, listRef], () => close());\n\n // Keep the active option in view.\n useEffect(() => {\n if (open && active >= 0)\n listRef.current?.querySelector(`[data-index=\"${active}\"]`)?.scrollIntoView({ block: \"nearest\" });\n }, [open, active]);\n\n const openList = (index?: number) => {\n setOpen(true);\n const current = visible.findIndex((o) => o.value === selected);\n setActive(index ?? (current >= 0 ? current : (enabled[0] ?? -1)));\n };\n const close = () => {\n setOpen(false);\n setActive(-1);\n setQuery(selectedOption?.label ?? \"\");\n };\n const choose = (option: ComboboxOption) => {\n if (option.disabled) return;\n setSelected(option.value);\n setQuery(option.label);\n setOpen(false);\n setActive(-1);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n const position = enabled.indexOf(active);\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (!open) openList();\n else setActive(enabled[(position + 1) % enabled.length] ?? -1);\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (!open) openList(enabled[enabled.length - 1]);\n else setActive(enabled[(position - 1 + enabled.length) % enabled.length] ?? -1);\n } else if (e.key === \"Enter\" && open) {\n e.preventDefault();\n const option = visible[active];\n if (option) choose(option);\n } else if (e.key === \"Escape\") {\n if (open) {\n e.preventDefault();\n close();\n } else if (query) {\n setQuery(selectedOption?.label ?? \"\");\n }\n } else if (e.key === \"Tab\" && open) {\n close();\n }\n };\n\n return (\n <div ref={wrapperRef} className={cx(\"trc-combobox\", className)}>\n <input\n ref={inputRef}\n type=\"text\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={listId}\n aria-autocomplete=\"list\"\n aria-activedescendant={open && active >= 0 ? `${listId}-${active}` : undefined}\n autoComplete=\"off\"\n placeholder={placeholder}\n disabled={disabled}\n value={query}\n onChange={(e) => {\n setQuery(e.target.value);\n setOpen(true);\n setActive(0);\n }}\n onClick={() => (open ? close() : openList())}\n onKeyDown={onKeyDown}\n className=\"trc-control trc-combobox__input\"\n {...a11y}\n />\n <ChevronDown aria-hidden className=\"trc-combobox__chevron\" />\n {name && <input type=\"hidden\" name={name} value={selected ?? \"\"} />}\n {open && (\n <Portal>\n <ul ref={listRef} id={listId} role=\"listbox\" className=\"trc-floating trc-listbox\">\n {visible.length === 0 && (\n <li role=\"presentation\" className=\"trc-listbox__empty\">\n {emptyText}\n </li>\n )}\n {visible.map((option, i) => (\n <li\n key={option.value}\n id={`${listId}-${i}`}\n data-index={i}\n role=\"option\"\n aria-selected={option.value === selected}\n aria-disabled={option.disabled || undefined}\n className={cx(\"trc-listbox__option\", i === active && \"trc-listbox__option--active\")}\n // Keep the focus in the field while clicking.\n onMouseDown={(e) => e.preventDefault()}\n onMouseMove={() => !option.disabled && setActive(i)}\n onClick={() => choose(option)}\n >\n <span className=\"trc-listbox__label\">{option.label}</span>\n {option.description != null && <span className=\"trc-listbox__description\">{option.description}</span>}\n </li>\n ))}\n </ul>\n </Portal>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport {\n forwardRef,\n useId,\n useState,\n type ChangeEvent,\n type ComponentPropsWithoutRef,\n type DragEvent,\n type ReactNode,\n} from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { Close } from \"../utils/icons\";\nimport { fill } from \"../utils/label\";\nimport { useFieldProps } from \"./field\";\n\n/** Readable size: 820 B, 14.2 KB, 3.5 MB. */\nexport function formatBytes(bytes: number) {\n if (bytes < 1024) return `${bytes} B`;\n const units = [\"KB\", \"MB\", \"GB\"];\n let value = bytes / 1024;\n let unit = 0;\n while (value >= 1024 && unit < units.length - 1) {\n value /= 1024;\n unit++;\n }\n return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[unit]}`;\n}\n\n/** Whether a file matches an `accept` list such as \"image/*,.pdf\". */\nexport function acceptsFile(file: File, accept?: string) {\n if (!accept) return true;\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return accept\n .split(\",\")\n .map((rule) => rule.trim().toLowerCase())\n .filter(Boolean)\n .some((rule) =>\n rule.startsWith(\".\")\n ? name.endsWith(rule)\n : rule.endsWith(\"/*\")\n ? type.startsWith(rule.slice(0, -1))\n : type === rule,\n );\n}\n\nexport type FileRejection = { file: File; reason: \"type\" | \"size\" | \"count\" };\n\ntype Rules = { accept?: string; maxSize?: number; maxFiles?: number };\n\n/** Splits files into accepted and rejected ones, with the reason of each rejection. */\nexport function validateFiles(files: File[], { accept, maxSize, maxFiles }: Rules, alreadyAccepted = 0) {\n const accepted: File[] = [];\n const rejected: FileRejection[] = [];\n for (const file of files) {\n if (!acceptsFile(file, accept)) rejected.push({ file, reason: \"type\" });\n else if (maxSize !== undefined && file.size > maxSize) rejected.push({ file, reason: \"size\" });\n else if (maxFiles !== undefined && alreadyAccepted + accepted.length >= maxFiles)\n rejected.push({ file, reason: \"count\" });\n else accepted.push(file);\n }\n return { accepted, rejected };\n}\n\nexport type FileInputProps = Omit<ComponentPropsWithoutRef<\"input\">, \"type\" | \"value\" | \"defaultValue\" | \"onChange\"> & {\n onFilesChange?: (files: File[]) => void;\n buttonLabel?: string;\n placeholder?: string;\n /** Text when several files are chosen: a template such as \"{count} files\", or a function. */\n countLabel?: string | ((count: number) => string);\n invalid?: boolean;\n};\n\n/**\n * Compact file field: a \"Choose a file\" button and the chosen names, on the native file input\n * (hidden but focusable). Works inside `Field` like `Input`.\n */\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(function FileInput(\n {\n onFilesChange,\n buttonLabel = \"Choose a file\",\n placeholder = \"No file chosen\",\n countLabel = \"{count} files\",\n disabled,\n invalid,\n className,\n ...props\n },\n ref,\n) {\n const [files, setFiles] = useState<File[]>([]);\n const a11y = useFieldProps({ ...props, invalid });\n const summary =\n files.length === 0\n ? placeholder\n : files.length === 1\n ? files[0]!.name\n : typeof countLabel === \"string\"\n ? fill(countLabel, { count: files.length })\n : countLabel(files.length);\n return (\n <label className={cx(\"trc-file-input\", disabled && \"trc-file-input--disabled\", className)}>\n <input\n ref={ref}\n {...props}\n {...a11y}\n type=\"file\"\n disabled={disabled}\n className=\"trc-visually-hidden\"\n onChange={(e) => {\n const chosen = [...(e.target.files ?? [])];\n setFiles(chosen);\n onFilesChange?.(chosen);\n }}\n />\n <span aria-hidden className=\"trc-file-input__button\">\n {buttonLabel}\n </span>\n <span className={cx(\"trc-file-input__name\", files.length === 0 && \"trc-file-input__name--empty\")}>{summary}</span>\n </label>\n );\n});\n\nexport type DropzoneProps = Rules & {\n multiple?: boolean;\n /** Called with every accepted file after each change. */\n onFilesChange?: (files: File[]) => void;\n /** Main text: \"Drop files here or\". */\n title?: ReactNode;\n /** Link-looking word that opens the file picker: \"browse\". */\n browseLabel?: ReactNode;\n /** Constraints shown under the title: \"PNG or PDF, up to 5 MB\". */\n hint?: ReactNode;\n /** Name of the remove button: a template such as \"Remove {name}\", or a function. */\n removeLabel?: string | ((file: File) => string);\n /**\n * Message of a rejected file: one template per reason, with {name}, or a function.\n */\n rejectionLabel?: Partial<Record<FileRejection[\"reason\"], string>> | ((rejection: FileRejection) => string);\n name?: string;\n disabled?: boolean;\n id?: string;\n className?: string;\n};\n\nconst DEFAULT_REJECTIONS: Record<FileRejection[\"reason\"], string> = {\n type: \"{name}: this type of file is not accepted\",\n size: \"{name}: the file is too large\",\n count: \"{name}: too many files\",\n};\n\n/**\n * Area to drop files on, or to click (and reach with the keyboard) to browse. Accepted files are\n * listed with their size and a remove button; rejected ones are announced with their reason.\n */\nexport function Dropzone({\n accept,\n maxSize,\n maxFiles,\n multiple = true,\n onFilesChange,\n title = \"Drop files here or\",\n browseLabel = \"browse\",\n hint,\n removeLabel = \"Remove {name}\",\n rejectionLabel = DEFAULT_REJECTIONS,\n name,\n disabled,\n id,\n className,\n}: DropzoneProps) {\n const [files, setFiles] = useState<File[]>([]);\n const [rejections, setRejections] = useState<FileRejection[]>([]);\n const rejectionText = (rejection: FileRejection) =>\n typeof rejectionLabel === \"function\"\n ? rejectionLabel(rejection)\n : fill(rejectionLabel[rejection.reason] ?? DEFAULT_REJECTIONS[rejection.reason], { name: rejection.file.name });\n const [dragging, setDragging] = useState(false);\n const hintId = useId();\n const a11y = useFieldProps({ id });\n\n const add = (incoming: File[]) => {\n const base = multiple ? files : [];\n const { accepted, rejected } = validateFiles(\n multiple ? incoming : incoming.slice(0, 1),\n { accept, maxSize, maxFiles },\n base.length,\n );\n const next = [...base, ...accepted];\n setFiles(next);\n setRejections(rejected);\n onFilesChange?.(next);\n };\n const remove = (index: number) => {\n const next = files.filter((_, i) => i !== index);\n setFiles(next);\n setRejections([]);\n onFilesChange?.(next);\n };\n\n const onDrop = (e: DragEvent) => {\n e.preventDefault();\n setDragging(false);\n if (!disabled) add([...e.dataTransfer.files]);\n };\n\n return (\n <div className={cx(\"trc-dropzone\", className)}>\n <label\n className={cx(\n \"trc-dropzone__area\",\n dragging && \"trc-dropzone__area--dragging\",\n disabled && \"trc-dropzone__area--disabled\",\n )}\n onDragEnter={(e) => {\n e.preventDefault();\n if (!disabled) setDragging(true);\n }}\n onDragOver={(e) => e.preventDefault()}\n onDragLeave={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node)) setDragging(false);\n }}\n onDrop={onDrop}\n >\n <input\n type=\"file\"\n accept={accept}\n multiple={multiple}\n name={name}\n disabled={disabled}\n className=\"trc-visually-hidden\"\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n add([...(e.target.files ?? [])]);\n // Choosing the same file again must trigger a change.\n e.target.value = \"\";\n }}\n {...a11y}\n aria-describedby={cx(a11y[\"aria-describedby\"], hint != null && hintId) || undefined}\n />\n <span className=\"trc-dropzone__title\">\n {title} <span className=\"trc-dropzone__browse\">{browseLabel}</span>\n </span>\n {/* Out of the field's name; read as its description instead. */}\n {hint != null && (\n <span id={hintId} aria-hidden className=\"trc-dropzone__hint\">\n {hint}\n </span>\n )}\n </label>\n\n <div aria-live=\"polite\">\n {rejections.length > 0 && (\n <ul className=\"trc-dropzone__rejections\">\n {rejections.map((rejection, i) => (\n <li key={i}>{rejectionText(rejection)}</li>\n ))}\n </ul>\n )}\n </div>\n\n {files.length > 0 && (\n <ul className=\"trc-dropzone__files\">\n {files.map((file, i) => (\n <li key={`${file.name}-${i}`} className=\"trc-dropzone__file\">\n <span className=\"trc-dropzone__file-name\">{file.name}</span>\n <span className=\"trc-dropzone__file-size\">{formatBytes(file.size)}</span>\n <button\n type=\"button\"\n className=\"trc-dropzone__remove\"\n aria-label={\n typeof removeLabel === \"string\" ? fill(removeLabel, { name: file.name }) : removeLabel(file)\n }\n onClick={() => remove(i)}\n >\n <Close />\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport { forwardRef, type ComponentPropsWithoutRef, type CSSProperties, type ReactNode } from \"react\";\nimport { useControllable } from \"../hooks/use-controllable\";\nimport { cx } from \"../utils/cx\";\nimport { useFieldProps } from \"./field\";\n\nexport type SliderProps = Omit<ComponentPropsWithoutRef<\"input\">, \"type\" | \"value\" | \"defaultValue\" | \"onChange\"> & {\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n /** Shows the value next to the slider. */\n showValue?: boolean;\n /** Formats the shown and announced value: \"€ 40\", \"75 %\". */\n formatValue?: (value: number) => ReactNode;\n invalid?: boolean;\n};\n\n/**\n * Range slider on the native input: keyboard (arrows, Page Up / Down, Home, End) and screen readers\n * work as usual. The track fills with the accent up to the thumb. Works inside `Field` like `Input`.\n */\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(function Slider(\n {\n value,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n showValue = false,\n formatValue = (v) => v,\n invalid,\n className,\n style,\n ...props\n },\n ref,\n) {\n const [current, setCurrent] = useControllable(value, defaultValue ?? min, onValueChange);\n const a11y = useFieldProps({ ...props, invalid });\n const progress = max > min ? ((current - min) / (max - min)) * 100 : 0;\n const formatted = formatValue(current);\n return (\n <div className={cx(\"trc-slider\", className)}>\n <input\n ref={ref}\n {...props}\n {...a11y}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={current}\n aria-valuetext={typeof formatted === \"string\" ? formatted : undefined}\n onChange={(e) => setCurrent(Number(e.target.value))}\n className=\"trc-slider__input\"\n style={{ ...style, \"--trc-slider-progress\": `${progress}%` } as CSSProperties}\n />\n {showValue && (\n <output htmlFor={a11y.id} className=\"trc-slider__value\" aria-hidden>\n {formatted}\n </output>\n )}\n </div>\n );\n});\n","\"use client\";\n\nimport { useEffect, useId, useRef, useState, type KeyboardEvent } from \"react\";\nimport { useAnchoredPosition, useDismiss } from \"../hooks/use-floating\";\nimport { useControllable } from \"../hooks/use-controllable\";\nimport { cx } from \"../utils/cx\";\nimport { addDays, addMonths, gridStart, isBefore, sameDay, startOfDay, toISODate } from \"../utils/dates\";\nimport { Calendar, ChevronLeft, ChevronRight } from \"../utils/icons\";\nimport { Portal } from \"../utils/portal\";\nimport { useFieldProps } from \"./field\";\n\nexport type DatePickerProps = {\n value?: Date | null;\n defaultValue?: Date | null;\n onValueChange?: (date: Date | null) => void;\n /** Earliest and latest choosable dates. */\n min?: Date;\n max?: Date;\n /** Locale of the month and day names, such as \"fr-FR\"; the browser's by default. */\n locale?: string;\n /** First day of the week: 0 for Sunday, 1 for Monday. */\n weekStartsOn?: number;\n placeholder?: string;\n /** Formats the chosen date in the field. */\n formatDate?: (date: Date) => string;\n /** Form field name: the date is submitted as YYYY-MM-DD. */\n name?: string;\n label?: string;\n previousMonthLabel?: string;\n nextMonthLabel?: string;\n invalid?: boolean;\n disabled?: boolean;\n required?: boolean;\n id?: string;\n className?: string;\n};\n\n/**\n * Date field that opens a calendar. Keyboard in the calendar: arrows move by a day or a week, Home\n * and End to the start and end of the week, Page Up and Page Down by a month (with Shift, a year),\n * Enter or Space chooses, Escape closes. Each day is announced in full; works inside `Field`.\n */\nexport function DatePicker({\n value,\n defaultValue = null,\n onValueChange,\n min,\n max,\n locale,\n weekStartsOn = 1,\n placeholder = \"Choose a date\",\n formatDate,\n name,\n label = \"Choose a date\",\n previousMonthLabel = \"Previous month\",\n nextMonthLabel = \"Next month\",\n invalid,\n disabled,\n required,\n id,\n className,\n}: DatePickerProps) {\n const [selected, setSelected] = useControllable<Date | null>(value, defaultValue, onValueChange);\n const [open, setOpen] = useState(false);\n // Day with the keyboard focus in the grid; it also sets the month shown.\n const [focused, setFocused] = useState<Date>(() => startOfDay(selected ?? new Date()));\n const triggerRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const uid = useId();\n const a11y = useFieldProps({ id, invalid, required });\n\n const display = new Intl.DateTimeFormat(locale, { dateStyle: \"medium\" });\n const full = new Intl.DateTimeFormat(locale, { dateStyle: \"full\" });\n const monthTitle = new Intl.DateTimeFormat(locale, { month: \"long\", year: \"numeric\" });\n const weekdayShort = new Intl.DateTimeFormat(locale, { weekday: \"short\" });\n const weekdayLong = new Intl.DateTimeFormat(locale, { weekday: \"long\" });\n const format = formatDate ?? ((d: Date) => display.format(d));\n\n const outOfRange = (date: Date) => (!!min && isBefore(date, min)) || (!!max && isBefore(max, date));\n const clamp = (date: Date) =>\n min && isBefore(date, min) ? startOfDay(min) : max && isBefore(max, date) ? startOfDay(max) : date;\n\n const openCalendar = () => {\n setFocused(clamp(startOfDay(selected ?? new Date())));\n setOpen(true);\n };\n const close = (returnFocus = true) => {\n setOpen(false);\n if (returnFocus) triggerRef.current?.focus();\n };\n const choose = (date: Date) => {\n if (outOfRange(date)) return;\n setSelected(date);\n close();\n };\n\n useAnchoredPosition(open, triggerRef, panelRef, { side: \"bottom\", align: \"start\" });\n useDismiss(open, [triggerRef, panelRef], (reason) => close(reason === \"escape\"));\n\n // Move the real focus to the focused day whenever it changes.\n useEffect(() => {\n if (open) panelRef.current?.querySelector<HTMLButtonElement>(`[data-date=\"${toISODate(focused)}\"]`)?.focus();\n }, [open, focused]);\n\n const onGridKeyDown = (e: KeyboardEvent) => {\n const moves: Record<string, () => Date> = {\n ArrowLeft: () => addDays(focused, -1),\n ArrowRight: () => addDays(focused, 1),\n ArrowUp: () => addDays(focused, -7),\n ArrowDown: () => addDays(focused, 7),\n Home: () => addDays(focused, -((focused.getDay() - weekStartsOn + 7) % 7)),\n End: () => addDays(focused, 6 - ((focused.getDay() - weekStartsOn + 7) % 7)),\n PageUp: () => addMonths(focused, e.shiftKey ? -12 : -1),\n PageDown: () => addMonths(focused, e.shiftKey ? 12 : 1),\n };\n const move = moves[e.key];\n if (move) {\n e.preventDefault();\n setFocused(clamp(move()));\n }\n };\n\n // Tab stays inside the calendar while it is open.\n const onPanelKeyDown = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\") return;\n const items = [\n ...(panelRef.current?.querySelectorAll<HTMLElement>(\"button:not([disabled]):not([tabindex='-1'])\") ?? []),\n ];\n const first = items[0];\n const last = items[items.length - 1];\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n last?.focus();\n } else if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n first?.focus();\n }\n };\n\n const start = gridStart(focused, weekStartsOn);\n const days = Array.from({ length: 42 }, (_, i) => addDays(start, i));\n const weeks = Array.from({ length: 6 }, (_, w) => days.slice(w * 7, w * 7 + 7));\n const today = startOfDay(new Date());\n const valueId = `${uid}-value`;\n\n return (\n <div className={cx(\"trc-date-picker\", className)}>\n <button\n ref={triggerRef}\n type=\"button\"\n id={a11y.id}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-invalid={a11y[\"aria-invalid\"]}\n aria-describedby={cx(valueId, a11y[\"aria-describedby\"]) || undefined}\n disabled={disabled}\n onClick={() => (open ? close() : openCalendar())}\n className={cx(\"trc-control\", \"trc-date-picker__trigger\", !selected && \"trc-date-picker__trigger--empty\")}\n >\n <span id={valueId}>{selected ? format(selected) : placeholder}</span>\n <Calendar className=\"trc-date-picker__icon\" />\n </button>\n {name && <input type=\"hidden\" name={name} value={selected ? toISODate(selected) : \"\"} required={required} />}\n\n {open && (\n <Portal>\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={label}\n className=\"trc-floating trc-calendar\"\n onKeyDown={onPanelKeyDown}\n >\n <div className=\"trc-calendar__head\">\n <button\n type=\"button\"\n className=\"trc-calendar__nav\"\n aria-label={previousMonthLabel}\n onClick={() => setFocused(clamp(addMonths(focused, -1)))}\n >\n <ChevronLeft />\n </button>\n <p id={`${uid}-title`} className=\"trc-calendar__title\" aria-live=\"polite\">\n {monthTitle.format(focused)}\n </p>\n <button\n type=\"button\"\n className=\"trc-calendar__nav\"\n aria-label={nextMonthLabel}\n onClick={() => setFocused(clamp(addMonths(focused, 1)))}\n >\n <ChevronRight />\n </button>\n </div>\n <table\n role=\"grid\"\n aria-labelledby={`${uid}-title`}\n className=\"trc-calendar__grid\"\n onKeyDown={onGridKeyDown}\n >\n <thead>\n <tr>\n {weeks[0]!.map((day) => (\n <th key={day.getDay()} scope=\"col\" abbr={weekdayLong.format(day)} className=\"trc-calendar__weekday\">\n {weekdayShort.format(day).replace(\".\", \"\").slice(0, 3)}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week, w) => (\n <tr key={w}>\n {week.map((day) => {\n const isSelected = sameDay(day, selected);\n const disabledDay = outOfRange(day);\n return (\n <td key={toISODate(day)} role=\"gridcell\" aria-selected={isSelected || undefined}>\n <button\n type=\"button\"\n data-date={toISODate(day)}\n tabIndex={sameDay(day, focused) ? 0 : -1}\n aria-label={full.format(day)}\n aria-current={sameDay(day, today) ? \"date\" : undefined}\n disabled={disabledDay}\n onClick={() => choose(day)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n choose(day);\n }\n }}\n className={cx(\n \"trc-calendar__day\",\n day.getMonth() !== focused.getMonth() && \"trc-calendar__day--outside\",\n isSelected && \"trc-calendar__day--selected\",\n )}\n >\n {day.getDate()}\n </button>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </Portal>\n )}\n </div>\n );\n}\n","/** Small local-date helpers for the date picker (no time zone surprises: everything is local). */\n\nexport const startOfDay = (date: Date) => new Date(date.getFullYear(), date.getMonth(), date.getDate());\n\nexport const addDays = (date: Date, days: number) => new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);\n\n/** Same day of another month, clamped to the last day when it does not exist (31 January + 1 month = 28 February). */\nexport function addMonths(date: Date, months: number) {\n const target = new Date(date.getFullYear(), date.getMonth() + months, 1);\n const lastDay = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();\n return new Date(target.getFullYear(), target.getMonth(), Math.min(date.getDate(), lastDay));\n}\n\nexport const sameDay = (a: Date | null | undefined, b: Date | null | undefined) =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\n/** \"2026-10-24\", in local time. */\nexport const toISODate = (date: Date) =>\n `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, \"0\")}-${String(date.getDate()).padStart(2, \"0\")}`;\n\n/** First day shown in the month grid: the start of the week containing the 1st. */\nexport function gridStart(month: Date, weekStartsOn: number) {\n const first = new Date(month.getFullYear(), month.getMonth(), 1);\n const offset = (first.getDay() - weekStartsOn + 7) % 7;\n return addDays(first, -offset);\n}\n\nexport const isBefore = (a: Date, b: Date) => startOfDay(a).getTime() < startOfDay(b).getTime();\n","\"use client\";\n\nimport { Children, useState, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { fill } from \"../utils/label\";\n\n/** Up to two initials from a name: \"Aurel Agbado\" → \"AA\", \"trc\" → \"T\". */\nexport function initials(name: string) {\n const words = name.trim().split(/\\s+/).filter(Boolean);\n const letters = words.length > 1 ? [words[0]![0], words[words.length - 1]![0]] : [words[0]?.[0]];\n return letters.filter(Boolean).join(\"\").toUpperCase();\n}\n\nexport type AvatarProps = {\n /** Person or organization shown: the accessible name, and the source of the initials. */\n name: string;\n src?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n className?: string;\n};\n\n/** Round picture of a person, falling back to their initials on graphite when there is no image or it fails. */\nexport function Avatar({ name, src, size = \"md\", className }: AvatarProps) {\n const [failed, setFailed] = useState(false);\n const showImage = src && !failed;\n return (\n <span className={cx(\"trc-avatar\", `trc-avatar--${size}`, className)}>\n {showImage ? (\n <img src={src} alt={name} className=\"trc-avatar__image\" onError={() => setFailed(true)} />\n ) : (\n <span role=\"img\" aria-label={name} className=\"trc-avatar__initials\">\n {initials(name)}\n </span>\n )}\n </span>\n );\n}\n\nexport type AvatarGroupProps = {\n children: ReactNode;\n /** Avatars shown before the \"+n\" counter. */\n max?: number;\n /** Accessible name of the counter: a template such as \"{count} more\", or a function. */\n moreLabel?: string | ((count: number) => string);\n size?: AvatarProps[\"size\"];\n className?: string;\n};\n\n/** Overlapping avatars, the rest summed up in a \"+n\" counter. */\nexport function AvatarGroup({\n children,\n max = 4,\n moreLabel = \"{count} more\",\n size = \"md\",\n className,\n}: AvatarGroupProps) {\n const items = Children.toArray(children);\n const hidden = items.length - max;\n return (\n <span className={cx(\"trc-avatar-group\", className)}>\n {items.slice(0, max)}\n {hidden > 0 && (\n <span className={cx(\"trc-avatar\", `trc-avatar--${size}`, \"trc-avatar--more\")}>\n <span\n role=\"img\"\n aria-label={typeof moreLabel === \"string\" ? fill(moreLabel, { count: hidden }) : moreLabel(hidden)}\n className=\"trc-avatar__initials\"\n >\n +{hidden}\n </span>\n </span>\n )}\n </span>\n );\n}\n","import type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { Close } from \"../utils/icons\";\n\nexport type TagProps = ComponentPropsWithoutRef<\"span\"> & {\n /** `accent` for the one tag that matters on a card. */\n tone?: \"default\" | \"accent\";\n /** Shows a remove button. */\n onRemove?: () => void;\n removeLabel?: string;\n children: ReactNode;\n};\n\n/** Small label for metadata (status, category, filter). Never placed over photos. */\nexport function Tag({ tone = \"default\", onRemove, removeLabel = \"Remove\", className, children, ...props }: TagProps) {\n return (\n <span className={cx(\"trc-tag\", tone === \"accent\" && \"trc-tag--accent\", className)} {...props}>\n {children}\n {onRemove && (\n <button\n type=\"button\"\n className=\"trc-tag__remove\"\n aria-label={`${removeLabel} ${typeof children === \"string\" ? children : \"\"}`.trim()}\n onClick={onRemove}\n >\n <Close />\n </button>\n )}\n </span>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\nexport type StatProps = {\n label: ReactNode;\n value: ReactNode;\n /** Change since the previous period: \"+12 %\". */\n change?: ReactNode;\n /** Color of the change: accent when positive, error color when negative. */\n changeTone?: \"positive\" | \"negative\" | \"neutral\";\n /** Short context under the value: \"vs last month\". */\n description?: ReactNode;\n className?: string;\n};\n\n/** A key figure with its label, in a large thin number. */\nexport function Stat({ label, value, change, changeTone = \"neutral\", description, className }: StatProps) {\n return (\n <dl className={cx(\"trc-stat\", className)}>\n <dt className=\"trc-stat__label\">{label}</dt>\n <dd className=\"trc-stat__value\">{value}</dd>\n {(change != null || description != null) && (\n <dd className=\"trc-stat__meta\">\n {change != null && (\n <span className={cx(\"trc-stat__change\", `trc-stat__change--${changeTone}`)}>{change}</span>\n )}\n {description != null && <span className=\"trc-stat__description\">{description}</span>}\n </dd>\n )}\n </dl>\n );\n}\n","\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { ChevronDown } from \"../utils/icons\";\n\nexport type TableColumn<Row> = {\n key: string;\n header: ReactNode;\n /** `right` for numbers, so that digits line up. */\n align?: \"left\" | \"center\" | \"right\";\n sortable?: boolean;\n /** Cell content; the row's `key` field by default. */\n render?: (row: Row) => ReactNode;\n /** Value used to sort; the row's `key` field by default. */\n sortValue?: (row: Row) => string | number | Date;\n};\n\nexport type SortState = { key: string; direction: \"ascending\" | \"descending\" };\n\nexport type TableProps<Row> = {\n columns: TableColumn<Row>[];\n rows: Row[];\n /** Unique key of each row. */\n rowKey: (row: Row) => string;\n /** Title of the table, read first by screen readers. */\n caption: ReactNode;\n /** Hides the caption visually; it stays for screen readers. */\n hideCaption?: boolean;\n defaultSort?: SortState;\n dense?: boolean;\n emptyText?: ReactNode;\n className?: string;\n};\n\nconst compare = (a: unknown, b: unknown) => {\n if (a instanceof Date && b instanceof Date) return a.getTime() - b.getTime();\n if (typeof a === \"number\" && typeof b === \"number\") return a - b;\n return String(a ?? \"\").localeCompare(String(b ?? \"\"), undefined, { numeric: true, sensitivity: \"base\" });\n};\n\n/**\n * Data table with a caption and sortable columns: each sortable header is a button, and the\n * current order is announced with `aria-sort`. Scrolls sideways on small screens, in a focusable\n * region so that keyboard users can scroll it too.\n */\nexport function Table<Row>({\n columns,\n rows,\n rowKey,\n caption,\n hideCaption = false,\n defaultSort,\n dense = false,\n emptyText = \"No data\",\n className,\n}: TableProps<Row>) {\n const [sort, setSort] = useState<SortState | undefined>(defaultSort);\n const field = (row: Row, key: string) => (row as Record<string, unknown>)[key];\n\n const sorted = (() => {\n const column = columns.find((c) => c.key === sort?.key);\n if (!sort || !column) return rows;\n const value = (row: Row) => (column.sortValue ? column.sortValue(row) : field(row, column.key));\n const ordered = [...rows].sort((a, b) => compare(value(a), value(b)));\n return sort.direction === \"ascending\" ? ordered : ordered.reverse();\n })();\n\n const toggle = (key: string) =>\n setSort((current) =>\n current?.key === key && current.direction === \"ascending\"\n ? { key, direction: \"descending\" }\n : { key, direction: \"ascending\" },\n );\n\n return (\n <div\n className={cx(\"trc-table\", dense && \"trc-table--dense\", className)}\n role=\"region\"\n aria-label={typeof caption === \"string\" ? caption : undefined}\n tabIndex={0}\n >\n <table className=\"trc-table__table\">\n <caption className={cx(\"trc-table__caption\", hideCaption && \"trc-visually-hidden\")}>{caption}</caption>\n <thead>\n <tr>\n {columns.map((column) => {\n const direction = sort?.key === column.key ? sort.direction : undefined;\n return (\n <th\n key={column.key}\n scope=\"col\"\n aria-sort={column.sortable ? (direction ?? \"none\") : undefined}\n className={cx(\"trc-table__head\", column.align && `trc-table__cell--${column.align}`)}\n >\n {column.sortable ? (\n <button type=\"button\" className=\"trc-table__sort\" onClick={() => toggle(column.key)}>\n {column.header}\n <ChevronDown\n className={cx(\n \"trc-table__sort-icon\",\n direction && \"trc-table__sort-icon--active\",\n direction === \"ascending\" && \"trc-table__sort-icon--up\",\n )}\n />\n </button>\n ) : (\n column.header\n )}\n </th>\n );\n })}\n </tr>\n </thead>\n <tbody>\n {sorted.length === 0 ? (\n <tr>\n <td colSpan={columns.length} className=\"trc-table__empty\">\n {emptyText}\n </td>\n </tr>\n ) : (\n sorted.map((row) => (\n <tr key={rowKey(row)}>\n {columns.map((column) => (\n <td\n key={column.key}\n className={cx(\"trc-table__cell\", column.align && `trc-table__cell--${column.align}`)}\n >\n {column.render ? column.render(row) : (field(row, column.key) as ReactNode)}\n </td>\n ))}\n </tr>\n ))\n )}\n </tbody>\n </table>\n </div>\n );\n}\n","import { useId, type CSSProperties, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\nexport type SkeletonProps = {\n width?: number | string;\n height?: number | string;\n /** Round, for an avatar. */\n circle?: boolean;\n /** Several lines of text, the last one shorter. */\n lines?: number;\n className?: string;\n};\n\nconst size = (value: number | string | undefined) => (typeof value === \"number\" ? `${value}px` : value);\n\n/** Placeholder shapes while content loads. Hidden from screen readers: announce the loading state elsewhere. */\nexport function Skeleton({ width, height, circle = false, lines, className }: SkeletonProps) {\n if (lines && lines > 1) {\n return (\n <span aria-hidden className={cx(\"trc-skeleton-lines\", className)} style={{ width: size(width) }}>\n {Array.from({ length: lines }, (_, i) => (\n <span\n key={i}\n className=\"trc-skeleton trc-skeleton--text\"\n style={{ width: i === lines - 1 ? \"60%\" : \"100%\" }}\n />\n ))}\n </span>\n );\n }\n return (\n <span\n aria-hidden\n className={cx(\n \"trc-skeleton\",\n circle && \"trc-skeleton--circle\",\n !height && !circle && \"trc-skeleton--text\",\n className,\n )}\n style={{ width: size(width), height: size(height) ?? (circle ? size(width) : undefined) }}\n />\n );\n}\n\nexport type SpinnerProps = {\n size?: \"sm\" | \"md\" | \"lg\";\n /** Announced to screen readers. */\n label?: string;\n className?: string;\n};\n\n/** Accent arc turning while something loads, announced through `role=\"status\"`. */\nexport function Spinner({ size: s = \"md\", label = \"Loading\", className }: SpinnerProps) {\n return (\n <span role=\"status\" className={cx(\"trc-spinner\", `trc-spinner--${s}`, className)}>\n <svg viewBox=\"0 0 24 24\" aria-hidden className=\"trc-spinner__svg\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" className=\"trc-spinner__track\" />\n <path d=\"M12 2a10 10 0 0 1 10 10\" className=\"trc-spinner__arc\" />\n </svg>\n <span className=\"trc-visually-hidden\">{label}</span>\n </span>\n );\n}\n\nexport type ProgressProps = {\n /** Progress from 0 to `max`; leave out while the total is unknown. */\n value?: number | null;\n max?: number;\n /** Visible label above the bar, also its accessible name. */\n label?: ReactNode;\n /** Accessible name when there is no visible label. */\n \"aria-label\"?: string;\n showValue?: boolean;\n formatValue?: (value: number, max: number) => string;\n className?: string;\n};\n\n/** Progress bar filled with the accent; indeterminate without a value. */\nexport function Progress({\n value,\n max = 100,\n label,\n \"aria-label\": ariaLabel,\n showValue = false,\n formatValue = (v, m) => `${Math.round((v / m) * 100)} %`,\n className,\n}: ProgressProps) {\n const id = useId();\n const determinate = value !== undefined && value !== null;\n const clamped = determinate ? Math.min(Math.max(value, 0), max) : 0;\n const text = determinate ? formatValue(clamped, max) : undefined;\n return (\n <div className={cx(\"trc-progress\", !determinate && \"trc-progress--indeterminate\", className)}>\n {(label != null || (showValue && text)) && (\n <div className=\"trc-progress__head\">\n {label != null && (\n <span id={`${id}-label`} className=\"trc-progress__label\">\n {label}\n </span>\n )}\n {showValue && text && (\n <span aria-hidden className=\"trc-progress__value\">\n {text}\n </span>\n )}\n </div>\n )}\n <div\n role=\"progressbar\"\n aria-labelledby={label != null ? `${id}-label` : undefined}\n aria-label={label == null ? ariaLabel : undefined}\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={determinate ? clamped : undefined}\n aria-valuetext={text}\n className=\"trc-progress__track\"\n >\n <div\n className=\"trc-progress__fill\"\n style={{ \"--trc-progress\": `${(clamped / max) * 100}%` } as CSSProperties}\n />\n </div>\n </div>\n );\n}\n","import type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\n\n/** A key of the keyboard, for shortcuts: <Kbd>⌘</Kbd> <Kbd>K</Kbd>. */\nexport function Kbd({ className, ...props }: ComponentPropsWithoutRef<\"kbd\">) {\n return <kbd className={cx(\"trc-kbd\", className)} {...props} />;\n}\n\nexport type DividerProps = {\n /** Text in the middle of the line: \"or\". */\n label?: ReactNode;\n orientation?: \"horizontal\" | \"vertical\";\n className?: string;\n};\n\n/** Hairline between groups of content, optionally with a word in the middle. */\nexport function Divider({ label, orientation = \"horizontal\", className }: DividerProps) {\n if (orientation === \"vertical\") {\n return <span role=\"separator\" aria-orientation=\"vertical\" className={cx(\"trc-divider--vertical\", className)} />;\n }\n if (label == null) return <hr className={cx(\"trc-divider\", className)} />;\n return (\n <div role=\"separator\" className={cx(\"trc-divider-label\", className)}>\n <span className=\"trc-divider-label__text\">{label}</span>\n </div>\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { cx } from \"../utils/cx\";\nimport { Check } from \"../utils/icons\";\n\nconst BADGES: Record<string, string> = {\n tsx: \"TS\",\n ts: \"TS\",\n jsx: \"JS\",\n js: \"JS\",\n css: \"CSS\",\n bash: \"SH\",\n sh: \"SH\",\n html: \"HTML\",\n json: \"JSON\",\n};\n\nexport type CodeBlockProps = {\n /** Source code, also what the copy button copies. */\n code: string;\n /** File name shown in a tab: \"app/layout.tsx\". */\n title?: ReactNode;\n /** Language, shown as a small badge next to the title. */\n language?: string;\n /** Highlighted rendering of the code, from your own highlighter; plain text by default. */\n children?: ReactNode;\n copyLabel?: string;\n copiedLabel?: string;\n className?: string;\n};\n\nconst CopyIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.75}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n >\n <rect x=\"9\" y=\"9\" width=\"12\" height=\"12\" rx=\"2.5\" />\n <path d=\"M5 15H4.5A1.5 1.5 0 0 1 3 13.5v-9A1.5 1.5 0 0 1 4.5 3h9A1.5 1.5 0 0 1 15 4.5V5\" />\n </svg>\n);\n\n/**\n * Code block with an optional file tab and a copy button that turns into an accent check for a\n * moment. Bring your own highlighting through `children`; the copied text is always `code`.\n */\nexport function CodeBlock({\n code,\n title,\n language,\n children,\n copyLabel = \"Copy code\",\n copiedLabel = \"Copied\",\n className,\n}: CodeBlockProps) {\n const [copied, setCopied] = useState(false);\n const timer = useRef<number | undefined>(undefined);\n useEffect(() => () => window.clearTimeout(timer.current), []);\n\n const copy = async () => {\n await navigator.clipboard.writeText(code);\n setCopied(true);\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => setCopied(false), 1600);\n };\n\n const button = (\n <button\n type=\"button\"\n onClick={copy}\n className=\"trc-code__copy\"\n aria-label={copyLabel}\n title={copyLabel}\n data-copied={copied}\n >\n {copied ? <Check /> : <CopyIcon />}\n <span className=\"trc-visually-hidden\" aria-live=\"polite\">\n {copied ? copiedLabel : \"\"}\n </span>\n </button>\n );\n\n return (\n <div className={cx(\"trc-code\", title == null && \"trc-code--bare\", className)}>\n {title != null ? (\n <div className=\"trc-code__bar\">\n <span className=\"trc-code__file\">\n {language && <span className=\"trc-code__lang\">{BADGES[language] ?? language.toUpperCase()}</span>}\n {title}\n </span>\n {button}\n </div>\n ) : (\n button\n )}\n <pre className=\"trc-code__pre\">\n <code>{children ?? code}</code>\n </pre>\n </div>\n );\n}\n"],"mappings":";;;AACO,SAAS,MAAM,SAAwD;AAC5E,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;;;ACOM,mBAGM,KAcR,YAjBE;AAHC,SAAS,WAAW,EAAE,MAAM,aAAa,EAAE,GAA0C;AAC1F,MAAI,KAAK,SAAS,GAAG,GAAG;AACtB,WACE,gCACG,eAAK,MAAM,GAAG,EAAE;AAAA,MAAI,CAAC,MAAM,MAC1B,IAAI,MAAM,IACR,oBAAC,UAAa,WAAU,cACrB,kBADQ,CAEX,IAEA;AAAA,IAEJ,GACF;AAAA,EAEJ;AACA,QAAM,QAAQ,KAAK,MAAM,GAAG;AAC5B,MAAI,CAAC,cAAc,MAAM,SAAS,EAAG,QAAO,gCAAG,gBAAK;AACpD,QAAM,IAAI,KAAK,IAAI,YAAY,MAAM,SAAS,CAAC;AAC/C,SACE,iCACG;AAAA,UAAM,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG;AAAA,IA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AAC1C,QAAM,QAAQC,SAA2B,MAAS;AAClD,EAAAC,YAAU,MAAM,MAAM,OAAO,aAAa,MAAM,OAAO,GAAG,CAAC,CAAC;AAE5D,QAAM,OAAO,YAAY;AACvB,UAAM,UAAU,UAAU,UAAU,IAAI;AACxC,cAAU,IAAI;AACd,WAAO,aAAa,MAAM,OAAO;AACjC,UAAM,UAAU,OAAO,WAAW,MAAM,UAAU,KAAK,GAAG,IAAI;AAAA,EAChE;AAEA,QAAM,SACJ,gBAAAH;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS;AAAA,MACT,WAAU;AAAA,MACV,cAAY;AAAA,MACZ,OAAO;AAAA,MACP,eAAa;AAAA,MAEZ;AAAA,iBAAS,gBAAAD,MAAC,SAAM,IAAK,gBAAAA,MAAC,YAAS;AAAA,QAChC,gBAAAA,MAAC,UAAK,WAAU,uBAAsB,aAAU,UAC7C,mBAAS,cAAc,IAC1B;AAAA;AAAA;AAAA,EACF;AAGF,SACE,gBAAAC,OAAC,SAAI,WAAW,GAAG,YAAY,SAAS,QAAQ,kBAAkB,SAAS,GACxE;AAAA,aAAS,OACR,gBAAAA,OAAC,SAAI,WAAU,iBACb;AAAA,sBAAAA,OAAC,UAAK,WAAU,kBACb;AAAA,oBAAY,gBAAAD,MAAC,UAAK,WAAU,kBAAkB,iBAAO,QAAQ,KAAK,SAAS,YAAY,GAAE;AAAA,QACzF;AAAA,SACH;AAAA,MACC;AAAA,OACH,IAEA;AAAA,IAEF,gBAAAA,MAAC,SAAI,WAAU,iBACb,0BAAAA,MAAC,UAAM,sBAAY,MAAK,GAC1B;AAAA,KACF;AAEJ;","names":["Tag","size","jsx","jsxs","Fragment","jsx","jsxs","size","PillButton","PillLink","Tag","jsx","jsxs","size","Tag","forwardRef","jsx","jsxs","forwardRef","Input","Textarea","Select","forwardRef","jsx","jsxs","forwardRef","Checkbox","Switch","useEffect","useId","useRef","useId","useRef","items","jsx","jsxs","useId","useRef","jsx","size","jsx","jsxs","useEffect","useId","useRef","jsx","jsxs","useEffect","useRef","useState","jsx","jsxs","useRef","useState","useEffect","useEffect","useState","jsx","useState","useEffect","jsx","size","useId","useRef","useState","useEffect","useRef","dismiss","Fragment","jsx","jsxs","items","useState","useRef","useId","cloneElement","useEffect","useId","useRef","useState","Fragment","jsx","jsxs","useState","useRef","useId","useEffect","cloneElement","cloneElement","useEffect","useId","useRef","useState","Fragment","jsx","jsxs","delay","useState","useRef","useId","useEffect","cloneElement","useEffect","useRef","useState","useSyncExternalStore","jsx","jsxs","useSyncExternalStore","useState","useRef","useEffect","jsx","jsxs","useId","useRef","useRef","useState","jsx","jsxs","items","useId","useRef","useId","jsx","jsxs","size","useId","useId","useRef","jsx","jsxs","items","useId","useRef","Heading","jsx","jsxs","items","jsx","jsxs","items","jsx","jsxs","jsx","useId","jsx","jsxs","useId","forwardRef","useState","jsx","jsxs","forwardRef","PasswordInput","useState","useRef","jsx","jsxs","useRef","useEffect","useId","useRef","useState","jsx","jsxs","useState","useRef","useId","useEffect","forwardRef","useId","useState","jsx","jsxs","forwardRef","FileInput","useState","useId","base","forwardRef","jsx","jsxs","forwardRef","Slider","useEffect","useId","useRef","useState","jsx","jsxs","useState","useRef","useId","useEffect","items","useState","jsx","jsxs","size","useState","items","jsx","jsxs","jsx","jsxs","useState","jsx","jsxs","useState","useId","jsx","jsxs","Spinner","useId","jsx","useEffect","useRef","useState","jsx","jsxs","useState","useRef","useEffect"]}